-
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
transaction pool optimizations #21328
Conversation
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
txs := list.Flatten() // Heavy but will be cached and is needed by the miner anyway | ||
pool.pendingNonces.set(addr, txs[len(txs)-1].Nonce()+1) | ||
highestPending := list.LastElement() | ||
pool.pendingNonces.set(addr, highestPending.Nonce()+1) |
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.
Why not use one line
pool.pendingNonces.set(addr, list.LastElement().Nonce()+1)
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.
Yeah, that would be fine too. As it is, it's more obvious for a reader that we're getting the highest nonce:d transaction, so it's a bit simpler to understand what's happening. I don't see any compelling reason to change it now
* core: added local tx pool test case * core, crypto: various allocation savings regarding tx handling * core/txlist, txpool: save a reheap operation, avoid some bigint allocs Co-authored-by: Marius van der Wijden <[email protected]>
* core: added local tx pool test case * core, crypto: various allocation savings regarding tx handling * core/txlist, txpool: save a reheap operation, avoid some bigint allocs Co-authored-by: Marius van der Wijden <[email protected]>
This PR contains some of the commits from the (now reverted) #21232 , leaving out the erroneous conversions to
uint64