ethereum / evmone

Fast Ethereum Virtual Machine implementation
Apache License 2.0
864 stars 286 forks source link

Refactor Host::execute_message() to allow CALLs with recipient != code_address #1008

Closed gumb0 closed 2 months ago

gumb0 commented 2 months ago

This is needed to prepare for EIP-7702 https://github.com/ethereum/evmone/pull/961

The main goal is to get rid of assertion that requires recipient == code_address in case kind == EVMC_CALL. (In 7702 world CALL can have code_address pointing to a different (delegate) address.)

The idea is to split a variable dst_acc that was containing either recepient or code_address account into two separate variables for each thing.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.98%. Comparing base (01eca77) to head (7406bac). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1008 +/- ## ======================================= Coverage 93.98% 93.98% ======================================= Files 147 147 Lines 15586 15588 +2 ======================================= + Hits 14649 14651 +2 Misses 937 937 ``` | [Flag](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | Coverage Δ | | |---|---|---| | [eof_execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `17.55% <100.00%> (+0.01%)` | :arrow_up: | | [ethereum_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `27.72% <100.00%> (+<0.01%)` | :arrow_up: | | [ethereum_tests_silkpre](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `19.47% <100.00%> (+0.01%)` | :arrow_up: | | [execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `19.45% <100.00%> (+0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/ethereum/evmone/pull/1008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `88.96% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/ethereum/evmone/pull/1008?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | Coverage Δ | | |---|---|---| | [test/state/host.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/1008?src=pr&el=tree&filepath=test%2Fstate%2Fhost.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9ob3N0LmNwcA==) | `100.00% <100.00%> (ø)` | |