-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: improve randomize_state field coverage for fork transition testing #4594
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
base: master
Are you sure you want to change the base?
feat: improve randomize_state field coverage for fork transition testing #4594
Conversation
a20cf1d
to
a2b434a
Compare
@jtraglia, do you think it is necessary to populate the fields for previous forks? |
Yes, it would be valuable to do this. Please complete the TODO items you've stated in the functions. Sorry I just haven't had enough time to properly review your PR. Given that this change will affect lots tests for several forks, it will require a more extensive review. In the mean time, I've started the CI checks for this. I would like for @leolara to review it too. He's in charge of testing here. |
5c00326
to
537e0d0
Compare
Hi @leolara, what are your thoughts? |
|
||
def _randomize_phase0_fields(spec, state): | ||
"""Set Phase0-specific fields to realistic non-default values.""" | ||
if is_post_altair(spec): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardgreg I think this ìf` either should not be here or throw an exception. Like it should not be allowed to call this function in the phase that is not supposed to be used. I search our code base and there are no examples like this, I think.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, Leo. It's a counterproductive measure
@richardgreg the reftests are failing in this branch: https://github.com/ethereum/consensus-specs/actions/runs/18327061427/job/52193981595 |
741a30e
to
1f7da1b
Compare
@richardgreg let me know if I should try to run the tests again |
* Add Electra churn field randomization * Add withdrawal field randomization for Capella+ forks * Add finality checkpoint randomization with safety checks * Add pending operations randomization * Randomize fields for all forks transitioning from phase0 to Electra
1f7da1b
to
ca9f91e
Compare
@leolara sure. You can go ahead and do it. My branch is up-to-date and it generates the reftests locally. I'm hoping that will fix any conflict arising in the CI |
feat: improve
randomize_state
field coverage for fork transition testingDescription
randomize_state
function to populate beacon state fields with realistic non-default values during testing.bugs because 0 == 0 assertions still pass, as demonstrated in the issue description with the Teku client. By using realistic test values, missing field copies now cause test failures
randomize_state
field population now extended to all forksRelations
Fixes #4535
Co-authored by Claude