-
Notifications
You must be signed in to change notification settings - Fork 71
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
refactor: remove feature gate from total_fee
function
#1463
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1463 +/- ##
=======================================
Coverage 82.7% 82.7%
=======================================
Files 871 871
Lines 370326 370393 +67
=======================================
+ Hits 306523 306584 +61
- Misses 63803 63809 +6 |
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.
Changes look good, and serve the purpose well. Just want to clarify before sign it off: the cached gate status will not be reused cross epoch boundary?
pub struct FeeDetails { | ||
transaction_fee: u64, | ||
prioritization_fee: u64, | ||
remove_rounding_in_fee_calculation: bool, |
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: FeeDetails
is public and implements default
, would making remove_rounding_in_fee_calculation
explicit as option<bool>
safer than just bool
?
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.
Well you can't set tx or pri fee to a non-zero value via a public method so if the default impl is used, the round feature wouldn't have any effect anyways
Good point, I wasn't planning for it to be used across epoch boundaries. Also, fee details in general can't be used across epoch boundaries so this PR doesn't make the situation any worse. |
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.
agree on both points, ship it
Problem
In PR #1462 I would like to calculate fees details once and reuse them downstream in places where the active feature set might not available. This makes calculating the
total_fee
for a transaction difficult because it requires a feature flag.Summary of Changes
Minor refactor which stores the
remove_rounding_in_fee_calculation
feature gate value inFeeDetails
so that it isn't required when callingtotal_fee
Fixes #