Repository navigation
feat(validator): publish proposer preferences (gloas) - #707
Conversation
🤖 Claude Code ReviewReview of PR 707: validator client publishes signed proposer preferencesI read the diff and the checked-out Correctness
Minor points
Tests No blocking issues. Automated review by Claude (Anthropic) · sonnet · custom prompt |
🤖 Codex Code ReviewI reviewed the PR diff and the touched Rust paths in context. Overall this looks careful and the added tests materially improve confidence around proposer-preferences signing and v2 duties. I did not find a clear consensus-breaking bug in the new logic.
Findings
What looks good
Looks good to me aside from the minor maintainability/UX notes above. Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Kimi Code ReviewI'll review this PR which implements proposer preferences for the Gloas fork. Let me analyze the changes systematically. Overall AssessmentThis is a well-structured PR adding Gloas fork proposer preferences support. The core logic is sound, but I've identified several issues ranging from minor to potentially serious. Critical Issues1. Potential Division by Zero in
|
| Priority | Issue | Location | Fix |
|---|---|---|---|
| Critical | builder_boost_factor serialized as string not number |
http.rs:94 |
Remove quotes: "{factor}" → {factor} |
| High | Signing domain uses MIN_SEED_LOOKAHEAD (4) vs epoch-1; comment/code mismatch |
signing.rs:339 |
Verify spec, fix code or comment |
| Medium | Mutex poison recovery hides bugs | preferences.rs:121 |
Use parking_lot or log recovery |
| Medium | Sequential epoch processing | preferences.rs:181 |
Consider join! |
| Medium | Sequential preference submission | preferences.rs:252 |
Consider limited parallelism |
| Low | AtomicBool ordering could be relaxed |
preferences.rs:178 |
compare_exchange_weak |
| Low | Test logic duplicates production | preferences.rs:437 |
Share domain computation |
The PR is well-tested and the architecture is sound. The string-vs-number JSON serialization is the most critical fix needed before merge.
Automated review by Kimi (Moonshot AI) · kimi-k2.6 · custom prompt
ae1a3d2 to
5931f19
Compare
5931f19 to
652bfc0
Compare
…nces Signed proposer preferences must carry the shuffling dependent root, which only v2 of the proposer duties endpoint reports (v1's root is one epoch later). Add both calls to the beacon node trait, with the fallback sending preferences to every node since each one gossips what it accepts.
…main The gossip validator verifies a preference at the fork version of the epoch before its proposal, while the validator guide signs with the head state. The two differ only in the first epoch of a fork, where the gossip rule is what peers accept, so sign for that one.
From gloas a proposer's fee recipient and gas limit travel in signed proposer preferences, and a node ignores trustless bids for a slot whose proposer published none. A per-slot service signs one per owned proposal in the current and next gloas epoch, keyed by (slot, dependent root) so a reorg re-publishes, and sends it to every node.
…oas bids by the boost factor Wire the preferences service into the slot loop, unconditionally since from gloas they carry every proposal's fee recipient. produceBlockV4 now sends the configured builder_boost_factor in its body, so with --builder-proposals a pooled p2p bid can win on value; without it the factor stays 0 as before.
…'s gossip rules The signing domain is the part of the preferences flow most likely to drift between the signer and the verifier, so drive the validator client's own signer and HTTP client against the real route and gossip rules.
Document the per-slot preferences, their two counters, the signing domain departure from the validator guide, and that the boost factor now also weighs gloas p2p bids.
… their reporting A node answers 400 for a whole call when any entry fails, and one it holds for the same slot and root with other content is such a failure, so a batch kept every entry unpublished and re-sent until that slot passed (a restart after a fee recipient change triggers it). Send each preference alone and remember each success. Also: a failed v2 duties fetch no longer warns "duty likely missed" twice a slot (the service warns once per epoch and counts it), the fork header is the target epoch's, the poll is spawned ahead of the proposal, the signing-domain explanation is corrected (get_domain reads state.fork, so the guide and the gossip rule differ only for a proposal in a fork's first epoch signed during it), v2 dependent slot reuses the state transition's definition, and the end-to-end test now reads its duty and dependent root through the client.
A preference a node keeps refusing is retried every slot until its slot passes, which warned up to two epochs of slots per entry. Warn on the first refusal of each (slot, dependent root), log repeats at debug, and keep counting every failure. Reword the failures metric to what it now counts.
…split the fetch counter try_all warned per node on every refusal, so a preference a node kept refusing still warned every slot despite the per-entry dedup; add a quiet variant for it. Poll after the proposal rather than before, so the next epoch duties fetch does not compete with block production. Count failed v2 duty fetches on their own counter, since a syncing node is not a refused preference.
From gloas the proposer preferences carry each validator's fee recipient and target gas limit, so the keymanager's `feerecipient` and `gas_limit` reach the node through them, from the next dependent root on, whether or not `--builder-proposals` is set. The README's duty list, written on main by #716, gains the preferences, which are published every slot.
652bfc0 to
34a914f
Compare
|
Security read of this PR, with the signing side and the network/node side reviewed separately. No critical or high issues: the message is signed under 1. Bound and check the duties before signing ( The v2 duties are taken as they come: no cap on the entry count and no check that 2. A node that refused once never receives the preference again (
Smaller
Tests I'd add: duties at slots outside the target epoch are dropped, and a list of hundreds of entries is bounded; a node that refused while another accepted receives the preference on a later poll; a key removed between the duties fetch and signing is skipped without losing the others; a preference signed during the first gloas epoch itself passing the node's rules end to end (the gossip test has gloas at epoch 0, so the boundary is unit-pinned only). Checked and clean: pre-gloas target epochs skipped before any fetch; started slots skipped, matching the node's IGNORE; one request per preference, so one refusal cannot hold back the others; an empty list never reaches the wire; |
|
/review |
🤖 Gemini Code ReviewThis PR looks great. The implementation of A few highlights:
No issues found — ready to merge. Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Codex Code Review
Tests could not run: Rustup attempted to write to its read-only temporary directory. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 Claude Code ReviewReview: proposer preferences in the validator client (PR 707)Overall this is well-structured. Single-flight polling, per-entry submits, per- Correctness / consensus1. A non-zero gloas boost factor lets a p2p bid win, but the proposal path is unchanged.
2. Unconditional publishing combined with factor
3. The signing domain deviates from
4. Verify that the
Behaviour5. Only the first node's duties are signed against.
6. Pre-fork submissions carry a gloas
Minor
Nice work extracting Automated review by Claude · claude-opus-5-5 · custom prompt |
🤖 Kimi Code ReviewFinding
Otherwise, the change looks well considered: the v2 dependent-root calculation now shares the state-transition helper, the fork-boundary signing domain is explicitly tested, single-flight cleanup is panic-safe, and one-preference-per-request avoids batch-wide rejection poisoning unrelated entries. Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Claude Code ReviewReview: proposer preferences in the validator client (PR 707)This is a well-reasoned PR. The domain switch to the proposal epoch's fork version, the v2 1.
|
🤖 Gemini Code ReviewThis PR is well-designed and thoroughly tested. The handling of the v1.7.0-beta.4 signing domain, A couple of minor edge-case suggestions in
Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Kimi Code ReviewNo blocking correctness or security issues found. The implementation handles the important edge cases well:
One non-blocking operational tradeoff: the once-per-epoch re-send schedule in Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Grok Code ReviewThe preferences work is careful and well tested: beta.4 signing, v2 dependent roots, one-preference-per-request, and the unconfirmed-message stickiness all line up with the gossip rules. A few correctness gaps are worth fixing before this ships.
Nits: The domain reorder, Automated review by Grok (xAI) · grok-4.7 · custom prompt |
🤖 DeepSeek Code ReviewReviewed the proposer preferences service, builder min-bid, gas-limit, and domain changes. The state machine is clear and the test coverage is thorough. Two issues worth addressing:
Automated review by DeepSeek · deepseek-v4-pro · custom prompt |
Claude, Gemini, Grok and DeepSeek (seventh review): a send whose slot started before its answer left no record, even when the failure was one a node may have taken. Its address was then missing from the block's fee check, and a message signed afresh after a refusal stayed recorded as refused though a node may hold it. Such a send of a message no node was known to hold is now kept as Unconfirmed; one already kept stays as it is. The mock waits before failing too, so a test can have a slot start while the send is in flight. The node now checks for an identical held entry before validate rather than relying on AlreadySeen being validate's first rule, so no rule can refuse a resubmission (Claude, in every round). docs/metrics.md also names nodes on different heads as a steady, expected source of preference failures.
|
/review |
🤖 Codex Code ReviewNo actionable correctness or security findings in the reviewed diff. The signing domain, preference retries, and Gloas builder configuration look consistent with the intended behavior. Tests could not run: rustup attempted a toolchain update but could not write to its read-only temporary directory. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 Claude Code ReviewReview: PR 707 — proposer preferences in the validator clientThis is a substantial, carefully reasoned PR. The domain fix (signing at the proposal epoch's fork version) and the Correctness / interop
Tests
Rust / maintainability
Small nits
Overall this is close to approve. I'd like Items 1 and 6 addressed (or confirmed) before merge. Automated review by Claude · claude-opus-5-5 · custom prompt |
🤖 Gemini Code ReviewThe implementation, fork-boundary domain handling, and end-to-end test coverage look solid. One minor race window in the RPC handler worth tightening:
Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Kimi Code ReviewNo blocking correctness or security issues found. The proposal-epoch signing domain and v2 dependent-root changes are well covered at the Fulu→Gloas boundary. The fallback’s definite-refusal versus unknown-outcome handling is appropriately conservative, and One non-blocking test concern:
The temporary acceptance of legacy beta.2 signature domains is documented and bounded to the fork-boundary compatibility case. Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Grok Code ReviewThe preferences state machine, beta.4 signing domain, and v2 dependent-root alignment look correct and are well tested. Fork choice, justification, finalization, and the STF are untouched. A few issues are worth fixing before this ships.
Smaller notes:
Automated review by Grok (xAI) · grok-4.7 · custom prompt |
🤖 DeepSeek Code ReviewOverall, this is a thorough, heavily tested PR. The preference signing-domain reordering and gossip dedup changes look correct. A few points worth addressing:
Automated review by DeepSeek · deepseek-v4-pro · custom prompt |
Gemini (eighth review): checking for the identical held entry before validate (6760670) opened a window. Gossip can record the same message between that check and validate's AlreadySeen rule, which then refused the submission with a 400. A refused verdict now asks again whether the node holds the identical entry before refusing. Also: - a_late_send_a_node_may_hold_is_kept now has a slot starting two to three seconds in and a node answering after three and a half, so only a two-second stall can break it (Claude, Kimi and Grok: the one-second margins could flake). - A docs/cli.md paragraph is reflowed (Claude).
# Conflicts: # crates/validator/src/beacon_node/fallback.rs # crates/validator/src/beacon_node/http.rs # crates/validator/src/beacon_node/mock.rs # crates/validator/src/http_api/proposer.rs # crates/validator/src/signing.rs
# Conflicts: # crates/validator/src/lib.rs
Brings the validator client work that landed on main (durable EIP-3076 slashing protection #734, its import and export #736, the review follow-ups #789, voluntary exits #779, builder blocks #705 and proposer preferences #707) along with the builder PRs they stack on (#694, #695, #696, #704), the generated node key (#726) and #787, #793. Conflicts resolved by keeping both sides: the engine client's getBlobsV2 timeout next to main's one-attempt getPayload timeout, and their wire tests; nightly's batched block_signature_set next to main's verify_proposer_signature (the blinded block's check); gloas_proposal.rs importing both EventBus and the sync status.
…s limit in validator_definitions.yml (#780) The keymanager API's feerecipient, graffiti and gas_limit routes overrode one validator's settings in memory only, so a restart put every validator back on the command line's defaults. They are now written onto the validator's entry in validator_definitions.yml, in Lighthouse's layout (suggested_fee_recipient, graffiti, gas_limit), before memory changes, and seeded from the file at startup. A re-import keeps an entry's values, an import that enables a disabled entry loads and validates the values it carries, and keystore and password files are flushed before the entry that names them is saved. Resolved against main, which this PR predates (slashing protection #734, #736, #789 and the builder flow #705, #707): - The definitions file is saved through main's write_private_durably, which already flushes the file and its directory, so the PR's own rename plus sync_dir is dropped. The settings routes save through save_definitions, keeping definitions_unflushed accurate, and treat Error::Unflushed as written (memory follows the file, with a warning), as the PR's logged directory flush did. The import seeds the settings in both the Ok and the Unflushed arm and returns main's Overwritten. - write_private and write_private_no_symlink keep the PR's flush, the latter staying public for the node key. - Overrides keeps main's registered() next to the PR's apply(), so seeding and every route still bump the generation the builder registrations cache on. - A gas_limit of zero in the file is refused, as --gas-limit and POST gas_limit refuse it since #707 signs it into proposer preferences. - Main's newer tests build ValidatorDefinition with the three fields as None.
…nd proposer preferences (#694-#707) and the slashing-protection follow-ups (#789), and sign the new messages through the async signing path. - Builder registrations and proposer preferences sign through `sign_under` like every other message, so a remote key's are Web3Signer requests: `VALIDATOR_REGISTRATION` with no `fork_info` (the signer builds the builder domain from its own genesis version), and `PROPOSER_PREFERENCES`, versioned gloas and told the fork at the proposal epoch. `SigningRequest::fork_info` is optional for that. - `RegistrationService::current` decides under the cache's locks, signs the chunk through `sign_all` with every lock released, and writes the cache last. Each chunk still runs on the blocking pool (driven there with `Handle::block_on`), so local signatures stay off the runtime and a chunk stays the unit of failure. `PreferencesService::sign` goes through `sign_all` with no read guard held. - `refresh_epoch` returns `Refreshed { moved, registrable }`. The epoch's full registration send is spawned after the slot's block, beside the subnet subscriptions, so its signer requests never queue ahead of the block's. - `ProducedBlock::header` covers the blinded block, whose header is the full block's. - The validator crate depends on `futures-util` alone: main added it for the same `join_all` this branch took `futures` for.
…s-limit and the keymanager's POST gas_limit refuse it, and correct the --enable-keymanager help text. - `ValidatorDefinition::overrides()` parsed `suggested_fee_recipient` and `graffiti` but passed `gas_limit` through unchecked, so a hand-written `gas_limit: 0` was seeded as that validator's gas limit, at startup and on an import that enables the entry. The command line and the keymanager route both refuse zero: the value goes into builder registrations, and since #707 it is signed into the gloas proposer preferences, which cannot be replaced for their dependent root. It is refused in `overrides()` now, with an error naming the entry and the field, as a malformed fee recipient or graffiti is. Raised in the review of #780, with this check and its test. - `--enable-keymanager`'s help text still said the three settings are held in memory only. It now reads as the flag's row in `docs/cli.md` does.
First gloas step of the builder work: the validator client publishes signed proposer preferences (fee recipient, target gas limit) for its gloas proposals. Stacked on #705.
Why: from gloas, beacon-APIs makes
SignedProposerPreferencesthe source of a proposer's fee recipient and gas limit, supersedingprepare_beacon_proposer. A proposer without preferences also gets no trustless bids: p2p bids for its slot are ignored.What it adds
dependent_rootis the shuffling dependent root the preferences must carry; the duty loop keeps v1. Keeps only duties inside the target epoch, one per slot, so a node's answer cannot make it sign more than an epoch's worth. Signs each own duty whose slot has not started and which not every node holds yet for that(slot, dependent_root). Sends one preference per request to every node, all of a poll's at once (both target epochs' fetches and sends too), so one refusal does not hold back the others and a hung node costs a poll one timeout. A preference only some nodes accepted is re-sent, as first signed, each slot until every node holds it. One every node holds is re-sent once an epoch, at the epoch's second-to-last slot (its last, if a slow node made the client skip that poll), for a node that restarted. A reorg that moves the dependent root re-publishes. With the slot clock, a slot that started while the poll waited is not sent--builder-proposals, as in Lighthouse: from gloas the preferences carry the fee recipient for every proposal. Validators with no fee recipient are skipped, with one warning per epochDOMAIN_PROPOSER_PREFERENCESat the fork version of the proposal epoch, as consensus-specs v1.7.0-beta.4 signs and verifies it, and as Lighthouse, Prysm, Teku, Lodestar and Nimbus do. ethlambda's beacon node also still accepts beta.2's domain (the fork of the epoch before the proposal's), since our fixtures are pinned to beta.2Eth-Consensus-Version--builder-proposals,produceBlockV4's body carries the configuredbuilder_boost_factor, so pooled p2p bids can win on value, and--builder-min-bid(gwei, default0) is sent asmin_bidwith or without it. Without it the factor stays0: the local payload unless it cannot be built, so a node whose execution client fails at the slot may still build on a p2p bid, and the client signs that block, as Lighthouse, Prysm and Teku do (#796 revisits the default)--gas-limit60000000), for registrations before gloas and preferences from it, whichproduceBlockV4builds this client's own payload toward. Not tied to--builder-proposalsethlambda_validator_proposer_preferences_published_total,..._failures_total(sends some node refused or did not answer, re-sends included),..._duty_fetch_failures_total(failed v2 duty fetches). A refusal by every node is warned once per preference, then logged at debug; preferences newly held by only some nodes are warned once per pollKnown limitations
GAS_LIMIT_SCHEDULEis not read, so a default configuration on a chain whose gas limit is not 60M still pulls toward 60M until--gas-limitis set (validator: take the default target gas limit from GAS_LIMIT_SCHEDULE #795). Sepolia and Platåberget schedule 200M, and the docs say to pass--gas-limit 200000000there.Tests
--gas-limitand--builder-min-bidparsing; the fee recipient check's accepted addresses, the proposer's own only; a zero gas limit refused by the keymanager.make lintpasses, as do the validator lib, rpc lib and binary tests. The second-round changes (once-an-epoch re-send, concurrent sends,--gas-limit,--builder-min-bid, the fee recipient check) are not devnet-tested yet.Devnet results
Kurtosis (ethereum-package) with this branch's head (
18a907cf), Lighthouse and Gethglamsterdam-devnet-8, and buildoor as the builder. Fulu from genesis, gloas at epoch 6. Three nodes: Lighthouse alone; ethlambda's validator client on a Lighthouse beacon node (--builder-proposals --prefer-builder-proposals, 40% of stake); ethlambda for both (--builder-proposals). All three stayed on one head through the fork.Works
(slot, dependent_root), 0 failures through ethlambda's beacon node, which validated, pooled and gossiped every preference.0, and the circuit breaker.Fails at the fork boundary
BadSignature, then accepted the same client's epoch-7 and epoch-8 ones. The client retried each refused preference every slot until its slot started (749 failures).Published proposer preferences to gossipsubat info, because the publish error is logged only at debug (swarm_adapter.rs). Possible fixes: re-send the pooled preferences at the fork, or publish the warm-up epoch's preferences closer to it.Together, on a network with Lighthouse, none of our validators had a preference for the first gloas epoch.
Not tested
builder_boost_factorinproduceBlockV4): buildoor's builder was never onboarded (the builder registry was empty on both clients), so there were no bids and every gloas block was self-built. Both beacon nodes accepted the request body.--builder-proposals, the reorg re-publish, and validators with no fee recipient.Found along the way, not from this PR (same on
main)committee_indexfromattestation_dataand sendspayload_attestation_data?slot=, as beacon-APIsmastersays. Lighthouseglamsterdam-devnet-8requirescommittee_indexand serves/payload_attestation_data/{slot}, answering 400 to both. The client on Lighthouse missed every attestation from the fork on: target participation fell from 97% to 58%, and justification stopped.--gas-limit: it registered (and from gloas preferred) 60M unless set per validator through the keymanager. On a 200M chain every builder bid failed the gas-limit check. Added in this PR, since from gloas the preference also steers the node's own payload.getPayloadright afterforkchoiceUpdated), so any bid beats a local build, and boost factors above0cannot be told apart.--builder-min-bidnow sets a floor.glamsterdam-devnet-8's gloas blocks pay the zero address, which our client flags as a fee recipient mismatch.https://claude.ai/code/session_011vghNjfTQmZNRCjPkRs1wP