Skip to content

config(state-sync): hide tendermint tuning knobs from template#3352

Merged
blindchaser merged 4 commits into
mainfrom
yiren/simplify-state-sync-config
May 8, 2026
Merged

config(state-sync): hide tendermint tuning knobs from template#3352
blindchaser merged 4 commits into
mainfrom
yiren/simplify-state-sync-config

Conversation

@blindchaser

Copy link
Copy Markdown
Contributor

Summary

Trim the rendered [statesync] section in sei-tendermint/config/toml.go so newly generated config.toml files show only the operator-facing state sync settings. Hidden settings are still parsed from existing config files, so upgraded nodes keep their current behavior.

  • Hidden from newly generated config.toml: backfill-blocks, backfill-duration, discovery-time, temp-dir, chunk-request-timeout, fetchers, verify-light-block-timeout, and blacklist-ttl.

  • Kept in newly generated config.toml: enable, use-p2p, rpc-servers, trust-height, trust-hash, trust-period, and use-local-snapshot.

  • Kept in generated app.toml: snapshot-interval, snapshot-keep-recent, and snapshot-directory. snapshot-keep-recent remains visible because operators commonly tune it for snapshot retention and disk usage.

  • sei-tendermint/config/toml.go: removes the eight tuning keys above from the rendered template and replaces their old per-key comments with one grouped comment that still names every hidden key.

  • sei-tendermint/config/toml_test.go: verifies the rendered template no longer contains assignments for the hidden keys.

  • sei-tendermint/config/statesync_compat_test.go: verifies hidden keys still parse when present in an existing config.toml, and verifies a fresh config without those keys uses DefaultStateSyncConfig() values and passes ValidateBasic().

Test plan

  • sei-tendermint/config/toml_test.go: checkConfig rejects rendered assignments for backfill-blocks, backfill-duration, discovery-time, temp-dir, chunk-request-timeout, fetchers, verify-light-block-timeout, and blacklist-ttl. configContainsKey avoids prefix false positives such as fetchers matching a longer key.
  • sei-tendermint/config/statesync_compat_test.go: TestHiddenStateSyncKnobsStillParseFromExistingConfig writes all hidden keys into a config file and asserts commands.ParseConfig populates the corresponding StateSyncConfig fields.
  • sei-tendermint/config/statesync_compat_test.go: TestFreshStateSyncConfigValidatesWithoutHiddenKnobs writes a fresh-style config without hidden keys, asserts omitted fields come from DefaultStateSyncConfig(), and asserts cfg.StateSync.ValidateBasic() succeeds.
  • Validation run locally: go test ./config/... -run 'TestConfig|TestHiddenStateSync|TestFreshStateSync' -count=1 -timeout 180s from sei-tendermint.

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 8, 2026, 8:52 AM

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.15%. Comparing base (c7e729a) to head (1cf5f35).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3352      +/-   ##
==========================================
- Coverage   59.17%   59.15%   -0.03%     
==========================================
  Files        2108     2097      -11     
  Lines      173660   172028    -1632     
==========================================
- Hits       102770   101755    -1015     
+ Misses      62008    61425     -583     
+ Partials     8882     8848      -34     
Flag Coverage Δ
sei-chain-pr 70.96% <ø> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-tendermint/config/toml.go 55.00% <ø> (ø)

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

@masih masih left a comment

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.

Thank @blindchaser and sorry it took me so long to review this one.

Left a question that we might need to address before cutting the next release; not a blocker and totally fine to approach in a separate PR if needed 🍻

# - chunk-request-timeout, fetchers: chunk transfer behavior
# - verify-light-block-timeout, blacklist-ttl: light client verification
# They are still parsed if set explicitly here; see the Sei docs for the full list
# and recommended values.

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.

This is good but how the code on the latest version behave when these configs are still present?
This is likely the case for most nodes, where they upgrade the binary but rarely change the config.

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.

Backward compatible: only the rendered template hides these keys. The StateSyncConfig struct fields and their mapstructure tags (backfill-blocks, backfill-duration, discovery-time, temp-dir, chunk-request-timeout, fetchers, verify-light-block-timeout, blacklist-ttl) are unchanged, so existing config.toml files continue to parse and honor those values exactly as before.

Covered by TestHiddenStateSyncKnobsStillParseFromExistingConfig in sei-tendermint/config/statesync_compat_test.go (existing config path) and TestFreshStateSyncConfigValidatesWithoutHiddenKnobs (fresh config falls back to DefaultStateSyncConfig() defaults).

@blindchaser blindchaser added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit d006cd1 May 8, 2026
38 checks passed
@blindchaser blindchaser deleted the yiren/simplify-state-sync-config branch May 8, 2026 14:41
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