[WIP]Implement simple subroutine opcodes
What was wrong?
EIP 2315 introduces three new opcodes (BEGINSUB, JUMPSUB, ENDSUB) which deal with subroutines and needed to be implemented.
How was it fixed?
The opcodes were implemented.
Also, while installing py-evm on a Mac during the project, I noticed that the doc page contributing.rst didn't include a step without which py-evm couldn't be installed on the system. I have fixed the doc accordingly.
Finally, this also implements the code at #1933 as a basis for the Berlin VM.
Fixes #1926
To-Do
-
[x] Implement logic in eth/vm/logic
-
[x] Write tests
Cute Animal Picture
(https://images.pexels.com/photos/146083/pexels-photo-146083.jpeg)
@cburgdorf since you started taking a look at Berlin already, do you mind coordinating this review?
since you started taking a look at Berlin already, do you mind coordinating this review?
@carver yep, will do.
@Peppece thanks for kicking this off!
I think you could rebase this on top of #1933. This will already give you the basic scaffolding for the Berlin fork including the BerlinVM which you'll need in test_opcodes.py
I just wanted to know if the mantainers think the changes I made up to this point conform to the style of the project
Yep, so far so good :+1:
I also wanted to ask if it was a good idea to create another file inside of the logic directory to implement the logic for the opcodes.
I think the implementation of the new opcodes should go into /eth/vm/logic/flow.py
@cburgdorf Awesome! So how do I rebase things on #1933? Do I just copy + paste the code in my branch or is there some git fu I'm missing?
You can either add my branch as a remote and pull it down or you edit your .git/config to always pull down PRs (makes your life much easier).
Then you can simple do:
git fetch origin
git rebase origin/pr/1933
Do I just copy + paste the code in my branch or is there some git fu I'm missing?
Just in case: after you pull down the other PR, you would literally git rebase on top of it. (then git push -f) -- notice that these are destructive, and can cause you to lose code, especially if you're still getting comfortable with this tools.
If you're worried about that, you might want to save a reference to your starting point. I still occasionally find myself doing a:
git branch copy-of-branch
git rebase some-branch-i-want-to-add-my-changes-on-top-of
# tool around, write some more code, test it
# take a look around, realize I hate it, decide to blow all changes away since the git branch above
git reset --hard copy-of-branch
Hey @Peppece just wanted to hear how things are going? Are you still working on this?
Hey @Peppece just wanted to hear how things are going? Are you still working on this?
Hey @cburgdorf I was working on this while a school deadline blocked me and I had to focus on that. However, in max 3 days I’ll be back on this.
@Peppece Sounds good!
I only noticed your review now. Will get back to work on this ASAP.
It's probably a good idea to rebase against the latest master, to minimize conflicts for yourself.
Hello! Is there a particular reason this isn't getting merged? Feel like it has been stuck for a while now.
Just a heads up that EIP-2315 was pulled from Berlin, so... I guess it makes sense to pause work on this. Sorry friend :/
Just a heads up that EIP-2315 was pulled from Berlin, so... I guess it makes sense to pause work on this. Sorry friend :/
Wow, didn't see this coming. How is this possible? I mean, hasn't this already been implemented for geth and besu?
@Peppece Yes, it was pulled last minute which is something you wouldn't normaly expect to happen. You may want to read up on the history here: https://github.com/ethereum/pm/issues/263
This doesn't mean your work was for nothing though. There's a chance that the concerns may be addressed and the EIP gets updated / replaced and ships in some other form in an upcoming fork. Sorry, for the disappointing news :/