-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(shred-network): minimize dependencies #462
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
…direct SlotLeaders interface
… test to reproduce issue and fix bug
yewman
previously approved these changes
Dec 29, 2024
c66fc19
to
882c162
Compare
This was
linked to
issues
Jan 2, 2025
the list of all nodes should be large enough to fit all staked nodes + gossip nodes + 1 for self. the bug was that it wasn't including 1 for itself, and it would hit an error on appendAssumeCapacity. normally this is not a problem because nodes get filtered out in the for loop, so it doesn't use the full capacity. but if no nodes are filtered out, then you get an error from having a capacity 1 less than necessary. this also refactors the stake calculation if-statement for clarity
yewman
approved these changes
Jan 2, 2025
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 is an alternative implementation for #423. It accomplishes the same goals, except that it implements the interface between
shred-network
and an epoch context provider with shared memory instead of a vtable.The static context of an epoch is defined by EpochContext, which contains staked nodes and a leader schedule.
The storage of relevant EpochContexts is managed by EpochContextManager. This specialized struct is needed because it must be aware of the epoch schedule.
Depending on the run mode, the initial EpochContext may be created from the bank or from rpc. There is currently only one way to update the EpochContextManager during the runtime of the validator, which is via rpc.
There is a limitation where RPC cannot be used to access epoch staked nodes. This can only be acquired from the bank. So the bank is used when available, otherwise the data is not populated.