Bound domain merge limit; add CLI override#20705
Merged
Merged
Conversation
…in-frozen-file Domain merges previously ignored the stepsInFrozenFile cap that history and inverted-index merges already honour, so a single domain merge could span arbitrarily many steps. Apply the same cap to domain merges. Also add --override.domain.steps-in-frozen-file to override the cap for domain merges only (history/II keep using erigondb.toml): a positive integer sets an explicit cap; "Inf" (via the new config3.UnboundedDomainMerge sentinel) restores the pre-existing unbounded behaviour. When the override is active it is logged once at startup alongside the "erigondb settings" log line so operators can see the active cap.
AskAlexSharov
approved these changes
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bounds domain-value merges by the same steps_in_frozen_file cap used elsewhere, and adds a CLI override to restore the legacy “unbounded domain merge” behavior when needed (e.g., for snapshot fabrication workflows).
Changes:
- Apply a merge-span cap to domain value merges (separately from history/II) and thread the new parameter through call sites/tests.
- Add
--override.domain.steps-in-frozen-fileCLI flag (supports"Inf") and plumb it into aggregator construction. - Introduce
config3.UnboundedDomainMergesentinel to represent “no cap”.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| node/ethconfig/gen_config.go | Adds TOML marshal/unmarshal support for the new override field. |
| node/ethconfig/config.go | Adds OverrideDomainStepsInFrozenFile to the node config schema with semantics doc. |
| node/eth/backend.go | Applies the override when building state.AggOpts, with startup logging. |
| node/cli/default_flags.go | Registers the new override flag in default CLI flags list. |
| cmd/utils/flags.go | Defines/parses the CLI flag and sets ethconfig.Config.OverrideDomainStepsInFrozenFile. |
| db/config3/config3.go | Adds UnboundedDomainMerge sentinel constant. |
| db/state/aggregator2.go | Adds AggOpts.DomainStepsInFrozenFileOverride plumbed into Aggregator. |
| db/state/aggregator.go | Uses the override to compute a domain-only max span and forwards it into domain merge-range selection. |
| db/state/merge.go | Updates DomainRoTx.findMergeRange to cap domain-value merge span via domainMaxSpan. |
| db/state/merge_test.go | Updates unit tests for the new findMergeRange signature. |
| db/state/domain_test.go | Updates domain tests to pass separate domain/history span args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rigondb.domain Rename the CLI flag from --override.domain.steps-in-frozen-file to --erigondb.domain.steps-in-frozen-file and the matching ethconfig/AggOpts identifiers, so the name reflects that it's an erigondb-level setting rather than a generic chain-config override.
2 tasks
AskAlexSharov
added a commit
to JayeTurn/erigon
that referenced
this pull request
Apr 23, 2026
…h#20730) ## Summary Documents the `--erigondb.domain.steps-in-frozen-file` flag introduced in erigontech#20705. - Adds entry to the **Database and Caching** section of `configuring-erigon/README.md` - Flag overrides `erigondb.toml` `steps_in_frozen_file` for the domain merge cap only - Accepts a positive integer or `Inf` (unbounded); default is unset (uses `erigondb.toml`) - History and inverted-index merges are unaffected ## Test plan - [ ] Verify flag appears in `erigon --help` on `main` - [ ] Verify `Inf` is accepted as value 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: bloxster <gianni.morselli@erigon.tech> Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
This was referenced May 12, 2026
Merged
AskAlexSharov
pushed a commit
that referenced
this pull request
May 13, 2026
….steps-in-frozen-file (#21148) Cherry-pick of #20705 to `release/3.4`. Conflict-resolution notes: - Kept `stepSize`/`stepsInFrozenFile` as `uint64` (release/3.4 hasn't picked up the `atomic.Uint64` refactor from main); only the new `erigondbDomainStepsInFrozenFile` override field was added. - Did not pull in unrelated test helpers (`filledDomainWithHashMapAccessor`, `TestDomain_KeyPosResetOnCollisionRetry`) that exist on main but not on `release/3.4`. - `node/eth/backend.go`: kept the `db/consensuschain` import and added `db/config3` alongside it. Prerequisite for cherry-pick of #21025 to `release/3.4`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently domain merge is unlimited (ignores steps-in-frozen-files setting, applied only to hsitory/index).
From now on, it follows the same limit by default.
On +3.5 snapshotters we should run erigon with
--override.domain.steps-in-frozen-files="Inf"to preserve the old behavior and fabricate domains with unlimited merging.