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

go/runtime/txpool: Limit outstanding transactions per sender #4665

Merged
merged 3 commits into from Apr 15, 2022

Conversation

kostko
Copy link
Member

@kostko kostko commented Apr 13, 2022

No description provided.

@kostko kostko added the c:runtime/scheduler Category: runtime txn scheduler label Apr 13, 2022
@kostko kostko force-pushed the kostko/feature/rt-txpool-callernonce branch from 742b05a to 0595a77 Compare April 13, 2022 12:25
cq.l.Lock()
defer cq.l.Unlock()

// NOTE: This is meant for retries so it ignores the size limit on purpose.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something in place to prevent unbounded growth? I guess with the accounting in add, the queue size will be at most 2 *cq.maxSize?

Copy link
Member Author

Choose a reason for hiding this comment

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

So this is only used for reinserting previously poped transactions (which are at most "batch size" long). In the worst case this could overflow the queue to be twice the max size (in case of check batches being that big -- which they are not by default) when the queue is full and batch checks are failing while new transactions are being queued.

@kostko kostko force-pushed the kostko/feature/rt-txpool-callernonce branch 2 times, most recently from beb07b6 to 483cd5a Compare April 13, 2022 16:50
@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #4665 (8381b14) into master (9e0c570) will decrease coverage by 0.15%.
The diff coverage is 87.78%.

@@            Coverage Diff             @@
##           master    #4665      +/-   ##
==========================================
- Coverage   67.07%   66.92%   -0.16%     
==========================================
  Files         431      432       +1     
  Lines       48884    48637     -247     
==========================================
- Hits        32790    32551     -239     
+ Misses      12071    12068       -3     
+ Partials     4023     4018       -5     
Impacted Files Coverage Δ
go/runtime/host/helpers.go 70.73% <ø> (-4.78%) ⬇️
go/runtime/host/protocol/types.go 54.54% <ø> (-2.60%) ⬇️
go/runtime/transaction/transaction.go 79.51% <ø> (-1.17%) ⬇️
go/worker/compute/executor/committee/batch.go 69.69% <50.00%> (-6.07%) ⬇️
go/worker/compute/executor/committee/node.go 69.55% <51.72%> (-2.15%) ⬇️
go/runtime/txpool/transaction.go 72.22% <72.22%> (ø)
go/runtime/host/mock/mock.go 91.59% <81.81%> (-2.69%) ⬇️
go/runtime/txpool/txpool.go 77.86% <91.08%> (+2.06%) ⬆️
go/runtime/txpool/check_queue.go 100.00% <100.00%> (+15.38%) ⬆️
go/runtime/txpool/schedule_queue.go 100.00% <100.00%> (ø)
... and 34 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89ed839...8381b14. Read the comment docs.

@kostko kostko force-pushed the kostko/feature/rt-txpool-callernonce branch 3 times, most recently from c978b03 to 337d8cd Compare April 14, 2022 09:52
@kostko kostko marked this pull request as ready for review April 14, 2022 10:42
go/runtime/txpool/schedule_queue.go Show resolved Hide resolved
go/runtime/txpool/txpool.go Outdated Show resolved Hide resolved
@kostko kostko force-pushed the kostko/feature/rt-txpool-callernonce branch 2 times, most recently from b0c54d9 to db90154 Compare April 15, 2022 08:06
This makes it possible to simplify the transaction pool as it no longer
needs to deal with weights.
@kostko kostko force-pushed the kostko/feature/rt-txpool-callernonce branch from db90154 to 8381b14 Compare April 15, 2022 08:10
@kostko kostko merged commit fb33bf9 into master Apr 15, 2022
@kostko kostko deleted the kostko/feature/rt-txpool-callernonce branch April 15, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:runtime/scheduler Category: runtime txn scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants