Implement `pre.empty_account()`
We do a lot the trick of pre.fund_eoa(amount=0) to signal in a test that we want an account that is guaranteed to be empty (and it's not a precompile or a system contract).
It would be better to have an explicit function like pre.empty_account() that would take no arguments and would always return an empty account in any context.
We would have to add an abstract method here https://github.com/ethereum/execution-spec-tests/blob/eaad0dd4079ce96d00139e7f42d2f4e109017db1/src/ethereum_test_types/types.py#L300
And then an implementation to: https://github.com/ethereum/execution-spec-tests/blob/eaad0dd4079ce96d00139e7f42d2f4e109017db1/src/pytest_plugins/execute/pre_alloc.py#L345 and https://github.com/ethereum/execution-spec-tests/blob/eaad0dd4079ce96d00139e7f42d2f4e109017db1/src/pytest_plugins/filler/pre_alloc.py#L252
@marioevz Can you please assign this issue to me.
@marioevz I followed your suggestion in the issue and added the abstract method empty_account() in types.py. I also implemented it in both execute/pre_alloc.py and filler/pre_alloc.py as instructed.
However, I’m encountering the following error when running the tests using:
uv run fill -k "push0 and delegatecall" tests/shanghai/ -m state_test -v
From what I can tell, it seems like the pre object in the fixture might still be referring to the base Alloc class rather than one of the subclasses where empty_account() is actually implemented.
I’ve looked through the related files, but I might be missing how or where the pre instance is being initialized and how to ensure the correct subclass is used during test execution.
Could you help clarify what I might be doing wrong? I’d also be happy to share the code diff if that would be helpful.
Thanks again for your guidance!
Hi @ArunRawat404 ! Thanks for taking a look at this, I think it would be definitely easier for us to review if you open up a PR, please don't hesitate to do so with this or other ideas in the future, plus it's easier to be picked up by anyone in the team for review other than myself :)
Completed in #1482