Select the building role from a supplied config - #554
Open
0w3n-d wants to merge 1 commit into
Open
Conversation
Turn `Roles` into a struct of optional configs. As an enum a third role needs seven variants. The building role takes its own two keys: `RELAY_KEY` is already read as secp256k1 by the merging role and as BLS by `load_keypair`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #550 (step 1 of 6)
What this PR does
Adds
BuildingConfig(--build.config) and turnsRolesfrom an enum into astruct of three optional configs. As an enum, a third role needs seven
variants.
The building role reads its own two keys,
BUILDER_BLS_KEY(signs thesubmission) and
BUILDER_PAYOUT_KEY(pays the proposer).RELAY_KEYcannotserve: the merging role parses it as secp256k1, and
helix_common::config::load_keypairparses it as BLS. Both are loaded andlogged before the node boots, so a bad key fails immediately and the operator
sees which pubkey to register and which address to fund.
What this PR deliberately does not do
It does not build or submit anything. Nothing is spawned. Steps 2-5 add the
slot context, block assembly, submission and the slot loop.
subsidy_weiandself_validatecarry#[allow(dead_code)]until steps 3 and 5 read them.Tests
14 new, all written before the implementation and signed off first.
BuildingConfig(8): the shipped example parses; the three required fieldsalone yield every default; an unknown field is rejected; a payout reserve
below the intrinsic 21 000 gas is rejected, as is an empty
submit_offsets_ms, a schemelessrelay_url, andextra_dataover 32bytes.
a_zero_subsidy_is_allowedpins the opt-out.Roles(2 new, 4 updated): a build config alone selects the building role;all three configs select all three; supplying none is still an error.
BuildingKeys(4): hex parses with and without0x; each malformed key isnamed in its own error; the pubkey and payout address are derived.
parse()is split fromload()so tests never touch process-wide env vars.103 pass in the crate.
Notes for the reviewer
Two things found rather than introduced, neither fixed here:
cargo clippy -p helix-builderreports 6 pre-existing errors inengine/*andvalidation/mod.rs. The documented command,cargo clippy --all-features --no-deps, lints onlycrates/relaybecausethat is the workspace's
default-members— so this crate has never beenlinted in CI.
--all-targetsfinds 4 more in test code. Worth a follow-up.validation/server_tests.rsis removed here as adrive-by; it arrived with Serve the SSZ validation routes from the simulation role #543 and blocked a clean build of this crate.
Reviewer checklist
lint,unit-test) is green