execution/stagedsync: an interrupt during the commitment reports a wrong trie root or panics

Open
#26,448 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@awskii is already working on this.

Since Nov 18, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Start with execution/stagedsync/committer.go around computeWithBlockAccumulator and computeCommitment, then trace the commitment state handling in execution/commitment/commitment_context.go and execution/commitment/hex_patricia_hashed.go. Reproduce an interrupt during the serial commitment path used by the stage_exec smoke test and inspect how errors affect trie state and the next block’s root. Done means shutdown no longer leaves state that produces a panic or reports a valid block as having a wrong trie root.

Written by the indexing model from the issue text.

Description

When integration stage_exec gets SIGTERM while the commitment calculator works, it can fail in two ways. Both come from the QA stage-exec smoke test on main (chaintip, serial commitment), which stops stage_exec with timeout 360:

  • 2026-11-07 (run, job 128296208629): 1 ms after "Got interrupt, shutting down...", the executor reports the next block as invalid:
    [EROR] [6/8 Execution] Wrong trie root of block 26293001: ceec74c2... (invalid block: wrong trie root: block 26293001 root ceec74c2... expected e2e49216...)
    
  • 2026-11-08 (run, job 128623497065): right after the interrupt, the commitment calculator panics:
    panic: currentKeyLen > 0 [recovered, repanicked]
    execution/commitment.(*HexPatriciaHashed).EncodeCurrentState  hex_patricia_hashed.go:3166
    execution/commitment/commitmentdb.(*SharedDomainsCommitmentContext).encodeCommitmentState  commitment_context.go:1004
    ...encodeAndStoreCommitmentState  commitment_context.go:975
    ...computeCommitment  commitment_context.go:480
    ...ComputeCommitmentWithDiff  commitment_context.go:439
    execution/stagedsync.(*commitmentCalculator).computeWithBlockAccumulator  committer.go:991
    ...compute  committer.go:841 / handleMessage  committer.go:487 / loop  committer.go:326
    

Line 480 at that commit (f62f1bfb3a) is the zero-update early return of computeCommitment, which stores the trie state. EncodeCurrentState panics when a fold is in progress, so a fold that an earlier, interrupted call left unfinished is the likely cause: when Process returns an error, computeCommitment does not reset the trie. Current main has the same early return. I have not checked how the interrupted fold reaches a wrong root without an error.

A wrong trie root during shutdown is the worse of the two, as the block is reported invalid. Since #26310 the smoke test runs only parallel commitment, and its daily runs have been green since 2026-11-09.

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.