forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implements RIP-7728 #2
Open
mralj
wants to merge
28
commits into
master
Choose a base branch
from
core/rip/7728
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[P2] Implements RIP-7728
I decided to implement it this way after trying to integrate code with Arbitrum and having a better understanding of the calls that are made to the NewEvm This approach makes it easier to both override the default config, and to have the option to "not to think about it"
Making rollup-geth easier to sync with both upstream and L2s
This was referenced Oct 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first PR (indicated by P1 as in Part 1) needed to implement RIP-7728.
Purpose of the PR
I've decided to split this implementation into multiple parts (there will probably be two parts)
L1SLOAD
precompile (actual implementation is easy)Notes about "code skeleton" for rollup-precompiles
My current view of the project (
rollup-geth
) is that implementing specific RIPs/EIPs shouldn't be that hard, what I think will be hard is answering (or better said, writing code for) these two questions:geth
changes, it's easy for us to "bring in" those changes to the repoBy easy, I mean most importantly that the process is not error-prone and ofc. that we don't lose too much time on margining/rebasing/whichever strategy we decide on
L2-rollup-geth
wants to "bring in" our code changes, it's easy on themThe definition of "easy" is the same as above
This PR tries to answer both requirements, but just for
precompiles.
That being said, even though we are "only" dealing with precompiles in this PR, the requirements forL1SLOAD
required extending how precompiles work. Specifically, I had to:eth.Client
into the precompiled contractblock.number
is the latest L1 block (not L2(!!!), and op-stack/scroll uses L2 contracts to store this info.Implementation details
The idea was to create new "rollup" files so that we don't have too many changes (preferably just a couple of lines) in files that already exist in the official
geth
(e.g.,vm/evm.go
orvm/contracts.go
) - this is whycontracts_rollup.go
exist.And similarly, to create new files, which would
L2-rollup-geth
forks override -contracts_rollup_overrides.go
. Ideally to change the functionality we are offering, theL2-rollup-geth
would just replace or copy over thecontracts_rollup_overrides.go
file.I need feedback on work so far that's why I'm opening this PR now. I don't think the specific implementation of
L1SLOAD
is that important ATM.If you like the route I'm headed, I'd like to have a similar approach for other "stuff" we touch (e.g.
flags.go
). I don't think it'll be easy/possible to have this approach for everything, but if you agree, I'd like to experiment with it further.Note
I tried to experiment with having a
rollup/
folder (in root) where we could put all our changes, but that doesn't seem feasible:As it is visible from the screenshot this would yield even huger diff; we would have to export private "stuff" from the folders/packages - this would be even messier