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

Use code_address member from evmc_message (EVMC 10.0.0-alpha.1) #360

Merged
merged 2 commits into from
Sep 20, 2021

Conversation

yperbasis
Copy link
Member

@yperbasis yperbasis commented Jul 13, 2021

See erigontech/silkworm#286 for the original discussion.

Consensus tests pass with erigontech/silkworm#288.

@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #360 (942ad52) into master (0a80512) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 942ad52 differs from pull request most recent head 873624d. Consider uploading reports for the commit 873624d to get more accurate results

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
- Coverage   99.76%   99.76%   -0.01%     
==========================================
  Files          30       30              
  Lines        4229     4217      -12     
==========================================
- Hits         4219     4207      -12     
  Misses         10       10              
Flag Coverage Δ
consensus 91.71% <100.00%> (+0.02%) ⬆️
unittests 99.76% <100.00%> (-0.01%) ⬇️

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_eip2929_test.cpp 100.00% <100.00%> (ø)
test/unittests/evm_test.cpp 99.71% <0.00%> (-0.01%) ⬇️
lib/evmone/instructions.hpp 100.00% <0.00%> (ø)
test/unittests/instructions_test.cpp
test/unittests/op_table_test.cpp 85.29% <0.00%> (ø)
lib/evmone/baseline.cpp 99.65% <0.00%> (+<0.01%) ⬆️

@yperbasis yperbasis marked this pull request as ready for review September 5, 2021 11:57
@@ -36,7 +36,8 @@ evmc_status_code call(ExecutionState& state) noexcept
msg.kind = Kind;
msg.flags = Static ? uint32_t{EVMC_STATIC} : state.msg->flags;
msg.depth = state.msg->depth + 1;
msg.destination = dst;
msg.destination = (Kind == EVMC_CALL) ? dst : state.msg->destination;
Copy link
Member

Choose a reason for hiding this comment

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

Wait. Shouldn't CALLCODE also use dst? That was one of the broken part about CALLCODE?

Copy link
Member Author

Choose a reason for hiding this comment

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

Message recipient in case of CALLCODE is the same as in case of DELEGATECALL. They differ in message sender.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, this is the address where VALUE goes and where storage is modified... This is still confusing after all these years.

@@ -36,7 +36,8 @@ evmc_status_code call(ExecutionState& state) noexcept
msg.kind = Kind;
msg.flags = Static ? uint32_t{EVMC_STATIC} : state.msg->flags;
msg.depth = state.msg->depth + 1;
msg.destination = dst;
msg.destination = (Kind == EVMC_CALL) ? dst : state.msg->destination;
Copy link
Member

Choose a reason for hiding this comment

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

Ok, this is the address where VALUE goes and where storage is modified... This is still confusing after all these years.

@chfast chfast requested a review from axic September 17, 2021 14:30
@chfast chfast changed the title Add code_address member to evmc_message Use code_address member from evmc_message (EVMC 10.0.0-alpha.1) Sep 17, 2021
@yperbasis
Copy link
Member Author

@chfast Looks good to me.

@chfast chfast merged commit 89bf547 into ethereum:master Sep 20, 2021
@chfast chfast deleted the code_address branch September 20, 2021 12:45
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