Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/cancun/eip4788: Update to use pre-deployed contract #246

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Aug 8, 2023

Updates EIP-4788 tests to use a pre-deployed bytecode instead of the regular pre-compile.

Framework Considerations

A new pre_allocation method is added to the base fork abstract class, which specifies a pre-allocation that must be performed for a given fork.

This method also has a new decorator prefer_transition_to_method, which marks the method so the to-fork implementation of the method takes priority when the method is evaluated.

This is necessary because the pre-allocation cannot be modified at fork transition, so it needs to be present in the genesis if we are transitioning to the given fork that requires this allocation. E.g. Shanghai->Cancun transition fork needs the Cancun pre-allocation of the beacon root bytecode pre-deploy.

EVM Considerations

  • DELEGATECALL and CODECALL no longer work as previously because the target address is not a precompile
  • Using address 0x000000000000000000000000000000000000000b until the mainnet address reaches consensus
  • Gas tests no longer work in current implementation due to gas not being a constant

Fill using: https://github.com/marioevz/go-ethereum/tree/4844-devnet-6-t8n

Copy link
Collaborator

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_multi_block_beacon_root_timestamp_calls is super nice :D

Only one comment but nothing essential, needs a rebase I think as well

src/ethereum_test_tools/common/types.py Outdated Show resolved Hide resolved
tests/cancun/eip4788_beacon_root/conftest.py Show resolved Hide resolved
spencer-tb
spencer-tb approved these changes Aug 10, 2023
@marioevz marioevz marked this pull request as ready for review August 10, 2023 17:06
marioevz and others added 3 commits August 10, 2023 17:14
forks: add beacon root contract to cancun pre allocation
tests/4788: fixes, add more tests

tests/4788: fixes, add blockchain tests

tests/4788: add withdrawals to system and contract addresses

tests/4788: test sending txs directly to the beacon root contract

tests/4788: add fork transition tests
@marioevz marioevz force-pushed the update-4844-to-pre-deployed-contract branch from 50f996b to 35485c2 Compare August 10, 2023 17:17
@marioevz marioevz merged commit efe1d49 into ethereum:main Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants