-
Notifications
You must be signed in to change notification settings - Fork 20k
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
cmd/evm: fix evm basefee #30281
Merged
Merged
cmd/evm: fix evm basefee #30281
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
holiman
requested review from
MariusVanDerWijden and
lightclient
as code owners
August 8, 2024 13:58
holiman
force-pushed
the
fix_evm_basefee
branch
from
August 8, 2024 14:00
2a6895f
to
f26ee59
Compare
lightclient
approved these changes
Aug 8, 2024
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.
Was able to replicate the issue and verify this fix works.
$ go run ./cmd/evm --debug --gas 0xffffff --nomemory=false --json --code 4860005260406000f3 --prestate ./genesis.json run
INFO [08-08|08:34:17.491] Persisted trie from memory database nodes=35 size=4.99KiB time="37.75µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=0 livesize=0.00B
{"pc":0,"op":72,"gas":"0x23f3e20","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"BASEFEE"}
{"pc":1,"op":96,"gas":"0x23f3e1e","gasCost":"0x3","memSize":0,"stack":["0x3b9aca00"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":3,"op":82,"gas":"0x23f3e1b","gasCost":"0x6","memSize":0,"stack":["0x3b9aca00","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}
{"pc":4,"op":96,"gas":"0x23f3e15","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000003b9aca00","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":6,"op":96,"gas":"0x23f3e12","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000003b9aca00","memSize":32,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":8,"op":243,"gas":"0x23f3e0f","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000003b9aca00","memSize":32,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"RETURN"}
{"output":"000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000","gasUsed":"0x14"}
#### LOGS ####
$ git pr 30281 upstream
$ go run ./cmd/evm --debug --gas 0xffffff --nomemory=false --json --code 4860005260406000f3 --prestate ./genesis.json run
INFO [08-08|08:35:05.186] Persisted trie from memory database nodes=35 size=4.99KiB time="40.167µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=0 livesize=0.00B
{"pc":0,"op":72,"gas":"0x23f3e20","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"BASEFEE"}
{"pc":1,"op":96,"gas":"0x23f3e1e","gasCost":"0x3","memSize":0,"stack":["0x7"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":3,"op":82,"gas":"0x23f3e1b","gasCost":"0x6","memSize":0,"stack":["0x7","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}
{"pc":4,"op":96,"gas":"0x23f3e15","gasCost":"0x3","memory":"0x0000000000000000000000000000000000000000000000000000000000000007","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":6,"op":96,"gas":"0x23f3e12","gasCost":"0x3","memory":"0x0000000000000000000000000000000000000000000000000000000000000007","memSize":32,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":8,"op":243,"gas":"0x23f3e0f","gasCost":"0x3","memory":"0x0000000000000000000000000000000000000000000000000000000000000007","memSize":32,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"RETURN"}
{"output":"00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000","gasUsed":"0x14"}
#### LOGS ####
rjl493456442
pushed a commit
to rjl493456442/go-ethereum
that referenced
this pull request
Aug 13, 2024
fixes ethereum#30279 -- previously we did not use the basefee from the genesis, and instead the defaults were used from `runtime.go/setDefaults`-function
leeren
pushed a commit
to storyprotocol/story-geth
that referenced
this pull request
Aug 16, 2024
fixes ethereum#30279 -- previously we did not use the basefee from the genesis, and instead the defaults were used from `runtime.go/setDefaults`-function
Pyaepyae-art
approved these changes
Aug 19, 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 PR fixes #30279
We did not use the basefee from the genesis, and instead the defaults were used from
runtime.go/setDefaults
-functionThat method will still be used if it's not provided in genesis.
With this PR