-
Notifications
You must be signed in to change notification settings - Fork 701
feat: add post-state-root data structs #9532
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
ef7abd8
to
1d66984
Compare
@@ -160,4 +160,4 @@ pub(super) enum PeerMessage { | |||
VersionedStateResponse(StateResponseInfo), | |||
} | |||
#[cfg(target_arch = "x86_64")] // Non-x86_64 doesn't match this requirement yet but it's not bad as it's not production-ready | |||
const _: () = assert!(std::mem::size_of::<PeerMessage>() <= 1144, "PeerMessage > 1144 bytes"); | |||
const _: () = assert!(std::mem::size_of::<PeerMessage>() <= 1500, "PeerMessage > 1500 bytes"); |
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.
not sure what the value of having that and it breaks builds when new fields are added to block or chunk headers, so I'm increasing this value to avoid updating that after each new field is added
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.
Is there any comment or meaningful explanation in the PR where this was introduced? Given this is networking one guess would be something to do with MTU but I doubt that matters to us.
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.
nope, I couldn't find any meaningful explanation on why this is needed.
@saketh-are maybe you (as a networking expert 😄) know something about that?
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.
Are you looking for any particular feedback on this PR?
It looks good to me as boilerplate.
@@ -160,4 +160,4 @@ pub(super) enum PeerMessage { | |||
VersionedStateResponse(StateResponseInfo), | |||
} | |||
#[cfg(target_arch = "x86_64")] // Non-x86_64 doesn't match this requirement yet but it's not bad as it's not production-ready | |||
const _: () = assert!(std::mem::size_of::<PeerMessage>() <= 1144, "PeerMessage > 1144 bytes"); | |||
const _: () = assert!(std::mem::size_of::<PeerMessage>() <= 1500, "PeerMessage > 1500 bytes"); |
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.
Is there any comment or meaningful explanation in the PR where this was introduced? Given this is networking one guess would be something to do with MTU but I doubt that matters to us.
|
||
// V2 -> V3: Post State Root | ||
#[derive(BorshSerialize, BorshDeserialize, Clone, PartialEq, Eq, Debug)] | ||
pub struct ShardChunkHeaderInnerV3 { |
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.
I spent way too much time looking for the difference ;)
1d66984
to
8f279b3
Compare
Yep, this is just a boilerplate code. I explicitly wanted to separate this from meaningful changes to make it easier to review. |
This PR introduces the following structs:
BlockHeaderV5
along withBlockHeaderInnerRestV5
. For now let's keepBlockHeaderInnerLite
as it is, later we can change that if we need more fields there.ShardChunkHeaderInnerV3
ShardChunkV3
For now those contain the same fields as the current versions. Later we will introduce post-state-root related fields there and also potentially remove some of the pre-state-root fields.
ShardChunkV3
is the only exception withprev_outgoing_receipts
being replaced byoutgoing_receipts
as part of this PR.This PR is a groundwork for #9450.