-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add functions to collect executed transactions fee in details; #178
Conversation
074d264
to
3fcc31a
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.
Could you explain the motivation for why the bank should be aware of the details of collection at all?
It seems all we need from the bank variable is to accumulate reward into a u64 so it can be distributed at the end of slot. In that case, why not simply use a (atomic)u64 for the accumulation?
For SIMD-0096, how fee is distributed at the end of bank is different based on fee "type". Transaction Fee will be 50% rewarded 50% burnt, and Priority Fee will be 100% rewarded. For that, bank has to keep collected fees in different buckets. Fee distribution changes are in next PR (preview). |
I understand we have to distribute them differently based on type. But that can be done at transaction level, the bank only needs to be aware of the reward at the end of the slot. Basically my question is why does the bank need to be aware of the details and not just the result, i.e. reward. edit: I see now - it's because we do not update total capitalization changes until end of slot. Change to capitalization will depend on the burn rate, so we need the details unless we moved capitalization update by fee into transaction committing. |
planning on adding tests? |
Yes 💪🏼, one last thing to address from Andrew's last review. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #178 +/- ##
========================================
Coverage 81.9% 81.9%
========================================
Files 838 838
Lines 226927 227067 +140
========================================
+ Hits 185918 186049 +131
- Misses 41009 41018 +9 |
7aa681a
to
ca0ae44
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.
Think we need to discuss the rounding; it seems to be a blocker for this style of accumulation.
I previously expressed my thought on accumulating only reward instead of fee, which I pointed out will not work due to the capitalization update.
Alternatively we could still accumulate 2 variables: reward, burn.
This would let us update capitalization correctly at the end of the slot using burn
.
I think that would also let us move forward with this change without blocking on the rounding feature.
wdyt?
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
@lheeger-jump Do you have time to check this one out? I'd like to merge this so can put next one out, which distributes collected |
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
…ails from PartialEq
43b8180
to
f59c93d
Compare
Problem
Working bank should be able to collect executed transactions's fee in detail, separating transaction_fee (half burnt) and prio fee (100% rewarded).
Summary of Changes
Fixes #