Skip to content

feat: add AUTOBAHN option to local docker cluster (CON-247)#3220

Open
wen-coding wants to merge 1 commit intomainfrom
wen/add_autobahn_to_localcluster_script
Open

feat: add AUTOBAHN option to local docker cluster (CON-247)#3220
wen-coding wants to merge 1 commit intomainfrom
wen/add_autobahn_to_localcluster_script

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

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

Summary

  • Add AUTOBAHN=true option to local docker cluster for testing autobahn consensus
  • NodeKey.SaveAs() writes node_pubkey.txt alongside node_key.json (node:ed25519:public:<hex> format)
  • FilePVKey.Save() writes validator_pubkey.txt alongside priv_validator_key.json (validator:ed25519:public:<hex> format)
  • step1_configure_init.sh copies pubkey files to shared volume for cross-node access
  • seid tendermint gen-autobahn-config Go command reads all nodes' pubkeys and generates the autobahn JSON config with typed validation (atypes.PublicKey, p2p.NodePublicKey, tcp.HostPort)
  • step4_config_override.sh invokes the command and injects the config path into config.toml
  • Shared AutobahnFileConfig and AutobahnValidator types in sei-tendermint/config/autobahn.go, used by both node/setup.go and the gen command
  • Startup log messages: "Autobahn config enabled", "Autobahn config loaded", "GigaRouter initialized"
  • AUTOBAHN env var wired through docker-compose.yml and Makefile

Usage

AUTOBAHN=true make docker-cluster-start

Test plan

  • AUTOBAHN=true make docker-cluster-start — all 4 nodes start with autobahn enabled, logs show config loaded and GigaRouter initialized
  • make docker-cluster-start (without AUTOBAHN) — no autobahn messages in logs, nodes start normally
  • go build ./... passes
  • gofmt -s -l . clean
  • Existing tests pass (config, node, commands, server packages)

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 10, 2026, 4:48 PM

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 9, 2026, 4:01 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 31.03448% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.06%. Comparing base (8d7e329) to head (db14f28).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...int/cmd/tendermint/commands/gen_autobahn_config.go 18.18% 44 Missing and 1 partial ⚠️
sei-tendermint/config/autobahn.go 37.50% 5 Missing and 5 partials ⚠️
sei-tendermint/privval/file.go 60.00% 1 Missing and 1 partial ⚠️
sei-tendermint/types/node_key.go 60.00% 1 Missing and 1 partial ⚠️
sei-tendermint/node/setup.go 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3220      +/-   ##
==========================================
+ Coverage   59.02%   59.06%   +0.04%     
==========================================
  Files        2065     2067       +2     
  Lines      169414   169911     +497     
==========================================
+ Hits        99994   100366     +372     
- Misses      60673    60765      +92     
- Partials     8747     8780      +33     
Flag Coverage Δ
sei-chain-pr 71.35% <31.03%> (?)
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-cosmos/server/util.go 66.37% <100.00%> (+0.14%) ⬆️
sei-tendermint/internal/p2p/giga_router.go 66.19% <100.00%> (+0.23%) ⬆️
sei-tendermint/node/setup.go 70.66% <75.00%> (+3.09%) ⬆️
sei-tendermint/privval/file.go 68.00% <60.00%> (-0.33%) ⬇️
sei-tendermint/types/node_key.go 67.44% <60.00%> (-1.79%) ⬇️
sei-tendermint/config/autobahn.go 37.50% <37.50%> (ø)
...int/cmd/tendermint/commands/gen_autobahn_config.go 18.18% <18.18%> (ø)

... and 7 files with indirect coverage changes

🚀 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 requested review from masih and pompon0 April 9, 2026 16:05
@wen-coding wen-coding force-pushed the wen/add_autobahn_to_localcluster_script branch from a67f990 to 2f9bcd2 Compare April 9, 2026 16:09
return err
}
// Write pubkey in autobahn-compatible format alongside the key file.
pubKeyStr := fmt.Sprintf("node:%v", nk.PubKey().String())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pubKeyStr := fmt.Sprintf("node:%v", nk.PubKey().String())
pubKeyStr := fmt.Sprintf("node:%s", nk.PubKey().String())

Copy link
Copy Markdown
Contributor

@pompon0 pompon0 Apr 10, 2026

Choose a reason for hiding this comment

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

nit: ".String()" suffix is redundant (if we used %v)

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.

also it is unfortunate that we need to duplicate Stringer implementation here. At least add a todo to fix that.

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 and added TODO

}
// Write pubkey in autobahn-compatible format alongside the key file.
pubKeyStr := fmt.Sprintf("validator:%v", pvKey.PubKey.String())
pubKeyPath := filepath.Join(filepath.Dir(outFile), "validator_pubkey.txt")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ditto re path cleaning.

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

return err
}
// Write pubkey in autobahn-compatible format alongside the key file.
pubKeyStr := fmt.Sprintf("validator:%v", pvKey.PubKey.String())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto re %s for string concat; that's more explicit given we want the strigner value of key and would safely fail if anything but string is passed in.

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

@wen-coding wen-coding force-pushed the wen/add_autobahn_to_localcluster_script branch from 39f68a7 to be2e651 Compare April 9, 2026 17:13
AUTOBAHN_CONFIG="$HOME/.sei/config/autobahn.json"

# Build validators JSON array from all nodes' pubkeys
VALIDATORS="["
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: do we really need this to be a bash script? My guess is that given that we use go binary to generate these files, we could also use a go binary to combine them into a full config.

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.

That's actually a good point, I reworked it to call seid tendermint gen-autobahn-config and moved the Autobahn config definitions around, ready for another look.

@wen-coding wen-coding force-pushed the wen/add_autobahn_to_localcluster_script branch 2 times, most recently from 264398b to e55efc6 Compare April 10, 2026 16:08
@wen-coding
Copy link
Copy Markdown
Contributor Author

@masih @pompon0 changed the PR significantly to share AutobahnConfig definition between generation and loading, and moved AutobahnConfig generation into a go file to be called by seid tendermint gen-autobahn-config, please take another look.

@wen-coding wen-coding force-pushed the wen/add_autobahn_to_localcluster_script branch 3 times, most recently from 98f4e5e to a246257 Compare April 10, 2026 16:36
- NodeKey.SaveAs writes node_pubkey.txt alongside node_key.json
- FilePVKey.Save writes validator_pubkey.txt alongside priv_validator_key.json
- step1 copies pubkey files to shared volume for cross-node access
- step4 generates autobahn JSON config from all nodes' pubkeys when AUTOBAHN=true
- Wired through docker-compose.yml and Makefile

Usage: AUTOBAHN=true make docker-cluster-start

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding force-pushed the wen/add_autobahn_to_localcluster_script branch from a246257 to db14f28 Compare April 10, 2026 16:47
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