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

Reject DELEGATECALL EOF → legacy #588

Merged
merged 1 commit into from
Jun 19, 2023
Merged

Reject DELEGATECALL EOF → legacy #588

merged 1 commit into from
Jun 19, 2023

Conversation

axic
Copy link
Member

@axic axic commented Mar 18, 2023

The code targeted by DELEGATECALL from an EOF must also be an EOF.
This restriction has been added to EIP-3540 in
ethereum/EIPs#7131.

@axic axic force-pushed the eof-delegatecall branch 2 times, most recently from 5fe2694 to 5506519 Compare March 21, 2023 12:54
@axic
Copy link
Member Author

axic commented Mar 21, 2023

@chfast @gumb0 any feedback on the direction (before I start adding tests / more code)?

Copy link
Member

@chfast chfast left a comment

Choose a reason for hiding this comment

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

Looks good in general.

I think we should do an experiment to pass "EOF mode" flag instead of checking code prefix in many places. But this can be done after this PR to asses full impact of the re-design.

test/state/host.cpp Outdated Show resolved Hide resolved
test/state/host.cpp Outdated Show resolved Hide resolved
@axic axic changed the base branch from eof2-extcode to master March 22, 2023 09:23
@axic axic added the EOF label Mar 22, 2023
test/state/host.cpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Merging #588 (3fad1cb) into master (1f8823e) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 3fad1cb differs from pull request most recent head 7fe279e. Consider uploading reports for the commit 7fe279e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #588      +/-   ##
==========================================
- Coverage   97.39%   97.34%   -0.05%     
==========================================
  Files          80       81       +1     
  Lines        7973     7770     -203     
==========================================
- Hits         7765     7564     -201     
+ Misses        208      206       -2     
Flag Coverage Δ
blockchaintests 64.04% <25.00%> (+0.97%) ⬆️
statetests 74.60% <100.00%> (+0.59%) ⬆️
unittests 94.85% <100.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/evmone/instructions_calls.cpp 100.00% <100.00%> (ø)
test/unittests/evm_eof_calls_test.cpp 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

test/state/host.cpp Outdated Show resolved Hide resolved
test/state/host.cpp Outdated Show resolved Hide resolved
@chfast chfast self-assigned this May 16, 2023
@chfast chfast marked this pull request as ready for review May 17, 2023 20:56
@chfast chfast changed the title host: Reject DELEGATECALL crossing EOF<>legacy boundary Reject DELEGATECALL EOF → legacy May 18, 2023
@chfast chfast requested a review from gumb0 May 18, 2023 09:35
@chfast chfast force-pushed the eof-delegatecall branch 2 times, most recently from 95c5401 to 4af57c8 Compare June 19, 2023 09:05
The code targeted by DELEGATECALL from an EOF must also be an EOF.
This restriction has been added to EIP-3540 in
ethereum/EIPs#7131.
@chfast chfast merged commit 94a948f into master Jun 19, 2023
@chfast chfast deleted the eof-delegatecall branch June 19, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants