From 584d1062684609cb0f5fa8949ee6cc9c8b673afa Mon Sep 17 00:00:00 2001 From: Tumas Date: Wed, 30 Oct 2024 11:48:48 +0200 Subject: [PATCH] Fix EL head querying post-electra --- fork_choice_control/src/mutator.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fork_choice_control/src/mutator.rs b/fork_choice_control/src/mutator.rs index 4d4f66c..1887ea4 100644 --- a/fork_choice_control/src/mutator.rs +++ b/fork_choice_control/src/mutator.rs @@ -318,6 +318,7 @@ where Ok(()) } + #[allow(clippy::too_many_lines)] fn handle_tick(&mut self, wait_group: &W, tick: Tick) -> Result<()> { if tick.epoch::

() > self.store.current_epoch() { let checkpoint = self.store.unrealized_justified_checkpoint(); @@ -354,7 +355,20 @@ where if let Some(execution_payload) = head.block.as_ref().clone().execution_payload() { let mut params = None; - if let Some(body) = head.block.message().body().post_deneb() { + if let Some(body) = head.block.message().body().post_electra() { + let versioned_hashes = body + .blob_kzg_commitments() + .iter() + .copied() + .map(misc::kzg_commitment_to_versioned_hash) + .collect(); + + params = Some(ExecutionPayloadParams::Electra { + versioned_hashes, + parent_beacon_block_root: head.block.message().parent_root(), + execution_requests: body.execution_requests().clone(), + }); + } else if let Some(body) = head.block.message().body().post_deneb() { let versioned_hashes = body .blob_kzg_commitments() .iter()