diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 056c1c1abc..7c0e948ca0 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -36,6 +36,7 @@ import ( "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" + "strings" ) var ( @@ -681,6 +682,9 @@ func (api *ConsensusAPI) delayPayloadImport(block *types.Block) (engine.PayloadS // that the parent state is missing and the syncer rejected extending the // current cycle with the new payload. log.Warn("Ignoring payload with missing parent", "number", block.NumberU64(), "hash", block.Hash(), "parent", block.ParentHash(), "reason", err) + if strings.Contains(err.Error(), "forced head needed for startup") { + return engine.PayloadStatusV1{Status: engine.SYNCING}, err + } } else { // In non-full sync mode (i.e. snap sync) all payloads are rejected until // snap sync terminates as snap sync relies on direct database injections diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index cbf744cd6d..382c4ecc0b 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -51,6 +51,7 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" "github.com/mattn/go-colorable" + "strings" ) var ( @@ -863,7 +864,7 @@ func TestTrickRemoteBlockCache(t *testing.T) { // feed the payloads to node B for _, payload := range invalidChain { status, err := apiB.NewPayloadV1(*payload) - if err != nil { + if err != nil && !strings.Contains(err.Error(), "forced head needed for startup") { panic(err) } if status.Status == engine.VALID {