You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bring the cache stack current with main (parallel/streaming commitment
correctness fixes#22184/#22113, nibblized-keccak cache #22185, erigondb.toml
commitment referencing #21452, trie io.Writer trace #21859, etc.). One
conflict in commitment_context.go's trieContext: keep both this branch's
probeSd/probeTx (adaptive trunk-pin probe) and main's traceW (io.Writer trace).
Copy file name to clipboardExpand all lines: .claude/rules/comments.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,6 @@ Default to **no comment**. Clear names and small functions should carry the mean
19
19
20
20
## When a comment is warranted
21
21
22
-
Keep it short and *why*-focused. If a reader could delete it without losing information, it shouldn't exist. Two tight lines beat a six-line essay.
22
+
Keep it concise and *why*-focused, but err on the side of clarity: cut what only adds length, keep what saves the reader a wrong guess. If a reader could delete it without losing information, it shouldn't exist. Two clear sentences beat both a cryptic one-liner and a six-line essay.
23
23
24
24
Test docstrings get slightly more latitude (explaining a non-obvious scenario the test pins), but the same rules apply — no incident/scope/task narration.
| A (legacy) |`Creating erigondb.toml with LEGACY settings` log | 1,562,500 | Written immediately on startup |
113
-
| B (fresh+downloader) |`erigondb.toml not found, using defaults` then `erigondb stepSize changed, propagating`| Code default 1,562,500 then network value (chain-dependent) | After downloader delivers it |
114
-
| C (fresh+no-downloader) |`Initializing erigondb.toml with DEFAULT settings (nodownloader)` log | 1,562,500 | Written immediately on startup |
| A (legacy) |`Creating erigondb.toml with LEGACY settings` log | 1,562,500 |`true` (written explicitly) | Written immediately on startup |
113
+
| B (fresh+downloader) |`erigondb.toml not found, using defaults` then `erigondb stepSize changed, propagating`| Code default 1,562,500 then network value (chain-dependent) | Resolves to `true` in memory until the downloader delivers the file; whatever the network publishes thereafter (a producer-published plain snapshot set ships `false`) | After downloader delivers it |
114
+
| C (fresh+no-downloader) |`Initializing erigondb.toml with DEFAULT settings (nodownloader)` log | 1,562,500 |`true` (written explicitly) | Written immediately on startup |
115
+
116
+
### references_in_commitment_branches per scenario
117
+
118
+
The `references_in_commitment_branches` field governs whether new commitment merges write referenced (short-key) `.kv` files. It resolves identically to `step_size` across the three scenarios — absent field normalizes to `true` in memory, and a downloaded `erigondb.toml` is never rewritten (it is synced snapshot metadata, so a producer's published `false` survives). The resolution logic is unit-tested in `db/state/erigondb_settings_test.go` (`TestResolveErigonDBSettings*`); these runtime scenarios confirm the same behavior end-to-end.
119
+
120
+
-**A (legacy):** the generated file contains `references_in_commitment_branches = true`.
121
+
-**B (fresh+downloader):** no file until the downloader delivers it; the in-memory resolved value is `true`. After delivery the field reflects the network's published value (a plain-snapshot producer ships `false`).
122
+
-**C (fresh+no-downloader):** the immediately-written file contains `references_in_commitment_branches = true`.
`references_in_commitment_branches` governs only *new* commitment merges; reads are version-aware and stay correct regardless of the flag (a `v2.0` commitment `.kv` whose range ≥ threshold is referenced/short-key; a `v2.1` file is plain). To publish a snapshot set whose commitment files carry no plain-key references:
127
+
128
+
1. In the producer datadir's `snapshots/erigondb.toml`, set `references_in_commitment_branches = false`**before** running merges.
129
+
2. Run the node / merge so commitment merges produce plain `v2.2``.kv` files. Existing `v2.1` referenced files convert to plain lazily as they are merged — no upfront migration.
130
+
3. Ship the datadir's `erigondb.toml` with the snapshot set. Consumers read the file and inherit `false`; a downloaded `erigondb.toml` is never rewritten, so the producer's `false` survives.
131
+
132
+
This supersedes the build-time const flip (`awskii/36exp`): no binary divergence and no CLI flag. Default nodes (field absent → `true`) keep writing byte-compatible `v2.1` referenced files with no behavior change.
Copy file name to clipboardExpand all lines: ChangeLog.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,12 @@ Aligns Erigon with the `eth_simulateV1` error code specification ([NethermindEth
36
36
37
37
- If your tooling matches on error code `-32602` to detect base-fee-too-low conditions in `eth_simulateV1` responses, update it to match `-38012` instead.
38
38
39
+
### Added
40
+
41
+
#### CLI & Operations
42
+
43
+
-`--prune.distance.blocks` now accepts readable policy names — `keep-post-merge` and `keep-all` — instead of the raw `MaxUint64`-based magic numbers (`18446744073709551615` / `18446744073709551614`); `--prune.distance` likewise accepts `keep-all`. Numeric values still work (#22119) — by @yperbasis
Copy file name to clipboardExpand all lines: agents.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ A comment may be warranted for: a non-obvious invariant the types don't enforce;
132
132
133
133
When a comment is genuinely required, it MUST be:
134
134
135
-
-**One sentence; rarely two; never a paragraph.** No bulleted lists inside `//`. No multi-section block comments with `// Concurrency:` / `// Why:` / `// How to apply:` sub-headings. If the explanation doesn't fit in two sentences, the rest belongs in the commit message, the PR description, or a design doc — not in source, where it goes stale.
135
+
-**Concise, but err on the side of clarity.** Most comments fit in a sentence or two; keep an extra sentence when cutting it would cost understanding, and cut it when it only adds length — two clear sentences beat both a cryptic one-liner and a six-line essay. An explanation that needs sub-headings (`// Concurrency:` / `// Why:`) or bullet lists to stay organized has outgrown source: put the full story in the commit message, the PR description, or a design doc, and keep the distilled why in the code.
136
136
-**High-level, not scenario-specific.** Explain the invariant or gotcha in general terms. Don't walk through specific call sites, sequences of operations, or particular situations a reader could find with `grep`. The right level of abstraction is "what must remain true," not "what happened to me last Tuesday."
137
137
-**Free of forensic detail.** Strip dates (`// found on 2026-05-21`), devnet/branch names (`// seen on bal-devnet-7`), PR/issue/review references (`// flagged in #21314 round-4 review`), incident anecdotes, and "used by X, Y, Z" callsite lists. That history belongs in the commit message and PR description, where it survives intact; in source it rots, misleads later readers, and bloats the file.
138
138
-**Not a restatement of the code.** If a reader could delete the comment without losing information, delete it. Standard Go idioms and well-known library behavior don't need annotation.
@@ -168,7 +168,7 @@ Function docstrings follow the same rule: a one-line summary, plus param/return
168
168
169
169
`// TODO` notes are only acceptable with a linked tracking issue and an owner. Better: file the issue and don't add the TODO; or fix it now.
170
170
171
-
**For automated agents specifically:** previous iterations of this guidance were not enough — agents kept producing multi-paragraph block comments enumerating call sites and incident history. Treat the rules above as hard limits. If you catch yourself writing a third sentence in a comment, stop and either delete it, condense to one sentence, or move the content into the commit message.
171
+
**For automated agents specifically:** previous iterations of this guidance were not enough — agents kept producing multi-paragraph block comments enumerating call sites and incident history. The forensic-detail and scenario rules above are hard limits; length is a judgment call with clarity as the tiebreaker. When a comment grows, look at what the growth is made of: call-site inventories and incident history move to the commit message; a sentence that saves the reader a wrong guess stays.
0 commit comments