Skip to content

Commit

Permalink
feat: Change the default priority mechanism to be based on gas price …
Browse files Browse the repository at this point in the history
…(backport cosmos#12953) (cosmos#13006)

* feat: Change the default priority mechanism to be based on gas price (cosmos#12953)

(cherry picked from commit befd816)

# Conflicts:
#	CHANGELOG.md
#	x/auth/ante/fee_test.go

* fix conflict

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent 2a6857f commit 349fc8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* [#12953](https://github.com/cosmos/cosmos-sdk/pull/12953) Change the default priority mechanism to be based on gas price.
* [#12981](https://github.com/cosmos/cosmos-sdk/pull/12981) Return proper error when parsing telemetry configuration.
* [#12969](https://github.com/cosmos/cosmos-sdk/pull/12969) Bump Tendermint to `v0.34.21` and IAVL to `v0.19.1`.
* [#12886](https://github.com/cosmos/cosmos-sdk/pull/12886) Amortize cost of processing cache KV store.
Expand Down
10 changes: 5 additions & 5 deletions x/auth/ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (s *AnteTestSuite) TestEnsureMempoolFees() {
// msg and signatures
msg := testdata.NewTestMsg(accs[0].acc.GetAddress())
feeAmount := testdata.NewTestFeeAmount()
gasLimit := testdata.NewTestGasLimit()
gasLimit := uint64(15)
s.Require().NoError(s.txBuilder.SetMsgs(msg))
s.txBuilder.SetFeeAmount(feeAmount)
s.txBuilder.SetGasLimit(gasLimit)
Expand All @@ -76,7 +76,7 @@ func (s *AnteTestSuite) TestEnsureMempoolFees() {
s.Require().NoError(err)

// Set high gas price so standard test fee fails
atomPrice := sdk.NewDecCoinFromDec("atom", math.LegacyNewDec(20))
atomPrice := sdk.NewDecCoinFromDec("atom", sdk.NewDec(20))
highGasPrice := []sdk.DecCoin{atomPrice}
s.ctx = s.ctx.WithMinGasPrices(highGasPrice)

Expand Down Expand Up @@ -108,9 +108,9 @@ func (s *AnteTestSuite) TestEnsureMempoolFees() {

newCtx, err := antehandler(s.ctx, tx, false)
s.Require().Nil(err, "Decorator should not have errored on fee higher than local gasPrice")
// Priority is the smallest amount in any denom. Since we have only 1 fee
// of 150atom, the priority here is 150.
s.Require().Equal(feeAmount.AmountOf("atom").Int64(), newCtx.Priority())
// Priority is the smallest gas price amount in any denom. Since we have only 1 gas price
// of 10atom, the priority here is 10.
s.Require().Equal(int64(10), newCtx.Priority())
}

func (s *AnteTestSuite) TestDeductFees() {
Expand Down

0 comments on commit 349fc8f

Please sign in to comment.