feat: add AUTOBAHN option to local docker cluster (CON-247)#3220
feat: add AUTOBAHN option to local docker cluster (CON-247)#3220wen-coding wants to merge 1 commit intomainfrom
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
|
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 #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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
a67f990 to
2f9bcd2
Compare
sei-tendermint/types/node_key.go
Outdated
| return err | ||
| } | ||
| // Write pubkey in autobahn-compatible format alongside the key file. | ||
| pubKeyStr := fmt.Sprintf("node:%v", nk.PubKey().String()) |
There was a problem hiding this comment.
| pubKeyStr := fmt.Sprintf("node:%v", nk.PubKey().String()) | |
| pubKeyStr := fmt.Sprintf("node:%s", nk.PubKey().String()) |
There was a problem hiding this comment.
nit: ".String()" suffix is redundant (if we used %v)
There was a problem hiding this comment.
also it is unfortunate that we need to duplicate Stringer implementation here. At least add a todo to fix that.
There was a problem hiding this comment.
done and added TODO
sei-tendermint/privval/file.go
Outdated
| } | ||
| // 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") |
sei-tendermint/privval/file.go
Outdated
| return err | ||
| } | ||
| // Write pubkey in autobahn-compatible format alongside the key file. | ||
| pubKeyStr := fmt.Sprintf("validator:%v", pvKey.PubKey.String()) |
There was a problem hiding this comment.
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.
39f68a7 to
be2e651
Compare
| AUTOBAHN_CONFIG="$HOME/.sei/config/autobahn.json" | ||
|
|
||
| # Build validators JSON array from all nodes' pubkeys | ||
| VALIDATORS="[" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
264398b to
e55efc6
Compare
98f4e5e to
a246257
Compare
- 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>
a246257 to
db14f28
Compare
Summary
AUTOBAHN=trueoption to local docker cluster for testing autobahn consensusNodeKey.SaveAs()writesnode_pubkey.txtalongsidenode_key.json(node:ed25519:public:<hex>format)FilePVKey.Save()writesvalidator_pubkey.txtalongsidepriv_validator_key.json(validator:ed25519:public:<hex>format)step1_configure_init.shcopies pubkey files to shared volume for cross-node accessseid tendermint gen-autobahn-configGo command reads all nodes' pubkeys and generates the autobahn JSON config with typed validation (atypes.PublicKey,p2p.NodePublicKey,tcp.HostPort)step4_config_override.shinvokes the command and injects the config path intoconfig.tomlAutobahnFileConfigandAutobahnValidatortypes insei-tendermint/config/autobahn.go, used by bothnode/setup.goand the gen commandAUTOBAHNenv var wired throughdocker-compose.ymlandMakefileUsage
Test plan
AUTOBAHN=true make docker-cluster-start— all 4 nodes start with autobahn enabled, logs show config loaded and GigaRouter initializedmake docker-cluster-start(without AUTOBAHN) — no autobahn messages in logs, nodes start normallygo build ./...passesgofmt -s -l .clean🤖 Generated with Claude Code