Commit 50e1623a authored by Axel Kingsley's avatar Axel Kingsley Committed by GitHub

interop: Reset Derivation and Backfill Supervisor when Too Far Behind (#12919)

* Reset Derivation when Supervisor is Behind

* Disable Batcher Throttling in Interop local-devnet
parent 910c9ade
......@@ -319,6 +319,7 @@ services:
OP_BATCHER_METRICS_ENABLED: "true"
OP_BATCHER_RPC_ENABLE_ADMIN: "true"
OP_BATCHER_BATCH_TYPE:
OP_BATCHER_THROTTLE_INTERVAL: 0
# uncomment to use blobs
# OP_BATCHER_DATA_AVAILABILITY_TYPE: blobs
env_file:
......@@ -350,6 +351,7 @@ services:
OP_BATCHER_METRICS_ENABLED: "true"
OP_BATCHER_RPC_ENABLE_ADMIN: "true"
OP_BATCHER_BATCH_TYPE:
OP_BATCHER_THROTTLE_INTERVAL: 0
# uncomment to use blobs
# OP_BATCHER_DATA_AVAILABILITY_TYPE: blobs
env_file:
......
......@@ -3,6 +3,7 @@ package interop
import (
"context"
"fmt"
"strings"
"sync"
"time"
......@@ -139,7 +140,10 @@ func (d *InteropDeriver) onInteropPendingSafeChangedEvent(x engine.InteropPendin
defer cancel()
if err := d.backend.UpdateLocalSafe(ctx, d.chainID, x.DerivedFrom, x.Ref.BlockRef()); err != nil {
d.log.Debug("Failed to signal derived-from update to interop backend", "derivedFrom", x.DerivedFrom, "block", x.Ref)
// still continue to try and do a cross-safe update
if strings.Contains(err.Error(), "too far behind") {
d.log.Error("Supervisor is too far behind, resetting derivation", "err", err)
d.emitter.Emit(rollup.ResetEvent{Err: fmt.Errorf("supervisor is too far behind: %w", err)})
}
}
// Now that the op-supervisor is aware of the new local-safe block, we want to check if cross-safe changed.
d.emitter.Emit(engine.RequestCrossSafeEvent{})
......
......@@ -67,8 +67,10 @@ func (db *DB) AddDerived(derivedFrom eth.BlockRef, derived eth.BlockRef) error {
derived, derived.ParentHash, lastDerived, types.ErrConflict)
}
} else if lastDerived.Number+1 < derived.Number {
return fmt.Errorf("derived block %s (parent: %s) is too new, expected to build on top of %s: %w",
derived, derived.ParentHash, lastDerived, types.ErrOutOfOrder)
return fmt.Errorf("cannot add block (%s derived from %s), last block (%s derived from %s) is too far behind: (%w)",
derived, derivedFrom,
lastDerived, lastDerivedFrom,
types.ErrOutOfOrder)
} else {
return fmt.Errorf("derived block %s is older than current derived block %s: %w",
derived, lastDerived, types.ErrOutOfOrder)
......@@ -89,8 +91,10 @@ func (db *DB) AddDerived(derivedFrom eth.BlockRef, derived eth.BlockRef) error {
}
} else if lastDerivedFrom.Number+1 < derivedFrom.Number {
// adding block that is derived from something too far into the future
return fmt.Errorf("cannot add block %s as derived from %s, still deriving from %s: %w",
derived, derivedFrom, lastDerivedFrom, types.ErrOutOfOrder)
return fmt.Errorf("cannot add block (%s derived from %s), last block (%s derived from %s) is too far behind: (%w)",
derived, derivedFrom,
lastDerived, lastDerivedFrom,
types.ErrOutOfOrder)
} else {
// adding block that is derived from something too old
return fmt.Errorf("cannot add block %s as derived from %s, deriving already at %s: %w",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment