Skip to content

Commit b9c8b68

Browse files
committed
docs: tighten receipt-store comments
Cut WHAT-narration, #3237 issue refs, version-compat justifications, and contract repetition. The ReceiptStoreConfig type godoc owns the KeepRecent-is-a-no-op explanation; the archive override site, legacy struct, and tests no longer repeat it. Reference upstream symbols by name (flagRSMisnamedBackend) instead of paraphrasing. Net -15 hand-written comment lines, no behavior change.
1 parent 9ca9764 commit b9c8b68

4 files changed

Lines changed: 10 additions & 25 deletions

File tree

config.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,9 @@ type StateStoreConfig struct {
341341
EVMDBDirectory string `toml:"evm_db_directory"`
342342
}
343343

344-
// ReceiptStoreConfig mirrors sei-chain's ReceiptStoreConfig.
345-
// On post-#3237 sei-chain, KeepRecent is tagged `mapstructure:"-"` upstream
346-
// and is stamped from base-app min-retain-blocks at startup; the TOML key
347-
// is silently ignored. We still emit it so the config self-documents the
348-
// retention intent and remains compatible with pre-#3237 binaries.
344+
// ReceiptStoreConfig — KeepRecent is silently ignored at runtime;
345+
// sei-chain tags it `mapstructure:"-"` and stamps the value from base-app
346+
// min-retain-blocks. Emitted anyway so the TOML documents retention intent.
349347
type ReceiptStoreConfig struct {
350348
Backend string `toml:"backend"`
351349
DBDirectory string `toml:"db_directory"`

config_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ func TestDefaultForMode_ArchiveKeepsAll(t *testing.T) {
7777
if cfg.EVM.MaxTraceLookbackBlocks != -1 {
7878
t.Errorf("archive max_trace_lookback_blocks: got %d, want -1", cfg.EVM.MaxTraceLookbackBlocks)
7979
}
80-
// All three knobs that govern receipt-store retention must evaluate to
81-
// "no pruning" — min-retain-blocks=0 (drives ReceiptStore.KeepRecent at
82-
// the app layer), pruning="nothing", and prune-interval-seconds=0.
8380
if got := cfg.Storage.ReceiptStore.KeepRecent; got != 0 {
8481
t.Errorf("archive receipt_store.keep_recent: got %d, want 0", got)
8582
}
@@ -89,11 +86,8 @@ func TestDefaultForMode_ArchiveKeepsAll(t *testing.T) {
8986
}
9087

9188
func TestWriteArchive_ReceiptStoreTOMLKeys(t *testing.T) {
92-
// Pin the literal app.toml keys in the [receipt-store] section. A symmetric
93-
// tag typo across toLegacyApp / fromLegacy round-trips cleanly but produces
94-
// an app.toml seid won't accept (e.g., flagRSMisnamedBackend rejects
95-
// "backend" without the rs- prefix at startup). Tag-renaming refactors
96-
// must update this list.
89+
// Symmetric tag typos round-trip cleanly but produce a TOML seid rejects;
90+
// pin the literal upstream key tokens.
9791
dir := t.TempDir()
9892
if err := WriteConfigToDir(DefaultForMode(ModeArchive), dir); err != nil {
9993
t.Fatalf("WriteConfigToDir: %v", err)
@@ -120,15 +114,13 @@ func TestWriteArchive_ReceiptStoreTOMLKeys(t *testing.T) {
120114
t.Errorf("app.toml missing receipt-store key %q", k)
121115
}
122116
}
123-
// Reject the misnamed-backend variant — sei-chain hard-errors on it.
117+
// flagRSMisnamedBackend hard-errors on the unprefixed key at startup.
124118
if strings.Contains(out, "\nbackend = ") {
125119
t.Errorf("app.toml emits unprefixed `backend = ` which sei-chain rejects")
126120
}
127121
}
128122

129123
func TestDefaultForMode_ReceiptStoreDefaults(t *testing.T) {
130-
// Non-archive modes match sei-chain's documented defaults so the emitted
131-
// TOML matches operator expectations on both pre- and post-#3237 binaries.
132124
rs := DefaultForMode(ModeFull).Storage.ReceiptStore
133125

134126
if rs.Backend != BackendPebbleDB {

defaults.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,8 @@ func applyArchiveOverrides(cfg *SeiConfig) {
308308

309309
cfg.Storage.PruningStrategy = PruningNothing
310310
cfg.Storage.StateStore.KeepRecent = 0
311-
// All three knobs that govern receipt retention are pinned to "no
312-
// pruning" intent. On post-#3237 sei-chain only MinRetainBlocks=0 is
313-
// load-bearing (KeepRecent is mapstructure:"-" and PruneIntervalSeconds=0
314-
// is silently floored on the pebbledb backend); on pre-#3237 binaries
315-
// the receipt-store keys are what take effect. Setting all three keeps
316-
// the emitted TOML self-documenting and version-agnostic.
311+
// Only MinRetainBlocks disables receipt pruning at runtime; the next two
312+
// are emitted to document intent (see ReceiptStoreConfig).
317313
cfg.Chain.MinRetainBlocks = 0
318314
cfg.Storage.ReceiptStore.KeepRecent = 0
319315
cfg.Storage.ReceiptStore.PruneIntervalSeconds = 0

legacy.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ type legacyStateStore struct {
282282
EVMDBDirectory string `toml:"ss-evm-db-directory"`
283283
}
284284

285-
// legacyReceiptStore mirrors the keys sei-chain reads from app.toml.
286-
// Note: rs-backend is asymmetric — only Backend carries the rs- prefix
287-
// upstream. The other keys do not.
285+
// rs-backend is asymmetric upstream — only Backend carries the rs- prefix.
286+
// flagRSMisnamedBackend rejects the unprefixed `backend` key at startup.
288287
type legacyReceiptStore struct {
289288
Backend string `toml:"rs-backend"`
290289
DBDirectory string `toml:"db-directory"`

0 commit comments

Comments
 (0)