Skip to content

[IBD/Rewind] Forego unused transactions and unnecessary commits in polls repo#936

Merged
quantumagi merged 2 commits intostratisproject:release/1.4.0.0from
quantumagi:foregottxandcommits
Apr 11, 2022
Merged

[IBD/Rewind] Forego unused transactions and unnecessary commits in polls repo#936
quantumagi merged 2 commits intostratisproject:release/1.4.0.0from
quantumagi:foregottxandcommits

Conversation

@quantumagi
Copy link
Contributor

@quantumagi quantumagi commented Mar 16, 2022

https://app.clickup.com/t/20xtcz0

This PR ensure that the polls repository DB is not involved (empty transactions or unnecessary commits) when ranges of blocks lead to no polls repository updates. After this PR we now see associated block throughput rates of over 100,000 per second:

	>> Voting & Poll Data
	Polls Repository Height : 1396716 (Hash: dbb11c175eab61a85033c004bba269fb25143619c0cdee5625a9289a8838108d)
	Blocks Processed        : 1396716         Avg Time: 0 ms      Throughput: 108000.72 per second

Approach: When entering transactional context the internal transaction creation is delayed until an actual db operation takes place. We then note the change and only call the commit if changes took place. The details of this behaviour is hidden in a new PollsRepository.Transaction class.

@quantumagi quantumagi changed the base branch from release/1.3.0.0 to release/1.4.0.0 March 21, 2022 12:46

currentTransaction.Commit();
currentTransaction.Dispose();
currentTransaction.Commit();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to any other reviewers: at first glance it may appear that there is a SetTip missing here when compared to the previous implementation, but it is actually being done inside every call to ProcessBlock

@quantumagi quantumagi merged commit 1ec9a71 into stratisproject:release/1.4.0.0 Apr 11, 2022
quantumagi added a commit to quantumagi/StratisFullNode-1 that referenced this pull request Jan 30, 2023
…lls repo (stratisproject#936)

* Forego unused transactions and unnecessary commits in polls repo

* Initialize CurrentTip at genesis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants