From db9164b7037e91c656d738d0f9f6b9c6f3027a3e Mon Sep 17 00:00:00 2001 From: Arnaud Mimart <33665250+amimart@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:08:57 +0200 Subject: [PATCH] fix(logic)!: remove max gas module parameter --- proto/logic/v1beta2/params.proto | 10 -- x/logic/keeper/grpc_query_ask.go | 22 ++--- x/logic/types/genesis.go | 3 - x/logic/types/params.go | 17 +--- x/logic/types/params.pb.go | 153 ++++++++++--------------------- x/logic/types/params_legacy.go | 24 ----- 6 files changed, 58 insertions(+), 171 deletions(-) delete mode 100644 x/logic/types/params_legacy.go diff --git a/proto/logic/v1beta2/params.proto b/proto/logic/v1beta2/params.proto index e161c04c..ac5cf81b 100644 --- a/proto/logic/v1beta2/params.proto +++ b/proto/logic/v1beta2/params.proto @@ -35,16 +35,6 @@ message Params { message Limits { option (gogoproto.goproto_stringer) = true; - // max_gas specifies the maximum amount of computing power, measured in "gas," that is allowed to be consumed when - // executing a request by the interpreter. The interpreter calculates the gas consumption based on the number and type - // of operations that are executed, as well as, in some cases, the complexity of the processed data. - // nil value remove max gas limitation. - string max_gas = 1 [ - (gogoproto.moretags) = "yaml:\"max_gas\",omitempty", - (gogoproto.customtype) = "cosmossdk.io/math.Uint", - (gogoproto.nullable) = true - ]; - // max_size specifies the maximum size, in bytes, that is accepted for a program. // nil value remove size limitation. string max_size = 3 [ diff --git a/x/logic/keeper/grpc_query_ask.go b/x/logic/keeper/grpc_query_ask.go index b082c118..bed5b716 100644 --- a/x/logic/keeper/grpc_query_ask.go +++ b/x/logic/keeper/grpc_query_ask.go @@ -3,6 +3,7 @@ package keeper import ( goctx "context" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -17,18 +18,11 @@ import ( var defaultSolutionsLimit = sdkmath.OneUint() func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (response *types.QueryServiceAskResponse, err error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - if req == nil { return nil, errorsmod.Wrap(types.InvalidArgument, "request is nil") } - limits := k.limits(ctx) - if err := checkLimits(req, limits); err != nil { - return nil, err - } - - sdkCtx = withGasMeter(sdkCtx, limits) + sdkCtx := withSafeGasMeter(sdk.UnwrapSDKContext(ctx)) defer func() { if r := recover(); r != nil { if gasError, ok := r.(storetypes.ErrorOutOfGas); ok { @@ -42,7 +36,11 @@ func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (respo panic(r) } }() - sdkCtx.GasMeter().ConsumeGas(sdkCtx.GasMeter().GasConsumed(), types.ModuleName) + + limits := k.limits(ctx) + if err := checkLimits(req, limits); err != nil { + return nil, err + } return k.execute( sdkCtx, @@ -51,10 +49,10 @@ func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (respo util.DerefOrDefault(req.Limit, defaultSolutionsLimit)) } -// withGasMeter returns a new context with a gas meter that has the given limit. +// withSafeGasMeter returns a new context with a gas meter that has the given limit. // The gas meter is go-router-safe. -func withGasMeter(sdkCtx sdk.Context, limits types.Limits) sdk.Context { - gasMeter := meter.WithSafeMeter(storetypes.NewGasMeter(limits.MaxGas.Uint64())) +func withSafeGasMeter(sdkCtx sdk.Context) sdk.Context { + gasMeter := meter.WithSafeMeter(sdkCtx.GasMeter()) return sdkCtx.WithGasMeter(gasMeter) } diff --git a/x/logic/types/genesis.go b/x/logic/types/genesis.go index a0e77ef0..91064234 100644 --- a/x/logic/types/genesis.go +++ b/x/logic/types/genesis.go @@ -1,8 +1,5 @@ package types -// DefaultIndex is the default global index. -const DefaultIndex uint64 = 1 - // DefaultGenesis returns the default genesis state. func DefaultGenesis() *GenesisState { return &GenesisState{ diff --git a/x/logic/types/params.go b/x/logic/types/params.go index c3124cfd..16ce83ee 100644 --- a/x/logic/types/params.go +++ b/x/logic/types/params.go @@ -9,16 +9,12 @@ import ( // Parameter store keys. var ( - ParamsKey = []byte("Params") - KeyInterpreter = []byte("Interpreter") - KeyLimits = []byte("Limits") + ParamsKey = []byte("Params") ) var ( DefaultPredicatesWhitelist = make([]string, 0) DefaultPredicatesBlacklist = make([]string, 0) - DefaultBootstrap = "" - DefaultMaxGas = math.NewUint(uint64(100000)) DefaultMaxSize = math.NewUint(uint64(5000)) DefaultMaxResultCount = math.NewUint(uint64(1)) ) @@ -129,13 +125,6 @@ func validateInterpreter(i interface{}) error { // LimitsOption is a functional option for configuring the Limits. type LimitsOption func(*Limits) -// WithMaxGas sets the max gas limits for interpreter. -func WithMaxGas(maxGas math.Uint) LimitsOption { - return func(i *Limits) { - i.MaxGas = &maxGas - } -} - // WithMaxSize sets the max size limits accepted for a prolog program. func WithMaxSize(maxSize math.Uint) LimitsOption { return func(i *Limits) { @@ -164,10 +153,6 @@ func NewLimits(opts ...LimitsOption) Limits { opt(&l) } - if l.MaxGas == nil { - l.MaxGas = &DefaultMaxGas - } - if l.MaxSize == nil { l.MaxSize = &DefaultMaxSize } diff --git a/x/logic/types/params.pb.go b/x/logic/types/params.pb.go index 3950e0ef..c7bf7a3e 100644 --- a/x/logic/types/params.pb.go +++ b/x/logic/types/params.pb.go @@ -91,11 +91,6 @@ func (m *Params) GetGasPolicy() GasPolicy { // Limits defines the limits of the logic module. type Limits struct { - // max_gas specifies the maximum amount of computing power, measured in "gas," that is allowed to be consumed when - // executing a request by the interpreter. The interpreter calculates the gas consumption based on the number and type - // of operations that are executed, as well as, in some cases, the complexity of the processed data. - // nil value remove max gas limitation. - MaxGas *cosmossdk_io_math.Uint `protobuf:"bytes,1,opt,name=max_gas,json=maxGas,proto3,customtype=cosmossdk.io/math.Uint" json:"max_gas,omitempty" yaml:"max_gas",omitempty` // max_size specifies the maximum size, in bytes, that is accepted for a program. // nil value remove size limitation. MaxSize *cosmossdk_io_math.Uint `protobuf:"bytes,3,opt,name=max_size,json=maxSize,proto3,customtype=cosmossdk.io/math.Uint" json:"max_size,omitempty" yaml:"max_size"` @@ -395,55 +390,53 @@ func init() { func init() { proto.RegisterFile("logic/v1beta2/params.proto", fileDescriptor_3af0daa241de0fa3) } var fileDescriptor_3af0daa241de0fa3 = []byte{ - // 756 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xc1, 0x6a, 0xdb, 0x4a, - 0x14, 0xb5, 0x6c, 0xe3, 0xf7, 0x34, 0x26, 0x89, 0x33, 0x38, 0x79, 0x7a, 0x7e, 0x2f, 0xb6, 0x99, - 0x55, 0x16, 0xad, 0x4c, 0x52, 0x48, 0x69, 0xa0, 0x14, 0x94, 0x92, 0xb4, 0x34, 0xd0, 0xa0, 0x10, - 0x28, 0xdd, 0x98, 0xb1, 0x3c, 0x91, 0x87, 0x48, 0x1e, 0xa1, 0x19, 0x25, 0x76, 0x96, 0x5d, 0x74, - 0xdd, 0x45, 0x17, 0x5d, 0x74, 0xd1, 0xcf, 0xc9, 0xaa, 0x64, 0x59, 0xba, 0x30, 0x25, 0xf9, 0x83, - 0x7c, 0x41, 0xd1, 0x68, 0x2c, 0xd9, 0x6a, 0xc0, 0xed, 0x4e, 0xbe, 0xe7, 0x9e, 0x73, 0x8f, 0xee, - 0x9c, 0xb1, 0x40, 0xc3, 0x63, 0x2e, 0x75, 0x3a, 0xe7, 0x5b, 0x3d, 0x22, 0xf0, 0x76, 0x27, 0xc0, - 0x21, 0xf6, 0xb9, 0x19, 0x84, 0x4c, 0x30, 0xb8, 0x24, 0x31, 0x53, 0x61, 0x8d, 0xba, 0xcb, 0x5c, - 0x26, 0x91, 0x4e, 0xfc, 0x94, 0x34, 0xa1, 0x77, 0x45, 0x50, 0x39, 0x92, 0x2c, 0xf8, 0x06, 0x54, - 0xe9, 0x50, 0x90, 0x30, 0x08, 0x89, 0x20, 0xa1, 0xa1, 0xb5, 0xb5, 0xcd, 0xea, 0x76, 0xc3, 0x9c, - 0x53, 0x31, 0x5f, 0x66, 0x1d, 0x56, 0xe3, 0x6a, 0xd2, 0x2a, 0xdc, 0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, 0x6e, 0x3d, 0x59, 0xa8, 0xfa, 0x4f, 0xa6, 0x3a, 0xcb, 0x47, 0xf6, 0xb2, 0x8f, 0x47, 0xb6, - 0xac, 0xec, 0xc5, 0x05, 0x38, 0x04, 0xf5, 0xb8, 0x29, 0xe2, 0x24, 0xec, 0xb2, 0x48, 0x04, 0x91, - 0x48, 0xec, 0x97, 0xe5, 0xa0, 0xa7, 0x0b, 0x07, 0xfd, 0x97, 0x0d, 0xca, 0x6b, 0x20, 0x7b, 0xd5, - 0xc7, 0xa3, 0x13, 0x4e, 0xc2, 0xd7, 0xb2, 0x18, 0xbf, 0x94, 0x3c, 0x08, 0x0d, 0x8d, 0x40, 0x65, - 0x9f, 0x7a, 0x71, 0x64, 0x76, 0x80, 0x7e, 0x31, 0xa0, 0x82, 0x78, 0x94, 0x0b, 0x43, 0x6b, 0x97, - 0x36, 0x75, 0xcb, 0x88, 0x87, 0xde, 0x4d, 0x5a, 0xb5, 0x44, 0x3a, 0x85, 0x91, 0x9d, 0xb5, 0xc6, - 0xbc, 0x9e, 0x87, 0x9d, 0x33, 0xc9, 0x2b, 0xde, 0xc7, 0x4b, 0x61, 0x64, 0x67, 0xad, 0xe8, 0x73, - 0x11, 0x54, 0x67, 0xb2, 0x0d, 0xfb, 0x60, 0x35, 0x08, 0x49, 0x9f, 0x3a, 0x58, 0x10, 0xde, 0x3d, - 0x95, 0xa6, 0xd4, 0x95, 0xc8, 0xa7, 0x37, 0x71, 0x6c, 0xb5, 0x55, 0xe0, 0x54, 0x1c, 0x7e, 0x61, - 0x23, 0xbb, 0x96, 0xd5, 0xb2, 0xb7, 0xec, 0x31, 0x26, 0xb8, 0x08, 0x71, 0xa0, 0x92, 0x91, 0x77, - 0x3b, 0x85, 0x63, 0xb7, 0xd3, 0x67, 0x48, 0x41, 0xfd, 0x9c, 0x86, 0x22, 0xc2, 0x5e, 0x2c, 0x9e, - 0x19, 0x2c, 0xff, 0x81, 0x41, 0x49, 0x1c, 0x73, 0x41, 0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, - 0x24, 0x0f, 0xe5, 0x07, 0xc4, 0x61, 0x5e, 0xf2, 0xb3, 0xdf, 0x19, 0x75, 0x92, 0x8f, 0x91, 0x18, - 0x07, 0x84, 0xf7, 0x2a, 0x12, 0x7e, 0xf4, 0x33, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x71, 0xc9, 0x6e, - 0xa2, 0x06, 0x00, 0x00, + // 732 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6a, 0xdb, 0x48, + 0x18, 0xb7, 0x6c, 0xe3, 0x5d, 0x8f, 0x49, 0xe2, 0x0c, 0x4e, 0x56, 0xeb, 0xdd, 0xd8, 0x66, 0x4e, + 0x39, 0xec, 0xca, 0x24, 0x0b, 0x59, 0x1a, 0x28, 0x05, 0xa5, 0xa4, 0x2d, 0x0d, 0x34, 0x4c, 0x09, + 0x94, 0x5e, 0xcc, 0x58, 0x9e, 0xc8, 0x43, 0x24, 0x8f, 0xd0, 0x8c, 0x12, 0x3b, 0xc7, 0x3e, 0x41, + 0x0f, 0x3d, 0xf4, 0xd0, 0x43, 0x5f, 0xa1, 0x6f, 0x91, 0x53, 0xc9, 0xb1, 0xf4, 0x60, 0x4a, 0xf2, + 0x06, 0x79, 0x82, 0xa2, 0x19, 0x59, 0xb2, 0xd5, 0x80, 0xc9, 0x6d, 0xfc, 0xfd, 0xbe, 0xdf, 0x9f, + 0xf9, 0xe6, 0xb3, 0x0d, 0x9a, 0x1e, 0x77, 0x99, 0xd3, 0x3d, 0xdf, 0xe9, 0x53, 0x49, 0x76, 0xbb, + 0x01, 0x09, 0x89, 0x2f, 0xac, 0x20, 0xe4, 0x92, 0xc3, 0x15, 0x85, 0x59, 0x09, 0xd6, 0x6c, 0xb8, + 0xdc, 0xe5, 0x0a, 0xe9, 0xc6, 0x27, 0xdd, 0x84, 0xde, 0x15, 0x41, 0xe5, 0x58, 0xb1, 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, 0xef, 0x92, 0x31, 0x1f, 0xd1, 0x7f, 0xd5, 0x6f, 0xbd, 0xc3, 0x3d, 0xfd, 0x71, + 0xd0, 0x1d, 0x77, 0xf5, 0xff, 0x86, 0x9c, 0x04, 0x54, 0xf4, 0x2b, 0x0a, 0xfe, 0xef, 0x67, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x0c, 0x3c, 0xbb, 0xd7, 0x4d, 0x06, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -555,18 +548,6 @@ func (m *Limits) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if m.MaxGas != nil { - { - size := m.MaxGas.Size() - i -= size - if _, err := m.MaxGas.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -796,10 +777,6 @@ func (m *Limits) Size() (n int) { } var l int _ = l - if m.MaxGas != nil { - l = m.MaxGas.Size() - n += 1 + l + sovParams(uint64(l)) - } if m.MaxResultCount != nil { l = m.MaxResultCount.Size() n += 1 + l + sovParams(uint64(l)) @@ -1077,42 +1054,6 @@ func (m *Limits) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Limits: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v cosmossdk_io_math.Uint - m.MaxGas = &v - if err := m.MaxGas.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxResultCount", wireType) diff --git a/x/logic/types/params_legacy.go b/x/logic/types/params_legacy.go deleted file mode 100644 index e9ec65d1..00000000 --- a/x/logic/types/params_legacy.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - -// ParamKeyTable the param key table for launch module. -// -// Deprecated: kept for migration purpose, -// will be removed soon. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamSetPairs get the params.ParamSet. -// -// Deprecated: kept for migration purpose, -// will be removed soon. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return []paramtypes.ParamSetPair{ - paramtypes.NewParamSetPair(KeyInterpreter, &p.Interpreter, validateInterpreter), - paramtypes.NewParamSetPair(KeyLimits, &p.Limits, validateLimits), - } -}