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

Disallow code sections unreachable from section 0 #866

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

hugo-dc
Copy link
Member

@hugo-dc hugo-dc commented Apr 16, 2024

  • Validates the code by using a worklist of accessed code sections
  • At the end if any code section was not accessed will return unreachable_code_sections error.
  • Fixes tests previously containing unreachable code sections

@hugo-dc hugo-dc requested a review from gumb0 April 16, 2024 05:27
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (9b3ee17) to head (e8626d2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #866   +/-   ##
=======================================
  Coverage   98.37%   98.38%           
=======================================
  Files         129      129           
  Lines       15536    15559   +23     
=======================================
+ Hits        15284    15307   +23     
  Misses        252      252           
Flag Coverage Δ
statetests 27.77% <30.00%> (-0.01%) ⬇️
statetests-silkpre 18.78% <0.00%> (-0.04%) ⬇️
unittests 94.18% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
lib/evmone/eof.cpp 86.22% <100.00%> (+0.18%) ⬆️
test/unittests/eof_validation_test.cpp 100.00% <100.00%> (ø)

@hugo-dc hugo-dc force-pushed the disallow-unreachable-cs branch 4 times, most recently from 20da468 to 04a0259 Compare April 16, 2024 07:36
@chfast chfast added the EOF label Apr 16, 2024
lib/evmone/eof.cpp Outdated Show resolved Hide resolved
lib/evmone/eof.cpp Outdated Show resolved Hide resolved
lib/evmone/eof.cpp Outdated Show resolved Hide resolved
lib/evmone/eof.cpp Outdated Show resolved Hide resolved
{
auto code_idx = code_sections_worklist.front();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
auto code_idx = code_sections_worklist.front();
const auto code_idx = code_sections_worklist.front();

@gumb0
Copy link
Member

gumb0 commented Apr 24, 2024

Please rebase

@hugo-dc hugo-dc force-pushed the disallow-unreachable-cs branch 2 times, most recently from f8cc612 to cb00a79 Compare April 25, 2024 17:39
@hugo-dc
Copy link
Member Author

hugo-dc commented Apr 25, 2024

Rebased.

Added a couple of tests for unreachable code sections in subcontainers.

@gumb0 gumb0 merged commit 41cc722 into ethereum:master Apr 26, 2024
23 checks passed
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