Skip to content

Deprecate IAVL and fix all dependency and test#3146

Merged
masih merged 19 commits into
mainfrom
yzang/deprecate-iavl
Apr 2, 2026
Merged

Deprecate IAVL and fix all dependency and test#3146
masih merged 19 commits into
mainfrom
yzang/deprecate-iavl

Conversation

@yzang2019

@yzang2019 yzang2019 commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Describe your changes and provide context

This PR fully removes the sei-iavl dependency from sei-chain, completing the migration to sei-db (memiavl) as the sole state commitment backend. After this change, nodes no longer open or depend on application.db, and all state commitment is handled exclusively through storev2/rootmulti backed by memiavl.

  • Remove sei-iavl as a dependency and make sei-db (memiavl) the sole state commitment backend.
  • Remove all sei-iavl imports; migrate ChangeSet/KVPair types to sei-db protobuf equivalents
  • Remove application.db dependency from app startup
  • Panic if scEnabled is false — memiavl state commit is now mandatory
  • Remove deprecated configs from app.toml: IAVL orphan storage settings, NoVersioning
  • Map StoreTypeIAVL to StoreTypeDB in legacy rootmulti for backward compatibility
  • Migrate baseapp snapshot tests to use storev2/rootmulti instead of IAVL
  • Wire sei-ibc-go SimApp with storev2/rootmulti so IBC integration tests (including proof verification) work without IAVL
  • Fix latent memiavl bug: ApplyChangeSets overwrote pending changesets instead of merging, causing WAL data loss when called multiple times between commits

Note: This PR has an intentionally breaking Proto change, since it removes the sei-iavl protos from root.

@github-actions

github-actions Bot commented Mar 31, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed❌ failed (0)Apr 2, 2026, 8:41 AM

@codecov

codecov Bot commented Mar 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.87500% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.86%. Comparing base (d3f22bd) to head (a4a2147).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/db_engine/test/storage_bench_suite.go 0.00% 9 Missing ⚠️
sei-cosmos/store/rootmulti/dbadapter.go 46.66% 7 Missing and 1 partial ⚠️
sei-db/tools/cmd/seidb/benchmark/generate.go 0.00% 5 Missing ⚠️
sei-db/tools/bench/benchmark.go 0.00% 3 Missing ⚠️
app/test_helpers.go 77.77% 1 Missing and 1 partial ⚠️
sei-cosmos/baseapp/baseapp.go 33.33% 1 Missing and 1 partial ⚠️
sei-cosmos/server/export.go 0.00% 2 Missing ⚠️
sei-cosmos/store/rootmulti/store.go 81.81% 2 Missing ⚠️
app/seidb.go 50.00% 1 Missing ⚠️
cmd/seid/cmd/blocktest.go 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3146      +/-   ##
==========================================
+ Coverage   58.56%   58.86%   +0.30%     
==========================================
  Files        2099     2096       -3     
  Lines      173961   173528     -433     
==========================================
+ Hits       101881   102155     +274     
+ Misses      62899    62236     -663     
+ Partials     9181     9137      -44     
Flag Coverage Δ
sei-chain-pr 65.26% <76.87%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
cmd/seid/cmd/root.go 25.00% <ø> (+0.27%) ⬆️
evmrpc/tests/utils.go 70.83% <ø> (ø)
sei-cosmos/baseapp/options.go 61.03% <ø> (+1.54%) ⬆️
sei-cosmos/server/config/config.go 94.31% <100.00%> (-0.37%) ⬇️
sei-cosmos/server/config/toml.go 57.14% <ø> (ø)
sei-cosmos/server/mock/store.go 17.43% <ø> (+0.61%) ⬆️
sei-cosmos/server/pruning.go 75.00% <100.00%> (-10.72%) ⬇️
sei-cosmos/server/rollback.go 71.25% <100.00%> (+0.66%) ⬆️
sei-cosmos/server/util.go 66.23% <ø> (-0.02%) ⬇️
sei-cosmos/store/types/store.go 73.68% <ø> (ø)
... and 29 more

... and 67 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.

Comment thread .github/workflows/buf-check.yml Outdated
with:
version: 1.58.0 No newline at end of file
version: 1.58.0
breaking: false No newline at end of file

@masih masih Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We do not want this skipped on main though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On main, buf.yaml has 9 modules (includes sei-iavl/proto). On this branch, we removed sei-iavl/proto, leaving 8 modules. buf breaking compares the PR branch against main and requires the same number of modules — it fails with "input contained 8 images, whereas against contained 9 images."

I think this is a one-time problem that only exists while main still has sei-iavl/proto. Once this PR merges into main, both sides will have 8 modules and buf breaking will work again and we can revert back this change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What exact breaking failure do we get?

I think there might be a less aggressive way to skip that specific error for specific protos, compared to disabling it for everything.

Worst comes to worst, we can always force-merge this PR knowing that the breaking changes in buf are expected.

The edge-case I worry about is one where a breaking proto change would find its way to main between this PR landing, and the setting getting reverted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We would get this failure:
input contained 8 images, whereas against contained 9 images

@yzang2019 yzang2019 Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm fine to force merge it as well, reverted the change

* main:
  fix(flatkv): harden error handling for readonly store and crash cleanup (#3127)
  Remove redundant makefiles, unused code and adjust docs (#3149)
  Fix minor logging issues (#3147)
  PLT-225 Use in place orbytes for bloom filter (#3144)
  Eliminate per-iteration allocation in SetEvmOnlyBlockBloom (#3133)
@yzang2019 yzang2019 requested review from Kbhat1, masih and sei-will March 31, 2026 18:48
exit 0
fi
echo "packages=./..." >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yay; glad to see this go 🍻

Comment thread app/seidb.go Outdated
Comment thread sei-cosmos/baseapp/baseapp_test.go Outdated

// app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: -5000000}})
// require.Panics(t, func() { app.getMaximumBlockGas(ctx) })
// }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you know by any chance why these were commented out? Can we just remove these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really sure, but I will look into it and see if we can remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The test calls app.InitChain followed by app.StoreConsensusParams, which is a pattern that was broken when Sei forked and restructured the ABCI interface (e.g., merging BeginBlock/DeliverTx/EndBlock into FinalizeBlock, and detaching the Tendermint header from the Cosmos header). The InitChain + StoreConsensusParams flow likely doesn't work the same way as before any more.

So it's mostly dead code that never worked in the Sei fork and safe to delete.

Comment thread sei-cosmos/x/genutil/config/priv_validator_key.json Outdated
Comment thread sei-cosmos/x/genutil/data/priv_validator_state.json Outdated
yzang2019 and others added 4 commits April 1, 2026 09:55
* main:
  Make cryptosim state store backend configurable + No Op Wrapper + Read Disable Config (#3145)
  Add warning message for IAVL deprecation (#3159)
  Change default min valid per window to zero (#3157)
  support for starting autobahn from non-zero global block (#3136)
  Fix upgrade list comparison to respect semver (#3153)
@masih

masih commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Added a note to PR description regarding the intentional breaking proto changes.

Will be force merging this as a one off.

Cc @yzang2019 and thanks for driving this work; super glad to see sei-iavl go 🙌

@masih masih merged commit a9ffa16 into main Apr 2, 2026
39 of 40 checks passed
@masih masih deleted the yzang/deprecate-iavl branch April 2, 2026 08:53
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.

3 participants