diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 181f31343f7..561ebd90326 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -55,3 +55,4 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi - [docker] \#9073 enable cross platform build using docker buildx - [docker] \#9462 ensure Docker image uses consistent version of Go - [sequencer] \#45 Restore crash recovery when reth v2.5.2 loses its default in-memory block window. (@panos-xyz) +- [sequencer] \#49 Restore crash recovery when reth v2.10.1 loses its default in-memory block window. (@panos-xyz) diff --git a/sequencer/state_v2.go b/sequencer/state_v2.go index c1bb6822e46..81f2bb04e13 100644 --- a/sequencer/state_v2.go +++ b/sequencer/state_v2.go @@ -49,8 +49,13 @@ const ( // It has to cover how far the EL's canonical head can regress after a crash, // which is upstream reth configuration rather than a fixed quantity: the // ceiling is persistence_backpressure_threshold + memory_block_buffer_target, - // i.e. 16 on reth v2.4.0 (16 + 0) and 21 on reth v2.5.2 (16 + 5) with default - // settings. 32 covers the v2.5.2 default with margin. + // i.e. 16 on reth v2.4.0 (16 + 0), 21 on reth v2.5.2 (16 + 5) and 105 on + // reth v2.10.1 (100 + 5) with default settings. 128 covers the v2.10.1 default + // with margin. + // + // reth's state-masking suffix does not add to that ceiling: masked blocks stay + // in memory and count against the backpressure threshold, and a restart after + // a crash unwinds to the start of the suffix. // // When changing this or the EL's persistence configuration, keep: // @@ -65,13 +70,13 @@ const ( // // A graceful EL shutdown persists up to the head, so the gap is 0 on SIGTERM // and only non-zero after a crash. - backfillMaxDepth = 32 + backfillMaxDepth = 128 // backfillCacheCapacity is how many recently applied blocks are retained so they // can be re-pushed after the EL loses its unpersisted head. Kept above // backfillMaxDepth so the oldest ancestor a backfill may need is still present; // see the invariant on backfillMaxDepth. - backfillCacheCapacity = 64 + backfillCacheCapacity = 256 // parentNotFoundError is the error text geth returns when a parent hash is // absent from its chain (see go-ethereum/eth/catalyst/l2_api.go, diff --git a/sequencer/state_v2_test.go b/sequencer/state_v2_test.go index e13858bdb6c..67b75354ad2 100644 --- a/sequencer/state_v2_test.go +++ b/sequencer/state_v2_test.go @@ -640,10 +640,10 @@ func cacheGap(t *testing.T, s *StateV2, head *BlockV2, depth int) common.Hash { // backfillMaxDepth has to cover how far the EL's canonical head can regress // after a crash. That ceiling is upstream reth configuration rather than a // fixed quantity — persistence_backpressure_threshold + memory_block_buffer_target -// is 16 on reth v2.4.0 and 21 on reth v2.5.2 — so the boundary is pinned here -// instead of being left to the constant's comment. A depth short of it refuses -// the gap outright, which is indistinguishable from a node that simply stopped -// catching up. +// is 16 on reth v2.4.0, 21 on reth v2.5.2 and 105 on reth v2.10.1 — so the +// boundary is pinned here instead of being left to the constant's comment. A +// depth short of it refuses the gap outright, which is indistinguishable from a +// node that simply stopped catching up. func TestStateV2_Backfill_DepthBoundary(t *testing.T) { for _, tc := range []struct { name string @@ -651,6 +651,7 @@ func TestStateV2_Backfill_DepthBoundary(t *testing.T) { wantErr string }{ {"reth v2.5.2 default ceiling", 21, ""}, + {"reth v2.10.1 default ceiling", 105, ""}, {"exactly backfillMaxDepth", backfillMaxDepth, ""}, {"one past backfillMaxDepth", backfillMaxDepth + 1, "gap exceeds backfillMaxDepth"}, } {