Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle sequencer recover related logic #250

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions op-node/rollup/attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"strings"
"time"

"github.com/ethereum/go-ethereum"
Expand Down Expand Up @@ -153,6 +154,9 @@ func (eq *AttributesHandler) forceNextSafeAttributes(ctx context.Context, attrib
_ = eq.ec.CancelPayload(ctx, true)
return derive.NewResetError(fmt.Errorf("need reset to resolve pre-state problem: %w", err))
case derive.BlockInsertPayloadErr:
if strings.Contains(err.Error(), "INCONSISTENT") {
return derive.NewTemporaryError(fmt.Errorf("temporarily cannot insert new safe block: %w", err))
}
_ = eq.ec.CancelPayload(ctx, true)
eq.log.Warn("could not process payload derived from L1 data, dropping batch", "err", err)
// Count the number of deposits to see if the tx list is deposit only.
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/derive/engine_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func confirmPayload(
if err != nil {
return nil, BlockInsertTemporaryErr, fmt.Errorf("failed to insert execution payload: %w", err)
}
if status.Status == eth.ExecutionInvalid || status.Status == eth.ExecutionInvalidBlockHash {
if status.Status == eth.ExecutionInvalid || status.Status == eth.ExecutionInvalidBlockHash || status.Status == eth.ExecutionInconsistent {
agossip.Clear()
return nil, BlockInsertPayloadErr, eth.NewPayloadErr(payload, status)
}
Expand Down
2 changes: 2 additions & 0 deletions op-service/eth/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func NewPayloadErr(payload *ExecutionPayload, payloadStatus *PayloadStatusV1) er
return fmt.Errorf("engine is misconfigured. Received invalid-terminal-block error while engine API should be active at genesis. err: %v", payloadStatus.ValidationError)
case ExecutionAccepted:
return fmt.Errorf("execution payload cannot be validated yet, latest valid hash is %s", payloadStatus.LatestValidHash)
case ExecutionInconsistent:
return fmt.Errorf("execution payload meets an INCONSISTENT status, latest valid hash is %s", payloadStatus.LatestValidHash)
default:
return fmt.Errorf("unknown execution status on %s: %q, ", payload.ID(), string(payloadStatus.Status))
}
Expand Down
Loading