-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
core/{.,state,vm},miner,eth/tracers,tests: implement 7709 with a syscall flag #31036
base: master
Are you sure you want to change the base?
Conversation
a5f88b0
to
eb5b36b
Compare
} | ||
// EIP-2935 / 7709 | ||
blockContext := NewEVMBlockContext(b.header, cm, &b.header.Coinbase) | ||
blockContext.Random = &common.Hash{} // enable post-merge instruction set |
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 is the best way I found to force the rules to accept that this is a merged network, happy to get some input in here.
Co-authored-by: Ignacio Hagopian <[email protected]>
eb5b36b
to
90e5325
Compare
@@ -85,7 +85,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg | |||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil { | |||
ProcessBeaconBlockRoot(*beaconRoot, evm) | |||
} | |||
if p.config.IsPrague(block.Number(), block.Time()) { | |||
if p.config.IsPrague(block.Number(), block.Time()) || p.config.IsVerkle(block.Number(), block.Time()) { |
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.
The p.config.IsPrague
will be true if chain is in Verkle, with the assumption forks are enabled in order.
It's unnecessary to add this condition here.
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.
that is not the case on verkle testnets as long as all of the code has been merged.
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.
Yeah...
It's annoying I agree...
In general, as Felix suggested, we can introduce a flag in the EVM to enable or disable the system call mode. Given that system contract calls have a call frame depth of one (with no internal cascading calls), this approach should be good enough. However, in the future, if we ever introduce some new system contracts which will call some other onchain contracts internally, then we must unset this flag for cascading call frames, otherwise all of them will be skipped for witness inclusion. |
Should be ready now. The basic idea is to just check for the system address as |
Same as #31015 but requires the contract to exist. Not compatible with any verkle testnet up to now.
This adds a
isSytemCall
flag so that it is possible to detect when a system call is executed, so that the code execution and other locations are not added to the witness.