feat: wire autobahn config propagation from top-level to GigaRouter (CON-232)#3194
feat: wire autobahn config propagation from top-level to GigaRouter (CON-232)#3194wen-coding merged 8 commits intomainfrom
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3194 +/- ##
==========================================
+ Coverage 58.79% 58.80% +0.01%
==========================================
Files 2054 2054
Lines 168315 168410 +95
==========================================
+ Hits 98958 99031 +73
- Misses 60610 60621 +11
- Partials 8747 8758 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
c77984d to
7f3ce09
Compare
693e7dd to
8488493
Compare
sei-tendermint/node/setup.go
Outdated
| type autobahnValidator struct { | ||
| ValidatorKey atypes.PublicKey `json:"validator_key"` // autobahn validator public key | ||
| NodeKey p2p.NodePublicKey `json:"node_key"` // p2p node public key | ||
| Host string `json:"host"` |
There was a problem hiding this comment.
nit: this is fine, but alternatively you can make it a single libs/utils/tcp.HostPort field (it has stringer and parser, just need to add (Un)MarshalText)
sei-tendermint/node/setup.go
Outdated
| func buildGigaConfig( | ||
| autobahnConfigFile string, | ||
| nodeKey types.NodeKey, | ||
| validatorKey utils.Option[crypto.PrivKey], |
There was a problem hiding this comment.
nit: make it autobahn/types.SecretKey already here, and convert outside.
sei-tendermint/node/setup.go
Outdated
| } | ||
|
|
||
| // Use the validator key (from priv_validator_key.json) as the autobahn consensus key. | ||
| valKey, ok := validatorKey.Get() |
There was a problem hiding this comment.
nit: if it is required, then it doesn't make sense to make it optional (or add a TODO that we need to add support for non-validator nodes here and change error messages that autobahn non-validator nodes are not supported yet).
There was a problem hiding this comment.
Added TODO for supporting non-validator nodes
Add [autobahn] config section and buildGigaConfig bridge so that GigaRouterConfig is actually populated when creating the P2P router. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace [autobahn] TOML section with a single autobahn-config-file field pointing to a JSON file. Empty string = autobahn disabled. The JSON file contains all autobahn settings: validators, producer, consensus, and dial config. Validated at load time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TestRouter_GigaSetWhenConfigured constructs a full GigaRouterConfig, passes it through NewRouter, and verifies router.giga is present. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ypes, validations - Separate validator_key and node_key in autobahn config (validator key from priv_validator_key.json, node key for P2P identity) - Add NodePublicKeyFromString + MarshalText/UnmarshalText to NodePublicKey - Use utils.Option for max_txs_per_second and persistent_state_dir - Derive autobahn consensus key from PrivValidator, not NodeKey - Error on remote validator signers (not supported by autobahn) - Validate own node key matches config entry - Check for duplicate node keys - E2e test verifies all non-default config values propagate through router Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TestRouter_GigaSetWhenConfigured now uses distinct validator and node keys to verify both propagate independently - Add doc comment on AutobahnConfigFile field in Config struct Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Duration fields in autobahn JSON config now marshal as "400ms", "1.5s" instead of nanosecond integers. Uses existing utils.Duration type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
buildGigaConfig no longer silently returns nil on empty path. The empty check is now in createRouter, and buildGigaConfig errors on empty path via os.ReadFile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…param, TODO for observer nodes - Add MarshalText/UnmarshalText to tcp.HostPort; use single Address field in autobahnValidator instead of separate Host/Port - buildGigaConfig takes atypes.SecretKey directly; conversion from PrivValidator key happens at call site in createRouter - createRouter takes Option[atypes.SecretKey]; TODO added for future non-validator (observer) node support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e912558 to
402e966
Compare
* main: Add receipt / log reads to cryptosim (#3081) persist blocks and FullCommitQCs in data layer via WAL (CON-231) (#3126) Update Changelog in prep to cut v6.4.1 (#3213) fix(sei-tendermint): resolve staticcheck warnings (#3207) Add historical state offload stream hook (#3183) feat: wire autobahn config propagation from top-level to GigaRouter (CON-232) (#3194)
Summary
autobahn-config-filefield to config.toml pointing to a JSON file with the full autobahn configuration (empty = disabled)validator_key/node_keywith prefixed string formats,utils.Optionfor optional fields,utils.Durationfor human-readable durationspriv_validator_key.json(separate from P2P node key); remote signers rejected with clear errorbuildGigaConfig()innode/setup.goloads JSON, validates (duplicates, self-in-set, node key match), and constructsGigaRouterConfigNodePublicKeygainsMarshalText/UnmarshalText(mirrorsatypes.PublicKeypattern)SecretKeyFromED25519()constructor added for bridging node key typesValidations
priv-validator.laddris set)Test plan
buildGigaConfig: disabled, full propagation, optional fields, file errors, duplicates, self-not-in-set, node key mismatch, no validator keyTestRouter_GigaNotSetByDefault,TestRouter_GigaSetWhenConfigured(e2e with non-default values, separate val/node keys)NodePublicKeyFromStringround-trip and invalid inputsgo build ./...passesgofmt -s -l .clean🤖 Generated with Claude Code