Skip to content

Commit

Permalink
Delay instead of rejecting blob sidecars if there is too many empty s…
Browse files Browse the repository at this point in the history
…lots for state cache to process
  • Loading branch information
povi committed Feb 10, 2025
1 parent 8404651 commit c4bd9e5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion fork_choice_store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ use crate::{
store_config::StoreConfig,
supersets::MultiPhaseAggregateAndProofSets as AggregateAndProofSupersets,
validations::validate_merge_block,
StateCacheError,
};

/// [`Store`] from the Fork Choice specification.
Expand Down Expand Up @@ -1756,7 +1757,16 @@ impl<P: Preset> Store<P> {
return Ok(BlobSidecarAction::Ignore(true));
}

let state = state_fn()?;
let state = match state_fn() {
Ok(state) => state,
Err(error) => {
if let Some(StateCacheError::StateFarBehind { .. }) = error.downcast_ref() {
return Ok(BlobSidecarAction::DelayUntilSlot(blob_sidecar));
}

bail!(error);
}
};

// [REJECT] The proposer signature of blob_sidecar.signed_block_header, is valid with respect to the block_header.proposer_index pubkey.
SingleVerifier.verify_singular(
Expand Down

0 comments on commit c4bd9e5

Please sign in to comment.