Skip to content

Conversation

@yzang2019
Copy link
Contributor

Describe your changes and provide context

This PR unifies and consolidate the configuration and interface for committer (CommitStore) by:

  • Introduce MemIAVLConfig and put that under memIAVL package
  • Introduce FlatKVConfig and put that under flatkv package
  • Consolidate them into one StateCommitConfig and would be used by composite store
  • Added a new CompositeCommitStore which handles both cosmos and evm backends based on read and write mode
  • Moved original cosmos CommitStore to memIAVL package (Still using this one for root multistore)
  • Added bunch of todos

Testing performed to validate your change

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 3, 2026, 9:56 AM

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 74.48560% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.69%. Comparing base (9a88201) to head (b30c232).

Files with missing lines Patch % Lines
sei-db/state_db/sc/composite/store.go 56.84% 30 Missing and 11 partials ⚠️
sei-db/state_db/bench/helper.go 0.00% 5 Missing ⚠️
sei-cosmos/storev2/rootmulti/store.go 50.00% 3 Missing and 1 partial ⚠️
sei-db/state_db/sc/memiavl/export.go 0.00% 4 Missing ⚠️
sei-db/state_db/sc/memiavl/snapshot.go 0.00% 3 Missing and 1 partial ⚠️
sei-db/state_db/sc/memiavl/opts.go 81.81% 1 Missing and 1 partial ⚠️
sei-db/state_db/sc/memiavl/store.go 89.47% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2786      +/-   ##
==========================================
- Coverage   56.70%   56.69%   -0.02%     
==========================================
  Files        2016     2023       +7     
  Lines      165448   165575     +127     
==========================================
+ Hits        93813    93865      +52     
- Misses      63420    63487      +67     
- Partials     8215     8223       +8     
Flag Coverage Δ
sei-chain 41.67% <66.25%> (+0.01%) ⬆️
sei-cosmos 48.12% <85.71%> (+<0.01%) ⬆️
sei-db 68.72% <ø> (ø)
sei-tendermint 58.25% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/seidb.go 80.35% <100.00%> (-0.68%) ⬇️
sei-cosmos/server/config/config.go 94.65% <100.00%> (+0.08%) ⬆️
sei-cosmos/storev2/commitment/store.go 50.00% <100.00%> (ø)
sei-db/common/evm/keys.go 80.95% <ø> (+4.95%) ⬆️
sei-db/config/read_mode.go 100.00% <100.00%> (ø)
sei-db/config/receipt_config.go 100.00% <100.00%> (ø)
sei-db/config/sc_config.go 100.00% <100.00%> (ø)
sei-db/config/ss_config.go 100.00% <100.00%> (ø)
sei-db/config/write_mode.go 100.00% <100.00%> (ø)
sei-db/state_db/sc/flatkv/config.go 100.00% <100.00%> (ø)
... and 11 more

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@blindchaser blindchaser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configs: StateCommitConfig no longer has AsyncCommitBuffer, SnapshotKeepRecent, etc. (they moved under MemIAVLConfig), but the template still renders .StateCommit.*. WriteConfigFile will panic at runtime when rendering.

need to update the toml.go, app/seidb.go / sei-cosmos/server/config/config.go etc


// SplitRead reads EVM data from EVM backend and non-EVM data from Cosmos.
// Use when migration is complete and backends are fully separated.
SplitRead ReadMode = "split_read"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about naming it SplitByKeyRead.

and do we still have split read use case if we choose migrating ALL EVM state over to Giga DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need split read, it means EVM goes from EVM and cosmos goes to cosmos

m := WriteMode(s)
if !m.IsValid() {
return "", fmt.Errorf("invalid write mode: %q, valid modes: %s, %s, %s, %s",
s, CosmosOnlyWrite, DualWrite, SplitWrite)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this s a good catch from ai

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, should be fixed

Config: config, // Embed the config directly
Dir: commitDBPath,
CreateIfMissing: true,
ZeroCopy: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirm that we want the ZeroCopy always to be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

return nil, fmt.Errorf("failed to load cosmos version: %w", err)
}

return cosmosSC, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return type of func LoadVersion is types.Committer, and we always return a cosmosCommitter here?

Copy link
Contributor Author

@yzang2019 yzang2019 Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, here we should return a composite store

* main:
  Composite State Store part 1: EVM config and type definitions (#2754)
  Add scenario capability to benchmark script (#2779)
  emit rewards withdrawn events for redelegate/undelegate (#2781)
  add original cachekv as base layer (#2780)
  Add Ethereum state test runner for Giga executor validation (#2707)
  Add changelog for 6.2 and 6.3 (#2751)
  Fix typo in backport CI workflow name (#2784)
  Upgrade to latest UCI workflows (#2783)
  Configure self-hosted runners for Go tests (#2715)
@yzang2019
Copy link
Contributor Author

yzang2019 commented Feb 2, 2026

Configs: StateCommitConfig no longer has AsyncCommitBuffer, SnapshotKeepRecent, etc. (they moved under MemIAVLConfig), but the template still renders .StateCommit.*. WriteConfigFile will panic at runtime when rendering.

need to update the toml.go, app/seidb.go / sei-cosmos/server/config/config.go etc

That's a good catch! Will fix the toml config name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants