erigontech / erigontech/erigon
buildBlackListForPruning: chain-history-expiry drops the merge-spanning transactions segment
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 455
Description
The chain-history-expiry branch blacklists tx segments with `cc.IsPreMerge(res.From)` (db/snapshotsync/snapshotsync.go). Mainnet's `v1.1-015500-016000-transactions.seg` spans the merge block (15537394), so it is blacklisted whole and a node syncing in this mode never downloads transactions for post-merge blocks 15537394–15999999.
Reachable only via the explicit `--prune.mode=archive --prune.distance.blocks=18446744073709551615` hybrid (chain-history-expiry); default `full` mode has a finite `Blocks` distance and takes the correct To-based branch.
Same off-by-one-file family as #22673 (there: `isReceiptsSegmentPruned` `s.From < minStep` dropped the cutoff-spanning `logtopics`/`logaddrs` segment). The fix direction is the same: blacklist only segments entirely pre-merge (`res.To <= mergeHeight`), keeping the spanning file — a few extra pre-merge blocks on disk is fine, a post-merge body hole is not.
Contributor guide
Research direction
Start in db/snapshotsync/snapshotsync.go at buildBlackListForPruning and inspect the chain-history-expiry branch using cc.IsPreMerge(res.From). Compare the segment bounds with the merge height; done means segments spanning the merge block are retained while segments entirely pre-merge are blacklisted, preserving post-merge transaction downloads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100