Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Dec 18, 2024
1 parent 2b5e309 commit c883096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Additions and Improvements
- Optimized blobs validation pipeline
- Remove delay when fetching blobs from the local EL on block arrival

### Bug Fixes
- Updated the gas change check for block building so that warnings only get raised if the change is off spec.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,11 @@ private BlockBlobSidecarsTracker internalOnNewBlock(

countBlock(remoteOrigin);

if (existingTracker.isRpcBlockFetchTriggered()) {
if (existingTracker.isRpcBlockFetchTriggered() && !existingTracker.isComplete()) {
// if we attempted to fetch this block via RPC, we missed the opportunity to
// complete the blob sidecars via local EL and RPC (since the block is required to
// be known) Let's try now
if (!existingTracker.isComplete()) {
fetchMissingContent(slotAndBlockRoot);
}
asyncRunner.runAsync(() -> fetchMissingContent(slotAndBlockRoot));
}
});

Expand Down Expand Up @@ -596,7 +594,7 @@ private void onFirstSeen(
final Duration blockFetchDelay = calculateBlockFetchDelay(slotAndBlockRoot);
asyncRunner.runAfterDelay(() -> fetchMissingContent(slotAndBlockRoot), blockFetchDelay);
}
// no delay for attempting to fetch blobs for when the block is first seen
// no delay for attempting to fetch blobs for when the block is first seen
case BLOCK -> asyncRunner.runAsync(() -> fetchMissingContent(slotAndBlockRoot));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ void shouldDropPossiblyFetchedBlobSidecars() {
}

@Test
void shouldTryToFetchFromLocalELWhenBlockArrivesAfterRPCFetch() {
void shouldTryToFetchBlobSidecarsWhenBlockArrivesAfterRPCFetch() {
final SignedBeaconBlock block = dataStructureUtil.randomSignedBeaconBlock(currentSlot);

final Set<BlobIdentifier> missingBlobs =
Expand All @@ -912,7 +912,7 @@ void shouldTryToFetchFromLocalELWhenBlockArrivesAfterRPCFetch() {
when(tracker.setBlock(any())).thenReturn(true);
when(tracker.getSlotAndBlockRoot()).thenReturn(block.getSlotAndBlockRoot());
when(tracker.isRpcBlockFetchTriggered()).thenReturn(true);
when(tracker.isLocalElBlobsFetchTriggered()).thenReturn(false);
when(tracker.isLocalElBlobsFetchTriggered()).thenReturn(true);
return tracker;
});

Expand All @@ -931,6 +931,9 @@ void shouldTryToFetchFromLocalELWhenBlockArrivesAfterRPCFetch() {

blockBlobSidecarsTrackersPool.onNewBlock(block, Optional.empty());

assertThat(asyncRunner.hasDelayedActions()).isTrue();
asyncRunner.executeQueuedActions();

verify(tracker).setLocalElBlobsFetchTriggered();
verify(executionLayer).engineGetBlobs(any(), any());
}
Expand Down

0 comments on commit c883096

Please sign in to comment.