269 set a chain wide upper gas limit for transactions (#309)

* set global tx gas limit
* extend lib/tx to process multiple messages
* extend lib/tx to configure tx gas limit
* added global gas limit tests
* increased account funding to support needs of testcases

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2024-02-01 10:23:38 +01:00 committed by GitHub
parent a38fe781ba
commit 373614e1b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 269 additions and 42 deletions

View File

@ -51,7 +51,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
}
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
NewSetUpContextDecorator(options.DaoKeeper), // outermost AnteDecorator. SetUpContext must be called first
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
NewGasKVCostDecorator(options.StakingKeeper),
ante.NewValidateBasicDecorator(),

View File

@ -39,6 +39,7 @@ type BankKeeper interface {
type DaoKeeper interface {
GetMintRequestByHash(ctx sdk.Context, hash string) (val daotypes.MintRequest, found bool)
GetMintAddress(ctx sdk.Context) (mintAddress string)
GetTxGasLimit(ctx sdk.Context) (txGasLimit uint64)
GetClaimAddress(ctx sdk.Context) (claimAddress string)
IsValidReissuanceProposal(ctx sdk.Context, msg *daotypes.MsgReissueRDDLProposal) (isValid bool)
GetRedeemClaim(ctx sdk.Context, benficiary string, id uint64) (val daotypes.RedeemClaim, found bool)

View File

@ -0,0 +1,92 @@
package ante
import (
"fmt"
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
)
var _ GasTx = (*legacytx.StdTx)(nil) // assert StdTx implements GasTx
// GasTx defines a Tx with a GetGas() method which is needed to use SetUpContextDecorator
type GasTx interface {
sdk.Tx
GetGas() uint64
}
// SetUpContextDecorator sets the GasMeter in the Context and wraps the next AnteHandler with a defer clause
// to recover from any downstream OutOfGas panics in the AnteHandler chain to return an error with information
// on gas provided and gas used.
// CONTRACT: Must be first decorator in the chain
// CONTRACT: Tx must implement GasTx interface
type SetUpContextDecorator struct {
dk DaoKeeper
}
func NewSetUpContextDecorator(dk DaoKeeper) SetUpContextDecorator {
return SetUpContextDecorator{
dk: dk,
}
}
func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
// all transactions must implement GasTx
gasTx, ok := tx.(GasTx)
if !ok {
// Set a gas meter with limit 0 as to prevent an infinite gas meter attack
// during runTx.
newCtx = SetGasMeter(simulate, ctx, 0)
return newCtx, errorsmod.Wrapf(sdkerrors.ErrTxDecode, "Tx must be GasTx")
}
gasLimit := sud.dk.GetTxGasLimit(ctx)
if gasLimit == 0 {
gasLimit = gasTx.GetGas()
}
newCtx = SetGasMeter(simulate, ctx, gasLimit)
if cp := ctx.ConsensusParams(); cp != nil && cp.Block != nil {
// If there exists a maximum block gas limit, we must ensure that the tx
// does not exceed it.
if cp.Block.MaxGas > 0 && gasTx.GetGas() > uint64(cp.Block.MaxGas) {
return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), cp.Block.MaxGas)
}
}
// Decorator will catch an OutOfGasPanic caused in the next antehandler
// AnteHandlers must have their own defer/recover in order for the BaseApp
// to know how much gas was used! This is because the GasMeter is created in
// the AnteHandler, but if it panics the context won't be set properly in
// runTx's recover call.
defer func() {
if r := recover(); r != nil {
switch rType := r.(type) {
case sdk.ErrorOutOfGas:
log := fmt.Sprintf(
"out of gas in location: %v; gasWanted: %d, gasUsed: %d",
rType.Descriptor, gasTx.GetGas(), newCtx.GasMeter().GasConsumed())
err = errorsmod.Wrapf(sdkerrors.ErrOutOfGas, log)
default:
panic(r)
}
}
}()
return next(newCtx, tx, simulate)
}
// SetGasMeter returns a new context with a gas meter set from a given context.
func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context {
// In various cases such as simulation and during the genesis block, we do not
// meter any gas utilization.
if simulate || ctx.BlockHeight() == 0 {
return ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
}
return ctx.WithGasMeter(sdk.NewGasMeter(gasLimit))
}

View File

