Skip to content
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

[EIP-7732] ExecutionPayloadEnvelopesByRange RPC #4120

Merged
merged 7 commits into from
Feb 18, 2025
Merged

Conversation

tbenr
Copy link
Contributor

@tbenr tbenr commented Feb 5, 2025

  • fixes versioning of existing RPC (no need to bump versions)
  • adds ExecutionPayloadEnvelopesByRange
  • assumes slot to be present in ExecutionPayloadEnvelope

Copy link
Contributor

@potuz potuz left a comment

Choose a reason for hiding this comment

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

LGTM. However, I think we may want to consider the option of getting these payloads blind. When range syncing an unfinalized long chain, the EL will have the option to download blocks from a given hash on the EL p2p chain, while the CL will still need the envelope to sync the CL state. I envision that this decoupling of blocks with payloads will actually be useful in the future for long range syncing.

@tbenr
Copy link
Contributor Author

tbenr commented Feb 12, 2025

the EL will have the option to download blocks from a given hash on the EL p2p chain, while the CL will still need the envelope to sync the CL state.

I see. In that mode we will be always optimistically syncing, from CL perspective.

Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @tbenr! @potuz this is ready to merge?

Copy link
Contributor

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

I think we should add more detail to this, similar to how we frame blocks by range. Examples:

Requests payload in the slot range [start_slot, start_slot + count), leading up to the current head block as selected by fork choice. For example, requesting payloads starting at start_slot=2 and count=4 would return the payloads at slots [2, 3, 4, 5]. If slot 4 were empty in the previous example, the returned array would contain [2, 3, 5].

PayloadByRange is primarily used to sync historical payloads.

The request MUST be encoded as an SSZ-container.

The response MUST consist of zero or more response_chunk. Each successful response_chunk MUST contain a single ExecutionPayloadEnvelope payload.

Clients MUST keep a record of signed execution payload envelopes seen on the epoch range [max(GENESIS_EPOCH, current_epoch - MIN_EPOCHS_FOR_BLOCK_REQUESTS), current_epoch], where current_epoch is defined by the current wall-clock time. Clients MUST support serving requests for execution payloads within this range.

Peers unable to reply to block payloads within the MIN_EPOCHS_FOR_BLOCK_REQUESTS epoch range SHOULD respond with error code 3: ResourceUnavailable. Such peers that fail to reply successfully to this range of requests MAY get descored or disconnected at any time.

Note: Although clients that bootstrap from a weak subjectivity checkpoint can begin participating in the networking immediately, other peers MAY disconnect and/or temporarily ban an un-synced or semi-synced client.

Clients MUST respond with at least the first payload that exists in the range, if they have it, and no more than MAX_REQUEST_BLOCKS payloads.

The following payloads, where they exist, MUST be sent in consecutive order.

Clients MAY limit the number of payloads in the response.

The response MUST contain no more than count payloads.

Clients MUST respond with payloads from their view of the current fork choice -- that is, payloads from the single chain defined by the current head. Payloads from slots before finalization MUST lead to the finalized payload reported in the Status handshake.

@tbenr
Copy link
Contributor Author

tbenr commented Feb 18, 2025

@terencechain just wanted to avoid this repetitions TBH. I don't mind adding that if you fill strongly.

Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM

@jtraglia jtraglia merged commit b9f8a75 into ethereum:dev Feb 18, 2025
23 checks passed
@tbenr tbenr deleted the 7732-rpc branch February 19, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants