Repository navigation
Conversation
…deposits churn A legacy deposit is credited to the XMSS key derived from its BLS key, which anyone can deposit for first. It now tops up a validator only if their withdrawal credentials are equal, and a builder only if it names the builder's execution address. Legacy deposits also consume churn, as in the current spec. Follows ethereum/consensus-specs#5937. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
🗒️ Description / Motivation
This follows ethereum/consensus-specs#5937 ahead of its merge.
A legacy deposit (a 48-byte key whose first 16 bytes are not zero) is credited to the XMSS key
keccak256(P ++ 0x00)derived from its BLS keyP.Anyone can compute that key and make a regular deposit for it first:
Pis processed next and finds that validator (or builder).What Changed
stf/epoch/pq.rs,apply_pending_deposit: a legacy deposit for an existing validator whose withdrawal credentials differ from the deposit's is discarded (still removed from the queue).stf/pq.rs,process_builder_deposit_request: a legacy deposit for an existing builder whose execution address differs fromwithdrawal_credentials[12:]is discarded.stf/epoch/pq.rs,process_pending_deposits: legacy deposits no longer skip the churn; this follows the spec's current churn rule (pqhead), where only a deposit for a withdrawn validator is credited without churn.Without it, the same front-run deposit would let anyone top up that active validator with legacy deposits outside the churn.
Correctness / Behavior Guarantees
Tests Added / Run
New tests, mirroring the spec PR's:
a_legacy_deposit_does_not_top_up_a_validator_with_other_credentials: before, FAILED (balance33000000000, expected1000000000); after, ok.a_legacy_builder_deposit_does_not_top_up_a_builder_with_another_address: before, FAILED (balance2000000000, expected1000000000); after, ok.a_legacy_deposit_consumes_churn: before, FAILED (validator created:65validators, expected64); after, ok.a_legacy_deposit_tops_up_a_validator_with_the_same_credentialsanda_legacy_builder_deposit_tops_up_a_builder_with_its_address: ok before and after.Commands:
cargo test -p ethlambda-state-transition --lib -- legacy deposit preregistration: 29 passed, 0 failedcargo clippy -p ethlambda-state-transition --all-targets -- -D warnings: cleancargo fmt -p ethlambda-state-transition -- --check: cleanRelated Issues / PRs
✅ Verification Checklist
make fmt— clean (cargo fmt -p ethlambda-state-transitiononly)make lint(clippy with-D warnings) — clean (ethlambda-state-transitiononly)make test(test-consensusplustest-node, atrelease-fast) — only the filteredethlambda-state-transitiontests above🤖 Generated with Claude Code