Skip to content

Add opts for scdual write#3002

Open
yzang2019 wants to merge 3 commits intomainfrom
yzang/add-sc-config
Open

Add opts for scdual write#3002
yzang2019 wants to merge 3 commits intomainfrom
yzang/add-sc-config

Conversation

@yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented Mar 2, 2026

Describe your changes and provide context

Add flags/opts to allow setting dual write and dual read for SC, remove migration flag as well

Testing performed to validate your change

Tested on RPC node

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 2, 2026, 10:11 PM

app/seidb.go Outdated
scConfig.MemIAVLConfig.SnapshotWriterLimit = cast.ToInt(appOpts.Get(FlagSCSnapshotWriterLimit))
scConfig.MemIAVLConfig.SnapshotPrefetchThreshold = cast.ToFloat64(appOpts.Get(FlagSCSnapshotPrefetchThreshold))
scConfig.MemIAVLConfig.SnapshotWriteRateMBps = cast.ToInt(appOpts.Get(FlagSCSnapshotWriteRateMBps))
scConfig.WriteMode = config.WriteMode(cast.ToString(appOpts.Get(FlagSCWriteMode)))
Copy link
Contributor

Choose a reason for hiding this comment

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

considering learning from ss config parsing string: only overwrite if non-empty, validate, and panic on invalid values


if wm := cast.ToString(appOpts.Get(FlagEVMSSWriteMode)); wm != "" {
		parsedWM, err := config.ParseWriteMode(wm)
		if err != nil {
			panic(fmt.Sprintf("invalid EVM SS write mode %q: %s", wm, err))
		}
		ssConfig.WriteMode = parsedWM
	}
	if rm := cast.ToString(appOpts.Get(FlagEVMSSReadMode)); rm != "" {
		parsedRM, err := config.ParseReadMode(rm)
		if err != nil {
			panic(fmt.Sprintf("invalid EVM SS read mode %q: %s", rm, err))
		}
		ssConfig.ReadMode = parsedRM
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point


// Other configs
FlagSnapshotInterval = "state-sync.snapshot-interval"
FlagMigrateIAVL = "migrate-iavl"
Copy link
Contributor

Choose a reason for hiding this comment

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

in cmd/seid/cmd/root.go -> addModuleInitFlags(), --migrate-iavl and --migrate-height CLI flags orphaned

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, removing

FlagSCEnable = "state-commit.sc-enable"
FlagSCDirectory = "state-commit.sc-directory"
FlagSCAsyncCommitBuffer = "state-commit.sc-async-commit-buffer"
FlagSCZeroCopy = "state-commit.sc-zero-copy"
Copy link
Contributor

Choose a reason for hiding this comment

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

docker config files (docker/localnode/config/app.toml, docker/rpcnode/config/app.toml) still reference sc-zero-copy and sc-cache-size. these are likely pre-existing and out of scope for this PR, but worth noting for cleanup

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 13.33333% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.30%. Comparing base (555d520) to head (2749706).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/seidb.go 15.38% 9 Missing and 2 partials ⚠️
sei-cosmos/storev2/rootmulti/store.go 0.00% 0 Missing and 1 partial ⚠️
tools/migration/sc/migrator.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3002      +/-   ##
==========================================
- Coverage   58.30%   58.30%   -0.01%     
==========================================
  Files        2108     2108              
  Lines      173672   173675       +3     
==========================================
- Hits       101262   101261       -1     
- Misses      63390    63393       +3     
- Partials     9020     9021       +1     
Flag Coverage Δ
sei-chain-pr 37.33% <13.33%> (?)
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 0.00% <ø> (ø)
sei-cosmos/storev2/rootmulti/store.go 46.47% <0.00%> (ø)
tools/migration/sc/migrator.go 0.00% <0.00%> (ø)
app/seidb.go 63.41% <15.38%> (-5.42%) ⬇️
🚀 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.

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