Skip to content
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 fee_details to fee calculation #35021

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

tao-stones
Copy link
Contributor

@tao-stones tao-stones commented Jan 31, 2024

Problem

To reward priority fee differently from transaction fee (solana-foundation/solana-improvement-documents#96), priority fee and transaction fee should be separately identified from result of calculate_fee(...)

Summary of Changes

  • define struct FeeDetails {}
  • add new public api to calculate_fee_details(...) -> FeeDetails
  • updated original calculate_fee(...) -> u64 without changing its logic to minimize impact on call sites
  • feature gate to remove rounding

Feature Gate Issue: #34982

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 81.6%. Comparing base (531793b) to head (27e15a4).
Report is 6 commits behind head on master.

❗ Current head 27e15a4 differs from pull request most recent head fbd3e82. Consider uploading reports for the commit fbd3e82 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #35021   +/-   ##
=======================================
  Coverage    81.6%    81.6%           
=======================================
  Files         834      830    -4     
  Lines      224803   224838   +35     
=======================================
+ Hits       183467   183504   +37     
+ Misses      41336    41334    -2     

sdk/src/fee.rs Outdated Show resolved Hide resolved
@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Feb 20, 2024
@github-actions github-actions bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Feb 21, 2024
@tao-stones tao-stones added the feature-gate Pull Request adds or modifies a runtime feature gate label Feb 22, 2024
Copy link
Contributor

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - thanks for introducing the feature for removing the rounding!

@tao-stones tao-stones merged commit 139b9c8 into solana-labs:master Feb 23, 2024
45 checks passed
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Feb 27, 2024
* add fee_details to fee calculation

* fix - no need to round after summing u64

* feature gate on removing unwanted rounding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-gate Pull Request adds or modifies a runtime feature gate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants