From 7055c2cb97871785f8b6a9f475fed8d7029096a7 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Wed, 3 Jul 2024 22:44:30 +0200 Subject: [PATCH] Cherry-pick: Caplin's past finalization check (#11006) --- cl/phase1/network/services/blob_sidecar_service.go | 6 +++++- turbo/execution/eth1/block_building.go | 2 -- turbo/execution/eth1/ethereum_execution.go | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cl/phase1/network/services/blob_sidecar_service.go b/cl/phase1/network/services/blob_sidecar_service.go index 57dde2104c5..0c89c9db339 100644 --- a/cl/phase1/network/services/blob_sidecar_service.go +++ b/cl/phase1/network/services/blob_sidecar_service.go @@ -78,11 +78,15 @@ func (b *blobSidecarService) ProcessMessage(ctx context.Context, subnetId *uint6 currentSlot := b.ethClock.GetCurrentSlot() sidecarSlot := msg.SignedBlockHeader.Header.Slot // [IGNORE] The block is not from a future slot (with a MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance) -- i.e. validate that - //signed_beacon_block.message.slot <= current_slot (a client MAY queue future blocks for processing at the appropriate slot). + // signed_beacon_block.message.slot <= current_slot (a client MAY queue future blocks for processing at the appropriate slot). if currentSlot < sidecarSlot && !b.ethClock.IsSlotCurrentSlotWithMaximumClockDisparity(sidecarSlot) { return ErrIgnore } + if b.forkchoiceStore.FinalizedSlot() >= sidecarSlot { + return ErrIgnore + } + blockRoot, err := msg.SignedBlockHeader.Header.HashSSZ() if err != nil { return err diff --git a/turbo/execution/eth1/block_building.go b/turbo/execution/eth1/block_building.go index 3bac0ca0a98..ec49b03ca27 100644 --- a/turbo/execution/eth1/block_building.go +++ b/turbo/execution/eth1/block_building.go @@ -42,7 +42,6 @@ func (e *EthereumExecutionModule) evictOldBuilders() { // Missing: NewPayload, AssembleBlock func (e *EthereumExecutionModule) AssembleBlock(ctx context.Context, req *execution.AssembleBlockRequest) (*execution.AssembleBlockResponse, error) { if !e.semaphore.TryAcquire(1) { - e.logger.Warn("ethereumExecutionModule.AssembleBlock: ExecutionStatus_Busy") return &execution.AssembleBlockResponse{ Id: 0, Busy: true, @@ -109,7 +108,6 @@ func blockValue(br *types.BlockWithReceipts, baseFee *uint256.Int) *uint256.Int func (e *EthereumExecutionModule) GetAssembledBlock(ctx context.Context, req *execution.GetAssembledBlockRequest) (*execution.GetAssembledBlockResponse, error) { if !e.semaphore.TryAcquire(1) { - e.logger.Warn("ethereumExecutionModule.GetAssembledBlock: ExecutionStatus_Busy") return &execution.GetAssembledBlockResponse{ Busy: true, }, nil diff --git a/turbo/execution/eth1/ethereum_execution.go b/turbo/execution/eth1/ethereum_execution.go index 5122edb36b7..257de763fde 100644 --- a/turbo/execution/eth1/ethereum_execution.go +++ b/turbo/execution/eth1/ethereum_execution.go @@ -212,7 +212,6 @@ func (e *EthereumExecutionModule) ValidateChain(ctx context.Context, req *execut } } if isInvalidChain { - e.logger.Warn("ethereumExecutionModule.ValidateChain: chain is invalid", "hash", libcommon.Hash(blockHash)) validationStatus = execution.ExecutionStatus_BadBlock } validationReceipt := &execution.ValidationReceipt{