From 4355f81731aa5b68b11dc99c7b74824580523b21 Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 16 May 2024 11:17:31 +0000 Subject: [PATCH] temporarily disable optimistic block hashing on electra --- beacon_chain/gossip_processing/block_processor.nim | 3 ++- beacon_chain/light_client.nim | 6 ++++-- beacon_chain/nimbus_light_client.nim | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index 4405e1a84..02bdf617c 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -551,7 +551,8 @@ proc storeBlock( # Client software MUST validate `blockHash` value as being equivalent to # `Keccak256(RLP(ExecutionBlockHeader))` # https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#specification - when typeof(signedBlock).kind >= ConsensusFork.Bellatrix: + when typeof(signedBlock).kind >= ConsensusFork.Bellatrix and typeof(signedBlock).kind <= ConsensusFork.Deneb: + debugComment "electra can do this in principle" template payload(): auto = signedBlock.message.body.execution_payload if signedBlock.message.is_execution_block and payload.block_hash != diff --git a/beacon_chain/light_client.nim b/beacon_chain/light_client.nim index 5490b05dd..232fe5361 100644 --- a/beacon_chain/light_client.nim +++ b/beacon_chain/light_client.nim @@ -366,6 +366,8 @@ proc updateGossipStatus*( lightClient: LightClient, slot: Slot, dagIsBehind = default(Option[bool])) = template cfg(): auto = lightClient.cfg + debugComment "when LC on electra works, add cfg.ELECTRA_FORK_EPOCH" + let epoch = slot.epoch @@ -382,7 +384,7 @@ proc updateGossipStatus*( currentEpochTargetGossipState = getTargetGossipState( epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, - cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, cfg.ELECTRA_FORK_EPOCH, + cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, FAR_FUTURE_EPOCH, isBehind) targetGossipState = if lcBehind or epoch < 1: @@ -393,7 +395,7 @@ proc updateGossipStatus*( # Therefore, LC topic subscriptions are kept for 1 extra epoch. let previousEpochTargetGossipState = getTargetGossipState( epoch - 1, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, - cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, cfg.ELECTRA_FORK_EPOCH, + cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, FAR_FUTURE_EPOCH, isBehind) currentEpochTargetGossipState + previousEpochTargetGossipState diff --git a/beacon_chain/nimbus_light_client.nim b/beacon_chain/nimbus_light_client.nim index 370246e57..abd515bee 100644 --- a/beacon_chain/nimbus_light_client.nim +++ b/beacon_chain/nimbus_light_client.nim @@ -224,7 +224,7 @@ programMain: targetGossipState = getTargetGossipState( slot.epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, - cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, cfg.ELECTRA_FORK_EPOCH, + cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, FAR_FUTURE_EPOCH, isBehind) template currentGossipState(): auto = blocksGossipState