-
Notifications
You must be signed in to change notification settings - Fork 500
feat: add eip-7685 requests root to header #668
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
mattsse
left a comment
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.
all of this looks correct, this basically shifts replaces the parent beacon root as the last entry
pending @Rjected
I assume we also need additional checks in the consensus impl?
|
@mattsse yeah i'm opening PRs as I progress on paradigmxyz/reth#8053, we need to add some fields to body + calc the root itself, will keep the alloy impl on par |
|
should we be managing changes in e.g. an enum over versions? |
while this would have advantages, we'd still need this type for decoding any rlp blob or we need additional context for decoding, like the hardfork so we know how to decode |
|
great i love it when field semantics change without any structural indication 🎉 |
Rjected
left a comment
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.
lgtm
| // Encode requests root length. | ||
| // | ||
| // If new fields are added, the above pattern will | ||
| // need to be repeated and placeholder length added. Otherwise, it's impossible to | ||
| // tell _which_ fields are missing. This is mainly relevant for contrived cases | ||
| // where a header is created at random, for example: | ||
| // * A header is created with a withdrawals root, but no base fee. Shanghai blocks are | ||
| // post-London, so this is technically not valid. However, a tool like proptest would | ||
| // generate a block like this. | ||
| if let Some(parent_beacon_block_root) = self.parent_beacon_block_root { | ||
| length += parent_beacon_block_root.length(); | ||
| if let Some(requests_root) = self.requests_root { | ||
| length += requests_root.length(); |
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: the hack in this comment is not needed in reth any more, the arbitrary impl was changed instead, we should copy it over so the encoding / decoding impl is more sensible
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.
will do
* feat: add eip-7685 requests root to header * feat: requests root for consensus header * chore: fmt
Adds EIP-7685 header fields to both the consensus and RPC
Headertypes.PR Checklist