-
Notifications
You must be signed in to change notification settings - Fork 756
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-2315: subroutines #754
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
There are ongoing revisions to EIP-2315 at eips/2676 Proposed changes in gas costs to
ethereum/tests 693 updates the tests for these values [EDIT: addressed in eb77f6a] |
Let's move forward here a bit. The temporary Yolo testnet - also https://yolonet.xyz for the status - is out and people will start testing their stuff against For past hardforks we followed the procedure that we at some point activated a new HF in the supportedHardfork list and marked as I would suggest that we directly activate Somewhat independently from the release decision we can update here on
Hope I didn't forget anything. 😄 |
Have gone through the list as suggested but am not sure I've enabled everything correctly 😄
I did get the
|
Looking at this again, it seems |
@cgewecke Thanks, nice! 😄 The tests haven't been regenerated for Berlin yet, so this is why only the small subset of subroutine tests are running. |
Ah! I guess will wait here for ethereum/test 692 and update when the name is finalized / the tests are regenerated. [Edit - actually I'm not sure what's right]. Think the only logic thing left is make the tester's default fork Berlin and map its alias correctly. |
Rebased this and did the following changes along:
|
Blockchain tests will need the update from #815 to work properly. |
Rebased this on top of #815 |
@holgerd77 for the |
… HF opcode section in opcodes.ts
…pcodes are now preselected on a HF basis in opcodes.ts)
Ok, my local > ts-node ./tests/tester --state "--fork=Berlin" "--dir=stSubroutine"
+--------------------------------------------------+
| VM -> GeneralStateTests |
| |
| TestGetterArgs |
| skipTests : 54 |
| forkConfig : Berlin |
| dir : stSubroutine |
| |
| RunnerArgs |
| forkConfigVM : berlin |
| forkConfigTestSuite : Berlin |
+--------------------------------------------------+
TAP version 13
# GeneralStateTests
# file: beginSubAtEndOfCode test: beginSubAtEndOfCode
ok 1 the state roots should match
# file: shouldErrorWhenExecuteBeginSub test: shouldErrorWhenExecuteBeginSub
ok 2 the state roots should match
# file: shouldErrorWhenJumpToJumpDest test: shouldErrorWhenJumpToJumpDest
ok 3 the state roots should match
# file: shouldErrorWhenReturnStackGrowsAbove1023 test: shouldErrorWhenReturnStackGrowsAbove1023
ok 4 the state roots should match
# file: shouldErrorWhenSubroutineEnteredViaBeginSub test: shouldErrorWhenSubroutineEnteredViaBeginSub
ok 5 the state roots should match
# file: shouldSucceedWhenReturnStackGrowsUntil1023 test: shouldSucceedWhenReturnStackGrowsUntil1023
ok 6 the state roots should match
# file: simpleSubroutine test: simpleSubroutine
ok 7 the state roots should match
# file: subroutineAtEndOfCode test: subroutineAtEndOfCode
ok 8 the state roots should match
# file: subroutineInvalidJump test: subroutineInvalidJump
ok 9 the state roots should match
# file: subroutineShallowReturnStack test: subroutineShallowReturnStack
ok 10 the state roots should match
# file: twoLevelsSubroutines test: twoLevelsSubroutines
ok 11 the state roots should match
1..11
# tests 11
# pass 11
# ok Have also given the last code missing in Will give this a merge now, maybe @jochem-brouwer can do the final test activation along the finalization of #785 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now.
#737
Implements EIP-2315 which introduces three new opcodes and a subroutine "return stack" to help separate control flow logic from computational operations on the main VM stack. This provides some efficiency benefits and is convenient for static analysis tools that require clear control flow semantics.
A detailed analysis of the EIP can be found at ethereum-magicians here
(In draft pending updates to the ethereum tests (and common Berlin hardfork opcodes?))