-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
TransactionState: add TransactionCost #34881
TransactionState: add TransactionCost #34881
Conversation
329bc51
to
62d5ed2
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #34881 +/- ##
=======================================
Coverage 81.7% 81.7%
=======================================
Files 826 826
Lines 223413 223441 +28
=======================================
+ Hits 182614 182681 +67
+ Misses 40799 40760 -39 |
let cu_limit = transaction_state | ||
.transaction_priority_details() | ||
.compute_unit_limit; | ||
let cost = transaction_state.transaction_cost().sum(); |
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.
Just a quick check: for Vote, its cu_limit
is always 0
, but has value of 3428
for cost
. By using different CU
s, will it impact how vote's scheduled?
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.
vote's don't go through the scheduler - they have their own independent threads still.
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.
this PR realy has no impact on its' own. The CUs are tracked, but not used for load-balancing currently because they are so unreliable. This is intended to be used later on, but right now its' just tracked, so changing from cu_limit to cost shouldn't impact anything.
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.
Gotcha, good to know it is for the purpose of load-balancing, not counting towards the limits.
Also worth noting that transaction_cost
includes requested_cu_limit
, if used. So that unreliability also in transaction_cost
atm.
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.
Right, a major difference here is that for simple txs which we know the cost of, it will not include "requested_cus". For example a simple transfer. So for purposes of prioritizing by reward/cu we want to use this number
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.
that would de-prioritize txs with large requested_cu but actually not-so-largge_actual-cu, if signature fee is included in reward/cu calculation, would it?
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 - it does not change existing function yet.
Problem
Summary of Changes
This will allow 2 subsequent improvements:
Fixes #