From d4006e27f99e5ce8883ebc795cbdb5039082857e Mon Sep 17 00:00:00 2001 From: Markus Waas Date: Wed, 15 Jan 2025 15:16:30 +1300 Subject: [PATCH] feat: add MsgExecCompat * ExecCompat has same functionality as Exec but accepts array of json-encoded message string instead of []*Any * Resolves issues with EIP712 signing --- proto/cosmos/tx/signing/v1beta1/signing.proto | 4 + types/tx/signing/signing.pb.go | 78 +-- x/authz/codec.go | 2 + x/authz/keeper/msg_server.go | 44 ++ x/authz/proto/cosmos/authz/v1beta1/tx.proto | 17 + x/authz/tx.pb.go | 518 ++++++++++++++++-- 6 files changed, 579 insertions(+), 84 deletions(-) diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto index 73b199815a0f..650cf01d6040 100644 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -41,6 +41,10 @@ enum SignMode { // Amino JSON and will be removed in the future. SIGN_MODE_LEGACY_AMINO_JSON = 127; + // Injective EIP712 support for any cosmos messages which uses proto-json encoded string for messages + // Signature verification is implemented in injective core + SIGN_MODE_EIP712_V2 = 128; + // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 // diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 7cbf43670814..9a2ee6622c10 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -56,6 +56,9 @@ const ( // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses // Amino JSON and will be removed in the future. SignMode_SIGN_MODE_LEGACY_AMINO_JSON SignMode = 127 + // Injective EIP712 support for any cosmos messages which uses proto-json encoded string for messages + // Signature verification is implemented in injective core + SignMode_SIGN_MODE_EIP712_V2 SignMode = 128 // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 // @@ -80,6 +83,7 @@ var SignMode_name = map[int32]string{ 2: "SIGN_MODE_TEXTUAL", 3: "SIGN_MODE_DIRECT_AUX", 127: "SIGN_MODE_LEGACY_AMINO_JSON", + 128: "SIGN_MODE_EIP712_V2", 191: "SIGN_MODE_EIP_191", } @@ -89,6 +93,7 @@ var SignMode_value = map[string]int32{ "SIGN_MODE_TEXTUAL": 2, "SIGN_MODE_DIRECT_AUX": 3, "SIGN_MODE_LEGACY_AMINO_JSON": 127, + "SIGN_MODE_EIP712_V2": 128, "SIGN_MODE_EIP_191": 191, } @@ -427,43 +432,44 @@ func init() { } var fileDescriptor_9a54958ff3d0b1b9 = []byte{ - // 573 bytes of a gzipped FileDescriptorProto + // 589 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xb3, 0x49, 0x5a, 0xa5, 0x53, 0x84, 0xcc, 0x92, 0x4a, 0xa9, 0x41, 0xa6, 0x2a, 0x07, - 0x2a, 0xa4, 0xae, 0x95, 0xf6, 0x80, 0xca, 0xcd, 0x4d, 0x4c, 0x6a, 0xda, 0xa4, 0xc5, 0x4e, 0xa5, - 0xc2, 0xc5, 0xb2, 0x9d, 0xad, 0xb1, 0x1a, 0x7b, 0x8d, 0x77, 0x8d, 0xea, 0x13, 0xaf, 0xc0, 0x6b, - 0xf4, 0x29, 0x38, 0x70, 0xe1, 0xd8, 0x23, 0x47, 0xd4, 0x3e, 0x03, 0x77, 0x54, 0x3b, 0x4e, 0x02, - 0x2a, 0x42, 0xf4, 0x64, 0xcd, 0xcc, 0xbf, 0xdf, 0xfc, 0xab, 0x99, 0x35, 0x3c, 0xf3, 0x18, 0x0f, - 0x19, 0x57, 0xc5, 0xb9, 0xca, 0x03, 0x3f, 0x0a, 0x22, 0x5f, 0xfd, 0xd8, 0x76, 0xa9, 0x70, 0x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x4e, 0xd8, 0xab, 0x98, 0x13, 0x16, 0x7e, 0x03, 0x0b, 0xf9, 0x94, - 0x26, 0x97, 0xd8, 0xb9, 0x0b, 0xb4, 0x7f, 0x03, 0xd8, 0xab, 0x98, 0x05, 0x49, 0xb6, 0x61, 0xb1, - 0x68, 0x83, 0x5f, 0x40, 0x3d, 0x64, 0xa3, 0xc2, 0xf0, 0xfd, 0xad, 0xa7, 0xff, 0x60, 0xf7, 0xd9, - 0x88, 0x9a, 0xf9, 0x01, 0xfc, 0x18, 0x96, 0xa6, 0x43, 0xcb, 0x9d, 0xdd, 0x33, 0x67, 0x09, 0xf9, - 0x02, 0xc1, 0x42, 0xde, 0x13, 0xef, 0x43, 0xc3, 0x0d, 0x84, 0x93, 0x24, 0x4e, 0x39, 0x34, 0xb5, - 0x6c, 0x52, 0xec, 0x24, 0x99, 0xae, 0x60, 0xd9, 0xa9, 0xc3, 0xc2, 0xd8, 0xf1, 0xc4, 0x6e, 0x20, - 0xb4, 0x9b, 0x63, 0xe6, 0x14, 0x80, 0xad, 0xdf, 0x76, 0xad, 0x9a, 0xef, 0xda, 0x9d, 0x86, 0x3a, - 0x87, 0xd9, 0x5d, 0x80, 0x1a, 0x4f, 0xc3, 0xe7, 0x17, 0x08, 0x1a, 0xe5, 0x1d, 0xf1, 0x2a, 0xac, - 0x58, 0x46, 0x6f, 0x60, 0xf7, 0x0f, 0xbb, 0xba, 0x7d, 0x3c, 0xb0, 0x8e, 0xf4, 0x8e, 0xf1, 0xca, - 0xd0, 0xbb, 0x52, 0x05, 0x37, 0x41, 0x9a, 0x95, 0xba, 0x86, 0xa9, 0x77, 0x86, 0x12, 0xc2, 0x2b, - 0xf0, 0x60, 0x96, 0x1d, 0xea, 0x27, 0xc3, 0x63, 0xed, 0x40, 0xaa, 0xe2, 0x16, 0x34, 0xff, 0x14, - 0xdb, 0xda, 0xf1, 0x89, 0x54, 0xc3, 0x4f, 0xe0, 0xd1, 0xac, 0x72, 0xa0, 0xf7, 0x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54, 0xc2, 0x8f, 0xe1, 0x61, 0x5e, 0x39, 0x54, 0xbb, 0xad, 0xf6, 0x1b, + 0xa3, 0xd5, 0xd3, 0xfa, 0x47, 0xc6, 0xcb, 0xc1, 0x51, 0x5f, 0xfa, 0x88, 0x6b, 0xb0, 0x92, 0x0b, + 0x54, 0xed, 0x78, 0xa7, 0xd1, 0x34, 0x5e, 0x37, 0xa5, 0x4f, 0x08, 0xcb, 0xb3, 0xbd, 0x54, 0xed, + 0xd8, 0x68, 0xec, 0x36, 0xa4, 0xaf, 0x48, 0x2e, 0x56, 0xd0, 0x5e, 0xf7, 0xdb, 0x75, 0x1d, 0x5d, + 0x5d, 0xd7, 0xd1, 0x8f, 0xeb, 0x3a, 0xfa, 0x7c, 0x53, 0x2f, 0x5c, 0xdd, 0xd4, 0x0b, 0xdf, 0x6f, + 0xea, 0x85, 0xb7, 0x5b, 0x8e, 0x2b, 0xde, 0x45, 0x16, 0xb1, 0x99, 0xa7, 0x64, 0x8f, 0x42, 0xf2, + 0xd9, 0xe2, 0xa3, 0x73, 0x45, 0xc4, 0x01, 0x9d, 0x7d, 0x69, 0xac, 0xc5, 0xe4, 0x97, 0xda, 0xfe, + 0x15, 0x00, 0x00, 0xff, 0xff, 0x55, 0x88, 0x3c, 0xd1, 0x85, 0x04, 0x00, 0x00, } func (m *SignatureDescriptors) Marshal() (dAtA []byte, err error) { diff --git a/x/authz/codec.go b/x/authz/codec.go index 4580a8b04f4f..1bf9deb0ea6d 100644 --- a/x/authz/codec.go +++ b/x/authz/codec.go @@ -16,6 +16,7 @@ func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) { legacy.RegisterAminoMsg(registrar, &MsgGrant{}, "cosmos-sdk/MsgGrant") legacy.RegisterAminoMsg(registrar, &MsgRevoke{}, "cosmos-sdk/MsgRevoke") legacy.RegisterAminoMsg(registrar, &MsgExec{}, "cosmos-sdk/MsgExec") + legacy.RegisterAminoMsg(registrar, &MsgExecCompat{}, "cosmos-sdk/MsgExecCompat") registrar.RegisterInterface((*Authorization)(nil), nil) registrar.RegisterConcrete(&GenericAuthorization{}, "cosmos-sdk/GenericAuthorization") @@ -27,6 +28,7 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) { &MsgGrant{}, &MsgRevoke{}, &MsgExec{}, + &MsgExecCompat{}, ) // since bank.SendAuthorization and staking.StakeAuthorization both implement Authorization diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index 1722a4f0bb14..d1e8ccc3acf2 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" "errors" + "fmt" "strings" errorsmod "cosmossdk.io/errors" @@ -131,6 +132,49 @@ func (k Keeper) Exec(ctx context.Context, msg *authz.MsgExec) (*authz.MsgExecRes return &authz.MsgExecResponse{Results: results}, nil } +// Exec implements the MsgServer.ExecCompat method. +func (k Keeper) ExecCompat(goCtx context.Context, msg *authz.MsgExecCompat) (*authz.MsgExecCompatResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + grantee, err := k.authKeeper.AddressCodec().StringToBytes(msg.Grantee) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid grantee address: %s", err) + } + + if len(msg.Msgs) == 0 { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("messages cannot be empty") + } + + subMsgs := make([]sdk.Msg, len(msg.Msgs)) + for idx, m := range msg.Msgs { + var iMsg sdk.Msg + err := k.cdc.UnmarshalInterfaceJSON([]byte(m), &iMsg) + if err != nil { + return nil, fmt.Errorf("parse message at index %d error: %w", idx, err) + } + + m, ok := iMsg.(sdk.HasValidateBasic) + if !ok { + subMsgs[idx] = iMsg + continue + } + + err = m.ValidateBasic() + if err != nil { + return nil, fmt.Errorf("validate message at index %d error: %w", idx, err) + } + + subMsgs[idx] = iMsg + } + + results, err := k.DispatchActions(ctx, grantee, subMsgs) + if err != nil { + return nil, fmt.Errorf("dispatch err: %w", err) + } + + return &authz.MsgExecCompatResponse{Results: results}, nil +} + func (k Keeper) PruneExpiredGrants(ctx context.Context, msg *authz.MsgPruneExpiredGrants) (*authz.MsgPruneExpiredGrantsResponse, error) { // 75 is an arbitrary value, we can change it later if needed if err := k.DequeueAndDeleteExpiredGrants(ctx, 75); err != nil { diff --git a/x/authz/proto/cosmos/authz/v1beta1/tx.proto b/x/authz/proto/cosmos/authz/v1beta1/tx.proto index 7c7d4bdbdf77..408f437f0c41 100644 --- a/x/authz/proto/cosmos/authz/v1beta1/tx.proto +++ b/x/authz/proto/cosmos/authz/v1beta1/tx.proto @@ -40,6 +40,9 @@ service Msg { rpc PruneExpiredGrants(MsgPruneExpiredGrants) returns (MsgPruneExpiredGrantsResponse) { option (cosmos_proto.method_added_in) = "cosmos-sdk 0.51"; } + + // ExecCompat has same functionality as Exec but accepts array of json-encoded message string instead of []*Any. Resolves issues with EIP712 signing. + rpc ExecCompat(MsgExecCompat) returns (MsgExecCompatResponse); } // MsgGrant is a request type for Grant method. It declares authorization to the grantee @@ -90,6 +93,11 @@ message MsgRevoke { // MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. message MsgRevokeResponse {} +// MsgExecCompatResponse defines the Msg/MsgExecCompatResponse response type. +message MsgExecCompatResponse { + repeated bytes results = 1; +} + // MsgRevokeAll revokes all grants issued by the specified granter. message MsgRevokeAll { option (cosmos_proto.message_added_in) = "cosmos-sdk 0.51"; @@ -116,3 +124,12 @@ message MsgPruneExpiredGrants { message MsgPruneExpiredGrantsResponse { option (cosmos_proto.message_added_in) = "x/authz v0.2.0"; } + +// MsgExecCompat supports legacy amino codec for frontend metamask signing +// Functions are same as MsgExec, but input for msgs is array of strings +message MsgExecCompat { + option (cosmos.msg.v1.signer) = "grantee"; + option (amino.name) = "cosmos-sdk/MsgExec"; + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated string msgs = 2; +} \ No newline at end of file diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index 75b550e895dd..f599d016b96a 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -270,6 +270,44 @@ func (m *MsgRevokeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRevokeResponse proto.InternalMessageInfo +// MsgExecCompatResponse defines the Msg/MsgExecCompatResponse response type. +type MsgExecCompatResponse struct { + Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (m *MsgExecCompatResponse) Reset() { *m = MsgExecCompatResponse{} } +func (m *MsgExecCompatResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecCompatResponse) ProtoMessage() {} +func (*MsgExecCompatResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{6} +} +func (m *MsgExecCompatResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecCompatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecCompatResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgExecCompatResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecCompatResponse.Merge(m, src) +} +func (m *MsgExecCompatResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecCompatResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecCompatResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecCompatResponse proto.InternalMessageInfo + // MsgRevokeAll revokes all grants issued by the specified granter. type MsgRevokeAll struct { Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` @@ -279,7 +317,7 @@ func (m *MsgRevokeAll) Reset() { *m = MsgRevokeAll{} } func (m *MsgRevokeAll) String() string { return proto.CompactTextString(m) } func (*MsgRevokeAll) ProtoMessage() {} func (*MsgRevokeAll) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{6} + return fileDescriptor_3ceddab7d8589ad1, []int{7} } func (m *MsgRevokeAll) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,7 +354,7 @@ func (m *MsgRevokeAllResponse) Reset() { *m = MsgRevokeAllResponse{} } func (m *MsgRevokeAllResponse) String() string { return proto.CompactTextString(m) } func (*MsgRevokeAllResponse) ProtoMessage() {} func (*MsgRevokeAllResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{7} + return fileDescriptor_3ceddab7d8589ad1, []int{8} } func (m *MsgRevokeAllResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -354,7 +392,7 @@ func (m *MsgPruneExpiredGrants) Reset() { *m = MsgPruneExpiredGrants{} } func (m *MsgPruneExpiredGrants) String() string { return proto.CompactTextString(m) } func (*MsgPruneExpiredGrants) ProtoMessage() {} func (*MsgPruneExpiredGrants) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{8} + return fileDescriptor_3ceddab7d8589ad1, []int{9} } func (m *MsgPruneExpiredGrants) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -391,7 +429,7 @@ func (m *MsgPruneExpiredGrantsResponse) Reset() { *m = MsgPruneExpiredGr func (m *MsgPruneExpiredGrantsResponse) String() string { return proto.CompactTextString(m) } func (*MsgPruneExpiredGrantsResponse) ProtoMessage() {} func (*MsgPruneExpiredGrantsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{9} + return fileDescriptor_3ceddab7d8589ad1, []int{10} } func (m *MsgPruneExpiredGrantsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -420,6 +458,46 @@ func (m *MsgPruneExpiredGrantsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPruneExpiredGrantsResponse proto.InternalMessageInfo +// MsgExecCompat supports legacy amino codec for frontend metamask signing +// Functions are same as MsgExec, but input for msgs is array of strings +type MsgExecCompat struct { + Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` + Msgs []string `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *MsgExecCompat) Reset() { *m = MsgExecCompat{} } +func (m *MsgExecCompat) String() string { return proto.CompactTextString(m) } +func (*MsgExecCompat) ProtoMessage() {} +func (*MsgExecCompat) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{11} +} +func (m *MsgExecCompat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecCompat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecCompat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgExecCompat) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecCompat.Merge(m, src) +} +func (m *MsgExecCompat) XXX_Size() int { + return m.Size() +} +func (m *MsgExecCompat) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecCompat.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecCompat proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgGrant)(nil), "cosmos.authz.v1beta1.MsgGrant") proto.RegisterType((*MsgGrantResponse)(nil), "cosmos.authz.v1beta1.MsgGrantResponse") @@ -427,59 +505,64 @@ func init() { proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") proto.RegisterType((*MsgRevoke)(nil), "cosmos.authz.v1beta1.MsgRevoke") proto.RegisterType((*MsgRevokeResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeResponse") + proto.RegisterType((*MsgExecCompatResponse)(nil), "cosmos.authz.v1beta1.MsgExecCompatResponse") proto.RegisterType((*MsgRevokeAll)(nil), "cosmos.authz.v1beta1.MsgRevokeAll") proto.RegisterType((*MsgRevokeAllResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeAllResponse") proto.RegisterType((*MsgPruneExpiredGrants)(nil), "cosmos.authz.v1beta1.MsgPruneExpiredGrants") proto.RegisterType((*MsgPruneExpiredGrantsResponse)(nil), "cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse") + proto.RegisterType((*MsgExecCompat)(nil), "cosmos.authz.v1beta1.MsgExecCompat") } func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } var fileDescriptor_3ceddab7d8589ad1 = []byte{ - // 687 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0xcf, 0x35, 0xfd, 0x43, 0xae, 0x15, 0xa5, 0x4e, 0x50, 0x5d, 0x57, 0x71, 0x2d, 0x43, 0x21, - 0x4a, 0x95, 0x73, 0x92, 0x8a, 0x25, 0xb0, 0x24, 0x52, 0xc5, 0x42, 0x04, 0x32, 0xb0, 0xb0, 0x54, - 0x49, 0x73, 0x5c, 0xa3, 0x3a, 0xb6, 0xe5, 0x73, 0xa2, 0x84, 0x05, 0xc4, 0x08, 0x0b, 0x1f, 0x03, - 0xb6, 0x0e, 0x19, 0xf9, 0x00, 0x55, 0xa7, 0xaa, 0x03, 0x62, 0x42, 0xd0, 0x0e, 0xfd, 0x18, 0x20, - 0xdf, 0x9d, 0xdd, 0x7f, 0x6e, 0x52, 0x18, 0x58, 0xda, 0xf7, 0xe7, 0xf7, 0xde, 0xfd, 0x5e, 0xde, - 0xef, 0x19, 0x66, 0xb7, 0x1c, 0xda, 0x71, 0xa8, 0xd1, 0xe8, 0xfa, 0xdb, 0x6f, 0x8c, 0x5e, 0xa9, - 0x89, 0xfd, 0x46, 0xc9, 0xf0, 0xfb, 0xc8, 0xf5, 0x1c, 0xdf, 0x91, 0x32, 0x3c, 0x8d, 0x58, 0x1a, - 0x89, 0x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 0x49, 0x8f, - 0x4a, 0x45, 0x38, 0xed, 0x06, 0xd1, 0xf1, 0xac, 0x05, 0xae, 0x92, 0x3d, 0x1c, 0x16, 0x6e, 0xf6, - 0xf9, 0x45, 0x6b, 0xbd, 0x22, 0x2a, 0xa3, 0x62, 0xc0, 0x59, 0xa4, 0xf5, 0x75, 0x98, 0x8d, 0x7d, - 0x29, 0xe2, 0x27, 0x5d, 0xae, 0x2f, 0xff, 0x4e, 0xc2, 0x64, 0x9d, 0x12, 0xe9, 0x29, 0x9c, 0xe2, - 0xa7, 0xae, 0xc6, 0xdf, 0x5c, 0x78, 0x32, 0xca, 0xbd, 0xd1, 0xf9, 0x48, 0x93, 0x4f, 0xe0, 0x24, - 0x3b, 0xa7, 0xec, 0x95, 0xf8, 0x20, 0xad, 0xac, 0x8e, 0x4c, 0x47, 0xdd, 0x4c, 0x38, 0x2d, 0x34, - 0xbc, 0x72, 0x65, 0x01, 0x07, 0x28, 0xf7, 0xc7, 0x00, 0xa2, 0x9e, 0x2e, 0x4c, 0x9d, 0x8a, 0x48, - 0x1f, 0x53, 0x55, 0xb5, 0x2c, 0x25, 0x3f, 0x1e, 0x13, 0x89, 0x34, 0xbd, 0x7f, 0x59, 0x0b, 0xd2, - 0x47, 0x00, 0xa5, 0x18, 0x25, 0xac, 0x5d, 0xd9, 0xf7, 0x32, 0x58, 0x59, 0xff, 0x0b, 0xf0, 0x48, - 0x36, 0xca, 0xd4, 0xbb, 0xe0, 0xe3, 0x59, 0x2b, 0xef, 0xfd, 0x52, 0x13, 0x7b, 0x47, 0x2a, 0x38, - 0x38, 0x52, 0xc1, 0xcf, 0x23, 0x15, 0x7c, 0x3a, 0x56, 0x13, 0x07, 0xc7, 0x6a, 0xe2, 0xfb, 0xb1, - 0x9a, 0x78, 0x25, 0x14, 0x49, 0x5b, 0x3b, 0xa8, 0xed, 0x18, 0x42, 0x3c, 0xcd, 0x69, 0xf6, 0x65, - 0x5b, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x34, 0x9d, 0x5f, 0xf4, 0x06, 0x00, 0x00, + // 735 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4d, 0x6f, 0x12, 0x4f, + 0x18, 0x67, 0x4b, 0x5f, 0xfe, 0x3c, 0xed, 0xdf, 0xda, 0x05, 0x53, 0xba, 0x0d, 0xdb, 0xcd, 0xd6, + 0x2a, 0x81, 0xb0, 0x0b, 0x34, 0x5e, 0xd0, 0x0b, 0x98, 0xc6, 0x8b, 0x44, 0x83, 0x7a, 0xf1, 0x60, + 0x03, 0x65, 0x9c, 0x92, 0xee, 0x5b, 0x76, 0x16, 0x02, 0xc6, 0x44, 0xe3, 0x51, 0x2f, 0x7e, 0x0c, + 0xbd, 0xf5, 0xc0, 0xd1, 0x0f, 0xd0, 0xf4, 0xd4, 0xf4, 0x60, 0x3c, 0xf9, 0xd2, 0x1e, 0xfa, 0x35, + 0xcc, 0xee, 0xcc, 0x6e, 0x69, 0xbb, 0x05, 0xda, 0x83, 0x17, 0x98, 0x99, 0xe7, 0xf7, 0x3c, 0xf3, + 0xfb, 0x3d, 0x2f, 0xb3, 0x90, 0xda, 0x32, 0x89, 0x6e, 0x12, 0xb5, 0xde, 0x76, 0xb6, 0xdf, 0xa8, + 0x9d, 0x42, 0x03, 0x39, 0xf5, 0x82, 0xea, 0x74, 0x15, 0xcb, 0x36, 0x1d, 0x93, 0x4f, 0x50, 0xb3, + 0xe2, 0x99, 0x15, 0x66, 0x16, 0x96, 0xe8, 0xe9, 0xa6, 0x87, 0x51, 0x19, 0xc4, 0xdb, 0x08, 0x09, + 0x6c, 0x62, 0x93, 0x9e, 0xbb, 0x2b, 0x76, 0xba, 0x84, 0x4d, 0x13, 0x6b, 0x48, 0xf5, 0x76, 0x8d, + 0xf6, 0x6b, 0xb5, 0x6e, 0xf4, 0x98, 0x49, 0x0a, 0x25, 0x40, 0xef, 0xa3, 0x88, 0x45, 0x86, 0xd0, + 0x09, 0x56, 0x3b, 0x05, 0xf7, 0x8f, 0x19, 0x16, 0xea, 0x7a, 0xcb, 0x30, 0x55, 0xef, 0x97, 0x1e, + 0xc9, 0xdf, 0x39, 0xf8, 0xaf, 0x4a, 0xf0, 0x23, 0xbb, 0x6e, 0x38, 0x7c, 0x11, 0x66, 0xb0, 0xbb, + 0x40, 0x76, 0x92, 0x93, 0xb8, 0x74, 0xac, 0x92, 0x3c, 0xec, 0xe7, 0x7c, 0x45, 0xe5, 0x66, 0xd3, + 0x46, 0x84, 0x3c, 0x73, 0xec, 0x96, 0x81, 0x6b, 0x3e, 0xf0, 0xd4, 0x07, 0x25, 0x27, 0xc6, 0xf3, + 0x41, 0xfc, 0x03, 0x98, 0xf2, 0x96, 0xc9, 0xa8, 0xc4, 0xa5, 0x67, 0x8b, 0xcb, 0x4a, 0x58, 0xd2, + 0x14, 0x8f, 0x53, 0x25, 0xb6, 0xf7, 0x73, 0x25, 0xf2, 0xe5, 0x64, 0x37, 0xc3, 0xd5, 0xa8, 0x53, + 0xe9, 0xf6, 0x87, 0x93, 0xdd, 0x8c, 0x7f, 0xff, 0xc7, 0x93, 0xdd, 0x4c, 0x9c, 0xba, 0xe7, 0x48, + 0x73, 0x47, 0xf5, 0xb5, 0xc8, 0x3c, 0xdc, 0xf4, 0xd7, 0x35, 0x44, 0x2c, 0xd3, 0x20, 0x48, 0xfe, + 0xca, 0xc1, 0x4c, 0x95, 0xe0, 0x8d, 0x2e, 0xda, 0x1a, 0xe4, 0xcd, 0x8d, 0xcb, 0x7b, 0x03, 0x26, + 0x75, 0x82, 0x49, 0x72, 0x42, 0x8a, 0xa6, 0x67, 0x8b, 0x09, 0x85, 0x16, 0x49, 0xf1, 0x8b, 0xa4, + 0x94, 0x8d, 0x5e, 0x65, 0x79, 0xbf, 0x9f, 0x63, 0x05, 0x50, 0x1a, 0x75, 0x82, 0x02, 0x39, 0x55, + 0x82, 0x6b,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0xa9, + 0x5f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x77, 0xa7, 0xd1, 0x05, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -510,6 +593,8 @@ type MsgClient interface { RevokeAll(ctx context.Context, in *MsgRevokeAll, opts ...grpc.CallOption) (*MsgRevokeAllResponse, error) // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error) + // ExecCompat has same functionality as Exec but accepts array of json-encoded message string instead of []*Any. Resolves issues with EIP712 signing. + ExecCompat(ctx context.Context, in *MsgExecCompat, opts ...grpc.CallOption) (*MsgExecCompatResponse, error) } type msgClient struct { @@ -565,6 +650,15 @@ func (c *msgClient) PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredG return out, nil } +func (c *msgClient) ExecCompat(ctx context.Context, in *MsgExecCompat, opts ...grpc.CallOption) (*MsgExecCompatResponse, error) { + out := new(MsgExecCompatResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/ExecCompat", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Grant grants the provided authorization to the grantee on the granter's @@ -583,6 +677,8 @@ type MsgServer interface { RevokeAll(context.Context, *MsgRevokeAll) (*MsgRevokeAllResponse, error) // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. PruneExpiredGrants(context.Context, *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) + // ExecCompat has same functionality as Exec but accepts array of json-encoded message string instead of []*Any. Resolves issues with EIP712 signing. + ExecCompat(context.Context, *MsgExecCompat) (*MsgExecCompatResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -604,6 +700,9 @@ func (*UnimplementedMsgServer) RevokeAll(ctx context.Context, req *MsgRevokeAll) func (*UnimplementedMsgServer) PruneExpiredGrants(ctx context.Context, req *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PruneExpiredGrants not implemented") } +func (*UnimplementedMsgServer) ExecCompat(ctx context.Context, req *MsgExecCompat) (*MsgExecCompatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecCompat not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -699,6 +798,24 @@ func _Msg_PruneExpiredGrants_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_ExecCompat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecCompat) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecCompat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Msg/ExecCompat", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecCompat(ctx, req.(*MsgExecCompat)) + } + return interceptor(ctx, in, info, handler) +} + var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.authz.v1beta1.Msg", @@ -724,6 +841,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "PruneExpiredGrants", Handler: _Msg_PruneExpiredGrants_Handler, }, + { + MethodName: "ExecCompat", + Handler: _Msg_ExecCompat_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/authz/v1beta1/tx.proto", @@ -942,6 +1063,38 @@ func (m *MsgRevokeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgExecCompatResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgExecCompatResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecCompatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Results[iNdEx]) + copy(dAtA[i:], m.Results[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *MsgRevokeAll) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1048,6 +1201,45 @@ func (m *MsgPruneExpiredGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgExecCompat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgExecCompat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecCompat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Msgs[iNdEx]) + copy(dAtA[i:], m.Msgs[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Msgs[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1151,6 +1343,21 @@ func (m *MsgRevokeResponse) Size() (n int) { return n } +func (m *MsgExecCompatResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, b := range m.Results { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func (m *MsgRevokeAll) Size() (n int) { if m == nil { return 0 @@ -1195,6 +1402,25 @@ func (m *MsgPruneExpiredGrantsResponse) Size() (n int) { return n } +func (m *MsgExecCompat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Msgs) > 0 { + for _, s := range m.Msgs { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1792,6 +2018,88 @@ func (m *MsgRevokeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExecCompatResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecCompatResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecCompatResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, make([]byte, postIndex-iNdEx)) + copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRevokeAll) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2056,6 +2364,120 @@ func (m *MsgPruneExpiredGrantsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExecCompat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecCompat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecCompat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0