Skip to content

Commit

Permalink
Merge pull request #207 from bnb-chain/release_v0.2.0_fix
Browse files Browse the repository at this point in the history
release:  prepare for release v0.2.1
  • Loading branch information
unclezoro authored May 22, 2023
2 parents 0848511 + 90a177d commit 138f387
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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' ./...
go test -mod=readonly -timeout 60m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./...
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions x/gashub/types/gas_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
18 changes: 18 additions & 0 deletions x/gashub/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 1 addition & 3 deletions x/gashub/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 138f387

Please sign in to comment.