Gloas range sync (#9362)

N/A


  Implement range sync in gloas.
Basically requests blocks and payloads post gloas from the same peer, couples them and sends it for processing.
Does not change sync much at all other than adding the machinery for payloads by range requests.

Main changes are:
`RangeSyncBlock` which used to be a struct is an enum to account for the Gloas case. This allows a clear separation between gloas and pre-gloas code.
`AvailableBlockData` now has a `BlockInEnvelope` variant. This is to clearly indicate the post gloas case. I feel this is simpler to follow compared to `NoData` variant.


Tries to extract post gloas logic into its own functions so that there is minimal logic change in mainnet range sync behaviour.

This is meant as a stable base on which we can iterate further to make range sync cleaner and for unblocking range sync support on devnet. Some ideas for later is removing the retry mechanism in favour of delegating column fetching to lookup sync which can be done post #9155 and batch signature verifying envelopes.


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Pawan Dhananjay
2026-06-10 16:00:57 +05:30
committed by GitHub
parent 844c6dd4a0
commit db3192e001
24 changed files with 1311 additions and 232 deletions

View File

@@ -669,7 +669,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
/// Verify a batch of data columns belonging to a single block, picking the right commitment
/// source for the block's fork (Fulu: inline on column; Gloas: from the embedded payload bid).
fn verify_columns_against_block<E: EthSpec>(
pub fn verify_columns_against_block<E: EthSpec>(
kzg: &Kzg,
block: &SignedBeaconBlock<E>,
columns: &[Arc<DataColumnSidecar<E>>],
@@ -792,7 +792,12 @@ async fn availability_cache_maintenance_service<T: BeaconChainTypes>(
#[derive(Debug, Clone)]
// TODO(#8633) move this to `block_verification_types.rs`
pub enum AvailableBlockData<E: EthSpec> {
/// Block is pre-Deneb or has zero blobs
/// Block has no inline DA object for block import.
///
/// This covers:
/// - pre-Deneb blocks,
/// - blocks with zero blobs, and
/// - Gloas blocks, where DA is checked on the payload envelope instead.
NoData,
/// Block is post-Deneb, pre-PeerDAS and has more than zero blobs
Blobs(BlobSidecarList<E>),
@@ -953,6 +958,19 @@ impl<E: EthSpec> AvailableBlock<E> {
})
}
pub fn new_gloas(block: Arc<SignedBeaconBlock<E>>) -> Result<Self, String> {
if block.fork_name_unchecked().gloas_enabled() {
Ok(Self {
block_root: block.canonical_root(),
block,
blob_data: AvailableBlockData::NoData,
blobs_available_timestamp: None,
})
} else {
Err("Block is not gloas".to_owned())
}
}
pub fn block(&self) -> &SignedBeaconBlock<E> {
&self.block
}
@@ -1294,7 +1312,7 @@ mod test {
let available_blocks = blocks_with_columns
.into_iter()
.map(|block| block.into_available_block())
.map(|block| block.into_available_block().unwrap().0)
.collect::<Vec<_>>();
// WHEN verifying all blocks together (totalling 256 data columns)