Skip to content

core, triedb, ethdb: remove incremental snapshot (incr db) feature - #3768

Merged
zlacfzy merged 3 commits into
bnb-chain:developfrom
zlacfzy:remove-incr-snapshots
Jul 22, 2026
Merged

zlacfzy merged 3 commits into
bnb-chain:developfrom
zlacfzy:remove-incr-snapshots

Conversation

@zlacfzy

@zlacfzy zlacfzy commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes the incremental snapshot (incr db) feature: the incr downloader/merger, the pathdb incr manager and async state, the rawdb incr snapshot db and accessors, the IncrSnapshot* config fields, and the EnableIncrSnapshots / remote-snapshot code paths.

Rationale

The feature is unused and was deliberately decoupled from the go-ethereum v1.17.3 merge to keep that PR focused. Now that the merge has landed on develop (#3760), the removal is submitted on its own. Old config files carrying IncrSnapshot* keys remain loadable — the fields are registered as deprecated no-ops.

Changes

  • Delete the incr downloader/merger, pathdb incr manager/async state, rawdb incr snapshot db + accessors, and their tests.
  • Drop the IncrSnapshot* fields from ethconfig and their CLI flags; keep deprecated field mappings in cmd/geth/config.go so existing configs still load.
  • Drop github.com/pierrec/lz4/v4 from the root module — it was used only by the incr snapshot store.
  • Re-tidy cmd/keeper/go.mod and go.sum accordingly: that submodule replaces the root module (=> ../../) and inherits its dependency set, so removing incr's deps prunes them here too.
…feature

Delete the incr-db feature end to end: incr downloader/merger, incr
freezers and pathdb incr manager, config/flags/subcommands, and the
incr-only ethdb interface methods (AncientWriter.ResetTableForIncr,
AncientFreezer.CleanBlock). rawdb.NewFreezer and utils.MakeTrieDatabase
drop their incr-only parameters accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hashdit-bot

hashdit-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pull Request Review

This PR removes the unused incremental snapshot feature from the Go-based Ethereum client, including its downloader, merger, path database manager, raw database accessors, CLI commands, configuration fields, tests, and LZ4 dependency. Legacy IncrSnapshot* configuration keys remain accepted as deprecated no-ops for backward compatibility, while related database and trie APIs are simplified.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

Tolerate the seven removed incr config fields in existing config.toml
files via deprecatedConfigFields (previous releases serialized them
unconditionally, so startup would hard-fail otherwise). Drop dead code
that lost its last caller with the feature: WriteHeaderRLP, WriteTdRLP,
WriteBlobSidecarsRLP, InspectAncients, chainFreezer.readHeadNumber, the
statesData journal types (restored to upstream function-local form) and
the pierrec/lz4 dependency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zlacfzy
zlacfzy force-pushed the remove-incr-snapshots branch from b0fa197 to aacca22 Compare July 22, 2026 07:06
@hashdit-bot

hashdit-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pull Request Review

This PR removes the unused incremental snapshot generation, download, merge, storage, and inspection functionality from the Go-based Ethereum client. It also removes the associated CLI flags, configuration fields, database interfaces, tests, and LZ4 dependency while retaining deprecated no-op mappings so legacy configuration files remain loadable.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

cmd/keeper replaces the root module with a local path (replace => ../../),
so removing the incremental snapshot feature and its lz4 dependency from
the root module prunes the corresponding indirect deps here as well.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hashdit-bot

hashdit-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pull Request Review

This PR removes the incremental snapshot subsystem from the Go-based Ethereum/BSC client, including its downloader, merger, path database manager, raw database accessors, CLI commands, configuration fields, tests, and related dependencies. Existing IncrSnapshot* configuration keys remain accepted as deprecated no-ops for backward compatibility, while trie and freezer APIs are simplified accordingly.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

@zlacfzy zlacfzy added this to the v1.8.0 milestone Jul 22, 2026
@zlacfzy
zlacfzy merged commit ece8248 into bnb-chain:develop Jul 22, 2026
8 checks passed
zlacfzy added a commit to zlacfzy/bsc that referenced this pull request Aug 11, 2026
…test

Revert bnb-chain#3294. It marked the header, canonical hash and total difficulty
freezer tables prunable so that the incremental snapshot merger could
truncate every chain table; that feature was removed in bnb-chain#3768, so the
only thing the flags still do is delete headers on every tail prune.

They also broke InsertHeadersBeforeCutoff, which truncates the tail right
after writing the pre-cutoff headers: with the headers, hashes and diffs
tables prunable that truncation dropped the data it had just written, so
the following InsertReceiptChain could not resolve the parent's total
difficulty and failed with ErrUnknownAncestor. bnb-chain#3294 disabled
TestInsertChainWithCutoff instead; restore it.

Datadirs pruned by v1.6.5 - v1.7.7 persist a non-zero virtualTail in the
meta file of those three tables, which flipping the flags back cannot
undo - the data files are already gone. Freezer.repair panicked and
Freezer.validate errored on such a tail, so every node that ran with
--pruneancient or --history.blocks would fail to start. Both now log a
warning and keep the legacy tail; the freezer tail is already the maximum
across tables, and reads below it fail today regardless.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
zlacfzy added a commit to zlacfzy/bsc that referenced this pull request Aug 11, 2026
…test

Revert bnb-chain#3294. It marked the header, canonical hash and total difficulty
freezer tables prunable so that the incremental snapshot merger could
truncate every chain table; that feature was removed in bnb-chain#3768, so the
only thing the flags still do is delete headers on every tail prune.

They also broke InsertHeadersBeforeCutoff, which truncates the tail right
after writing the pre-cutoff headers: with the headers, hashes and diffs
tables prunable that truncation dropped the data it had just written, so
the following InsertReceiptChain could not resolve the parent's total
difficulty and failed with ErrUnknownAncestor. bnb-chain#3294 disabled
TestInsertChainWithCutoff instead; restore it.

Datadirs pruned by v1.6.5 - v1.7.7 persist a non-zero virtualTail in the
meta file of those three tables, which flipping the flags back cannot
undo - the data files are already gone. Freezer.repair panicked and
Freezer.validate errored on such a tail, so every node that ran with
--pruneancient or --history.blocks would fail to start. Both now log a
warning and keep the legacy tail; the freezer tail is already the maximum
across tables, and reads below it fail today regardless.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants