Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3043 +/- ##
==========================================
- Coverage 58.38% 58.32% -0.06%
==========================================
Files 2080 2080
Lines 171898 171831 -67
==========================================
- Hits 100364 100223 -141
- Misses 62596 62675 +79
+ Partials 8938 8933 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| StoreInfos: combined, | ||
| } | ||
| } | ||
| return commitInfo |
There was a problem hiding this comment.
duplicate "evm" StoreInfo: in DualWrite mode, all changesets (including EVM) are sent to the cosmos committer. This means cosmosCommitter.WorkingCommitInfo() already contains an "evm" StoreInfo with the IAVL hash. The code then appends a second "evm" StoreInfo with the lattice hash
There was a problem hiding this comment.
Yes, that's what we want. MemIAVL still have data for EVM, and we also have EVM for flatKV during the migration. So both EVM data need to participate in hash
There was a problem hiding this comment.
Oh actually we can't have two module hash with the same name, going to fix this
| scConfig.ReadMode = parsedRM | ||
| } | ||
|
|
||
| scConfig.EnableLatticeHash = cast.ToBool(appOpts.Get(FlagSCEnableLatticeHash)) |
There was a problem hiding this comment.
Setting EnableLatticeHash = true with WriteMode = CosmosOnlyWrite is a silent no-op because evmCommitter is nil. The Validate() method can catch this
There was a problem hiding this comment.
True, but I think this is probably fine, we don't have to panic here. EnableLatticeHash only take effects when FlatKV is being used, which is expected.
| } | ||
|
|
||
| // LastCommitInfo returns the last commit info | ||
| func (cs *CompositeCommitStore) LastCommitInfo() *proto.CommitInfo { |
There was a problem hiding this comment.
some code duplication between WorkingCommitInfo and LastCommitInfo, consider extract a helper?
There was a problem hiding this comment.
Will look into that, good suggestion!
| ReadMode ReadMode `mapstructure:"read_mode"` | ||
|
|
||
| // EnableLatticeHash controls whether lattice hash will be participating in final app hash or not | ||
| EnableLatticeHash bool `mapstructure:"enable-lattice-hash"` |
There was a problem hiding this comment.
Data format:
EnableLatticeHash bool mapstructure:"enable-lattice-hash"
other fields:
WriteMode WriteMode mapstructure:"write_mode"
There was a problem hiding this comment.
Good catch, will fix
| } | ||
| }) | ||
|
|
||
| t.Run("enabled appends flatkv lattice hash", func(t *testing.T) { |
There was a problem hiding this comment.
Consider adding a multi-commit test to ensure the lattice hash accumulates correctly and doesn't reset or diverge across versions. Also consider testing the interaction with SplitWrite mode?
There was a problem hiding this comment.
"Consider adding a multi-commit test to ensure the lattice hash accumulates correctly and doesn't reset or diverge across versions"
Isn't that already covered by the store_test in flatkv?
Also consider testing the interaction with SplitWrite mode
Yes, I can add that as well
This commit was inadvertently reverted by the squash-merge of #3039. Restores LatticeHashEnabled config option in StateCommitConfig, composite store lattice hash support, and related tests. Conflict resolved: store_test.go needed all three imports (metrics from HEAD, evm+logger from #3043). 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>
This PR add a new config to enable lattice hash participation in app hash. Added unit test
Describe your changes and provide context
This PR add a new config to enable lattice hash participation in app hash.
Testing performed to validate your change
Added unit test