Skip to content

Backport TxPool limits to release/1.4 #3116

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

Merged
merged 7 commits into from
Oct 10, 2016
Merged

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Oct 10, 2016

This backports the changes from #2742.

@GitCop
Copy link

GitCop commented Oct 10, 2016

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: df64a9f
    • Commit subjects should be kept under 80 characters
  • Commit: ff697e8
    • Commit subjects should be kept under 80 characters

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

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.

A few stray comments

var drops types.Transactions

sort.Sort(*m.index)
for size := len(m.items); size > threshold; size-- {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm probably wrong, but it looks like it would be possible to remove all extraneous items in one go, instead of doing them one at a time in an loop...?

}
// Otherwise start accumulating incremental transactions
var ready types.Transactions
for next := (*m.index)[0]; m.index.Len() > 0 && (*m.index)[0] == next; next++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks strange to me: for next := (*m.index)[0]; ...&& (*m.index)[0] == next . Assignment first, then validating that the assignment worked?

// This method uses the cached costcap to quickly decide if there's even a point
// in calculating all the costs or if the balance covers all. If the threshold is
// lower than the costcap, the costcap will be reset to a new high after removing
// expensive the too transactions.
Copy link
Contributor

Choose a reason for hiding this comment

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

"the too expensive transactions"

maxQueued = 64 // max limit of queued txs per address
var (
maxQueuedPerAccount = uint64(64) // Max limit of queued transactions per address
maxQueuedInTotal = uint64(65536) // Max limit of queued transactions from all accounts
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that a bit large? Seeing as how nodes are toppling at 10k transactions

delete(txs, hash)
// Otherwise postpone any invalidated transactions
for _, tx := range invalids {
pool.enqueueTx(tx.Hash(), tx)
Copy link
Contributor

Choose a reason for hiding this comment

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

When the timer in expirationLoop starts deleting transactions from an account, it will start by deleting the lowest nonce. It looks like litle loop here will add back all the resulting invalids, and expirationLoop will have to iterate through all of them, rebuilding the cache in every loop. Looks suboptimal to me...?

@GitCop
Copy link

GitCop commented Oct 10, 2016

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: df64a9f
    • Commit subjects should be kept under 80 characters
  • Commit: ff697e8
    • Commit subjects should be kept under 80 characters

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link

GitCop commented Oct 10, 2016

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: df64a9f
    • Commit subjects should be kept under 80 characters
  • Commit: ff697e8
    • Commit subjects should be kept under 80 characters

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@fjl fjl merged commit 5a6008e into ethereum:release/1.4 Oct 10, 2016
@fjl fjl removed the review label Oct 10, 2016
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.

4 participants