diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52ccc44cf5..48f4e3c309 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,7 +74,7 @@ jobs: - name: test & coverage report creation if: env.GIT_DIFF run: | - cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -race -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' + cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -race -timeout 60m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' - uses: actions/upload-artifact@v3 if: env.GIT_DIFF with: @@ -256,9 +256,9 @@ jobs: if: env.GIT_DIFF run: | cd simapp - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... + go test -mod=readonly -timeout 60m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: tests simapp v1 if: env.GIT_DIFF run: | cd simapp - go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./... \ No newline at end of file + go test -mod=readonly -timeout 60m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./... diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e8ce92389..00e214a23e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # Changelog + +## v0.2.1 +This release is a hot fix release for v0.2.0. + +* [\#203](https://github.com/bnb-chain/greenfield-cosmos-sdk/pull/203) fix: update DefaultMaxTxSize and gas simulation logic +* [\#204](https://github.com/bnb-chain/greenfield-cosmos-sdk/pull/204) fix: allow GasParams fixedtype's gas is zero + ## v0.2.0 This release upgrades the reference cosmos-sdk to v0.47.2. As the cosmos-sdk v0.47.2 is a huge breaking upgrade, we decide to cherry-pick the recent contributed commits and apply to the v0.47.2. The commit history previous diff --git a/x/gashub/types/gas_calculator.go b/x/gashub/types/gas_calculator.go index 382ba424f2..f01e1fbc23 100644 --- a/x/gashub/types/gas_calculator.go +++ b/x/gashub/types/gas_calculator.go @@ -63,9 +63,6 @@ func GetGasCalculatorGen(mgp MsgGasParams) (GasCalculatorGenerator, error) { func FixedGasCalculator(amount uint64) GasCalculator { return func(msg types.Msg) (uint64, error) { - if amount == 0 { - return 0, errorsmod.Wrapf(errors.ErrInvalidMsgGasParams, "msg type: %s", types.MsgTypeURL(msg)) - } return amount, nil } } diff --git a/x/gashub/types/genesis.go b/x/gashub/types/genesis.go index cbd3451820..c7dd044764 100644 --- a/x/gashub/types/genesis.go +++ b/x/gashub/types/genesis.go @@ -40,6 +40,24 @@ func NewGenesisState(params Params, msgGasParamsSet []MsgGasParams) *GenesisStat // DefaultGenesisState - Return a default genesis state func DefaultGenesisState() *GenesisState { defaultMsgGasParamsSet := []MsgGasParams{ + *NewMsgGasParamsWithFixedGas("/cosmos.auth.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.bank.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.consensus.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.crisis.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.crosschain.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.gashub.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.mint.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.oracle.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.slashing.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.staking.v1beta1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.bridge.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.sp.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.storage.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.payment.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.challenge.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/greenfield.permission.MsgUpdateParams", 0), *NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgExec", 1.2e3), *NewMsgGasParamsWithFixedGas("/cosmos.authz.v1beta1.MsgRevoke", 1.2e3), *NewMsgGasParamsWithFixedGas("/cosmos.bank.v1beta1.MsgSend", 1.2e3), diff --git a/x/gashub/types/params.go b/x/gashub/types/params.go index 8130ac0c3b..39c6931fb4 100644 --- a/x/gashub/types/params.go +++ b/x/gashub/types/params.go @@ -92,9 +92,7 @@ func (mgp MsgGasParams) Validate() error { switch p := mgp.GasParams.(type) { case *MsgGasParams_FixedType: - if p.FixedType.FixedGas == 0 { - return fmt.Errorf("invalid gas. cannot be zero") - } + return nil case *MsgGasParams_GrantType: if p.GrantType.FixedGas == 0 || p.GrantType.GasPerItem == 0 { return fmt.Errorf("invalid gas. cannot be zero")