-
Notifications
You must be signed in to change notification settings - Fork 701
feat: introduce post-state-root protocol feature #9538
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: introduce post-state-root protocol feature #9538
Conversation
|
@@ -120,6 +120,7 @@ pub enum ProtocolFeature { | |||
RejectBlocksWithOutdatedProtocolVersions, | |||
#[cfg(feature = "protocol_feature_simple_nightshade_v2")] | |||
SimpleNightshadeV2, | |||
PostStateRoot, |
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.
Pretty sure rustc will complain about unused enum variants. Either mark it as an exception, or maybe just wait with introducing it until you have your first PR that actually needs it.
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.
Seems like rustc is OK with it 🤷
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.
Oh right because it's pub
it may be used outside the crate! Well, then I'm even more confused why we bother with hiding even the enum variants behind compilation flags, seems completely pointless to me. 🤔
@@ -173,6 +174,7 @@ impl ProtocolFeature { | |||
ProtocolFeature::RejectBlocksWithOutdatedProtocolVersions => 132, | |||
#[cfg(feature = "protocol_feature_simple_nightshade_v2")] | |||
ProtocolFeature::SimpleNightshadeV2 => 135, | |||
ProtocolFeature::PostStateRoot => 136, |
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.
Note that the nightly protocol version is 138
.
I guess it is fine to re-use protocol version numbers of stabilized features.
1b3ea4e
to
3577277
Compare
This PR introduces
ProtocolFeature::PostStateRoot
which is included in nightly.After a discussion with @nikurt and @jakmeier it was decided not to introduce a cargo feature for conditional compilation until it is actually needed. As far as I see all post-state-root code can be added without need for conditional compilation. The only switch we need is to enable post-state-root chunk and block production based on protocol version check.
This PR is a groundwork for #9450.