Skip to content

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

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

[ConfigManager] Register Node Sections 4/4#3995
bdchatham wants to merge 4 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

Declares the fourteen keys 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.

Why a schema rather than the node's own type

That type carries the root keys and the nine tables, so declaring against it would declare
every table's keys a second time. The schema squashes the same base group, so fourteen
spellings still come from the node's own tags, and 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 by name, tag and type, and holds the count of non-table fields. A third one
appearing there fails rather than going undeclared.

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.

That leaves the step which 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.

The test names both paths as literals rather than reading the list the registration uses. A
test comparing that list against itself agrees however it changes, so a path dropped from it
would leave the test passing while the key became declared. Verified by removing mode and
confirming the test 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 it. The registry does not catch it, and this is the
first change to declare root keys beside another package's, so a test here checks the whole
registered set.

gofmt, goimports, go vet, golangci-lint clean; config/... and cmd/seid/... pass.
With this the registry declares 12 sections and 187 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.56%. Comparing base (579b53d) to head (0621687).

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##           plt-775-node-sections-3    #3995   +/-   ##
========================================================
  Coverage                    57.56%   57.56%           
========================================================
  Files                         2225     2225           
  Lines                       186513   186521    +8     
========================================================
+ Hits                        107370   107378    +8     
  Misses                       69337    69337           
  Partials                      9806     9806           
Flag Coverage Δ
sei-chain-pr 100.00% <100.00%> (ø)

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, 9:21 PM

# Conflicts:
#	config/tendermintbase/tendermintbase_test.go
@bdchatham
bdchatham marked this pull request as ready for review August 25, 2026 21:14
@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Declarative registry and test-only checks; no change to how the node reads or applies configuration until a later consumer wires these keys in.

Overview
Completes ConfigManager registration for the node TOML by declaring top-level keys (section node_base) alongside the nine existing tables. Registration uses a dedicated nodeRootSchema that squashes BaseConfig and explicitly carries autobahn-config-file and hash-vault-disabled-unsafe, avoiding double-declaring every nested table key if the full tmcfg.Config type were used.

home and mode are excluded from declared keys because they are already fixed by the CLI / file header; rootDefaults supplies mode-agnostic defaults for generated files from the same forMode pipeline as other sections.

Adds tests that keep the schema aligned with tmcfg.Config, assert the two exclusions, and guard against a root key sharing a section name (a gap the registry does not validate). Nothing in this PR applies these keys at runtime—registry metadata only.

Reviewed by Cursor Bugbot for commit 6a27859. Bugbot is set up for automated code reviews on this repo. Configure here.

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