Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Add a test for processing multiple deposits within the same epoch for a given validator #6632

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

bshastry
Copy link

Issue Addressed

ethereum/consensus-specs#4021

Proposed Changes

The idea is to create pre/post electra tests that do the following

  • create a deposit in block N, epoch E for validator X
  • create another deposit in block N + 3, epoch E for validator X
  • assert that the balance of the validator after processing the deposits in the epoch equals expectation

Additional Info

The test case pre electra works. I have not been able to correctly model state transition to electra (this test currently panics due to the mock execution layer not being able to provide a valid payload), so help there would be appreciated. I have hence maked this PR, draft.

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2024

CLA assistant check
All committers have signed the CLA.

@bshastry bshastry force-pushed the cons_spec_issue_4021 branch 2 times, most recently from 2edcb5e to 37d5404 Compare December 2, 2024 08:35
@bshastry bshastry marked this pull request as ready for review December 9, 2024 08:37
@bshastry
Copy link
Author

This PR is waiting on CI workflow approval I think

@bshastry bshastry force-pushed the cons_spec_issue_4021 branch from 37d5404 to 30fe8c1 Compare December 12, 2024 11:01
@michaelsproul michaelsproul added test improvement Improve tests electra Required for the Electra/Prague fork ready-for-review The code is ready for review labels Dec 13, 2024
@bshastry
Copy link
Author

The test case for Electra fails because I don't know how to process deposit requests, can you please guide me?

per_block_processing::tests::test_multiple_deposits_same_validator_same_epoch_post_electra ---
thread 'per_block_processing::tests::test_multiple_deposits_same_validator_same_epoch_post_electra' panicked at consensus/state_processing/src/per_block_processing/tests.rs:1322:5:
Found the following validation errors:
Validator 1 balance is 32001788855 gwei, expected 34001788855 gwei (initial: 32001788855 + deposits: 2000000000)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electra Required for the Electra/Prague fork ready-for-review The code is ready for review test improvement Improve tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants