Skip to content

Commit

Permalink
Cherry-pick: Caplin's past finalization check (#11006)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Jul 3, 2024
1 parent 4193e03 commit 7055c2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cl/phase1/network/services/blob_sidecar_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions turbo/execution/eth1/block_building.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion turbo/execution/eth1/ethereum_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 7055c2c

Please sign in to comment.