@ -47047,6 +47047,9 @@ paths:
format: int64
claim_address:
type: string
tx_gas_limit:
type: string
format: uint64
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
@ -76715,6 +76718,9 @@ definitions:
format: int64
claim_address:
type: string
tx_gas_limit:
type: string
format: uint64
description: Params defines the parameters for the module.
planetmintgo.dao.QueryAllRedeemClaimResponse:
type: object
@ -76989,6 +76995,9 @@ definitions:
format: int64
claim_address:
type: string
tx_gas_limit:
type: string
format: uint64
description: QueryParamsResponse is response type for the Query/Params RPC method.
planetmintgo.dao.QueryRedeemClaimByLiquidTxHashResponse:
type: object

View File

@ -16,6 +16,7 @@ type Config struct {
FeeDenom string `json:"fee-denom" mapstructure:"fee-denom"`
RootDir string `json:"root-dir" mapstructure:"root-dir"`
RPCEndpoint string `json:"rpc-endpoint" mapstructure:"rpc-endpoint"`
TxGas uint64 `json:"tx-gas" mapstructure:"tx-gas"`
}
// lib wide global singleton
@ -34,6 +35,7 @@ func DefaultConfig() *Config {
FeeDenom: "plmnt",
RootDir: "~/.planetmint-go/",
RPCEndpoint: "http://127.0.0.1:26657",
TxGas: 200000,
}
}
@ -91,3 +93,9 @@ func (config *Config) SetRPCEndpoint(rpcEndpoint string) *Config {
config.RPCEndpoint = rpcEndpoint
return config
}
// SetTxGas sets the amount of Gas for the TX that is send to the network
func (config *Config) SetTxGas(txGas uint64) *Config {
config.TxGas = txGas
return config
}

View File

