Add random execution_payload_header to Bellatrix state in tests#4047
Add random execution_payload_header to Bellatrix state in tests#4047KatyaRyazantseva wants to merge 10 commits intoethereum:devfrom
execution_payload_header to Bellatrix state in tests#4047Conversation
|
Hey Katya. I've pulled some updates to the Makefile into your branch. Please run |
97a7e5e to
e9c9a0a
Compare
|
|
||
|
|
||
| def build_randomized_execution_payload(spec, state, rng): | ||
| from eth2spec.test.helpers.random import exit_random_validators |
There was a problem hiding this comment.
@jtraglia I have a circular import error when I put the import at the beginning. Is there a way to avoid it here?
There was a problem hiding this comment.
Hey @KatyaRyazantseva. We shouldn't actually need this import. exit_random_validators mutates the input state and I don't believe we should do that. We can simply rely on get_expected_withdrawals for withdrawals. Given a random state for Capella+, there should (in theory) be some exited validators, which would cause there to be withdrawals.
Also, when building the randomized execution payload header, we can/should re-use the fields from the random execution payload we just built. Then all we need to do is fill in transactions_root and withdrawals_root which is relatively easy. I've pushed a commit for this.
One more thing, I haven't thoroughly checked these randomized payload to ensure they make sense. But this should be enough to unblock you.
|
Hey @KatyaRyazantseva I'm going to close this PR. If you decide to pick this up again in the future, please reopen. |
This PR adds random
execution_payload_headerto random Bellatrix state in tests