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

Implement EIP-663: Unlimited SWAP and DUP instructions #529

Merged
merged 3 commits into from
Dec 13, 2022
Merged

Conversation

rodiazet
Copy link
Collaborator

@rodiazet rodiazet commented Nov 24, 2022

@rodiazet rodiazet requested a review from chfast November 24, 2022 19:47
@chfast chfast requested a review from axic November 24, 2022 19:51
@codecov
Copy link

codecov bot commented Nov 24, 2022

Codecov Report

Merging #529 (2e4634f) into master (6d03f5d) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 2e4634f differs from pull request most recent head 3e0ab0e. Consider uploading reports for the commit 3e0ab0e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #529      +/-   ##
==========================================
+ Coverage   98.03%   98.08%   +0.05%     
==========================================
  Files          59       59              
  Lines        5687     5837     +150     
==========================================
+ Hits         5575     5725     +150     
  Misses        112      112              
Flag Coverage Δ
blockchaintests 76.93% <0.00%> (-1.22%) ⬇️
statetests 72.06% <0.00%> (-0.71%) ⬇️
unittests 91.93% <100.00%> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
lib/evmone/advanced_instructions.cpp 100.00% <ø> (ø)
test/unittests/evm_fixture.hpp 100.00% <ø> (ø)
lib/evmone/instructions.hpp 100.00% <100.00%> (ø)
test/unittests/eof_validation_test.cpp 100.00% <100.00%> (ø)
test/unittests/evm_fixture.cpp 90.90% <100.00%> (+2.02%) ⬆️
test/unittests/evm_test.cpp 100.00% <100.00%> (ø)
test/unittests/instructions_test.cpp 87.50% <100.00%> (+2.20%) ⬆️

@rodiazet rodiazet force-pushed the eip-663 branch 5 times, most recently from a8861e5 to 996d37b Compare November 28, 2022 11:31
@rodiazet rodiazet marked this pull request as ready for review November 28, 2022 11:32
@rodiazet rodiazet force-pushed the eip-663 branch 2 times, most recently from 132aed6 to c2c0237 Compare November 30, 2022 17:56
lib/evmone/instructions.hpp Outdated Show resolved Hide resolved
return nullptr;
}

stack.push(stack[n]);
Copy link
Member

Choose a reason for hiding this comment

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

I think this misses the < 1024 check. push does not seem enforce the 1024 limit.

Copy link
Member

Choose a reason for hiding this comment

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

The stack overflow check is done automatically by the interpreter. This information is in the instruction traits.

@axic axic requested a review from gumb0 December 5, 2022 22:57
lib/evmone/instructions.hpp Outdated Show resolved Hide resolved
EXPECT_STATUS(EVMC_SUCCESS);
EXPECT_OUTPUT_INT(256);

execute(full_stack_code + OP_DUPN + "fe" + OP_DUPN + "ff");
Copy link
Member

Choose a reason for hiding this comment

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

would it overflow with POP as in checks above?

Suggested change
execute(full_stack_code + OP_DUPN + "fe" + OP_DUPN + "ff");
execute(full_stack_code + OP_POP + OP_DUPN + "fe" + OP_DUPN + "ff");

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see OP_POP was needed because of ret_top() in the end

test/unittests/evm_test.cpp Outdated Show resolved Hide resolved
@chfast chfast changed the title EIP 663. DUPN and SWAPN added. Implement EIP-663: Unlimited SWAP and DUP instructions Dec 13, 2022
@rodiazet rodiazet merged commit b6d103b into master Dec 13, 2022
@rodiazet rodiazet deleted the eip-663 branch December 13, 2022 12:27
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.

4 participants