-
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
Estimate gas chooses wrong instruction set at genesis #29404
Comments
h/t @fselmo for reporting |
For more context, I am trying to set up a geth For now, I'm actually able to hack a way around this to coax the config into no longer raising the Obviously this isn't ideal but it gets me past that and into another situation where the first block won't seal due to So it seems that even when I get around the log when setting INFO [03-29|12:53:45.588] Starting work on payload id=0x023860e15e737afe
TRACE[03-29|12:53:45.588] Engine API request received method=GetPayload id=0x023860e15e737afe
INFO [03-29|12:53:45.589] Updated payload id=0x023860e15e737afe number=1 hash=661826..9c65fd txs=0 withdrawals=0 gas=0 fees=0 root=149cc3..2373b3 elapsed="42.548µs"
TRACE[03-29|12:53:45.589] Engine API request received method=NewPayload number=1 hash=661826..9c65fd
INFO [03-29|12:53:45.589] Stopping work on payload id=0x023860e15e737afe reason=delivery
TRACE[03-29|12:53:45.589] Inserting block without sethead hash=661826..9c65fd number=0x100ca0a80 log when setting INFO [03-29|12:47:50.598] Starting work on payload id=0x0274b8c685c83cd5
TRACE[03-29|12:47:50.598] Engine API request received method=GetPayload id=0x0274b8c685c83cd5
INFO [03-29|12:47:50.598] Updated payload id=0x0274b8c685c83cd5 number=1 hash=f42623..852eec txs=0 withdrawals=0 gas=0 fees=0 root=149cc3..2373b3 elapsed="43.128µs"
INFO [03-29|12:47:50.598] Stopping work on payload id=0x0274b8c685c83cd5 reason=delivery
WARN [03-29|12:47:50.598] Error performing sealing work err="Invalid parameters" |
@lightclient looks like the latest edit: this commit probably helped 😅 |
Correction, when I don't supply However, in current |
Resolved in #29469 . |
@jwasinger I'm still seeing this running against geth
I specify With the |
I opened #29579 that resolves things for me. Perhaps just a better message when difficulty > TTD and we are post-merge at genesis would make for better UX. |
That's weird that master is still broken for you. Trying the example that Matt posted in the issue description of #29404 (comment) works for me. |
hmmm does your genesis specify TTD and difficulty values when you tested? |
Yes, I tested with the default geth dev mode config. Genesis TTD/difficulty are both 0, which I agree seems wrong as this would make the genesis block the last pre-merge block. But post-merge features are activated at genesis, and the withdrawal shim functionality still works so... 🤷♂️ . |
If I use my own genesis I can't set them both to |
The default genesis config for dev mode ( |
Correct but if a custom genesis is used, it enters that validation block where |
Can you link this in the code? And if setting TTD/difficulty to 0 is still breaking with your config, can you post a reproducable example (as this would indicate another bug at this point)? If I |
It's that code block both you and I ended up making the same exact change. I'm almost to my computer and can try to post a quick example. But it actually looks like that whole block is triggered if the DataDir flag is set? Starts at Or you also need the datadir flag and even with the default configuration it would trigger. |
Ah whoops. You are correct, we will fail to start up when a custom dev genesis block is used (https://github.com/ethereum/go-ethereum/blob/master/cmd/utils/flags.go#L1880) . I forgot to switch my branch from #29566 .. |
Yep, that's the spot. At my computer now, should we continue the conversation in #29579? |
Bug
Culprit
We determine
random
value based on ifdifficulty
is set:go-ethereum/core/evm.go
Lines 62 to 64 in a382917
But then here we use it as
isMerge
for creating the chain rules.go-ethereum/core/vm/evm.go
Line 148 in a382917
The chain rules then dictate the instruction set, so we choose London instructions instead of Shanghai.
Resolution
I guess the main question is should we support this behavior. Is the genesis block technically considered post-merge? A simple fix would be to change the value that goes into
Rules(..)
to beblockCtx.Random != nil || chainConfig.TerminalTotalDifficultyPassed
. But this doesn't feel too great either.The text was updated successfully, but these errors were encountered: