Skip to content

Update SS write/read modes into single evm-ss-mode#3278

Merged
Kbhat1 merged 8 commits intomainfrom
kartik/giga-ss-simplify-modes
Apr 22, 2026
Merged

Update SS write/read modes into single evm-ss-mode#3278
Kbhat1 merged 8 commits intomainfrom
kartik/giga-ss-simplify-modes

Conversation

@Kbhat1
Copy link
Copy Markdown
Contributor

@Kbhat1 Kbhat1 commented Apr 20, 2026

Describe your changes and provide context

  • Simplify config evm-ss-write-mode + evm-ss-read-mode -> evm-ss-evm-ss-split
  • No fallback to cosmos

Testing performed to validate your change

  • Unit tests
  • Verifying on node

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>
@Kbhat1 Kbhat1 marked this pull request as ready for review April 20, 2026 21:17
Kbhat1 and others added 2 commits April 21, 2026 07:38
- 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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 22, 2026, 12:11 AM

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
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.30%. Comparing base (0ad5733) to head (7b3e982).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/seidb.go 50.00% 0 Missing and 1 partial ⚠️
sei-db/state_db/ss/composite/store.go 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
sei-chain-pr 54.45% <90.47%> (?)
sei-db 69.36% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-cosmos/server/config/config.go 93.04% <100.00%> (-0.04%) ⬇️
sei-db/config/ss_config.go 100.00% <100.00%> (ø)
app/seidb.go 73.25% <50.00%> (+2.12%) ⬆️
sei-db/state_db/ss/composite/store.go 66.75% <94.11%> (+0.56%) ⬆️

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

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>
…ead-mode keys

Co-authored-by: Kartik Bhat <Kbhat1@users.noreply.github.com>
@Kbhat1 Kbhat1 enabled auto-merge April 22, 2026 00:19
@Kbhat1 Kbhat1 added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit d98c078 Apr 22, 2026
39 checks passed
@Kbhat1 Kbhat1 deleted the kartik/giga-ss-simplify-modes branch April 22, 2026 00:37
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