Skip to content

Commit

Permalink
Only prepare execution payload if there is a registered validator pro…
Browse files Browse the repository at this point in the history
…posing in the next slot.

Add AlwaysPrepareExecutionPayload feature to prepare execution in advance for each slot.
  • Loading branch information
povi authored and Tumas committed May 16, 2024
1 parent 9f1110e commit d6bb1e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static FEATURES: [AtomicBool; Feature::CARDINALITY] = [FALSE; Feature::CARDINALI
)]
pub enum Feature {
AlwaysPrepackAttestations,
AlwaysPrepareExecutionPayload,
CacheTargetStates,
DebugEth1,
DebugP2p,
Expand Down
5 changes: 4 additions & 1 deletion validator/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ impl<P: Preset, W: Wait + Sync> Validator<P, W> {
}
},
ValidatorMessage::PrepareExecutionPayload(slot, safe_execution_payload_hash, finalized_execution_payload_hash) => {
if !self.attestation_agg_pool.has_registered_validators_proposing_in_slots(slot..=slot).await {
let should_prepare_execution_payload = Feature::AlwaysPrepareExecutionPayload.is_enabled()
|| self.attestation_agg_pool.has_registered_validators_proposing_in_slots(slot..=slot).await;

if !should_prepare_execution_payload {
return Ok(());
}

Expand Down

0 comments on commit d6bb1e9

Please sign in to comment.