Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Nov 21, 2024

It's a subsequent pull request after the #30745 , removing some unnecessary parameters.

@@ -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 {
Copy link
Contributor

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.

Suggested change
if err := sim.sanitizeCall(&call, tracingStateDB, header, blockContext, &gasUsed); err != nil {
if err := sim.sanitizeCall(&call, sim.state, header, blockContext, &gasUsed); err != nil {

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the change

Copy link

@Pjrich1313 Pjrich1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fork then Merge

@rjl493456442 rjl493456442 added this to the 1.14.13 milestone Nov 21, 2024
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants