config(state-sync): hide tendermint tuning knobs from template#3352
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
masih
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
Summary
Trim the rendered
[statesync]section insei-tendermint/config/toml.goso newly generatedconfig.tomlfiles 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, andblacklist-ttl.Kept in newly generated
config.toml:enable,use-p2p,rpc-servers,trust-height,trust-hash,trust-period, anduse-local-snapshot.Kept in generated
app.toml:snapshot-interval,snapshot-keep-recent, andsnapshot-directory.snapshot-keep-recentremains 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 existingconfig.toml, and verifies a fresh config without those keys usesDefaultStateSyncConfig()values and passesValidateBasic().Test plan
sei-tendermint/config/toml_test.go:checkConfigrejects rendered assignments forbackfill-blocks,backfill-duration,discovery-time,temp-dir,chunk-request-timeout,fetchers,verify-light-block-timeout, andblacklist-ttl.configContainsKeyavoids prefix false positives such asfetchersmatching a longer key.sei-tendermint/config/statesync_compat_test.go:TestHiddenStateSyncKnobsStillParseFromExistingConfigwrites all hidden keys into a config file and assertscommands.ParseConfigpopulates the correspondingStateSyncConfigfields.sei-tendermint/config/statesync_compat_test.go:TestFreshStateSyncConfigValidatesWithoutHiddenKnobswrites a fresh-style config without hidden keys, asserts omitted fields come fromDefaultStateSyncConfig(), and assertscfg.StateSync.ValidateBasic()succeeds.go test ./config/... -run 'TestConfig|TestHiddenStateSync|TestFreshStateSync' -count=1 -timeout 180sfromsei-tendermint.