Skip to content
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

Merge 1.8.x changes that aren't yet in main. #714

Merged
merged 31 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cf4b2f2
add java distribution (#625) (#628)
egaxhaj Jan 28, 2022
ec93ac6
Backport scope/attributes, gov deposit, and java distribution changes…
iramiller Feb 2, 2022
0673d73
Add msgfees module to added store upgrades (#638)
channa-figure Feb 9, 2022
a4fe7fc
614 proto binding support with buf build (#630) (#641)
egaxhaj Feb 10, 2022
b2cd69e
fix for incorrect line endings (#644)
egaxhaj Feb 10, 2022
104f6f4
add needs: build_init (#646) (#647)
egaxhaj Feb 10, 2022
8b51053
Add base denom to nhash, Add change log (#649)
channa-figure Feb 10, 2022
cd2500d
Fix maven publish release version reference (#652)
egaxhaj Feb 11, 2022
f67ed4f
Bump cosmwasm from v1.0.0-beta5 to v1.0.0-beta6 (#656)
channa-figure Feb 11, 2022
50d23de
Port iterator fix to v1.8 (#660)
fkneeland-figure Feb 15, 2022
1561bf6
new upgrade handler hazel. (#661)
arnabmitra Feb 15, 2022
d1bbe15
remove v from artifact version (#654) (#657)
egaxhaj Feb 15, 2022
5c889f1
Fix contract address length support (#663)
channa-figure Feb 16, 2022
1f96775
adding upgrade handler indigo. (#665)
arnabmitra Feb 16, 2022
e95e98b
Go lint fixes (#698)
fkneeland-figure Mar 2, 2022
7a6cf3c
backport tx gas limits #681 (#704)
iramiller Mar 2, 2022
26c64f0
backport: In release 1.8(not yet in mainnet), floor gas price should …
arnabmitra Mar 2, 2022
9325837
fix owner array initialization size when creating scope mutation mess…
ktalley-figure Feb 23, 2022
dbee322
Merge pull request #706 from provenance-io/ktalley/issue/675
ktalley-figure Mar 3, 2022
55c93a6
Simulation tests for smart contracts (#673)
fkneeland-figure Mar 3, 2022
a54db31
Add jasmine upgrade handler (#713)
Mar 4, 2022
9419b1c
Merge branch 'release/v1.8.x' into dwedul/merge-1.8.x-after-rc9
dwedul-figure Mar 8, 2022
55abf19
fix lint errors and run make format.
dwedul-figure Mar 8, 2022
4426e10
Adjustments for v1.8.0 release (#717)
Mar 9, 2022
498cf5c
Merge branch 'main' into dwedul/merge-1.8.x-after-rc9
dwedul-figure Mar 10, 2022
0246795
Merge branch 'release/v1.8.x' into dwedul/merge-1.8.x-after-rc9
dwedul-figure Mar 10, 2022
a2ac7f6
Add some underscores to a couple large numbers.
dwedul-figure Mar 11, 2022
28c94c7
Add go version to lint to hopefully fix it.
dwedul-figure Mar 11, 2022
96b155b
Merge branch 'main' into dwedul/merge-1.8.x-after-rc9
dwedul-figure Mar 11, 2022
ffab2ec
Merge branch 'main' into dwedul/merge-1.8.x-after-rc9
iramiller Mar 16, 2022
03bf8da
Merge branch 'main' into dwedul/merge-1.8.x-after-rc9
iramiller Mar 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,4 @@ jobs:
-Psigning.keyId=B7D30ABE \
-Psigning.password="${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}" \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
--info
--info
28 changes: 28 additions & 0 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,34 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-simple:
runs-on: ubuntu-latest
needs: [ build, install-runsim ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.5
with:
go-version: 1.17
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.go
go.mod
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/cache@v2.1.7
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-simple
run: |
make test-sim-simple
if: env.GIT_DIFF

test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: [build, install-runsim]
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Allow attributes to be associated with scopes [#631](https://github.com/provenance-io/provenance/issues/631)
* Add `add-genesis-msg-fee` command to add msg fees to genesis.json and update Makefile to have pre-defined msg fees [#667](https://github.com/provenance-io/provenance/issues/667)
* Add msgfees summary event to be emitted when there are txs that have fees [#678](https://github.com/provenance-io/provenance/issues/678)

### Improvements

* Add `bank` and `authz` module query `proto` files required by `grpcurl` [#482](https://github.com/provenance-io/provenance/issues/482)
Expand All @@ -70,8 +71,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `provenance.metadata.v1.MsgWriteScopeRequest` 10 hash (10,000,000,000 nhash)
* `provenance.metadata.v1.MsgP8eMemorializeContractRequest` 10 hash (10,000,000,000 nhash)
* When the `start` command encounters an error, it no longer outputs command usage [#670](https://github.com/provenance-io/provenance/issues/670)
* Add integration tests for smart contracts [#392](https://github.com/provenance-io/provenance/issues/392)
* Change max length on marker unresticted denom from 64 to 83 [#719](https://github.com/provenance-io/provenance/issues/719)

### Client Breaking

* Enforce a maximum gas limit on individual transactions so that at least 20 can fit in any given block. [#681](https://github.com/provenance-io/provenance/issues/681)
Expand All @@ -89,9 +91,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add migration to re-index the metadata indexes involving addresses [#541](https://github.com/provenance-io/provenance/issues/541)
* Add migration to delete empty sessions [#480](https://github.com/provenance-io/provenance/issues/480)
* Add Java distribution tag to workflow [#624](https://github.com/provenance-io/provenance/issues/624)
* Add `msgfees` module to added store upgrades [#640](https://github.com/provenance-io/provenance/issues/640)
* Use `nhash` for base denom in gov proposal upgrade [#648](https://github.com/provenance-io/provenance/issues/648)
* Bump `cosmowasm` from `v1.0.0-beta5` to `v1.0.0-beta6` [#655](https://github.com/provenance-io/provenance/issues/655)
* Fix maven publish release version number reference [#650](https://github.com/provenance-io/provenance/issues/650)
* String "v" from Jar artifact version number [#653](https://github.com/provenance-io/provenance/issues/653)
* Add `iterator` as feature for wasm [#658](https://github.com/provenance-io/provenance/issues/658)
* String "v" from Jar artifact version number [#653](https://github.com/provenance-io/provenance/issues/653)
* Fix `wasm` contract migration failure to find contract history [#662](https://github.com/provenance-io/provenance/issues/662)

## [v1.7.6](https://github.com/provenance-io/provenance/releases/tag/v1.7.6) - 2021-12-15

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ func New(
name.NewAppModule(appCodec, app.NameKeeper, app.AccountKeeper, app.BankKeeper),
attribute.NewAppModule(appCodec, app.AttributeKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper),
msgfeesmodule.NewAppModule(appCodec, app.MsgFeesKeeper, app.interfaceRegistry),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
provwasm.NewWrapper(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper),

ibc.NewAppModule(app.IBCKeeper),
transferModule,
Expand Down
Binary file added app/sim_contracts/tutorial.wasm
Binary file not shown.
32 changes: 32 additions & 0 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,38 @@ func TestFullAppSimulation(t *testing.T) {
}
}

func TestSimple(t *testing.T) {
config, db, dir, logger, skip, err := sdksim.SetupSimulation("leveldb-app-sim", "Simulation")
if skip {
t.Skip("skipping provenance application simulation")
}
require.NoError(t, err, "provenance simulation setup failed")

defer func() {
db.Close()
require.NoError(t, os.RemoveAll(dir))
}()

app := New(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, sdksim.FlagPeriodValue, MakeEncodingConfig(), sdksim.EmptyAppOptions{}, fauxMerkleModeOpt)
require.Equal(t, "provenanced", app.Name())

// run randomized simulation
_, _, simErr := simulation.SimulateFromSeed(
t,
os.Stdout,
app.BaseApp,
sdksim.AppStateFn(app.AppCodec(), app.SimulationManager()),
simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
sdksim.SimulationOperations(app, app.AppCodec(), config),
app.ModuleAccountAddrs(),
config,
app.AppCodec(),
)

require.NoError(t, simErr)
sdksim.PrintStats(db)
}

// Profile with:
// /usr/local/go/bin/go test -benchmem -run=^$ github.com/provenance-io/provenance -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out
func TestAppImportExport(t *testing.T) {
Expand Down
17 changes: 16 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var handlers = map[string]appUpgrade{
// set governance deposit requirement to 50,000HASH
govParams := app.GovKeeper.GetDepositParams(ctx)
beforeDeposit := govParams.MinDeposit
govParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(50_000_000_000_000)))
govParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(DefaultBondDenom, sdk.NewInt(50_000_000_000_000)))
app.GovKeeper.SetDepositParams(ctx, govParams)
ctx.Logger().Info(fmt.Sprintf("Updated governance module minimum deposit from %s to %s", beforeDeposit, govParams.MinDeposit))

Expand All @@ -80,7 +80,22 @@ var handlers = map[string]appUpgrade{
return resultVM, AddMsgBasedFees(app, ctx)

},
Added: []string{msgfeestypes.ModuleName},
},
"hazel": {},
"indigo": {}, // upgrade for pio-testnet-1 from v1.8.0-rc7 to v1.8.0-rc8
"jasmine": {
Handler: func(app *App, ctx sdk.Context, plan upgradetypes.Plan) (module.VersionMap, error) {
// Ensure consensus params are correct and match mainnet/testnet. Max Block Sizes: 60M gas, 5MB
params := app.GetConsensusParams(ctx)
params.Block.MaxBytes = 1024 * 1024 * 5 // 5MB
params.Block.MaxGas = 60_000_000 // With ante tx gas limit this will yield 3M gas max per tx.
app.StoreConsensusParams(ctx, params)
versionMap := app.UpgradeKeeper.GetModuleVersionMap(ctx)
return versionMap, nil
}, // upgrade for pio-testnet-1 from v1.8.0-rc8 to v1.8.0-rc9
},
"kahlua": {}, // upgrade for pio-testnet-1 from v1.8.0-rc9 to v1.8.0
// TODO - Add new upgrade definitions here.
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/provenanced/cmd/simulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package cmd_test

import (
"fmt"
"github.com/provenance-io/provenance/internal/antewrapper"
"os"
"path/filepath"
"testing"

"github.com/provenance-io/provenance/internal/antewrapper"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
Expand Down
11 changes: 10 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,19 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

replace github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.45.0-pio-1
replace github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.45.0-pio-2

replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76

// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0

// Fixes chain panic. Should be removed once cosmwasm has fixed their release
// Dockerfile also needs a reference that will need removing
// TODO Remove it: https://github.com/CosmWasm/cosmwasm/pull/1223
replace github.com/CosmWasm/wasmvm => github.com/CosmWasm/wasmvm v1.0.0-beta6

// Fixes address length issue to support contract address of length 20 (pre v1.8.0) with current length 22
// TODO Remove it when fixed upstream
replace github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.22.0-pio-address-fix
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmd v0.22.0 h1:6Bn2DDjHvLwZJkYXL+/PRQ9bSll0ReX2IZqRt/BQkhg=
github.com/CosmWasm/wasmd v0.22.0/go.mod h1:kNDnMAQDJyVek9k6SxCNijMCzOROzzUGBRT8r/vr7oY=
github.com/CosmWasm/wasmvm v1.0.0-beta5 h1:38M8z89LB5cFMYB5vfjewMzz9Pr8TB1QBHdjnrWnkas=
github.com/CosmWasm/wasmvm v1.0.0-beta5/go.mod h1:mtwKxbmsko1zdwpaKiRkRwxijMmIAtnLaX5/UT2nPFk=
github.com/CosmWasm/wasmvm v1.0.0-beta6 h1:JYh9Z7qF6h9a2sOOx9hZRwCVS4aFdd+aiwrIXznLn8k=
github.com/CosmWasm/wasmvm v1.0.0-beta6/go.mod h1:mtwKxbmsko1zdwpaKiRkRwxijMmIAtnLaX5/UT2nPFk=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
Expand Down Expand Up @@ -915,8 +913,10 @@ github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/provenance-io/cosmos-sdk v0.45.0-pio-1 h1:b3m1PVb9CvcD0xiKNvK1gDSfAPtdd3qYKntrJF1eQ24=
github.com/provenance-io/cosmos-sdk v0.45.0-pio-1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ=
github.com/provenance-io/cosmos-sdk v0.45.0-pio-2 h1:se3UWMt0pQjYr+8Zi5o0tHaYr8W6FIwRZ6288+lodwc=
github.com/provenance-io/cosmos-sdk v0.45.0-pio-2/go.mod h1:APQJszmf9+rA/3YVNoAbJKVehN4oANbbhoapB0ywCQY=
github.com/provenance-io/wasmd v0.22.0-pio-address-fix h1:oMgJkRT3nq1l58VcP56G39fLsKSQ1Nq44D9fafbdIh4=
github.com/provenance-io/wasmd v0.22.0-pio-address-fix/go.mod h1:kNDnMAQDJyVek9k6SxCNijMCzOROzzUGBRT8r/vr7oY=
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down
2 changes: 1 addition & 1 deletion internal/antewrapper/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// outermost AnteDecorator. SetUpContext must be called first
NewFeeMeterContextDecorator(), // NOTE : fee gas meter also has the functionality of GasTracerContextDecorator in previous versions
cosmosante.NewRejectExtensionOptionsDecorator(),
cosmosante.NewMempoolFeeDecorator(),
NewTxGasLimitDecorator(),
cosmosante.NewMempoolFeeDecorator(),
// Fee Decorator works to augment NewMempoolFeeDecorator and also check that enough fees are paid
NewMsgFeesDecorator(options.BankKeeper, options.AccountKeeper, options.FeegrantKeeper, options.MsgFeesKeeper),
cosmosante.NewValidateBasicDecorator(),
Expand Down
8 changes: 5 additions & 3 deletions internal/antewrapper/msg_fees_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package antewrapper
import (
"fmt"

"github.com/cosmos/cosmos-sdk/simapp/helpers"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
cosmosante "github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand Down Expand Up @@ -68,7 +70,7 @@ func (afd MsgFeesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool
}
// floor gas price should be checked for all Tx's ( i.e nodes cannot set min-gas-price < floor gas price)
// the chain id check is exclusively for not breaking all existing sim tests which freak out when denom is anything other than stake.
if ctx.IsCheckTx() && !simulate && shouldIgnoreFloorGasPriceCheck(ctx) && (additionalFees.IsZero() || additionalFees == nil) {
if ctx.IsCheckTx() && !simulate && shouldIgnoreChecksForTests(ctx) && (additionalFees.IsZero() || additionalFees == nil) {
err = checkFloorGasFees(gas, feeCoins, additionalFees, afd.msgFeeKeeper.GetFloorGasPrice(ctx))
if err != nil {
return ctx, err
Expand Down Expand Up @@ -120,8 +122,8 @@ func (afd MsgFeesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool
// This check for chain-id is exclusively for not breaking all existing sim tests which freak out when denom is anything other than stake.
// and some network tests won't work without a chain id being set(but they also setup everything with stake denom) so `simapp-unit-testing` chain id is skipped also.
// This only needs to work to pio-testnet and pio-mainnet, so this is safe.
func shouldIgnoreFloorGasPriceCheck(ctx sdk.Context) bool {
return len(ctx.ChainID()) != 0 && ctx.ChainID() != SimAppChainID
func shouldIgnoreChecksForTests(ctx sdk.Context) bool {
return len(ctx.ChainID()) != 0 && ctx.ChainID() != SimAppChainID && ctx.ChainID() != helpers.SimAppChainID
}

// getFeeGranterIfExists checks if fee granter exists and returns account to deduct fees from
Expand Down
1 change: 0 additions & 1 deletion internal/antewrapper/msg_fees_decorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func (suite *AnteTestSuite) TestEnsureMempoolAndMsgFeesNoAdditionalFeesLowGas()
suite.Require().Contains(err.Error(), "not enough fees based on floor gas price: \"1905nhash\"; required base fees >=\"190500000nhash\": Supplied fee was \"100000nhash\": insufficient fee", "got wrong message")
}


// checkTx true, high min gas price irrespective of additional fees
func (suite *AnteTestSuite) TestEnsureMempoolHighMinGasPrice() {
err, antehandler := setUpApp(suite, true, "atom", 100)
Expand Down
10 changes: 2 additions & 8 deletions internal/antewrapper/tx_gas_limit_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import (
// CONTRACT: Tx must implement FeeTx to use TxGasLimitDecorator
type TxGasLimitDecorator struct{}

// MinTxPerBlock is used to determine the maximum amount of gas that any given transaction can use based on the block gas limit.
const MinTxPerBlock = 20

func NewTxGasLimitDecorator() TxGasLimitDecorator {
return TxGasLimitDecorator{}
}
Expand All @@ -27,10 +24,7 @@ func (mfd TxGasLimitDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b
}
// Ensure that the requested gas does not exceed the configured block maximum
gas := feeTx.GetGas()
gasTxLimit := uint64(0)
if ctx.BlockGasMeter() != nil {
gasTxLimit = ctx.BlockGasMeter().Limit() / MinTxPerBlock
}
gasTxLimit := uint64(4_000_000)

// Skip gas limit check for txs with MsgSubmitProposal
hasSubmitPropMsg := false
Expand All @@ -43,7 +37,7 @@ func (mfd TxGasLimitDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b
}

// TODO - remove "gasTxLimit > 0" with SDK 0.46 which fixes the infinite gas meter to use max int vs zero for the limit.
if gasTxLimit > 0 && gas > gasTxLimit && !hasSubmitPropMsg {
if shouldIgnoreChecksForTests(ctx) && gasTxLimit > 0 && gas > gasTxLimit && !hasSubmitPropMsg {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrTxTooLarge, "transaction gas exceeds maximum allowed; got: %d max allowed: %d", gas, gasTxLimit)
}
return next(ctx, tx, simulate)
Expand Down
Loading