10000 feat: add post-state-root data structs by pugachAG · Pull Request #9532 · near/nearcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

pugachAG
Copy link
Contributor
@pugachAG pugachAG commented Sep 18, 2023

This PR introduces the following structs:

  • BlockHeaderV5 along with BlockHeaderInnerRestV5. For now let's keep BlockHeaderInnerLite 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 with prev_outgoing_receipts being replaced by outgoing_receipts as part of this PR.

This PR is a groundwork for #9450.

@pugachAG pugachAG force-pushed the new-chunk-version branch 5 times, most recently from ef7abd8 to 1d66984 Compare September 19, 2023 09:14
@pugachAG pugachAG changed the title feat: add Post State Root header versions feat: add post-state-root data structs Sep 19, 2023
@@ -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");
Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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?

@pugachAG pugachAG added the A-chain Area: Chain, client & related label Sep 19, 2023
@pugachAG pugachAG marked this pull request as ready for review September 19, 2023 09:23
@pugachAG pugachAG requested a review from a team as a code owner September 19, 2023 09:23
Copy link
Contributor
@wacban wacban left a 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");
Copy link
Contributor

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 {
Copy link
Contributor

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 ;)

@pugachAG
Copy link
Contributor Author

@wacban

Are you looking for any particular feedback on this PR?
It looks good to me as boilerplate.

Yep, this is just a boilerplate code. I explicitly wanted to separate this from meaningful changes to make it easier to review.

@pugachAG pugachAG added this pull request to the merge queue Sep 21, 2023
Merged via the queue into near:master with commit 7f62527 Sep 21, 2023
@pugachAG pugachAG deleted the new-chunk-version branch September 21, 2023 13:49
nikurt pushed a commit that referenced this pull request Sep 22, 2023
nikurt pushed a commit that referenced this pull request Sep 26, 2023
nikurt pushed a commit that referenced this pull request Sep 26, 2023
nikurt pushed a commit that referenced this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chain Area: Chain, client & related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0