Skip to content

Commit f3b5f74

Browse files
tmelhaotmelhao
authored andcommitted
eth/catalyst: remove error return in delayPayloadImport (ethereum#29043)
Co-authored-by: tmelhao <tmelhao@gmail.com>
1 parent 0eb9439 commit f3b5f74

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

eth/catalyst/api.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
567567
// update after legit payload executions.
568568
parent := api.eth.BlockChain().GetBlock(block.ParentHash(), block.NumberU64()-1)
569569
if parent == nil {
570-
return api.delayPayloadImport(block)
570+
return api.delayPayloadImport(block), nil
571571
}
572572
// We have an existing parent, do some sanity checks to avoid the beacon client
573573
// triggering too early
@@ -593,7 +593,7 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
593593
// into the database directly will conflict with the assumptions of snap sync
594594
// that it has an empty db that it can fill itself.
595595
if api.eth.SyncMode() != downloader.FullSync {
596-
return api.delayPayloadImport(block)
596+
return api.delayPayloadImport(block), nil
597597
}
598598
if !api.eth.BlockChain().HasBlockAndState(block.ParentHash(), block.NumberU64()-1) {
599599
api.remoteBlocks.put(block.Hash(), block.Header())
@@ -619,11 +619,11 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
619619
// either via a forkchoice update or a sync extension. This method is meant to
620620
// be called by the newpayload command when the block seems to be ok, but some
621621
// prerequisite prevents it from being processed (e.g. no parent, or snap sync).
622-
func (api *ConsensusAPI) delayPayloadImport(block *types.Block) (engine.PayloadStatusV1, error) {
622+
func (api *ConsensusAPI) delayPayloadImport(block *types.Block) engine.PayloadStatusV1 {
623623
// Sanity check that this block's parent is not on a previously invalidated
624624
// chain. If it is, mark the block as invalid too.
625625
if res := api.checkInvalidAncestor(block.ParentHash(), block.Hash()); res != nil {
626-
return *res, nil
626+
return *res
627627
}
628628
// Stash the block away for a potential forced forkchoice update to it
629629
// at a later time.
@@ -635,7 +635,7 @@ func (api *ConsensusAPI) delayPayloadImport(block *types.Block) (engine.PayloadS
635635
err := api.eth.Downloader().BeaconExtend(api.eth.SyncMode(), block.Header())
636636
if err == nil {
637637
log.Debug("Payload accepted for sync extension", "number", block.NumberU64(), "hash", block.Hash())
638-
return engine.PayloadStatusV1{Status: engine.SYNCING}, nil
638+
return engine.PayloadStatusV1{Status: engine.SYNCING}
639639
}
640640
// Either no beacon sync was started yet, or it rejected the delivered
641641
// payload as non-integratable on top of the existing sync. We'll just
@@ -652,7 +652,7 @@ func (api *ConsensusAPI) delayPayloadImport(block *types.Block) (engine.PayloadS
652652
// and cannot afford concurrent out-if-band modifications via imports.
653653
log.Warn("Ignoring payload while snap syncing", "number", block.NumberU64(), "hash", block.Hash(), "reason", err)
654654
}
655-
return engine.PayloadStatusV1{Status: engine.SYNCING}, nil
655+
return engine.PayloadStatusV1{Status: engine.SYNCING}
656656
}
657657

658658
// setInvalidAncestor is a callback for the downloader to notify us if a bad block

0 commit comments

Comments
 (0)