-
Notifications
You must be signed in to change notification settings - Fork 115
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
runtime: add support for transaction priority and weights #3965
Conversation
fc94450
to
cae02aa
Compare
bfe5234
to
ccfdc9c
Compare
Codecov Report
@@ Coverage Diff @@
## master #3965 +/- ##
==========================================
- Coverage 67.22% 67.17% -0.06%
==========================================
Files 410 410
Lines 41819 41815 -4
==========================================
- Hits 28112 28088 -24
- Misses 9751 9765 +14
- Partials 3956 3962 +6
Continue to review full report at Codecov.
|
479737d
to
23cd37e
Compare
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.
Did you do any benchmarking to compare with the previous implementation?
// XXX: potentially there could be smaller transactions that would | ||
// fit, which this will miss. Could do some lookahead. |
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.
Should we open a follow up issue for this?
go/runtime/scheduling/simple/txpool/priorityqueue/priority_queue.go
Outdated
Show resolved
Hide resolved
go/runtime/scheduling/simple/txpool/priorityqueue/priority_queue.go
Outdated
Show resolved
Hide resolved
go/runtime/scheduling/simple/txpool/priorityqueue/priority_queue.go
Outdated
Show resolved
Hide resolved
Yeah I did. I can dig up the results, but generally the adding/getting batches is a bit slower than previous The drastic performance degradation is in the |
759a19b
to
dc8a844
Compare
go/runtime/scheduling/simple/txpool/priorityqueue/priority_queue.go
Outdated
Show resolved
Hide resolved
dc8a844
to
ac2385c
Compare
Orderedmap implementation doesn't support priority
ac2385c
to
f6222b0
Compare
Closes #3760
See also: oasisprotocol/oasis-sdk#146
Adds support for runtime transaction priority and weights that can be set by runtime on
CheckTx
. Transaction are scheduled by priority (higher first). Transaction weights are used by scheduler when creating batches to ensure no batch passes the per-round weight limits. Supported limits are:size
- number of transactions - per batch/round limit is defined in the registrysize_bytes
- size of transaction in bytes - per batch/round limit is defined in the registryconsensus_messages
- number of emitted consensus messages - per batch/round limit is defined in the registryPer-account sequence numbers can be implemented in a follow-up PR (TODO: open issue), as unless all runtimes are required to implement accounts, the scheduler needs to handle the base case (no per-account seq. numbers) as well.
TODO: