[ConfigManager] Register Node Sections 3/4 - #3994
Conversation
State sync, the transaction index, instrumentation, the signing key paths and self remediation. That is every table in the node's own configuration file. The transaction index varies by node kind: a node that serves queries indexes transactions so it can answer them, and a validator and a seed serve none, so they index nothing and keep the write. State sync leaves one path out. The servers to fetch a snapshot from are the operator's own peers, so there is no value to inherit, and an address written here would name a host this binary cannot know about. A test now walks the section names this package owns rather than a list kept beside them, so the next section is covered by registering it. Another asserts the registry refused nothing, which is the check no single section can make: two of the refusals depend on what else has registered, and a section that loses is dropped whole rather than reported by itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
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 @@
## plt-775-node-sections-2 #3994 +/- ##
========================================================
Coverage 57.59% 57.59%
========================================================
Files 2230 2230
Lines 186966 186980 +14
========================================================
+ Hits 107683 107696 +13
- Misses 69447 69448 +1
Partials 9836 9836
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The last of the five sections carrying the root directory field the node fills from the command line after the file is read. The signing key section is the one where a blank root is worst: a node that cannot find its key does not sign. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview
Tests now derive the section list from Reviewed by Cursor Bugbot for commit 579b53d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Declares the last five sei-tendermint sections in the config registry with per-mode defaults and adds tests that walk the package's own section set. The registrations are structurally sound (all fields tagged, no defect-producing shapes, tx-index.indexer mode split matches SetTendermintConfigByMode); two exclusion-policy choices are worth a second look before the registry gets wired to a reader.
Findings: 0 blocking | 2 non-blocking | 2 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- None at the file/PR level.
- 2 suggestion(s)/nit(s) flagged inline on specific lines.
| registry.RegisterSectionExcluding(MempoolSectionName, &tmcfg.MempoolConfig{}, mempoolDefaults, | ||
| filledFromTheCommandLine) | ||
| registry.RegisterSectionExcluding(StateSyncSectionName, &tmcfg.StateSyncConfig{}, stateSyncDefaults, | ||
| "rpc-servers") |
There was a problem hiding this comment.
[suggestion] The stated reason for excluding rpc-servers — "has no default and cannot have one" — doesn't hold up against the rest of this same section, and it's the first exclusion in this package that covers a key generated files actually carry.
- The default is the empty list, and
TestTheStateSyncExclusionIsThePathWithNoDefaultasserts exactly that (len(DefaultStateSyncConfig().RPCServers) != 0is the failure). An empty list resolves fine throughsectionValues/detachand is carryable by an env var ([]stringpassesoneVariableCanCarry), so nothing forces the exclusion. - The "operator's own peers, nothing to inherit" argument applies identically to
statesync.trust-height,trust-hashandtemp-dir, which this section declares with their zero values. The asymmetry isn't explained by either categoryRegisterSectionExcluding's doc names (a reader that refuses the key outright, or a field whose absence is the setting). - Concretely:
sei-tendermint/config/toml.go:527writesrpc-servers = "..."into every generatedconfig.toml, so once a reader is onResolve, a key present in every operator's file lands inResolved.Unknown— the channel whose purpose is "a typo in an operator's file is visible." The other two exclusions in this package (home,p2p.max-outbound-connections) are absent from the template, so they don't have this effect.
Declaring it with its empty-list default looks more consistent than excluding it. (Codex reached the opposite conclusion — exclude trust-height/trust-hash too — on the theory that registry defaults could overwrite runtime-computed values; that mechanism doesn't apply here, since Resolve puts defaults at the bottom of the precedence order and nothing installs a resolution yet. The asymmetry is the real point either way.)
| registry.RegisterSectionExcluding(StateSyncSectionName, &tmcfg.StateSyncConfig{}, stateSyncDefaults, | ||
| "rpc-servers") | ||
| registry.RegisterSection(TxIndexSectionName, &tmcfg.TxIndexConfig{}, txIndexDefaults) | ||
| registry.RegisterSection(InstrumentationSectionName, &tmcfg.InstrumentationConfig{}, |
There was a problem hiding this comment.
[suggestion] instrumentation.namespace is a key that changes nothing about how the node runs, and this section offers it.
InstrumentationConfig.Namespace (sei-tendermint/config/config.go:1442) is documented as "Deprecated: Instrumentation namespace is ignored. Tendermint Prometheus metrics always use the fixed "tendermint" namespace," and nothing reads it — the metrics constructors take MetricsNamespace instead. The generated template doesn't write it either.
That is the same class removedSettings exists for a few lines up, with the rationale spelled out there: "declaring any of them would offer a key that changes nothing about how the node runs." Consider RegisterSectionExcluding(InstrumentationSectionName, ..., "namespace"), with a note on the exclusion list. Note that the existing consensus pin (TestTheExcludedConsensusPathsAreTheRemovedOnes) keys off fields named Deprecated*, so it won't reach this one — a small assertion against DefaultInstrumentationConfig().Namespace still being the ignored fixed value would keep the exclusion honest if the node ever starts reading the field.
Declares the last five tables: state sync, the transaction index, instrumentation, the
signing key paths, and self remediation. 33 keys. Nothing consumes them.
After this every table in the file is declared; the keys at its top are the remaining step.
One key varies by node kind
tx-index.indexeris[kv]for a node that serves queries and[null]for a validator orseed, which serve none and keep the write. The other four sections answer the same for every
mode, and each says why in the source.
What is left out
statesync.rpc-serversnames the operator's own peers, so there is no value to inherit andan address written here would name a host this binary cannot know exists.
statesync.trust-heightandtrust-hashare computed from the chain tip each time a nodestarts. The signing key section carries the root directory field the node fills from the
command line, and it is the one where a blank root is worst: a node that cannot find its key
does not sign.
Two tests worth naming
One walks the section names this package owns rather than a list kept beside them, so the
next section is covered by registering it.
The other asserts the registry refused nothing. That is the check no single section can make:
two of the refusals depend on what else has registered, and a section that loses one is
dropped whole with every key it declared.
gofmt,goimports,go vet,golangci-lintclean;config/...andcmd/seid/...pass.