Fix test_builder_payment_after_missed_epochs - #5120
Conversation
| # the same state transition. This makes block_1 build on a full parent; by | ||
| # also aligning bid_1.block_hash with latest_execution_payload_bid.block_hash | ||
| # below, block_2 will also see its parent (block_1) as full. | ||
| set_parent_block_full(spec, state) |
There was a problem hiding this comment.
I'm not super familiar with the Python test generators, but isn't this function kind of a hack? Shouldn't it be possible to construct the test state without manually editing the state.latest_block_hash?
E.g. could we construct block_1 with bid.parent_block_hash == state.latest_execution_payload_bid.block_hash, which would trigger apply_parent_execution_payload when block_1 is applied, thus making the block prior to block_1 full?
There was a problem hiding this comment.
Yes that seems possible & less hacky. I'll work on this tomorrow.
There was a problem hiding this comment.
Just pushed 2a6425e. It's slightly less hacky, but this is still pretty hacky:
bid.parent_block_hash = state.latest_execution_payload_bid.block_hash
bid.block_hash = state.latest_execution_payload_bid.block_hashWithout more complex changes to the testing framework, this is necessary right now 🫤
|
Going to merge now so we can generate a full suite of reference tests. We can make this less hacky in the future. |

In #5094, I made a mistake with this test. I mutated the state after yielding it. Not supposed to do that 😅
Thank you @michaelsproul for reporting!
For context: