-
Notifications
You must be signed in to change notification settings - Fork 101
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
hotfix(message/validation): optimize signer state memory usage #1874
Open
nkryuchkov
wants to merge
20
commits into
stage
Choose a base branch
from
msgvalidation-optimize-signer-state
base: stage
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
nkryuchkov
changed the title
message/validation: optimize signer state memory usage
fix(message/validation): optimize signer state memory usage
Nov 22, 2024
nkryuchkov
changed the title
fix(message/validation): optimize signer state memory usage
message/validation: optimize signer state memory usage
Nov 22, 2024
y0sher
reviewed
Nov 26, 2024
iurii-ssv
approved these changes
Nov 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
nkryuchkov
changed the title
message/validation: optimize signer state memory usage
hotfix(message/validation): optimize signer state memory usage
Nov 26, 2024
MatheusFranco99
approved these changes
Nov 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!
The issue I raised doesn't regard this PR, so approving :)
MatusKysel
approved these changes
Dec 6, 2024
# Conflicts: # message/validation/consensus_validation.go # message/validation/partial_validation.go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Changes:
Calculations of signer state for 50K validators for
MessageCounts
:We store the state for each validator for each of the 6 roles. For each role, we store the state, of each signer, up to 13. For each signer, we store the state of the 64 slots. Then for each slot, we store the signer state. So overall we have up to 50000 * 6 * 13 * 64 ~= 249_600_000 signer states. I'll count the maximal value but the actual value should be lower because the average amount of operators is less than 13.
So if
MessageCounts
is reduced from 48 bytes to 1 then in such case the max theoretical memory consumption should reduce from ~12 GB to ~250 MBChanges in Pyroscope: