Skip to content

Commit

Permalink
Don't request blobs when das enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumas committed May 17, 2024
1 parent 94a9ce2 commit 53dde91
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions p2p/src/block_sync_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ impl<P: Preset> BlockSyncService<P> {

if let Some(peer_id) = peer {
match target {
// todo!(feature/eip7594)
SyncTarget::DataColumnSidecar => {}
SyncTarget::BlobSidecar => {
SyncToP2p::RequestBlobsByRange(request_id, peer_id, start_slot, count)
.send(&self.sync_to_p2p_tx);
Expand Down Expand Up @@ -495,6 +497,8 @@ impl<P: Preset> BlockSyncService<P> {
} = batch;

match target {
//TODO(feature/eip-7594)
SyncTarget::DataColumnSidecar => {}
SyncTarget::BlobSidecar => {
self.sync_manager
.add_blob_request_by_range(request_id, batch);
Expand Down
23 changes: 15 additions & 8 deletions p2p/src/sync_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const SEQUENTIAL_REDOWNLOADS_TILL_RESET: usize = 5;
pub enum SyncTarget {
BlobSidecar,
Block,
DataColumnSidecar,
}

#[derive(Debug)]
Expand Down Expand Up @@ -136,6 +137,8 @@ impl SyncManager {
};

match batch.target {
// TODO(feature/eip7594)
SyncTarget::DataColumnSidecar => {}
SyncTarget::BlobSidecar => self.add_blob_request_by_range(request_id, batch),
SyncTarget::Block => self.add_block_request_by_range(request_id, batch),
}
Expand Down Expand Up @@ -306,14 +309,18 @@ impl SyncManager {

max_slot = start_slot + count - 1;

if blob_serve_range_slot < max_slot {
sync_batches.push(SyncBatch {
target: SyncTarget::BlobSidecar,
direction: SyncDirection::Forward,
peer_id,
start_slot,
count,
});
if config.is_eip7594_fork(misc::compute_epoch_at_slot::<P>(start_slot)) {
// TODO(feature/eip7594)
} else {
if blob_serve_range_slot < max_slot {
sync_batches.push(SyncBatch {
target: SyncTarget::BlobSidecar,
direction: SyncDirection::Forward,
peer_id,
start_slot,
count,
});
}
}

sync_batches.push(SyncBatch {
Expand Down

0 comments on commit 53dde91

Please sign in to comment.