[IBD/Rewind] Forego unused transactions and unnecessary commits in polls repo#936
Merged
quantumagi merged 2 commits intostratisproject:release/1.4.0.0from Apr 11, 2022
Merged
Conversation
zeptin
reviewed
Apr 3, 2022
|
|
||
| currentTransaction.Commit(); | ||
| currentTransaction.Dispose(); | ||
| currentTransaction.Commit(); |
Collaborator
There was a problem hiding this comment.
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
zeptin
approved these changes
Apr 3, 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.Transactionclass.