solana
solana copied to clipboard
Remove congestion multiplier from calculate_fee function
Problem
bank.calculate_fee()
takes a parameter with misleading name (lamports_per_signature
) for testing congestion multiplier to be zero, which has been removed everywhere. That parameter should also be removed.
Due to legacy or perhaps misleading name of the parameter, call sites are calling extra code to resolve lamports_per_signature
before calling calculate_fee()
, in some instances, it locks hash_queue to do so. All of these are not necessary.
Summary of Changes
- remove
congestion_multiplier
withincalculate_fee()
- remove
lamports_per_signature
input parameter ofcalculate_fee()
, durable transaction also uses fee rate from time of execution. - remove code that fetches
lamports_per_signature
from nonce account leading to call ofcalculate_fee()
Fixes #
I agree that this code is messy but I'm not sure that this is the right way to clean it up. I believe the reason that the lamports_per_signature
is passed here is so that it can be overridden for durable nonce transactions. Maybe @t-nelson can add more context on what the latest discussion on durable nonce tx fees was?
I agree that this code is messy but I'm not sure that this is the right way to clean it up. I believe the reason that the
lamports_per_signature
is passed here is so that it can be overridden for durable nonce transactions. Maybe @t-nelson can add more context on what the latest discussion on durable nonce tx fees was?
was this supposed to be a line comment? where's "here"?
I agree that this code is messy but I'm not sure that this is the right way to clean it up. I believe the reason that the
lamports_per_signature
is passed here is so that it can be overridden for durable nonce transactions. Maybe @t-nelson can add more context on what the latest discussion on durable nonce tx fees was?was this supposed to be a line comment? where's "here"?
"here" is calculate_fee()
.
It suppose to be an innocent PR to remove unused stuff 😇 But it revealed few issues. The first one is: have we been wrong in calculating nonce tx signature fee? line commente here.
Convert this PR to Draft, going to break it into smaller and separated PRs:
- just remove congestion_multiplier from fee calculation, and fix/harden all tests
- new issue/PR to state durable transaction will be charged with current bank's fee rate, not by fee rate in nonce account, remove related code.