execution-spec-tests icon indicating copy to clipboard operation
execution-spec-tests copied to clipboard

refactor: update addresses used in tests

Open enitrat opened this issue 1 year ago • 4 comments

🗒️ Description

RIP precompiles will use addresses starting from 0x100. As such, and to make the ethereum execution spec tests re-usable by EVM rollups teams, I propose to bump the addresses 0x100 used in tests to something else - in this case, 0x1000. This allows rollup teams to benefit from the test coverage of ethereum, while innovating on new features.

🔗 Related Issues

Fixes #552

✅ Checklist

  • [x] All: Set appropriate labels for the changes.
  • [x] All: Considered squashing commits to improve commit history.
  • [x] All: Added an entry to CHANGELOG.md.
  • [x] All: Considered updating the online docs in the ./docs/ directory.
  • [x] Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • [ ] Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • [ ] Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

enitrat avatar May 14 '24 12:05 enitrat

The address range used by rollups is between 0x000 and 0xFFF? I would love for rollups to get use from the tests here.

I think we could optionally add something into to the framework, where addresses that dont fit within that range are bumped. Although that might be tricky.

We could add an error check if a test uses an address that fits within that range nonetheless.

spencer-tb avatar May 16 '24 05:05 spencer-tb

Hi @spencer-tb, as per https://eips.ethereum.org/EIPS/eip-7587

The address range between 0x0000000000000000000000000000000000000100 and 0x00000000000000000000000000000000000001ff is reserved for use by the RIP process.

At Kakarot we are extensively using ethereum/tests for our zkevm, and we recently implement RIP7212, a secp256r1 signature verification available at address 0x100. This caused conflicts with some existing tests, so I bumped all the addresses in the range 0x100-0x1ff and re-filled the fixtures, so that we can keep our test coverage - and it worked very well!

I also refilled the legacy (non-python) tests, you can check here for more info: https://github.com/kkrt-labs/tests

enitrat avatar May 16 '24 07:05 enitrat

Hi, I think https://github.com/ethereum/execution-spec-tests/pull/584 is the beginning to make a solid foundation to prevent this from ever being an issue again.

All tests written with the new convention should start from 0x1000 but, adding to that, this start address is now even configurable so rollups could do:

fill -n auto --test-contract-start-address 0x1000000000000000000 --test-contract-address-increments 0x1000000000000000000

to specify from which address the test contracts should be defined.

The PR does not update all contract addresses, but we will start the refactor effort for the rest of the tests in the following weeks.

marioevz avatar May 31 '24 22:05 marioevz

Hi ! Indeed this was just a quick fix, a more robust and customizable solution is definitely the right approach - especially now that rollups will start innovating and use different specific ranges of reserved addresses.

This is just a "quick fix", let me know if you want this to get merged or simply wait for the full refactor.

enitrat avatar Jun 01 '24 10:06 enitrat

@marioevz shall this be updated with eoa generator ?

winsvega avatar Apr 07 '25 11:04 winsvega

I think it can be closed due to #584

spencer-tb avatar Apr 07 '25 12:04 spencer-tb

Closing due to fix implemented in #584.

marioevz avatar May 02 '25 19:05 marioevz