Skip to content

Make EIP-7934 tests fork agnostic #1972

@fselmo

Description

@fselmo

Right now, our EIP-7934 tests use a "template" blank block to assess some base RLP size before filling this block with enough data to reach exactly the RLP limit - using mostly some large data transactions and then finding the exact fit for the last transaction to reach the exact block rlp limit. This test was created in a rather quick fashion because we needed something accurate for Berlinterop, but it needs to be flexible enough to account for new forks introducing new fields to the block header / body.

Adding new fields to block header, or the block body, changes the block rlp size and thus this static template needs to have the added flexibility of changing with respect to the fork it is being tested for. We need to come up with a good way to make this test dynamic enough to account for all forks as these tests are currently turned off in Amsterdam tests, for example in BALs testing (EIP-7928) (see here).


One approach we could try is to "ping" the t8n tool for an empty block and use this as the template instead. What I mean by this is if we could get an empty block at the setup of the test, to build on top of, we wouldn't need to create a static block and we could then calculate the RLP from a block that is representative of the current fork.

edit: Revising the above approach. This could be handled with less complexity if the Fork (fork fixture) can create an empty block based on the fields it supports, with defaults. The implementation can then be to call fork.build_empty_block(), or something like this, and use this as the base from which to measure the RLP and build from. This would be fork agnostic and would allow for execute support as it's not relying on t8n for the block RLP base.


We may still have to make some fields more predictable by zeroing them out or assigning static values to them to guarantee that the block fields don't change. Certain things like hashes will always be the same size, but even the timestamp can affect the resulting RLP by 1 byte or so.

Metadata

Metadata

Assignees

Labels

A-test-testsArea: tests for packages/testingC-bugCategory: this is a bug, deviation, or other problem

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions