-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Rename priority to compute_unit_price #35062
Rename priority to compute_unit_price #35062
Conversation
c5b0767
to
e7b0e24
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #35062 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.1%
=========================================
Files 830 830
Lines 224946 224949 +3
=========================================
- Hits 183674 183670 -4
- Misses 41272 41279 +7 |
@@ -208,7 +205,7 @@ impl PrioritizationFeeCache { | |||
} | |||
} | |||
|
|||
/// Update with a list of non-vote transactions' tx_priority_details and tx_account_locks; Only | |||
/// Update with a list of non-vote transactions' tx_compute_budget_details and tx_account_locks; Only | |||
/// transactions have both valid priority_detail and account_locks will be used to update |
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.
nit: priority_detail
=> compute_budget_details
(also, i'd prefer removing the seemingly-unneeded tx_
prefixes.
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.
@@ -294,16 +294,16 @@ mod tests { | |||
} | |||
|
|||
#[test] | |||
fn test_transaction_priority_details() { | |||
fn test_compute_budget_details() { | |||
let priority = 15; |
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.
nit: rename to let compute_unit_price = 15
.
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.
let mut priority_details = sanitized_transaction | ||
.get_transaction_priority_details(packet.meta().round_compute_unit_price()) | ||
let mut compute_budget_details = sanitized_transaction | ||
.get_compute_budget_details(packet.meta().round_compute_unit_price()) | ||
.ok_or(DeserializedPacketError::PrioritizationFailure)?; | ||
|
||
// set priority to zero for vote transactions |
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.
nit: // set compute_unit_price to zero for vote transactions
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.
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.
thanks for not forgetting rename. :)
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; perfect. i think touched code is read better a lot. thanks for addressing all my nits.
Will get @tao-stones to take a look as well, much of this is compute unit stuff so he may also have opinions! |
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 - thanks for renaming
@@ -8,46 +8,46 @@ use { | |||
}; | |||
|
|||
#[derive(Clone, Debug, PartialEq, Eq)] | |||
pub struct TransactionPriorityDetails { | |||
pub priority: u64, | |||
pub struct ComputeBudgetDetails { |
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.
at first glance, I wanted to nit pick the name ComputeBudgetDetails
here, cause it implies to details of ComputeBudget
defined program-runtime/src/compute_budget.rs
. But then, this file is on its way out, we don't needed it when start to using runtime-transaction. I'm OK with this change for now.
Problem
Summary of Changes
TransactionPriorityDetails
priority
field tocompute_unit_price
TransactionPriorityDetails
and associated traits toComputeBudgetDetails
Fixes #