Skip to content

Conversation

@onbjerg
Copy link
Collaborator

@onbjerg onbjerg commented May 2, 2024

Adds types for EIP-7685, adds a new Requests table, and adjusts the code where appropriate.

This still lacks:

  • Blockchain tree integration
  • Writing the Requests in the bodies stage
  • Validating the requests root in the body downloader
  • Full engine API integration

Will do these in separate PRs to unblock EIPs 6110 and 7002

@onbjerg onbjerg added C-enhancement New feature or request E-prague Related to the prague network upgrade labels May 2, 2024
Copy link
Member

Choose a reason for hiding this comment

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

Just leave it empty

@onbjerg onbjerg force-pushed the onbjerg/eip-7685 branch from 21b3e0f to da07e6f Compare May 13, 2024 08:17
@onbjerg onbjerg changed the base branch from main to devnet-0 May 13, 2024 08:53
@onbjerg onbjerg marked this pull request as ready for review May 13, 2024 08:54
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

smol nit

Comment on lines +9 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

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

we're missing a few helper impls but this is ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will add before merge to main

@onbjerg onbjerg force-pushed the onbjerg/eip-7685 branch from 678db80 to 27c2ec6 Compare May 13, 2024 09:16
@gakonst gakonst mentioned this pull request May 13, 2024
10 tasks
@gakonst gakonst mentioned this pull request May 13, 2024
let block_ommers = self.get_or_take::<tables::BlockOmmers, TAKE>(range.clone())?;
let block_withdrawals =
self.get_or_take::<tables::BlockWithdrawals, TAKE>(range.clone())?;
let block_requests = self.get_or_take::<tables::BlockRequests, TAKE>(range.clone())?;
Copy link
Member

Choose a reason for hiding this comment

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

still dont love this get/take function we should investigate fixing later

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree

Comment on lines +248 to +256
// note(onbjerg): the rpc spec has not been changed to include requests, so for now we just
// set these to empty
let (requests, requests_root) =
if chain_spec.is_prague_active_at_timestamp(block_env.timestamp.to::<u64>()) {
(Some(Requests::default()), Some(EMPTY_ROOT_HASH))
} else {
(None, None)
};

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@onbjerg onbjerg May 13, 2024

Choose a reason for hiding this comment

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

the pr is for the engine api, this code snippet is for regular rpc which does not have any changes currently


/// Returns all recorded requests.
pub fn take_requests(&mut self) -> Requests {
pub fn take_requests(&mut self) -> Vec<Requests> {
Copy link
Member

Choose a reason for hiding this comment

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

I think we start having a lot of these Vec<Vec<_>> outer / inner vecs so maybe we should do a generic Batch<T> to encapsulate that

Comment on lines +16 to +18
// HACK(onbjerg): we need this to always set `requests` to `None` since we might otherwise generate
// a block with `None` withdrawals and `Some` requests, in which case we end up trying to decode the
// requests as withdrawals
Copy link
Member

Choose a reason for hiding this comment

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

this seems fine, not a hack?

@onbjerg onbjerg merged commit b60225f into devnet-0 May 13, 2024
@onbjerg onbjerg deleted the onbjerg/eip-7685 branch May 13, 2024 12:37
shekhirin added a commit that referenced this pull request May 28, 2024
Co-authored-by: Alexey Shekhirin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement New feature or request E-prague Related to the prague network upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants