Skip to content

feat: wire autobahn config propagation from top-level to GigaRouter (CON-232)#3194

Merged
wen-coding merged 8 commits intomainfrom
wen/add_autobahn_config
Apr 8, 2026
Merged

feat: wire autobahn config propagation from top-level to GigaRouter (CON-232)#3194
wen-coding merged 8 commits intomainfrom
wen/add_autobahn_config

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

@wen-coding wen-coding commented Apr 4, 2026

Summary

  • Add autobahn-config-file field to config.toml pointing to a JSON file with the full autobahn configuration (empty = disabled)
  • JSON config uses structured types: validator_key / node_key with prefixed string formats, utils.Option for optional fields, utils.Duration for human-readable durations
  • Validator key sourced from priv_validator_key.json (separate from P2P node key); remote signers rejected with clear error
  • buildGigaConfig() in node/setup.go loads JSON, validates (duplicates, self-in-set, node key match), and constructs GigaRouterConfig
  • NodePublicKey gains MarshalText/UnmarshalText (mirrors atypes.PublicKey pattern)
  • SecretKeyFromED25519() constructor added for bridging node key types

Validations

  • Empty validators, zero config values
  • Duplicate validator keys, duplicate node keys
  • Node's own validator key must be in the config
  • Node key in config must match the actual node key
  • Remote validator signers not supported (error if priv-validator.laddr is set)

Test plan

  • 12 unit tests for buildGigaConfig: disabled, full propagation, optional fields, file errors, duplicates, self-not-in-set, node key mismatch, no validator key
  • 2 router tests: TestRouter_GigaNotSetByDefault, TestRouter_GigaSetWhenConfigured (e2e with non-default values, separate val/node keys)
  • 2 conv tests: NodePublicKeyFromString round-trip and invalid inputs
  • go build ./... passes
  • gofmt -s -l . clean

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 7, 2026, 7:28 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 73.19588% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.80%. Comparing base (7246320) to head (402e966).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/node/setup.go 72.30% 12 Missing and 6 partials ⚠️
sei-tendermint/node/node.go 20.00% 3 Missing and 1 partial ⚠️
sei-tendermint/internal/p2p/conv.go 87.50% 1 Missing and 1 partial ⚠️
sei-tendermint/libs/utils/tcp/tcp.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
sei-chain-pr 72.80% <73.19%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-tendermint/config/config.go 70.34% <ø> (ø)
sei-tendermint/config/toml.go 55.00% <ø> (ø)
sei-tendermint/internal/autobahn/types/msg.go 73.82% <100.00%> (+0.35%) ⬆️
sei-tendermint/node/seed.go 45.26% <100.00%> (ø)
sei-tendermint/internal/p2p/conv.go 80.51% <87.50%> (+1.83%) ⬆️
sei-tendermint/libs/utils/tcp/tcp.go 80.45% <75.00%> (+1.68%) ⬆️
sei-tendermint/node/node.go 58.74% <20.00%> (-0.63%) ⬇️
sei-tendermint/node/setup.go 67.67% <72.30%> (+1.13%) ⬆️
🚀 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.

@wen-coding wen-coding force-pushed the wen/add_autobahn_config branch 3 times, most recently from c77984d to 7f3ce09 Compare April 5, 2026 01:59
@wen-coding wen-coding force-pushed the wen/add_autobahn_config branch from 693e7dd to 8488493 Compare April 6, 2026 15:22
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"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

func buildGigaConfig(
autobahnConfigFile string,
nodeKey types.NodeKey,
validatorKey utils.Option[crypto.PrivKey],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make it autobahn/types.SecretKey already here, and convert outside.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

// Use the validator key (from priv_validator_key.json) as the autobahn consensus key.
valKey, ok := validatorKey.Get()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO for supporting non-validator nodes

wen-coding and others added 8 commits April 7, 2026 11:54
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>
@wen-coding wen-coding force-pushed the wen/add_autobahn_config branch from e912558 to 402e966 Compare April 7, 2026 19:27
@wen-coding wen-coding changed the title feat: wire autobahn config propagation from top-level to GigaRouter feat: wire autobahn config propagation from top-level to GigaRouter (CON-232) Apr 8, 2026
@wen-coding wen-coding added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 5c9949f Apr 8, 2026
40 checks passed
@wen-coding wen-coding deleted the wen/add_autobahn_config branch April 8, 2026 19:12
yzang2019 added a commit that referenced this pull request Apr 9, 2026
* 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)
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.

3 participants