shutter: recover from unwinds before the first keyper set activates

Open
#26,376 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@joxerx is already working on this.

Since Nov 18, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start with KsmEonTracker.readEonAtNewBlockEvent and trace how its cached currentEon and GetKeyperSetIndexByBlock behave when the chain unwinds before the first keyper set activates. Add regression coverage for the reported block 4 → 10 → 9 unwind and recovery after activation becomes canonical again. Confirm the new handling recovers from a missing active set while preserving errors from unrelated contract failures.

Written by the indexing model from the issue text.

Description

A reorg can stop Shutter after the keyper-set manager has been deployed but before its first keyper set activates. This pre-existing behavior surfaced while reviewing #25515.

KsmEonTracker.readEonAtNewBlockEvent checks for an active keyper set only when currentEon is nil. After learning an eon, an unwind into the earlier interval leaves that cache populated, skips the guard, and calls GetKeyperSetIndexByBlock. Its revert propagates through the tracker and stops the Shutter pool until restart. The existing bind.ErrNoCode handling covers an unwind before deployment, but not this interval.

Reproduction: deploy the manager at block 4, activate the first keyper set at block 10, let the tracker learn that eon, then unwind to block 9. The review reproduction reported get keyper set index by block: execution reverted and pool stopped.

Treat the absence of an active keyper set as a recoverable state, invalidate the relevant cached eons, and resume when activation becomes canonical again. Preserve errors for unrelated contract failures. Add a regression covering the unwind and subsequent recovery. This is operational Shutter behavior; frame-transaction support is not required.

Dominant language
Go
Stars
3.6k
Forks
1.6k
Avg merge
1d 17h
Merged PRs (30d)
820

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from erigontech/erigon

All issues in erigontech/erigon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.