-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Compatible] Fix block producer long async cycle #13654
Merged
Merged
Conversation
This file contains 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
!ci-build-me |
psteckler
approved these changes
Jul 19, 2023
!ci-build-me |
deepthiskumar
changed the title
Fix block producer long async cycle
[Compatible] Fix block producer long async cycle
Jul 25, 2023
!ci-build-me |
I've tested it on devnet. The log shows that this branch would reduce the long async cycle for block producers. Previously after producing a block there would be a 5-15 seconds long async cycle. The node using this branch would only have a long async cycle of less than 1 sec. |
This was referenced Sep 7, 2023
7 tasks
!ci-build-me |
!ci-build-me |
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.
This PR fixes a long async cycle observed on block producers. The cycle occurs whenever a block producer is staking from a non-genesis epoch ledger. The cause of the long async cycle was that we would make a complete in-memory copy of a db ledger when preparing consensus block data for the next block, rather than taking only the subset of accounts necessary to generate the proof. Making an entire in-memory copy of a db ledger was implemented calling a non-batching version of
Mina_ledger.Ledger.Db.foldi
, which took a very long time to load all of the data from the ledger. The performance of this ledger operation seems to vary across software versions, as the cycles we have seen inberkeley
with a smaller ledger are much larger than anything we've seen oncompatible
versions running with the full mainnet ledger.There are some followup tasks to further remove existing usages of
Mina_ledger.Ledger.Db.foldi
from the code, but this fix tackles the most immediate issue.Fixes #13576