Add range sync machinery on sync side

This commit is contained in:
Pawan Dhananjay
2026-03-30 17:00:29 -07:00
parent 0f996ddbe8
commit 4ca10e95be
12 changed files with 538 additions and 72 deletions

View File

@@ -33,6 +33,8 @@ pub enum SyncRequestId {
DataColumnsByRange(DataColumnsByRangeRequestId),
/// Request searching for an execution payload envelope given a block root.
SinglePayloadEnvelope { id: SingleLookupReqId },
/// Payload envelopes by range request
PayloadEnvelopesByRange(PayloadEnvelopesByRangeRequestId),
}
/// Request ID for data_columns_by_root requests. Block lookups do not issue this request directly.
@@ -78,6 +80,14 @@ pub enum DataColumnsByRangeRequester {
CustodyBackfillSync(CustodyBackFillBatchRequestId),
}
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub struct PayloadEnvelopesByRangeRequestId {
/// Id to identify this attempt at a payload_envelopes_by_range request for `parent_request_id`
pub id: Id,
/// The Id of the overall By Range request for block components.
pub parent_request_id: ComponentsByRangeRequestId,
}
/// Block components by range request for range sync. Includes an ID for downstream consumers to
/// handle retries and tie all their sub requests together.
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
@@ -254,6 +264,12 @@ macro_rules! impl_display {
impl_display!(BlocksByRangeRequestId, "{}/{}", id, parent_request_id);
impl_display!(BlobsByRangeRequestId, "{}/{}", id, parent_request_id);
impl_display!(DataColumnsByRangeRequestId, "{}/{}", id, parent_request_id);
impl_display!(
PayloadEnvelopesByRangeRequestId,
"{}/{}",
id,
parent_request_id
);
impl_display!(ComponentsByRangeRequestId, "{}/{}", id, requester);
impl_display!(DataColumnsByRootRequestId, "{}/{}", id, requester);
impl_display!(SingleLookupReqId, "{}/Lookup/{}", req_id, lookup_id);