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

eth/gasprice: avoid modifying TestChainConfig #23204

Merged
merged 5 commits into from
Oct 10, 2021

Conversation

aaronbuchwald
Copy link
Contributor

This PR cleans up a no-op in the gasprice unit tests where a variable is overwritten in a conditional checking if it is nil or not, but the conditional is not necessary. In one branch, there is additionally a signer object that is overwritten, which will be identical to the one created and overwritten directly above it.

} else {
gspec.Config.LondonBlock = nil
}
gspec.Config.LondonBlock = londonBlock
Copy link
Contributor

@fjl fjl Jul 14, 2021

Choose a reason for hiding this comment

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

I also found it non-obvious in the original PR where this conditional got introduced.

With your change, the assignment of signer gets lost. This changes the outcome
because LatestSigner may choose another signer type if London is enabled.

Both your version and the original version have another issue: params.TestChainConfig
is modified without copying it first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I didn't realize this. Would it make sense to copy the config, modify the LondonBlock, and then create the signer to remove the no-op here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that would be better.

@fjl fjl changed the title Cleanup no-op in gasprice test eth/gasprice: avoid modifying TestChainConfig Aug 25, 2021
@fjl fjl self-assigned this Oct 10, 2021
@fjl fjl merged commit bcbd700 into ethereum:master Oct 10, 2021
@fjl fjl added this to the 1.10.10 milestone Oct 10, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Oct 11, 2021
Co-authored-by: Felix Lange <fjl@twurst.com>
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
Co-authored-by: Felix Lange <fjl@twurst.com>
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request May 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request May 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 10, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 11, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 11, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 13, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 13, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 13, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 13, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 13, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 14, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 18, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 18, 2024
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.

None yet

2 participants