Skip to content

Commit

Permalink
chore: refine the default gas (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 authored Mar 24, 2023
1 parent 461b280 commit 9f1a5fc
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions x/auth/ante/msg_gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (suite *AnteTestSuite) TestMsgGas() {
expectedGas uint64
}
testCases := []testCase{
{"MsgSend", msgSend, 12000},
{"MsgMultiSend", msgMultiSend, 32000},
{"MsgSend", msgSend, 1200},
{"MsgMultiSend", msgMultiSend, 3200},
}
for _, tc := range testCases {
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() // Create new txBuilder for each test
Expand Down
88 changes: 44 additions & 44 deletions x/gashub/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,78 +69,78 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
// DefaultParams returns a default set of parameters.
func DefaultParams() Params {
defaultMsgGasParamsSet := []*MsgGasParams{
NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgExec", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgRevoke", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.bank.v1beta1.MsgSend", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.feegrant.v1beta1.MsgRevokeAllowance", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgDeposit", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgExec", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgRevoke", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.bank.v1beta1.MsgSend", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.feegrant.v1beta1.MsgRevokeAllowance", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgDeposit", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgSubmitProposal", 2e8),
NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgVote", 2e7),
NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgVoteWeighted", 2e7),
NewMsgGasParamsWithFixedGas("/cosmos.oracle.v1.MsgClaim", 1e3),
NewMsgGasParamsWithFixedGas("/cosmos.slashing.v1beta1.MsgUnjail", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgBeginRedelegate", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.slashing.v1beta1.MsgUnjail", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgBeginRedelegate", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgCreateValidator", 2e8),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgDelegate", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgDelegate", 1.2e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgEditValidator", 2e7),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgUndelegate", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.bridge.MsgTransferOut", 12e3),
NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgUndelegate", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.bridge.MsgTransferOut", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.sp.MsgCreateStorageProvider", 2e8),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.sp.MsgDeposit", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.sp.MsgDeposit", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.sp.MsgEditStorageProvider", 2e7),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.sp.MsgUpdateSpStoragePrice", 2e7),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateBucket", 24e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteBucket", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorBucket", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgUpdateBucketInfo", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgSealObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgRejectSealObject", 12e4),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCopyObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCancelCreateObject", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateGroup", 24e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteGroup", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgLeaveGroup", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgUpdateGroupMember", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorGroup", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgPutPolicy", 24e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeletePolicy", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgCreatePaymentAccount", 2e6),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgDeposit", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgWithdraw", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgDisableRefund", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.challenge.MsgSubmit", 12e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateBucket", 2.4e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteBucket", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorBucket", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgUpdateBucketInfo", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgSealObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgRejectSealObject", 1.2e4),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCopyObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCancelCreateObject", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgCreateGroup", 2.4e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeleteGroup", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgLeaveGroup", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgUpdateGroupMember", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgMirrorGroup", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgPutPolicy", 2.4e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.storage.MsgDeletePolicy", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgCreatePaymentAccount", 2e5),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgDeposit", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgWithdraw", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.payment.MsgDisableRefund", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.challenge.MsgSubmit", 1.2e3),
NewMsgGasParamsWithFixedGas("/bnbchain.greenfield.challenge.MsgAttest", 1e2),
NewMsgGasParamsWithDynamicGas(
"/cosmos.authz.v1beta1.MsgGrant",
&MsgGasParams_GrantType{
GrantType: &MsgGasParams_DynamicGasParams{
FixedGas: 8e3,
GasPerItem: 8e3,
FixedGas: 8e2,
GasPerItem: 8e2,
},
},
),
NewMsgGasParamsWithDynamicGas(
"/cosmos.bank.v1beta1.MsgMultiSend",
&MsgGasParams_MultiSendType{
MultiSendType: &MsgGasParams_DynamicGasParams{
FixedGas: 8e3,
GasPerItem: 8e3,
FixedGas: 8e2,
GasPerItem: 8e2,
},
},
),
NewMsgGasParamsWithDynamicGas(
"/cosmos.feegrant.v1beta1.MsgGrantAllowance",
&MsgGasParams_GrantAllowanceType{
GrantAllowanceType: &MsgGasParams_DynamicGasParams{
FixedGas: 8e3,
GasPerItem: 8e3,
FixedGas: 8e2,
GasPerItem: 8e2,
},
},
),
Expand Down

0 comments on commit 9f1a5fc

Please sign in to comment.