Update SS write/read modes into single evm-ss-mode#3278
Merged
Conversation
Replaces the two-field StateStoreConfig.WriteMode / ReadMode with a single EVMMode enum that takes only "cosmos_only" or "split". The previous matrix (cosmos_only / dual_write / split_write crossed with cosmos_only / evm_first / split_read) produced configurations whose behavior was hard to reason about — in particular, evm_first's fallback-to-cosmos semantics masked inconsistencies between the two backends and hid the iterator routing bug that broke pointer lookups on Giga-enabled nodes. Under "split" there is no fallback: a read or iterate that would miss returns empty rather than silently routing to a different backend. Scope is the SS (State Store) layer only. The SC layer still uses the older WriteMode / ReadMode enums; those were left untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- mapstructure tag on EVMMode is now "evm-ss-mode", matching the TOML key used in app.toml and the viper binding. - Renamed tests that still mentioned the removed modes (SplitWrite, SplitRead, CosmosOnlyWrite) so the names describe behavior under the new single EVMMode field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The tag is dead code for StateStoreConfig — Unmarshal is only used in ParseConfig (app.toml template generation), which doesn't read from viper at all. The live runtime path uses viper.GetString directly and bypasses mapstructure. Other fields in the same struct share the same "tag doesn't match TOML key" pattern, so touching only this one made the struct more inconsistent. A uniform cleanup of the tags can happen separately if desired. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…fy-modes # Conflicts: # sei-db/state_db/ss/composite/store.go
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
sei-cosmos/server/config/config_test.go was still referencing the removed StateStore.WriteMode / ReadMode fields and the old WriteMode/ReadMode constants (SplitWrite, SplitRead, CosmosOnlyWrite, CosmosOnlyRead). Updated the StateStore blocks to use the single EVMMode field and EVMModeSplit / EVMModeCosmosOnly constants. SC blocks (which still use WriteMode/ReadMode) are untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3278 +/- ##
==========================================
+ Coverage 58.53% 59.30% +0.77%
==========================================
Files 2072 2072
Lines 207948 170881 -37067
==========================================
- Hits 121712 101348 -20364
+ Misses 77452 60754 -16698
+ Partials 8784 8779 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Replaces the short-lived EVMMode string enum (cosmos_only / split)
with a plain bool EVMSplit. The enum only ever had two values so the
string type carried no real information beyond "on or off"; a bool
reads more naturally, eliminates parse/validate code, and drops any
chance of a typo in app.toml silently falling back to a default.
Key -> flow:
TOML state-store.evm-ss-split = {true|false} (default false)
viper v.GetBool("state-store.evm-ss-split")
flag FlagEVMSSSplit -> cast.ToBool
struct StateStoreConfig.EVMSplit bool
runtime evmStore opened iff EVMSplit; routing keys off evmStore != nil
Deletes sei-db/config/evm_mode.go entirely. Collapses the composite
"evmRouted" helper to a nil check — if evmStore was opened, EVMSplit
was true at startup and it's the sole home for EVM data. Import and
recovery paths likewise drop the mode comparison.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jewei1997
approved these changes
Apr 21, 2026
yzang2019
approved these changes
Apr 21, 2026
…ead-mode keys Co-authored-by: Kartik Bhat <Kbhat1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes and provide context
Testing performed to validate your change