Skip to content

Do not let gossip start with unset shred version #5837

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

Conversation

gregcusack
Copy link

@gregcusack gregcusack commented Apr 15, 2025

Problem

We are in the process of removing the special shred_version == 0 case where validators can pull from any node if they set the shred version to 0

Summary of Changes

Do not let gossip start with an unset shred version. Also, remove the special case check where we check to see if our shred version is 0.

@gregcusack gregcusack force-pushed the force-validator-to-start-with-set-shred-version branch from b4d7b34 to b3ac904 Compare April 15, 2025 21:18
@gregcusack gregcusack marked this pull request as ready for review April 15, 2025 21:43
@gregcusack gregcusack force-pushed the force-validator-to-start-with-set-shred-version branch 2 times, most recently from 9ba3095 to 83a7379 Compare April 16, 2025 00:20
@gregcusack gregcusack changed the title Force validator to start with set shred version Do not let gossip with unset shred version Apr 16, 2025
@gregcusack gregcusack changed the title Do not let gossip with unset shred version Do not let gossip start with unset shred version Apr 16, 2025
if my_shred_version != 0
&& (node.shred_version() != 0 && node.shred_version() != my_shred_version)
{
if node.shred_version() != 0 && node.shred_version() != my_shred_version {

Choose a reason for hiding this comment

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

Can node shred_version be ever zero in the first place?

Copy link
Author

Choose a reason for hiding this comment

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

not anymore since we switched spy to run on a valid shred version

Copy link

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

LGTM, maybe also is possible to follow-up and make it impossible to create Node with invalid shred_version (though it may be overkill)

Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

LGTM

@gregcusack
Copy link
Author

gregcusack commented Apr 16, 2025

LGTM, maybe also is possible to follow-up and make it impossible to create Node with invalid shred_version (though it may be overkill)

ya not a bad idea. it's a little complicated since when we create a Node we don't know the shred version yet. We need to create the Node to download a snapshot at boot. but we don't need a valid shred version to download a snapshot. and then when we get the snapshot and genesis, we calculate the shred_version from genesis (if not passed in from cli). once we have the shred version, we update Node with the correct shred version. i will have to think about this one.

@gregcusack gregcusack merged commit fe5c24a into anza-xyz:master Apr 16, 2025
30 checks passed
@gregcusack gregcusack deleted the force-validator-to-start-with-set-shred-version branch April 16, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants