core: more efficient nonce-update in txpool#22231
Merged
Merged
Conversation
Contributor
Author
|
Pushed a fix to make the benchmarks call the |
Member
|
@holiman this looks pretty good, should we rebase and merge it? |
Benchmark the speed of transaction insertion under multiple accounts core: fix rebase issues + docstring core: make benchmark test use sync:ed method
Contributor
Author
|
@MariusVanDerWijden yes, I'd almost forgotten about this. Rebased, ptal |
karalabe
reviewed
Nov 2, 2021
| } | ||
|
|
||
| // resetAll sets the nonces for all accounts to the given map. | ||
| func (txn *txNoncer) resetAll(all map[common.Address]uint64) { |
Member
There was a problem hiding this comment.
Perhaps call it setAll, since it doesn't really reset it.
karalabe
reviewed
Nov 2, 2021
| pool.priced.SetBaseFee(pendingBaseFee) | ||
| } | ||
| // Update all accounts to the latest known pending nonce | ||
| nonces := make(map[common.Address]uint64) |
Member
There was a problem hiding this comment.
If we want to ensure allocs are low, add len(pool.pending) to the end of the map make
Member
|
Pls add the allocs to the benchmark, just as sanity |
fjl
approved these changes
Nov 2, 2021
Contributor
fjl
left a comment
There was a problem hiding this comment.
I think this is OK, and may even resolve some consistency bugs in nonce management.
Contributor
Author
|
sidhujag
pushed a commit
to syscoin/go-ethereum
that referenced
this pull request
Nov 3, 2021
* Adjust pending nonce update operation Benchmark the speed of transaction insertion under multiple accounts core: fix rebase issues + docstring core: make benchmark test use sync:ed method * core: address review comments * core: add memreport to benchmark Co-authored-by: WeiLoy <wei_loy@163.com>
This was referenced Sep 23, 2022
yongjun925
pushed a commit
to DODOEX/go-ethereum
that referenced
this pull request
Dec 3, 2022
* Adjust pending nonce update operation Benchmark the speed of transaction insertion under multiple accounts core: fix rebase issues + docstring core: make benchmark test use sync:ed method * core: address review comments * core: add memreport to benchmark Co-authored-by: WeiLoy <wei_loy@163.com>
19 tasks
This file contains hidden or 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
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 supersedes #21164 by @WeiLoy . The original PR was based off a fork of geth but on
master, and I was not able to push the rebased + fixed version onto amasterbranch.I believe that the original implementation by @WeiLoy was correct, but it had been a bit bitrotted, the PR is quite old.
Here are the benchmarks compared to current master: