diff --git a/proto/sedachain/randomness/v1/genesis.proto b/proto/sedachain/randomness/v1/genesis.proto index 06393829..a1637d67 100644 --- a/proto/sedachain/randomness/v1/genesis.proto +++ b/proto/sedachain/randomness/v1/genesis.proto @@ -5,6 +5,4 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types"; -message GenesisState { - string seed = 1; -} +message GenesisState { string seed = 1; } diff --git a/proto/sedachain/randomness/v1/tx.proto b/proto/sedachain/randomness/v1/tx.proto index 643789e2..52e2b7d5 100644 --- a/proto/sedachain/randomness/v1/tx.proto +++ b/proto/sedachain/randomness/v1/tx.proto @@ -5,16 +5,13 @@ import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/sedaprotocol/seda-chain/x/randomness/types"; -service Msg { - rpc NewSeed(MsgNewSeed) - returns (MsgNewSeedResponse); -} +service Msg { rpc NewSeed(MsgNewSeed) returns (MsgNewSeedResponse); } message MsgNewSeed { option (cosmos.msg.v1.signer) = "proposer"; - + string proposer = 1; - string pi = 2; // VRF proof + string pi = 2; // VRF proof string beta = 3; // VRF hash } diff --git a/proto/sedachain/wasm_storage/v1/tx.proto b/proto/sedachain/wasm_storage/v1/tx.proto index 269dcd7c..8d799013 100644 --- a/proto/sedachain/wasm_storage/v1/tx.proto +++ b/proto/sedachain/wasm_storage/v1/tx.proto @@ -17,7 +17,7 @@ service Msg { rpc InstantiateAndRegisterProxyContract( MsgInstantiateAndRegisterProxyContract) returns (MsgInstantiateAndRegisterProxyContractResponse); - rpc SetMaxWasmSize(MsgSetMaxWasmSize) returns (MsgSetMaxWasmSizeResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message MsgStoreDataRequestWasm { @@ -63,9 +63,15 @@ message MsgInstantiateAndRegisterProxyContractResponse { [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } -message MsgSetMaxWasmSize { - uint64 max_wasm_size = 1; +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + Params params = 2 [ (gogoproto.nullable) = false ]; } // no data needs to be returned -message MsgSetMaxWasmSizeResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/sedachain/wasm_storage/v1/wasm_storage.proto b/proto/sedachain/wasm_storage/v1/wasm_storage.proto index 31973a37..5527871a 100644 --- a/proto/sedachain/wasm_storage/v1/wasm_storage.proto +++ b/proto/sedachain/wasm_storage/v1/wasm_storage.proto @@ -28,6 +28,8 @@ enum WasmType { [ (gogoproto.enumvalue_customname) = "WasmTypeRelayer" ]; } -message Params { - uint64 max_wasm_size = 1; +message Params { + option (gogoproto.equal) = true; + + uint64 max_wasm_size = 1; } \ No newline at end of file diff --git a/x/wasm-storage/keeper/keeper.go b/x/wasm-storage/keeper/keeper.go index 2394aea8..87420b20 100644 --- a/x/wasm-storage/keeper/keeper.go +++ b/x/wasm-storage/keeper/keeper.go @@ -2,7 +2,6 @@ package keeper import ( "encoding/hex" - "errors" "fmt" "cosmossdk.io/log" @@ -29,6 +28,11 @@ func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, authority st } } +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + // SetDataRequestWasm stores Data Request Wasm using its hash as the key. func (k Keeper) SetDataRequestWasm(ctx sdk.Context, wasm *types.Wasm) { store := ctx.KVStore(k.storeKey) @@ -156,21 +160,13 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { } // SetParams sets the parameters in the store. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.KeyParams), bz) -} - -// SetMaxWasmSize updates the MaxWasmSize parameter. -func (k Keeper) SetMaxWasmSize(ctx sdk.Context, maxWasmSize uint64) error { - if maxWasmSize == 0 { - return errors.New("MaxWasmSize cannot be zero") + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err } - - params := k.GetParams(ctx) - params.MaxWasmSize = maxWasmSize - k.SetParams(ctx, params) + store.Set([]byte(types.KeyParams), bz) return nil } diff --git a/x/wasm-storage/keeper/msg_server.go b/x/wasm-storage/keeper/msg_server.go index a812d68b..28344d91 100644 --- a/x/wasm-storage/keeper/msg_server.go +++ b/x/wasm-storage/keeper/msg_server.go @@ -174,14 +174,15 @@ func unzipWasm(wasm []byte) ([]byte, error) { return unzipped, nil } -// SetMaxWasmSize sets the MaxWasmSize parameter in the store. -func (k msgServer) SetMaxWasmSize(goCtx context.Context, msg *types.MsgSetMaxWasmSize) (*types.MsgSetMaxWasmSizeResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, fmt.Errorf("invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } - err := k.Keeper.SetMaxWasmSize(ctx, msg.MaxWasmSize) - if err != nil { + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.SetParams(ctx, req.Params); err != nil { return nil, err } - return &types.MsgSetMaxWasmSizeResponse{}, nil + return &types.MsgUpdateParamsResponse{}, nil } diff --git a/x/wasm-storage/keeper/msg_server_test.go b/x/wasm-storage/keeper/msg_server_test.go index 38be6cf9..73536699 100644 --- a/x/wasm-storage/keeper/msg_server_test.go +++ b/x/wasm-storage/keeper/msg_server_test.go @@ -262,48 +262,40 @@ func (s *KeeperTestSuite) TestMarshalJSON() { } } -func (s *KeeperTestSuite) TestSetMaxWasmSize() { +func (s *KeeperTestSuite) TestSetParams() { cases := []struct { name string preRun func() - input types.MsgSetMaxWasmSize + input types.Params expErr bool expErrMsg string }{ { name: "happy path", - input: types.MsgSetMaxWasmSize{ + input: types.Params{ MaxWasmSize: 1000000, // 1 MB }, preRun: func() {}, expErr: false, expErrMsg: "", }, - { - name: "zero size", - input: types.MsgSetMaxWasmSize{ - MaxWasmSize: 0, - }, - preRun: func() {}, - expErr: true, - expErrMsg: "MaxWasmSize cannot be zero", - }, + // negative cases would be caught in ValidateBasic before reaching keeper } for _, tc := range cases { s.Run(tc.name, func() { s.SetupTest() tc.preRun() - _, err := s.msgSrvr.SetMaxWasmSize(s.ctx, &tc.input) + err := s.wasmStorageKeeper.SetParams(s.ctx, tc.input) if tc.expErr { s.Require().Error(err) s.Require().Equal(tc.expErrMsg, err.Error()) } else { s.Require().NoError(err) - // Check that the MaxWasmSize parameter was correctly set + // Check that the Params were correctly set params := s.wasmStorageKeeper.GetParams(s.ctx) - s.Require().Equal(tc.input.MaxWasmSize, params.MaxWasmSize) + s.Require().Equal(tc.input, params) } }) } diff --git a/x/wasm-storage/types/codec.go b/x/wasm-storage/types/codec.go index b70e2a44..b91b5f4c 100644 --- a/x/wasm-storage/types/codec.go +++ b/x/wasm-storage/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -10,6 +11,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/wasm-storage/types/keys.go b/x/wasm-storage/types/keys.go index 1ccd755d..727a7828 100644 --- a/x/wasm-storage/types/keys.go +++ b/x/wasm-storage/types/keys.go @@ -18,9 +18,6 @@ const ( // KeyParams is the store key for the parameters. KeyParams = "params" - - // KeyMaxWasmSize defines the key for the MaxWasmSize parameter - KeyMaxWasmSize = "max-wasm-size" ) var ( diff --git a/x/wasm-storage/types/tx.go b/x/wasm-storage/types/tx.go index 4b44cdc7..5b768fa6 100644 --- a/x/wasm-storage/types/tx.go +++ b/x/wasm-storage/types/tx.go @@ -87,3 +87,15 @@ func (msg MsgInstantiateAndRegisterProxyContract) ValidateBasic() error { } return nil } + +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return fmt.Errorf("invalid authority address: %s", err) + } + + if err := m.Params.ValidateBasic(); err != nil { + return err + } + + return nil +} diff --git a/x/wasm-storage/types/tx.pb.go b/x/wasm-storage/types/tx.pb.go index 00e96916..5cdad941 100644 --- a/x/wasm-storage/types/tx.pb.go +++ b/x/wasm-storage/types/tx.pb.go @@ -391,22 +391,25 @@ func (m *MsgInstantiateAndRegisterProxyContractResponse) GetContractAddress() st return "" } -type MsgSetMaxWasmSize struct { - MaxWasmSize uint64 `protobuf:"varint,1,opt,name=max_wasm_size,json=maxWasmSize,proto3" json:"max_wasm_size,omitempty"` +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } -func (m *MsgSetMaxWasmSize) Reset() { *m = MsgSetMaxWasmSize{} } -func (m *MsgSetMaxWasmSize) String() string { return proto.CompactTextString(m) } -func (*MsgSetMaxWasmSize) ProtoMessage() {} -func (*MsgSetMaxWasmSize) Descriptor() ([]byte, []int) { +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { return fileDescriptor_10a76e8135c0d000, []int{6} } -func (m *MsgSetMaxWasmSize) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSetMaxWasmSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSetMaxWasmSize.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -416,41 +419,48 @@ func (m *MsgSetMaxWasmSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgSetMaxWasmSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetMaxWasmSize.Merge(m, src) +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) } -func (m *MsgSetMaxWasmSize) XXX_Size() int { +func (m *MsgUpdateParams) XXX_Size() int { return m.Size() } -func (m *MsgSetMaxWasmSize) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetMaxWasmSize.DiscardUnknown(m) +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) } -var xxx_messageInfo_MsgSetMaxWasmSize proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo -func (m *MsgSetMaxWasmSize) GetMaxWasmSize() uint64 { +func (m *MsgUpdateParams) GetAuthority() string { if m != nil { - return m.MaxWasmSize + return m.Authority } - return 0 + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} } // no data needs to be returned -type MsgSetMaxWasmSizeResponse struct { +type MsgUpdateParamsResponse struct { } -func (m *MsgSetMaxWasmSizeResponse) Reset() { *m = MsgSetMaxWasmSizeResponse{} } -func (m *MsgSetMaxWasmSizeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetMaxWasmSizeResponse) ProtoMessage() {} -func (*MsgSetMaxWasmSizeResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_10a76e8135c0d000, []int{7} } -func (m *MsgSetMaxWasmSizeResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSetMaxWasmSizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSetMaxWasmSizeResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -460,17 +470,17 @@ func (m *MsgSetMaxWasmSizeResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *MsgSetMaxWasmSizeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetMaxWasmSizeResponse.Merge(m, src) +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) } -func (m *MsgSetMaxWasmSizeResponse) XXX_Size() int { +func (m *MsgUpdateParamsResponse) XXX_Size() int { return m.Size() } -func (m *MsgSetMaxWasmSizeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetMaxWasmSizeResponse.DiscardUnknown(m) +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgSetMaxWasmSizeResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgStoreDataRequestWasm)(nil), "sedachain.wasm_storage.v1.MsgStoreDataRequestWasm") @@ -479,8 +489,8 @@ func init() { proto.RegisterType((*MsgStoreOverlayWasmResponse)(nil), "sedachain.wasm_storage.v1.MsgStoreOverlayWasmResponse") proto.RegisterType((*MsgInstantiateAndRegisterProxyContract)(nil), "sedachain.wasm_storage.v1.MsgInstantiateAndRegisterProxyContract") proto.RegisterType((*MsgInstantiateAndRegisterProxyContractResponse)(nil), "sedachain.wasm_storage.v1.MsgInstantiateAndRegisterProxyContractResponse") - proto.RegisterType((*MsgSetMaxWasmSize)(nil), "sedachain.wasm_storage.v1.MsgSetMaxWasmSize") - proto.RegisterType((*MsgSetMaxWasmSizeResponse)(nil), "sedachain.wasm_storage.v1.MsgSetMaxWasmSizeResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "sedachain.wasm_storage.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "sedachain.wasm_storage.v1.MsgUpdateParamsResponse") } func init() { @@ -488,54 +498,56 @@ func init() { } var fileDescriptor_10a76e8135c0d000 = []byte{ - // 751 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0x8e, 0xff, 0x5c, 0xda, 0x7f, 0x0a, 0xa5, 0x98, 0x48, 0x75, 0x52, 0x29, 0x89, 0x52, 0x09, - 0x45, 0xa8, 0xb1, 0x9b, 0x70, 0xa9, 0xa8, 0x84, 0x50, 0x93, 0x6e, 0xb2, 0x88, 0x0a, 0x2e, 0x52, - 0x25, 0x36, 0xd1, 0xc4, 0x9e, 0x3a, 0x16, 0xb1, 0x27, 0xf8, 0x4c, 0x5a, 0xa7, 0x4b, 0x16, 0xac, - 0x79, 0x0d, 0x90, 0x90, 0x90, 0x8a, 0x78, 0x86, 0x2e, 0x2b, 0x56, 0xac, 0x0a, 0x4a, 0x17, 0xbc, - 0x03, 0x2b, 0x34, 0xf6, 0x24, 0xa4, 0x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0x8e, 0xed, 0x93, 0xba, - 0x23, 0xa0, 0xfa, 0xd0, 0x68, 0x7d, 0xee, 0xd5, 0xf7, 0x0f, 0x77, 0x44, 0x84, 0xfc, 0x7d, 0x94, - 0x1d, 0x93, 0xae, 0x4e, 0xa0, 0x43, 0x5d, 0x20, 0x3c, 0x89, 0x16, 0x86, 0x56, 0x98, 0xb4, 0x1e, - 0xc8, 0xf9, 0xb7, 0x12, 0xba, 0x35, 0xb0, 0xdb, 0xda, 0x23, 0x5e, 0x1b, 0xf7, 0xfe, 0xd9, 0x12, - 0x4b, 0x68, 0xe9, 0x82, 0x54, 0x27, 0x96, 0x77, 0x18, 0x45, 0xb7, 0xeb, 0x60, 0xd5, 0x5c, 0x60, - 0xd8, 0x65, 0x36, 0x66, 0x64, 0xc3, 0x35, 0x75, 0x62, 0xd9, 0xc0, 0x88, 0xf7, 0xc4, 0xa3, 0x7e, - 0xaf, 0x4a, 0x5d, 0xe6, 0x61, 0x83, 0xfd, 0x41, 0xc5, 0x2a, 0x8a, 0x63, 0xd3, 0xb1, 0xdd, 0xa0, - 0xe4, 0x49, 0x06, 0x21, 0x4c, 0x5e, 0x46, 0x33, 0x06, 0x35, 0x49, 0xc3, 0x36, 0x83, 0x66, 0xc4, - 0x2a, 0xa8, 0x7f, 0x92, 0x4d, 0x54, 0xa9, 0x49, 0x6a, 0x9b, 0x7a, 0x82, 0xab, 0x6a, 0xa6, 0x9c, - 0x44, 0xf1, 0x36, 0x6e, 0x92, 0xb6, 0x12, 0x0b, 0xca, 0x08, 0x0f, 0xf2, 0x16, 0x8a, 0x3a, 0x60, - 0x29, 0x71, 0xde, 0xdb, 0xca, 0xa3, 0x1f, 0x27, 0xd9, 0x87, 0x96, 0xcd, 0x5a, 0xdd, 0xa6, 0x6a, - 0x50, 0x47, 0xab, 0x52, 0x70, 0x78, 0x27, 0x82, 0x35, 0x36, 0x35, 0x3f, 0xf8, 0x6a, 0xac, 0xd7, - 0x21, 0xa0, 0xea, 0x78, 0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xd0, 0xc2, 0x39, 0xba, 0xab, 0x53, - 0xf8, 0x1b, 0xc1, 0xa7, 0x1f, 0x5c, 0x0d, 0x3f, 0x8c, 0x7d, 0x28, 0xa1, 0xe5, 0x69, 0xc8, 0xb8, - 0x31, 0xd9, 0xff, 0x14, 0x2e, 0xd2, 0xb5, 0xbf, 0x76, 0x31, 0xcc, 0x9a, 0xa1, 0xf9, 0xdf, 0xb6, - 0x62, 0xe5, 0x92, 0xfa, 0xcf, 0xa0, 0xd3, 0xf7, 0xae, 0x82, 0x1e, 0x44, 0xad, 0x3c, 0x3d, 0xea, - 0x67, 0xa4, 0xe3, 0x7e, 0x46, 0xfa, 0xd6, 0xcf, 0x48, 0x6f, 0x4e, 0x33, 0x91, 0xe3, 0xd3, 0x4c, - 0xe4, 0xcb, 0x69, 0x26, 0xf2, 0x7c, 0x6d, 0x84, 0x8a, 0xdc, 0x73, 0xf0, 0x62, 0x19, 0xb4, 0x1d, - 0x1c, 0x8a, 0xe1, 0x13, 0x17, 0xfe, 0x05, 0x8a, 0x83, 0x47, 0x2e, 0xe0, 0x67, 0x33, 0x11, 0x20, - 0xef, 0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x30, 0x7d, 0x13, 0xcb, 0xb4, 0x07, 0x00, 0x00, + // 778 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x4f, 0x1b, 0x49, + 0x18, 0xf6, 0x9e, 0x3f, 0x80, 0x01, 0x01, 0xda, 0xb3, 0xc4, 0xda, 0x27, 0xd9, 0x3e, 0x23, 0x9d, + 0x2c, 0x74, 0xde, 0xc5, 0x3e, 0x1d, 0xa7, 0x43, 0x3a, 0x21, 0x6c, 0x1a, 0x17, 0x16, 0xdc, 0x72, + 0x27, 0xa4, 0x34, 0xd6, 0x78, 0x77, 0x58, 0xaf, 0xe2, 0xdd, 0x71, 0xf6, 0x1d, 0x83, 0x9d, 0x32, + 0x45, 0xea, 0xd4, 0xf9, 0x07, 0x89, 0x14, 0x09, 0x89, 0xfc, 0x08, 0x4a, 0x94, 0x2a, 0x15, 0x89, + 0x4c, 0x91, 0xff, 0x90, 0x2a, 0x9a, 0xd9, 0xb1, 0x31, 0x0a, 0x36, 0x26, 0x69, 0x52, 0xcd, 0xd7, + 0xf3, 0x3e, 0xef, 0xf7, 0x3b, 0x28, 0x0f, 0xc4, 0xc6, 0x56, 0x0b, 0xbb, 0xbe, 0x71, 0x8a, 0xc1, + 0x6b, 0x00, 0xa3, 0x01, 0x76, 0x88, 0x71, 0x52, 0x32, 0x58, 0x4f, 0xef, 0x04, 0x94, 0x51, 0x35, + 0x35, 0xc2, 0xe8, 0xe3, 0x18, 0xfd, 0xa4, 0x94, 0xce, 0x58, 0x14, 0x3c, 0x0a, 0x46, 0x13, 0x03, + 0x97, 0x69, 0x12, 0x86, 0x4b, 0x86, 0x45, 0x5d, 0x3f, 0x14, 0x4d, 0xaf, 0xc9, 0x77, 0x0f, 0x1c, + 0x4e, 0xe9, 0x81, 0x23, 0x1f, 0x92, 0x0e, 0x75, 0xa8, 0xd8, 0x1a, 0x7c, 0x27, 0x6f, 0x53, 0x21, + 0xbc, 0x11, 0x3e, 0x84, 0x07, 0xf9, 0xf4, 0xfb, 0x64, 0x43, 0x6f, 0x19, 0x25, 0xd0, 0xf9, 0x37, + 0x0a, 0x5a, 0xab, 0x83, 0x73, 0xc8, 0x68, 0x40, 0xf6, 0x30, 0xc3, 0x26, 0x79, 0xd2, 0x25, 0xc0, + 0x8e, 0x30, 0x78, 0xea, 0x26, 0x4a, 0x00, 0xf1, 0x6d, 0x12, 0x68, 0x4a, 0x4e, 0x29, 0x2c, 0x54, + 0xb4, 0x77, 0x6f, 0x8b, 0x49, 0xa9, 0x6b, 0xd7, 0xb6, 0x03, 0x02, 0x70, 0xc8, 0x02, 0xd7, 0x77, + 0x4c, 0x89, 0x53, 0x55, 0x14, 0xe3, 0x3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, 0xbf, 0x4e, 0xa9, 0xfb, 0x50, 0x55, 0x25, 0xc6, 0x03, 0x6d, 0x4a, 0xb1, 0xed, 0x65, 0x1e, + 0x90, 0x1b, 0xc2, 0x7c, 0x4a, 0x8c, 0xa3, 0x71, 0xdb, 0x86, 0xce, 0x97, 0xcf, 0x62, 0x28, 0x5a, + 0x07, 0x47, 0x7d, 0xae, 0xa0, 0xe4, 0x9d, 0xf3, 0xaa, 0x3c, 0x45, 0xf9, 0x84, 0xa1, 0x91, 0xde, + 0x7e, 0xb8, 0xcc, 0x28, 0x1b, 0x4f, 0xd1, 0xea, 0x57, 0x03, 0x45, 0x9f, 0x81, 0x6f, 0x0c, 0x9f, + 0xde, 0x7a, 0x18, 0x7e, 0xa4, 0xfb, 0x5c, 0x41, 0xeb, 0xb3, 0xb4, 0xfb, 0xee, 0x74, 0xfe, 0x19, + 0x28, 0xd2, 0xb5, 0xef, 0xa6, 0x18, 0x59, 0xed, 0xa3, 0xa5, 0x5b, 0x65, 0xb7, 0x31, 0x9d, 0x7a, + 0x1c, 0x9b, 0x2e, 0xcf, 0x8e, 0x1d, 0xea, 0xab, 0xfc, 0x7b, 0x31, 0xc8, 0x28, 0x97, 0x83, 0x8c, + 0xf2, 0x71, 0x90, 0x51, 0x5e, 0x5c, 0x67, 0x22, 0x97, 0xd7, 0x99, 0xc8, 0xfb, 0xeb, 0x4c, 0xe4, + 0xd1, 0x5f, 0x63, 0x6d, 0xce, 0x79, 0xc5, 0x6f, 0x68, 0xd1, 0xb6, 0x38, 0x14, 0xc3, 0xef, 0x33, + 0x9c, 0x30, 0xc5, 0xe1, 0x07, 0x2a, 0x7a, 0xbf, 0x99, 0x10, 0xc8, 0x3f, 0xbe, 0x04, 0x00, 0x00, + 0xff, 0xff, 0x13, 0x9d, 0x74, 0xeb, 0x10, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -553,7 +565,7 @@ type MsgClient interface { StoreDataRequestWasm(ctx context.Context, in *MsgStoreDataRequestWasm, opts ...grpc.CallOption) (*MsgStoreDataRequestWasmResponse, error) StoreOverlayWasm(ctx context.Context, in *MsgStoreOverlayWasm, opts ...grpc.CallOption) (*MsgStoreOverlayWasmResponse, error) InstantiateAndRegisterProxyContract(ctx context.Context, in *MsgInstantiateAndRegisterProxyContract, opts ...grpc.CallOption) (*MsgInstantiateAndRegisterProxyContractResponse, error) - SetMaxWasmSize(ctx context.Context, in *MsgSetMaxWasmSize, opts ...grpc.CallOption) (*MsgSetMaxWasmSizeResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -591,9 +603,9 @@ func (c *msgClient) InstantiateAndRegisterProxyContract(ctx context.Context, in return out, nil } -func (c *msgClient) SetMaxWasmSize(ctx context.Context, in *MsgSetMaxWasmSize, opts ...grpc.CallOption) (*MsgSetMaxWasmSizeResponse, error) { - out := new(MsgSetMaxWasmSizeResponse) - err := c.cc.Invoke(ctx, "/sedachain.wasm_storage.v1.Msg/SetMaxWasmSize", in, out, opts...) +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/sedachain.wasm_storage.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -605,7 +617,7 @@ type MsgServer interface { StoreDataRequestWasm(context.Context, *MsgStoreDataRequestWasm) (*MsgStoreDataRequestWasmResponse, error) StoreOverlayWasm(context.Context, *MsgStoreOverlayWasm) (*MsgStoreOverlayWasmResponse, error) InstantiateAndRegisterProxyContract(context.Context, *MsgInstantiateAndRegisterProxyContract) (*MsgInstantiateAndRegisterProxyContractResponse, error) - SetMaxWasmSize(context.Context, *MsgSetMaxWasmSize) (*MsgSetMaxWasmSizeResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -621,8 +633,8 @@ func (*UnimplementedMsgServer) StoreOverlayWasm(ctx context.Context, req *MsgSto func (*UnimplementedMsgServer) InstantiateAndRegisterProxyContract(ctx context.Context, req *MsgInstantiateAndRegisterProxyContract) (*MsgInstantiateAndRegisterProxyContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InstantiateAndRegisterProxyContract not implemented") } -func (*UnimplementedMsgServer) SetMaxWasmSize(ctx context.Context, req *MsgSetMaxWasmSize) (*MsgSetMaxWasmSizeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetMaxWasmSize not implemented") +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -683,20 +695,20 @@ func _Msg_InstantiateAndRegisterProxyContract_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } -func _Msg_SetMaxWasmSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetMaxWasmSize) +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).SetMaxWasmSize(ctx, in) + return srv.(MsgServer).UpdateParams(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/sedachain.wasm_storage.v1.Msg/SetMaxWasmSize", + FullMethod: "/sedachain.wasm_storage.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetMaxWasmSize(ctx, req.(*MsgSetMaxWasmSize)) + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) } return interceptor(ctx, in, info, handler) } @@ -718,8 +730,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_InstantiateAndRegisterProxyContract_Handler, }, { - MethodName: "SetMaxWasmSize", - Handler: _Msg_SetMaxWasmSize_Handler, + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -987,7 +999,7 @@ func (m *MsgInstantiateAndRegisterProxyContractResponse) MarshalToSizedBuffer(dA return len(dAtA) - i, nil } -func (m *MsgSetMaxWasmSize) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -997,25 +1009,37 @@ func (m *MsgSetMaxWasmSize) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSetMaxWasmSize) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetMaxWasmSize) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.MaxWasmSize != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MaxWasmSize)) + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgSetMaxWasmSizeResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1025,12 +1049,12 @@ func (m *MsgSetMaxWasmSizeResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSetMaxWasmSizeResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetMaxWasmSizeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1169,19 +1193,22 @@ func (m *MsgInstantiateAndRegisterProxyContractResponse) Size() (n int) { return n } -func (m *MsgSetMaxWasmSize) Size() (n int) { +func (m *MsgUpdateParams) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.MaxWasmSize != 0 { - n += 1 + sovTx(uint64(m.MaxWasmSize)) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgSetMaxWasmSizeResponse) Size() (n int) { +func (m *MsgUpdateParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -1999,7 +2026,7 @@ func (m *MsgInstantiateAndRegisterProxyContractResponse) Unmarshal(dAtA []byte) } return nil } -func (m *MsgSetMaxWasmSize) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2022,17 +2049,49 @@ func (m *MsgSetMaxWasmSize) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetMaxWasmSize: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetMaxWasmSize: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxWasmSize", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx } - m.MaxWasmSize = 0 + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2042,11 +2101,25 @@ func (m *MsgSetMaxWasmSize) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxWasmSize |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2068,7 +2141,7 @@ func (m *MsgSetMaxWasmSize) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetMaxWasmSizeResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2091,10 +2164,10 @@ func (m *MsgSetMaxWasmSizeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetMaxWasmSizeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetMaxWasmSizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/wasm-storage/types/wasm_storage.pb.go b/x/wasm-storage/types/wasm_storage.pb.go index 7e513952..b7f471d3 100644 --- a/x/wasm-storage/types/wasm_storage.pb.go +++ b/x/wasm-storage/types/wasm_storage.pb.go @@ -184,41 +184,65 @@ func init() { } var fileDescriptor_9a4bda463450c942 = []byte{ - // 501 bytes of a gzipped FileDescriptorProto + // 510 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6e, 0xda, 0x4c, - 0x14, 0xc5, 0x3d, 0xc4, 0xca, 0x87, 0x86, 0x2f, 0x85, 0x4c, 0xfa, 0x87, 0x4e, 0x25, 0x63, 0x51, - 0xa9, 0x42, 0x28, 0xb1, 0x95, 0x64, 0xd1, 0x65, 0xe5, 0x84, 0xa9, 0x14, 0x89, 0xa6, 0xc4, 0x18, - 0x51, 0xba, 0xb1, 0x06, 0x98, 0x1a, 0x4b, 0x76, 0x87, 0xe2, 0x21, 0x85, 0x3c, 0x41, 0x45, 0x37, - 0x79, 0x01, 0xaf, 0xfa, 0x12, 0x7d, 0x84, 0x2c, 0xb3, 0xec, 0xaa, 0xad, 0xe0, 0x45, 0x2a, 0x8f, - 0x6b, 0x50, 0xa4, 0x74, 0x77, 0x8f, 0xfd, 0x3b, 0xf7, 0x1e, 0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} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MaxWasmSize != that1.MaxWasmSize { + return false + } + return true +} func (m *Wasm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size)