@ -66,7 +66,7 @@ func getTxFactoryWithAccountNumberAndSequence(clientCtx client.Context, accountN
WithAccountRetriever(clientCtx.AccountRetriever).
WithChainID(clientCtx.ChainID).
WithFeeGranter(clientCtx.FeeGranter).
WithGas(200000).
WithGas(GetConfig().TxGas).
WithGasPrices("0.000005" + GetConfig().FeeDenom).
WithKeybase(clientCtx.Keyring).
WithSequence(sequence).

View File

@ -25,4 +25,5 @@ message Params {
string distribution_address_pop = 14;
int64 mqtt_response_timeout = 15;
string claim_address = 16;
uint64 tx_gas_limit = 17;
}

View File

@ -1,7 +1,13 @@
package dao
import (
"bufio"
"os"
"strconv"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/planetmint/planetmint-go/lib"
clitestutil "github.com/planetmint/planetmint-go/testutil/cli"
@ -16,20 +22,65 @@ import (
type GasConsumptionE2ETestSuite struct {
suite.Suite
cfg network.Config
network *network.Network
cfg network.Config
network *network.Network
minterAddr sdk.AccAddress
}
func NewGasConsumptionE2ETestSuite(cfg network.Config) *GasConsumptionE2ETestSuite {
return &GasConsumptionE2ETestSuite{cfg: cfg}
}
func (s *GasConsumptionE2ETestSuite) createValAccount(cfg network.Config) (address sdk.AccAddress, err error) {
buf := bufio.NewReader(os.Stdin)
kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, s.T().TempDir(), buf, cfg.Codec, cfg.KeyringOptions...)
if err != nil {
return nil, err
}
keyringAlgos, _ := kb.SupportedAlgorithms()
algo, err := keyring.NewSigningAlgoFromString(cfg.SigningAlgo, keyringAlgos)
if err != nil {
return nil, err
}
mnemonic := cfg.Mnemonics[0]
record, err := kb.NewAccount("node0", mnemonic, keyring.DefaultBIP39Passphrase, sdk.GetConfig().GetFullBIP44Path(), algo)
if err != nil {
return nil, err
}
addr, err := record.GetAddress()
if err != nil {
return nil, err
}
return addr, nil
}
func (s *GasConsumptionE2ETestSuite) SetupSuite() {
s.T().Log("setting up e2e test suite")
s.cfg.Mnemonics = []string{sample.Mnemonic}
addr, err := s.createValAccount(s.cfg)
s.Require().NoError(err)
// set accounts for alice and bob in genesis state
var authGenState authtypes.GenesisState
s.cfg.Codec.MustUnmarshalJSON(s.cfg.GenesisState[authtypes.ModuleName], &authGenState)
s.minterAddr = addr
minter := authtypes.NewBaseAccount(s.minterAddr, nil, 0, 0)
accounts, err := authtypes.PackAccounts(authtypes.GenesisAccounts{minter})
s.Require().NoError(err)
authGenState.Accounts = append(authGenState.Accounts, accounts...)
s.cfg.GenesisState[authtypes.ModuleName] = s.cfg.Codec.MustMarshalJSON(&authGenState)
var daoGenState daotypes.GenesisState
s.cfg.Codec.MustUnmarshalJSON(s.cfg.GenesisState[daotypes.ModuleName], &daoGenState)
daoGenState.Params.FeeDenom = sample.FeeDenom
daoGenState.Params.MintAddress = s.minterAddr.String()
s.cfg.GenesisState[daotypes.ModuleName] = s.cfg.Codec.MustMarshalJSON(&daoGenState)
s.network = network.New(s.T(), s.cfg)
@ -79,7 +130,7 @@ func (s *GasConsumptionE2ETestSuite) TestNonValidatorConsumptionOverflow() {
_, err = clitestutil.GetRawLogFromTxOut(val, out)
s.Require().Error(err)
assert.Equal(s.T(), "out of gas in location: Has; gasWanted: 200000, gasUsed: 200241: out of gas", err.Error())
assert.Equal(s.T(), "out of gas in location: Has; gasWanted: 200000, gasUsed: 200701: out of gas", err.Error())
}
func createMsgs(from sdk.AccAddress, to sdk.AccAddress, n int) (msgs []sdk.Msg) {
@ -90,3 +141,24 @@ func createMsgs(from sdk.AccAddress, to sdk.AccAddress, n int) (msgs []sdk.Msg)
}
return
}
func (s *GasConsumptionE2ETestSuite) TestNetworkBasedTxGasLimit() {
var gasAmountAboveGlobalGasLimit uint64 = 200000000
libConfig := lib.GetConfig()
libConfig.SetTxGas(gasAmountAboveGlobalGasLimit)
var msgs []sdk.Msg
for i := 0; i < 1000; i++ {
mintRequest := sample.MintRequest(s.minterAddr.String(), 1, "hash"+strconv.Itoa(i))
msg := daotypes.NewMsgMintToken(s.minterAddr.String(), &mintRequest)
msgs = append(msgs, msg)
}
_, err := e2etestutil.BuildSignBroadcastTx(s.T(), s.minterAddr, msgs...)
s.Require().Error(err)
s.Assert().Contains(err.Error(), "out of gas in location: txSize; gasWanted: "+strconv.FormatUint(gasAmountAboveGlobalGasLimit, 10)+", gasUsed:")
s.Assert().Contains(err.Error(), " out of gas")
s.Require().NoError(s.network.WaitForNextBlock())
}

View File

@ -36,7 +36,7 @@ func FundAccount(network *network.Network, account *keyring.Record) (err error)
}
// sending funds to account to initialize account on chain
coin := sdk.NewCoins(sdk.NewInt64Coin("stake", 1000))
coin := sdk.NewCoins(sdk.NewInt64Coin("stake", 10000)) // TODO: make denom dependent on cfg
msg := banktypes.NewMsgSend(val.Address, addr, coin)
out, err := lib.BroadcastTxWithFileLock(val.Address, msg)
if err != nil {

View File

@ -10,8 +10,8 @@ import (
)
// BuildSignBroadcastTx builds, signs and broadcasts transaction to the network.
func BuildSignBroadcastTx(t *testing.T, addr sdk.AccAddress, msg sdk.Msg) (out *bytes.Buffer, err error) {
out, err = lib.BroadcastTxWithFileLock(addr, msg)
func BuildSignBroadcastTx(t *testing.T, addr sdk.AccAddress, msgs ...sdk.Msg) (out *bytes.Buffer, err error) {
out, err = lib.BroadcastTxWithFileLock(addr, msgs...)
if err != nil {
t.Log("broadcast tx failed: " + err.Error())
return

View File

@ -35,6 +35,10 @@ func (k Keeper) GetMintAddress(ctx sdk.Context) (mintAddress string) {
return k.GetParams(ctx).MintAddress
}
func (k Keeper) GetTxGasLimit(ctx sdk.Context) (txGasLimit uint64) {
return k.GetParams(ctx).TxGasLimit
}
func (k Keeper) GetClaimAddress(ctx sdk.Context) (claimAddress string) {
return k.GetParams(ctx).ClaimAddress
}

View File

@ -17,7 +17,7 @@ func NewParams(mintAddress string, tokenDenom string, feeDenom string, stagedDen
claimDenom string, reissuanceAsset string, reissuanceEpochs int64, popEpochs int64,
distributionOffset int64, distributionAddressEarlyInv string, distributionAddressInvestor string,
distributionAddressStrategic string, distributionAddressDao string, distributionAddressPop string,
mqttResponseTimeout int64, claimAddress string) Params {
mqttResponseTimeout int64, claimAddress string, txGasLimit uint64) Params {
return Params{
MintAddress: mintAddress,
TokenDenom: tokenDenom,
@ -42,6 +42,7 @@ func NewParams(mintAddress string, tokenDenom string, feeDenom string, stagedDen
DistributionAddressPop: distributionAddressPop,
MqttResponseTimeout: mqttResponseTimeout,
ClaimAddress: claimAddress,
TxGasLimit: txGasLimit,
}
}
@ -63,7 +64,8 @@ func DefaultParams() Params {
"vjU8eMzU3JbUWZEpVANt2ePJuPWSPixgjiSj2jDMvkVVQQi2DDnZuBRVX4Ygt5YGBf5zvTWCr1ntdqYH",
"vjTvXCFSReRsZ7grdsAreRR12KuKpDw8idueQJK9Yh1BYS7ggAqgvCxCgwh13KGK6M52y37HUmvr4GdD",
2000,
"plmnt1dyuhg8ldu3d6nvhrvzzemtc3893dys9v9lvdty")
"plmnt1dyuhg8ldu3d6nvhrvzzemtc3893dys9v9lvdty",
200000)
}
// ParamSetPairs get the params.ParamSet

View File

@ -41,6 +41,7 @@ type Params struct {
DistributionAddressPop string `protobuf:"bytes,14,opt,name=distribution_address_pop,json=distributionAddressPop,proto3" json:"distribution_address_pop,omitempty"`
MqttResponseTimeout int64 `protobuf:"varint,15,opt,name=mqtt_response_timeout,json=mqttResponseTimeout,proto3" json:"mqtt_response_timeout,omitempty"`
ClaimAddress string `protobuf:"bytes,16,opt,name=claim_address,json=claimAddress,proto3" json:"claim_address,omitempty"`
TxGasLimit uint64 `protobuf:"varint,17,opt,name=tx_gas_limit,json=txGasLimit,proto3" json:"tx_gas_limit,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
@ -187,6 +188,13 @@ func (m *Params) GetClaimAddress() string {
return ""
}
func (m *Params) GetTxGasLimit() uint64 {
if m != nil {
return m.TxGasLimit
}
return 0
}
func init() {
proto.RegisterType((*Params)(nil), "planetmintgo.dao.Params")
}
@ -194,38 +202,39 @@ func init() {
func init() { proto.RegisterFile("planetmintgo/dao/params.proto", fileDescriptor_a58575036b3ad531) }
var fileDescriptor_a58575036b3ad531 = []byte{
// 483 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xb1, 0x6e, 0x13, 0x4d,
0x14, 0x85, 0xbd, 0x7f, 0x12, 0xff, 0xf1, 0xd8, 0x21, 0x66, 0x02, 0x68, 0x44, 0xf0, 0x3a, 0x81,
0x26, 0x08, 0xe1, 0x95, 0xa0, 0x41, 0x74, 0x09, 0x4e, 0xe1, 0x8a, 0xc8, 0x50, 0xd1, 0xac, 0xc6,
0xbb, 0xd7, 0x9b, 0x11, 0xde, 0xb9, 0xc3, 0xce, 0xd8, 0x22, 0x6f, 0x41, 0x49, 0xc9, 0xe3, 0x50,
0xa6, 0xa4, 0x44, 0xf6, 0x43, 0xd0, 0xa2, 0xbd, 0xb3, 0x56, 0x16, 0xc9, 0xee, 0x46, 0xe7, 0x7c,
0xe7, 0xdc, 0xd1, 0x68, 0x2e, 0xeb, 0x99, 0x99, 0xd4, 0xe0, 0x72, 0xa5, 0x5d, 0x86, 0x51, 0x2a,
0x31, 0x32, 0xb2, 0x90, 0xb9, 0x1d, 0x98, 0x02, 0x1d, 0xf2, 0x6e, 0xdd, 0x1e, 0xa4, 0x12, 0x1f,
0x3f, 0xc8, 0x30, 0x43, 0x32, 0xa3, 0xf2, 0xe4, 0xb9, 0xa7, 0x7f, 0xf6, 0x58, 0xf3, 0x8a, 0x82,
0xfc, 0x94, 0x75, 0x4a, 0x3c, 0x96, 0x69, 0x5a, 0x80, 0xb5, 0x22, 0x38, 0x09, 0xce, 0x5a, 0xe3,
0x76, 0xa9, 0x9d, 0x7b, 0x89, 0xf7, 0x59, 0xdb, 0xe1, 0x67, 0xd0, 0x71, 0x0a, 0x1a, 0x73, 0xf1,
0x1f, 0x11, 0x8c, 0xa4, 0x61, 0xa9, 0xf0, 0x63, 0xd6, 0x9a, 0x02, 0x54, 0xf6, 0x0e, 0xd9, 0xfb,
0x53, 0x00, 0x6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, 0x83, 0x46, 0xdc, 0xdb, 0x9a, 0xbc, 0x42,
0xc3, 0x5f, 0xb1, 0x87, 0xf9, 0x17, 0xe7, 0xe2, 0x02, 0xac, 0x41, 0x6d, 0x21, 0x76, 0x2a, 0x07,
0x9c, 0x3b, 0x71, 0x48, 0xaf, 0x7e, 0x54, 0x9a, 0xe3, 0xca, 0xfb, 0xe8, 0x2d, 0xfe, 0x8c, 0x1d,
0xf8, 0xff, 0xb3, 0xfe, 0xc4, 0x5d, 0x1a, 0xd1, 0x21, 0xb1, 0xea, 0x7e, 0xbb, 0xfb, 0xfd, 0x47,
0xbf, 0x71, 0x31, 0xfa, 0xb9, 0x0c, 0x83, 0xdb, 0x65, 0x18, 0xfc, 0x5e, 0x86, 0xc1, 0xb7, 0x55,
0xd8, 0xb8, 0x5d, 0x85, 0x8d, 0x5f, 0xab, 0xb0, 0xf1, 0x29, 0xca, 0x94, 0xbb, 0x9e, 0x4f, 0x06,
0x09, 0xe6, 0xd1, 0xdd, 0x1a, 0xd5, 0x8e, 0x2f, 0x33, 0x8c, 0xbe, 0xd2, 0xce, 0xb9, 0x1b, 0x03,
0x76, 0xd2, 0xa4, 0x5d, 0x7a, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0x28, 0xe9, 0x84, 0xf9, 0x94,
0x03, 0x00, 0x00,
// 507 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x41, 0x6f, 0x12, 0x41,
0x14, 0xc7, 0x59, 0x8b, 0x58, 0x1e, 0xd4, 0xd2, 0xa9, 0x9a, 0x89, 0x95, 0x85, 0xea, 0x05, 0x63,
0x64, 0x13, 0xbd, 0x18, 0x6f, 0xad, 0x34, 0x86, 0xc4, 0xc4, 0x06, 0x3d, 0x79, 0xd9, 0x0c, 0xec,
0xb0, 0x9d, 0xc8, 0xee, 0x1b, 0x77, 0x1e, 0x84, 0x7e, 0x0b, 0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55, 0x47, 0x40, 0xcb, 0xf7, 0xc2,
0x7c, 0xc8, 0x93, 0xb7, 0xd5, 0x1f, 0xbf, 0x3a, 0x95, 0xf3, 0xe1, 0xef, 0x95, 0xef, 0xdd, 0xac,
0x7c, 0xef, 0xef, 0xca, 0xf7, 0xbe, 0xaf, 0xfd, 0xca, 0xcd, 0xda, 0xaf, 0xfc, 0x59, 0xfb, 0x95,
0x2f, 0x41, 0xac, 0xe8, 0x6a, 0x3e, 0xee, 0x4f, 0x30, 0x09, 0x6e, 0x17, 0xad, 0x74, 0x7c, 0x19,
0x63, 0xb0, 0xb4, 0x5b, 0x49, 0xd7, 0x5a, 0x9a, 0x71, 0xcd, 0x6e, 0xdb, 0xeb, 0x7f, 0x01, 0x00,
0x00, 0xff, 0xff, 0x45, 0xb8, 0xbd, 0x25, 0xb6, 0x03, 0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
@ -248,6 +257,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.TxGasLimit != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.TxGasLimit))
i--
dAtA[i] = 0x1
i--
dAtA[i] = 0x88
}
if len(m.ClaimAddress) > 0 {
i -= len(m.ClaimAddress)
copy(dAtA[i:], m.ClaimAddress)
@ -434,6 +450,9 @@ func (m *Params) Size() (n int) {
if l > 0 {
n += 2 + l + sovParams(uint64(l))
}
if m.TxGasLimit != 0 {
n += 2 + sovParams(uint64(m.TxGasLimit))
}
return n
}
@ -932,6 +951,25 @@ func (m *Params) Unmarshal(dAtA []byte) error {
}
m.ClaimAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 17:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TxGasLimit", wireType)
}
m.TxGasLimit = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.TxGasLimit |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipParams(dAtA[iNdEx:])