Add receiptdb config option in app.toml#3035
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3035 +/- ##
==========================================
+ Coverage 58.31% 58.35% +0.03%
==========================================
Files 2079 2080 +1
Lines 171804 171898 +94
==========================================
+ Hits 100193 100315 +122
+ Misses 62681 62649 -32
- Partials 8930 8934 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
app/seidb.go
Outdated
| func parseReceiptConfigs(appOpts servertypes.AppOptions) config.ReceiptStoreConfig { | ||
| receiptConfig := config.DefaultReceiptStoreConfig() | ||
| if backend := cast.ToString(appOpts.Get(FlagRSBackend)); backend != "" { | ||
| receiptConfig.Backend = backend |
There was a problem hiding this comment.
parseReceiptConfigs() only reads FlagRSBackend. The remaining fields (AsyncWriteBuffer, KeepRecent, PruneIntervalSeconds, UseDefaultComparer) come from DefaultReceiptStoreConfig(). The TOML template also only renders rs-backend.
is this expected?
|
suggestion for testings:
|
| customAppTemplate := serverconfig.ManualConfigTemplate + | ||
| seidbconfig.StateCommitConfigTemplate + | ||
| seidbconfig.StateStoreConfigTemplate + | ||
| seidbconfig.ReceiptStoreConfigTemplate + |
There was a problem hiding this comment.
ReceiptStoreConfigTemplate only has one config for rs-backend, what about other configs? Do we want to allow people to configure them as well?
This commit introduces additional configuration options for the receipt store, including `db-directory`, `async-write-buffer`, `keep-recent`, and `prune-interval-seconds`. The changes include updates to the TOML configuration template, the receipt store configuration struct, and the associated reading logic. Unit tests have been added to ensure that these new configuration options are correctly parsed and utilized, as well as to verify that the receipt store behaves as expected with the new settings. This enhances the flexibility and usability of the receipt store configuration.
| receiptConfig := ssconfig.DefaultReceiptStoreConfig() | ||
| receiptConfig.DBDirectory = receiptStorePath | ||
| receiptConfig.KeepRecent = cast.ToInt(appOpts.Get(server.FlagMinRetainBlocks)) | ||
| receiptConfig, err := readReceiptStoreConfig(homePath, appOpts) |
There was a problem hiding this comment.
on main, the receipt store inherited its pruning window from min-retain-blocks. This branch removes that fallback and defaults receipts to DefaultReceiptStoreConfig().KeepRecent instead. BaseApp still uses min-retain-blocks, so after upgrade the node can retain far more receipt data than before unless receipt-store.keep-recent is manually set. The updated test also locks in this new behavior.
is this expected?
There was a problem hiding this comment.
I think the default matches up with DefaultSSKeepRecent (100k) so I don't think it's a big deal if not set.
This commit was inadvertently reverted by the squash-merge of #3039. Restores ReceiptStoreConfig in app.toml, readReceiptStoreConfig(), BackendTypeName(), receipt config tests, and init_test.go. Conflicts resolved: - app_config.go: kept both ReceiptStore (from #3035) and Admin (from #3062) - receipt_store.go: kept BackendTypeName but used #3050's slog convention - parquet_store_test.go: kept #3053's deterministic pruning test fix Made-with: Cursor
The cherry-picked tests from #3035 and #3043 still referenced the old logger package (removed by #3050 slog migration). Fix: - composite/store_test.go: remove logger import/arg, add CommittedRootHash to mock - parquet/store_config_test.go: remove dbLogger arg from NewStore - receipt/parquet_store_test.go: remove dbLogger arg from NewReceiptStore Made-with: Cursor
## Summary The squash-merge of #3039 (`feat(flatkv): add read-only LoadVersion for state sync`) inadvertently reverted changes from 5 previously-merged PRs. The `yiren/flatkv-readonly` branch had accumulated stale versions of files through merge-from-main commits, and when the final squash-merge landed, those stale versions overwrote the newer code on `main`. ### PRs reverted by #3039 and restored in this PR | PR | Title | Key changes lost | |---|---|---| | **#2810** | fix(giga): check whether txs follow Giga ordering | `firstCosmosSeen` tx ordering check, `len(evmEntries) > 0` / `len(v2Entries) > 0` guards in `ProcessTXsWithOCCGiga` | | **#3035** | Add receiptdb config option in app.toml | `ReceiptStoreConfig` in app.toml, `readReceiptStoreConfig()`, `BackendTypeName()`, receipt config tests | | **#3043** | Add config to enable lattice hash | `EnableLatticeHash` config, composite store lattice hash support | | **#3021** | Background Transaction Generation | `block.go`, `block_builder.go` for cryptosim benchmark | | **#3046** | Add console logger and fix memiavl config for benchmark | `BlocksPerCommit=1`, `SnapshotInterval=1000`, `SnapshotMinTimeInterval=60` | ### Conflict resolutions Since several PRs landed after #3039 (notably #3050 slog migration, #3053 flaky test fix, #3062 admin service), cherry-picks required manual conflict resolution: - **`app/app.go`** (#2810): Kept #2810's structural changes, used `logger.Error` (from #3050) instead of `ctx.Logger().Error` - **`cmd/seid/cmd/app_config.go`** (#3035): Kept both `ReceiptStore` (from #3035) and `Admin` (from #3062) - **`sei-db/ledger_db/receipt/receipt_store.go`** (#3035): Restored `BackendTypeName` but dropped logger param (superseded by #3050 slog) - **`sei-db/ledger_db/receipt/parquet_store_test.go`** (#3035): Kept #3053's deterministic pruning test fix - **`sei-db/state_db/sc/composite/store_test.go`** (#3043): Merged all three needed imports - **`sei-db/common/logger/logger.go`** (#3046): Kept deletion from #3050; `consoleLogger` is no longer needed with slog - **`sei-db/state_db/bench/wrappers/db_implementations.go`** (#3046): Kept #3050's no-logger-param API --------- Signed-off-by: Cody Littley <cody.littley@seinetwork.io> Co-authored-by: Cody Littley <56973212+cody-littley@users.noreply.github.com> Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
--------- Co-authored-by: Kartik Bhat <kartikbhatri@gmail.com>
Describe your changes and provide context
Testing performed to validate your change