Repository navigation
feat(cli): take beacon --bootnodes as a list of ENRs and multiaddrs - #825
MegaRedHand wants to merge 9 commits into
Conversation
beacon --bootnodes now takes a comma-separated, repeatable list in the shape of Lighthouse's --boot-nodes: each entry an ENR (enr: prefix optional) or a /ip4|ip6/.../{tcp|udp/quic-v1|udp}/.../p2p/<peer-id> multiaddr. The entries are added in front of the network's own bootnode list instead of replacing it. A command-line entry that does not parse is a startup error naming it; a file path is refused with a hint, since the flag used to take one. node --bootnodes keeps taking a file of ENRs.
🤖 Gemini Code ReviewThe changes look solid. Splitting
Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Claude Code ReviewReview:
|
🤖 Codex Code ReviewNo actionable findings. Bootnode parsing and integration look sound, with good coverage of malformed inputs and preserved network defaults. Consensus processing is unchanged. Tests could not run because rustup attempted to write to a read-only directory. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 DeepSeek Code ReviewOverall this is a clean split of A few issues/improvements worth addressing:
Automated review by DeepSeek · deepseek-v4-pro · custom prompt |
🤖 Kimi Code ReviewNo blocking issues found.
I don’t see correctness, security, or performance regressions in this diff. Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Grok Code ReviewThe bootnode split is sound: chain-specific flags, CLI entries fail closed, network ENRs still warn-and-skip, and multiaddr parsing rejects DNS, draft QUIC, missing
Minor: the Automated review by Grok (xAI) · grok-4.7 · custom prompt |
beacon adds its --bootnodes entries to the network's ENR list and leaves duplicates to build_swarm's merge, so a peer typed as a multiaddr and also listed by the network must reach one dial with both addresses. The new test parses one of each for the same key and checks the merge. Bootnode now derives Debug, so the refusal helper uses expect_err.
- beacon warns when neither --bootnodes nor the network's own list gives a bootnode, which leaves discv5 with no seed. A network directory with no bootnode file used to start that way with only an info-level count. - node warns when its --bootnodes file gives no usable bootnode. parse_enrs's own warning is worded for one list now that beacon adds to its result, so it no longer says the node starts with none. - The network and the bootnodes are resolved in one match, so beacon's arm has the NetworkSource in hand and no expect is needed. - The file-path error says the entries are added to the network's own list, not put in its place, since --bootnodes used to replace it. - The comment on the -- check derives why no ENR starts with --, and the blank-entry comment no longer implies parse_bootnode does not trim. - The empty-value CLI test's doc says its assertion holds whether clap yields no entry or one empty entry.
|
Round one (the automated review of ab725fa). Fixed in 12e9fac and 713a639. Verification: Fixed
Not changed
Gemini, Codex and Kimi found nothing to change. |
|
/review |
🤖 Gemini Code ReviewThis PR looks good. The split of Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Codex Code ReviewNo actionable findings. The new bootnode parser validates transport structure, ports, and embedded public keys, and correctly routes entries to static dialing or discv5 discovery. Consensus logic is unchanged. Tests could not run because rustup attempted to write to a read-only toolchain directory. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 Claude Code ReviewReview:
|
🤖 Kimi Code ReviewNo blocking correctness, security, or performance issues found in the supplied diff. The implementation looks sound:
The operator-facing breaking change is also clearly documented with a targeted startup-error hint for legacy file-based launch scripts. Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Grok Code ReviewThe bootnode split is sound: lean stays a file, beacon adds ENRs/multiaddrs on top of the network list, bad CLI entries fail startup, and network entries still warn-and-skip. No fork-choice, attestation, finalization, STF, XMSS, or SSZ changes. The
Nit: a lean file whose ENRs all fail now warns twice ( Automated review by Grok (xAI) · grok-4.7 · custom prompt |
🤖 DeepSeek Code ReviewAutomated review by DeepSeek |
run_node binds discovery to the IPv4 wildcard, and an IPv4 UDP socket cannot send to an IPv6 address. A --bootnodes entry such as /ip6/<ip>/udp/<port>/p2p/<id>, or an ENR whose only address is ip6 and whose only port is udp, was therefore accepted at startup and never contacted. That is the case the parser already refuses for a discv5 contact with a non-secp256k1 key: nothing could use the entry. parse_bootnode now refuses it for either form. An IPv6 entry with a QUIC or TCP port is kept, since the swarm dials it rather than the discovery socket. A new test checks both sides. The network's own list keeps its lenient rule, as it did. docs/cli.md, docs/discovery.md and CLAUDE.md say so.
…ML markers The hint for a file passed to beacon --bootnodes said to join the file's entries with commas. A bootnode file is usually a YAML list, so joining its lines as they are keeps the "- " markers and comments, and the next start fails as an invalid ENR without the hint. It now says to pass the records themselves, without markers or comments, and that a directory network can list them in its bootstrap_nodes.yaml instead. The hint fired only for a path that exists. A launcher whose bootnode file is missing got an ENR or multiaddr decoding error. A path ending in .yaml, .yml or .txt now gets the hint too. Tests: the existing file test checks the marker advice, and a new one passes a missing absolute path and a missing relative one. docs/cli.md says the same, and adds that nothing turns the network's bootnodes off: each dialable one is dialed at startup and redialed 12 s after every failed dial or disconnect, so running on other bootnodes alone means a directory network listing only those.
…ling comma The trailing-comma half of the empty-value test asserted clap's exact output, ["enr:a", ""], so a clap release that dropped the empty entry would fail it, though startup skips empty entries either way. It now checks that "enr:a" comes first and that anything after it is empty, as the first half already did for "".
|
Round two (the automated review of 713a639). Fixed in 155878d, 923f04e and b867a34. The head these sit on, bdc9bbe, is 713a639 with main merged and no other change, so every point was judged there. Fixed
Not changed
Gemini, Codex and Kimi found nothing to change. DeepSeek's job returned an empty response. |
|
/review |
AI security review: 1 finding(s) to checkReviewed by Opus, GPT, Kimi, GLM, DeepSeek. A judge model checked every one of the findings against the code.
DetailsM1. Kurtosis still launches beacon with the removed bootnode file interface (low, logic)
Duplicates folded into another finding: 2
Cost of this review: ~$3.36 of a $30 budget (estimated from token counts). |
|
Round three (the review of b867a34). Nothing changed in this round. Not changed
|
|
The review loop stops here: the last round raised nothing left to address. Its one finding, the kurtosis launcher pin, is a follow-up that only works once this PR is on main: #850. |
What
ethlambda beacon --bootnodesnow takes a list of bootnodes on the command line instead of a file path, in the shape of Lighthouse's--boot-nodes:/is a multiaddr. Anything else is an ENR, with theenr:prefix optional.Bootnodean ENR produces:/tcp/<port>is dialed over TCP./udp/<port>/quic-v1is dialed over QUIC./udp/<port>is the discv5 port. That peer seeds discovery and is not dialed, which is how Lighthouse reads a UDP multiaddr too.nodeis unchanged.node --bootnodes <PATH>still takes a file of ENRs. The field moved out ofCommonOptionsintoLeanOptions/MainnetOptions, since the two sub-commands now read it differently.Departures from Lighthouse
/p2p/<peer-id>, and the peer id must embed its public key, which every secp256k1 id does. Bootnodes are keyed by peer id for dial merging, skipping our own record and redials, and discv5 is seeded with that key. Lighthouse dials a TCP multiaddr with no peer id anonymously.Bootnodeholds an IP.Breaking: kurtosis launcher
beacon --bootnodes <file>no longer works. A path that names an existing file fails with an error saying the flag now takes a comma-separated list.The assertoor battery's pinned
lambdaclass/ethereum-packagelauncher (ETHEREUM_PACKAGE_REF67cb0e02) writes the bootnodes to/tmp/ethlambda-bootnodes.txtand passes that path. It will fail at startup until the launcher passes the list directly and the pin is bumped; that change is being made separately. The same applies to any host launch script that passesbeacona bootnode file.Review notes
A review pass raised these; they were fixed in this PR:
--bootnodes(for example, an unset variable in a script) takes the next flag as its value because ofallow_hyphen_values. That is now refused as "given no value" instead of being reported as a malformed ENR.Left as they are, because ENR bootnodes behave the same way today:
/ip6addresses (ENRs fall back toip6), and unspecified addresses such as0.0.0.0.Tests
ethlambda-p2p: 14 parser tests: every transport, ENRs with and without the prefix, peer id to key round trip, and each refusal.ethlambda:--network, a prefix-less ENR starting with-, empty values, lean's file path.beacon_bootnodes: order and additivity, empty entries skipped, malformed entry, file hint, missing value, bad network entry skipped.make fmt, workspace clippy with-D warnings, and theethlambdaandethlambda-p2ptest suites pass.