-
Notifications
You must be signed in to change notification settings - Fork 293
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
feat: make global min gas price gov modifiable #3094
feat: make global min gas price gov modifiable #3094
Conversation
d471c49
to
0cfa5bb
Compare
79c9be2
to
90742ce
Compare
90742ce
to
2396e5b
Compare
1b47b3e
to
efcdbb2
Compare
Co-authored-by: Callum Waters <[email protected]>
Co-authored-by: Callum Waters <[email protected]>
Co-authored-by: Rootul P <[email protected]>
Co-authored-by: Rootul P <[email protected]>
Co-authored-by: Rootul P <[email protected]>
|
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.
Great work!
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.
+1 great work!
// unit of gas is fixed and set globally, and the tx priority is computed from the gas price. | ||
func CheckTxFeeWithGlobalMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { | ||
// CheckTxFeeWithMinGasPrices implements default fee validation logic for transactions. | ||
// It ensures that the provided transaction fee meets a minimum threshold for the validator |
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.
Ahh now I remember that. I think that means we can close #3034 as won't do.
[optional] we could update the comment here to say that the config minimum only applies for CheckTx
and the global minimum applies for Prepare/ProcessProposal
.
Update: it's described in the body of this function so definitely optional / not blocking.
{ | ||
name: "bad tx; fee below node's required minimum", | ||
fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount-1)), | ||
gasLimit: uint64(float64(feeAmount) / validatorMinGasPrice), | ||
appVersion: uint64(1), | ||
isCheckTx: true, | ||
expErr: true, | ||
}, |
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.
👍
@@ -64,5 +64,6 @@ are blocked by the `x/paramfilter` module. | |||
| staking.MaxValidators | 100 | Maximum number of validators. | True | | |||
| staking.MinCommissionRate | 0.05 (5%) | Minimum commission rate used by all validators. | True | | |||
| staking.UnbondingTime | 1814400 (21 days) | Duration of time for unbonding in seconds. | False | | |||
| minfee.GlobalMinGasPrice | 0.002 | All transactions must have a gas price greater than or equal to this value | True | |
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] this param table is alphabetically sorted. Can you please move minfee
up?
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.
[tangent] we don't have to figure this out in this PR but I wonder if it would make sense to include the app version that a constant is applicable for in this table. For example, I think some of these params could be modified to be different in different app versions and at that point it's not immediately obvious if this table should reflect the original or updated value. Perhaps both with a new column for app version?
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.
yes, i can move it in a follow up pr. thanks @rootulp
to you second point i think that's a good call. I'll export your comment as an issue and we can discuss it during our grooming session.
|
||
// The purpose of this wrapper is to enable the passing of an additional paramKeeper parameter | ||
// whilst still satisfying the ante.TxFeeChecker type. | ||
func CheckTxFeeWithGlobalMinGasPricesWrapper(paramKeeper paramkeeper.Keeper) ante.TxFeeChecker { |
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.
[optional]
the name CheckTx
could be confusing
if ctx.IsCheckTx() { | ||
minGasPrice := ctx.MinGasPrices().AmountOf(appconsts.BondDenom) | ||
if !minGasPrice.IsZero() { | ||
err := verifyMinFee(fee, gas, minGasPrice, "insufficient minimum gas price for this validator") |
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.
[optoinal]
since all nodes will run this, validator might be confusing to users
thanks for testing rigorously! only had optional naming related things left! |
thanks evan! I'll update in a follow up pr. |
## Overview follow-up pr addressing some of the comments on [minfee-module](#3094) ---------
Makes GlobalMinGasPrice hard-coded constant gov modifiable Fixes - celestiaorg#3092 ---------
## Overview follow-up pr addressing some of the comments on [minfee-module](celestiaorg#3094) ---------
## Overview follow-up pr addressing some of the comments on [minfee-module](celestiaorg/celestia-app#3094) ---------
Overview
Makes GlobalMinGasPrice hard-coded constant gov modifiable
Fixes - #3092