-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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, eth, internal, miner: remove unnecessary parameters #30776
base: master
Are you sure you want to change the base?
Conversation
internal/ethapi/simulate.go
Outdated
@@ -200,7 +200,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header, | |||
if err := ctx.Err(); err != nil { | |||
return nil, nil, err | |||
} | |||
if err := sim.sanitizeCall(&call, sim.state, header, blockContext, &gasUsed); err != nil { | |||
if err := sim.sanitizeCall(&call, tracingStateDB, header, blockContext, &gasUsed); err != nil { |
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 a change in semantics. I think this is wrong, the sanitizeCall
is only used for setting nonce if unset:
nonce := state.GetNonce(call.from())
call.Nonce = (*hexutil.Uint64)(&nonce)
I don't think we should use the hooked state for that.
if err := sim.sanitizeCall(&call, tracingStateDB, header, blockContext, &gasUsed); err != nil { | |
if err := sim.sanitizeCall(&call, sim.state, header, blockContext, &gasUsed); err != nil { |
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.
Hm, actually, sanitizeCall
is only called from one location (here), you could just do the nonce-check outside, and skip passing the state along
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.
I reverted the change
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.
Fork then Merge
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.
LGTM
It's a subsequent pull request after the #30745 , removing some unnecessary parameters.