Skip to content

[ConfigManager] Register Node Sections 4/4 - #3995

Draft
bdchatham wants to merge 2 commits into
plt-775-node-sections-3from
plt-775-node-sections-4
Draft

[ConfigManager] Register Node Sections 4/4#3995
bdchatham wants to merge 2 commits into
plt-775-node-sections-3from
plt-775-node-sections-4

Conversation

@bdchatham

@bdchatham bdchatham commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What this does

Declares the fourteen keys that sit at the top of the node's configuration file with
no table of their own. That completes the file: nine tables and its root. Nothing
consumes them, so a node's configuration reads exactly as it did.

Why these are declared against a schema

The node's top-level type carries the root keys and the nine tables both, so
declaring against it would declare every table's keys a second time.

The schema here squashes the same base group that type squashes, so fourteen
spellings still come from the node's own tags and cannot drift from them. It
restates only the two fields held beside that group.

Those two restatements are the one place a spelling is written twice, so a test
holds them to the type they came from by name, tag and type, and holds the count of
non-table fields on that type. A third field appearing there fails here rather than
going undeclared and unnoticed.

Two paths left out

home is where this file is found, so a value inside it would be the file naming
its own location, and the command line already carries it.

mode is the fact the file states at the top under its own name. Declaring a second
spelling would let the two disagree, with the resolution answering for one and the
node reading the other.

This leaves the step that makes these keys take effect something to do. Nothing
will carry the file's own mode into the node's mode, so whatever installs a written
value has to map it. Worth stating here rather than discovering there.

The test names both paths as literals rather than reading the list the registration
uses. A test comparing that list against itself agrees however the list changes, so
a path dropped from it would leave the test passing while the key became declared. I
checked that by removing mode and confirming the test now objects.

A collision nothing refuses

A key at the top of the file that is also a section's name cannot be written. No
file holds both a value for a name and a table under that name, so one of the two
settings is unreachable and nothing says which.

The registry does not catch this. It has no instance today, and this is the first
change to declare root keys beside another package's, so a test here checks the
whole registered set. It belongs somewhere better eventually; a check that exists is
worth more than the right home for it.

Verification

gofmt, goimports, go vet clean. golangci-lint reports nothing on the touched
package. config/... and cmd/seid/... pass.

I also broke two behaviours on purpose and checked a test objected: a restated root
field going unchecked, and the mode key being declared after all. Both were caught,
the second only after the self-referential test above was rewritten.

Two notes on what happens after this

The stacked base is behind the four it holds. Those PRs have taken review fixes and a main
merge since this base branch was cut, so it is short of them. The diff here is still only this
step's work, because the base is a consistent ancestor. But main has to be merged into this
stack before the first PR is retargeted, or a main-based diff would read as reverting the later
commits on those branches.

One key this leaves for whatever delivers these values. mode is not declared, so nothing
here can set it, and sei.toml states the same fact at its top under its own name. Those two
can disagree across the two files with nothing saying so, and a node resolving one kind's values
while running as another reads correctly in every other report about it. Comparing them and
reporting a disagreement belongs with the delivery, not here.

Reviewing this

Last of four, stacked on the third, so the diff shows only this step. With it the
registry declares 12 sections and 188 keys.

Fourteen keys sit at the top of that file with no table of their own. They are
declared against a schema rather than the node's top-level type, because that
type carries the nine tables as well and declaring against it would declare
every table's keys a second time. The schema squashes the same base group that
type squashes, so those spellings still come from the node's own tags, and it
restates the two fields held beside that group. A test holds those two to the
type they came from by name, tag and type, and holds the count, so a third one
appearing there fails rather than going undeclared.

Two paths are left out. The home directory is where this file is found, so a
value inside it would be the file naming its own location, and the command line
already carries it. The node mode is the fact the file states at the top under
its own name, and a second spelling would let the two disagree, with the
resolution answering for one and the node reading the other.

A test also checks that no root key is another section's name. Nothing refuses
that collision, and the two settings it produces cannot both be written because
no file holds a value for a name and a table under it. This is the first change
to declare root keys beside another package's, so the check lives here until it
has somewhere better to be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.61%. Comparing base (ecc927b) to head (bbd07d4).

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##           plt-775-node-sections-3    #3995   +/-   ##
========================================================
  Coverage                    57.61%   57.61%           
========================================================
  Files                         2230     2230           
  Lines                       187682   187690    +8     
========================================================
+ Hits                        108126   108134    +8     
  Misses                       69689    69689           
  Partials                      9867     9867           
Flag Coverage Δ
sei-chain-pr 100.00% <100.00%> (ø)
sei-db 69.80% <ø> (ø)

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

Files with missing lines Coverage Δ
config/tendermintbase/tendermintbase.go 100.00% <100.00%> (ø)
🚀 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.

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 25, 2026, 1:20 AM

# Conflicts:
#	config/tendermintbase/tendermintbase_test.go
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.

1 participant