Skip to content

Commit

Permalink
add extra error info when meet a unexpected el sync
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Jul 31, 2024
1 parent 0c45fd0 commit e277e17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion eth/catalyst/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie"
"github.com/mattn/go-colorable"
"strings"
)

var (
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e277e17

Please sign in to comment.