From 6848448dc258944bf47d3a41e4033fbd9af3e59a Mon Sep 17 00:00:00 2001 From: testinginprod <98415576+testinginprod@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:15:31 +0100 Subject: [PATCH] =?UTF-8?q?feat(accounts):=20Add=20TxCompat=20field=20?= =?UTF-8?q?=E2=80=93=C2=A0=20implement=20Tx=20integration=20(part=201)=20(?= =?UTF-8?q?#18969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: unknown unknown --- .../accounts/v1/account_abstraction.pulsar.go | 860 ++++++++++++++++-- .../accounts/v1/account_abstraction.proto | 21 +- simapp/go.mod | 2 +- .../e2e/accounts/account_abstraction_test.go | 45 +- tests/go.mod | 2 +- tests/starship/tests/go.mod | 2 +- x/accounts/keeper_account_abstraction.go | 10 + x/accounts/msg_server.go | 15 +- x/accounts/v1/account_abstraction.pb.go | 399 +++++++- 9 files changed, 1196 insertions(+), 160 deletions(-) diff --git a/api/cosmos/accounts/v1/account_abstraction.pulsar.go b/api/cosmos/accounts/v1/account_abstraction.pulsar.go index 838500494cb6..451b7e9d2324 100644 --- a/api/cosmos/accounts/v1/account_abstraction.pulsar.go +++ b/api/cosmos/accounts/v1/account_abstraction.pulsar.go @@ -125,6 +125,7 @@ var ( fd_UserOperation_bundler_payment_gas_limit protoreflect.FieldDescriptor fd_UserOperation_execution_messages protoreflect.FieldDescriptor fd_UserOperation_execution_gas_limit protoreflect.FieldDescriptor + fd_UserOperation_tx_compat protoreflect.FieldDescriptor ) func init() { @@ -138,6 +139,7 @@ func init() { fd_UserOperation_bundler_payment_gas_limit = md_UserOperation.Fields().ByName("bundler_payment_gas_limit") fd_UserOperation_execution_messages = md_UserOperation.Fields().ByName("execution_messages") fd_UserOperation_execution_gas_limit = md_UserOperation.Fields().ByName("execution_gas_limit") + fd_UserOperation_tx_compat = md_UserOperation.Fields().ByName("tx_compat") } var _ protoreflect.Message = (*fastReflection_UserOperation)(nil) @@ -217,8 +219,8 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor return } } - if len(x.AuthenticationData) != 0 { - value := protoreflect.ValueOfBytes(x.AuthenticationData) + if x.AuthenticationData != nil { + value := protoreflect.ValueOfMessage(x.AuthenticationData.ProtoReflect()) if !f(fd_UserOperation_authentication_data, value) { return } @@ -253,6 +255,12 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor return } } + if x.TxCompat != nil { + value := protoreflect.ValueOfMessage(x.TxCompat.ProtoReflect()) + if !f(fd_UserOperation_tx_compat, value) { + return + } + } } // Has reports whether a field is populated. @@ -273,7 +281,7 @@ func (x *fastReflection_UserOperation) Has(fd protoreflect.FieldDescriptor) bool case "cosmos.accounts.v1.UserOperation.authentication_method": return x.AuthenticationMethod != "" case "cosmos.accounts.v1.UserOperation.authentication_data": - return len(x.AuthenticationData) != 0 + return x.AuthenticationData != nil case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return x.AuthenticationGasLimit != uint64(0) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -284,6 +292,8 @@ func (x *fastReflection_UserOperation) Has(fd protoreflect.FieldDescriptor) bool return len(x.ExecutionMessages) != 0 case "cosmos.accounts.v1.UserOperation.execution_gas_limit": return x.ExecutionGasLimit != uint64(0) + case "cosmos.accounts.v1.UserOperation.tx_compat": + return x.TxCompat != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -316,6 +326,8 @@ func (x *fastReflection_UserOperation) Clear(fd protoreflect.FieldDescriptor) { x.ExecutionMessages = nil case "cosmos.accounts.v1.UserOperation.execution_gas_limit": x.ExecutionGasLimit = uint64(0) + case "cosmos.accounts.v1.UserOperation.tx_compat": + x.TxCompat = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -340,7 +352,7 @@ func (x *fastReflection_UserOperation) Get(descriptor protoreflect.FieldDescript return protoreflect.ValueOfString(value) case "cosmos.accounts.v1.UserOperation.authentication_data": value := x.AuthenticationData - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": value := x.AuthenticationGasLimit return protoreflect.ValueOfUint64(value) @@ -362,6 +374,9 @@ func (x *fastReflection_UserOperation) Get(descriptor protoreflect.FieldDescript case "cosmos.accounts.v1.UserOperation.execution_gas_limit": value := x.ExecutionGasLimit return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperation.tx_compat": + value := x.TxCompat + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -387,7 +402,7 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu case "cosmos.accounts.v1.UserOperation.authentication_method": x.AuthenticationMethod = value.Interface().(string) case "cosmos.accounts.v1.UserOperation.authentication_data": - x.AuthenticationData = value.Bytes() + x.AuthenticationData = value.Message().Interface().(*anypb.Any) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": x.AuthenticationGasLimit = value.Uint() case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -402,6 +417,8 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu x.ExecutionMessages = *clv.list case "cosmos.accounts.v1.UserOperation.execution_gas_limit": x.ExecutionGasLimit = value.Uint() + case "cosmos.accounts.v1.UserOperation.tx_compat": + x.TxCompat = value.Message().Interface().(*TxCompat) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -422,6 +439,11 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.authentication_data": + if x.AuthenticationData == nil { + x.AuthenticationData = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.AuthenticationData.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": if x.BundlerPaymentMessages == nil { x.BundlerPaymentMessages = []*anypb.Any{} @@ -434,12 +456,15 @@ func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) } value := &_UserOperation_7_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperation.tx_compat": + if x.TxCompat == nil { + x.TxCompat = new(TxCompat) + } + return protoreflect.ValueOfMessage(x.TxCompat.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.sender": panic(fmt.Errorf("field sender of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_method": panic(fmt.Errorf("field authentication_method of message cosmos.accounts.v1.UserOperation is not mutable")) - case "cosmos.accounts.v1.UserOperation.authentication_data": - panic(fmt.Errorf("field authentication_data of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": panic(fmt.Errorf("field authentication_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": @@ -464,7 +489,8 @@ func (x *fastReflection_UserOperation) NewField(fd protoreflect.FieldDescriptor) case "cosmos.accounts.v1.UserOperation.authentication_method": return protoreflect.ValueOfString("") case "cosmos.accounts.v1.UserOperation.authentication_data": - return protoreflect.ValueOfBytes(nil) + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -477,6 +503,9 @@ func (x *fastReflection_UserOperation) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfList(&_UserOperation_7_list{list: &list}) case "cosmos.accounts.v1.UserOperation.execution_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperation.tx_compat": + m := new(TxCompat) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -554,8 +583,8 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AuthenticationData) - if l > 0 { + if x.AuthenticationData != nil { + l = options.Size(x.AuthenticationData) n += 1 + l + runtime.Sov(uint64(l)) } if x.AuthenticationGasLimit != 0 { @@ -579,6 +608,10 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if x.ExecutionGasLimit != 0 { n += 1 + runtime.Sov(uint64(x.ExecutionGasLimit)) } + if x.TxCompat != nil { + l = options.Size(x.TxCompat) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -608,6 +641,20 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.TxCompat != nil { + encoded, err := options.Marshal(x.TxCompat) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x4a + } if x.ExecutionGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecutionGasLimit)) i-- @@ -655,10 +702,17 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x20 } - if len(x.AuthenticationData) > 0 { - i -= len(x.AuthenticationData) - copy(dAtA[i:], x.AuthenticationData) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthenticationData))) + if x.AuthenticationData != nil { + encoded, err := options.Marshal(x.AuthenticationData) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x1a } @@ -793,7 +847,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -803,24 +857,26 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AuthenticationData = append(x.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) if x.AuthenticationData == nil { - x.AuthenticationData = []byte{} + x.AuthenticationData = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AuthenticationData); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex case 4: @@ -948,6 +1004,530 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { break } } + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxCompat", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TxCompat == nil { + x.TxCompat = &TxCompat{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TxCompat); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_TxCompat protoreflect.MessageDescriptor + fd_TxCompat_auth_info_bytes protoreflect.FieldDescriptor + fd_TxCompat_body_bytes protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_account_abstraction_proto_init() + md_TxCompat = File_cosmos_accounts_v1_account_abstraction_proto.Messages().ByName("TxCompat") + fd_TxCompat_auth_info_bytes = md_TxCompat.Fields().ByName("auth_info_bytes") + fd_TxCompat_body_bytes = md_TxCompat.Fields().ByName("body_bytes") +} + +var _ protoreflect.Message = (*fastReflection_TxCompat)(nil) + +type fastReflection_TxCompat TxCompat + +func (x *TxCompat) ProtoReflect() protoreflect.Message { + return (*fastReflection_TxCompat)(x) +} + +func (x *TxCompat) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TxCompat_messageType fastReflection_TxCompat_messageType +var _ protoreflect.MessageType = fastReflection_TxCompat_messageType{} + +type fastReflection_TxCompat_messageType struct{} + +func (x fastReflection_TxCompat_messageType) Zero() protoreflect.Message { + return (*fastReflection_TxCompat)(nil) +} +func (x fastReflection_TxCompat_messageType) New() protoreflect.Message { + return new(fastReflection_TxCompat) +} +func (x fastReflection_TxCompat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TxCompat +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TxCompat) Descriptor() protoreflect.MessageDescriptor { + return md_TxCompat +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TxCompat) Type() protoreflect.MessageType { + return _fastReflection_TxCompat_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TxCompat) New() protoreflect.Message { + return new(fastReflection_TxCompat) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TxCompat) Interface() protoreflect.ProtoMessage { + return (*TxCompat)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TxCompat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AuthInfoBytes) != 0 { + value := protoreflect.ValueOfBytes(x.AuthInfoBytes) + if !f(fd_TxCompat_auth_info_bytes, value) { + return + } + } + if len(x.BodyBytes) != 0 { + value := protoreflect.ValueOfBytes(x.BodyBytes) + if !f(fd_TxCompat_body_bytes, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TxCompat) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + return len(x.AuthInfoBytes) != 0 + case "cosmos.accounts.v1.TxCompat.body_bytes": + return len(x.BodyBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxCompat) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + x.AuthInfoBytes = nil + case "cosmos.accounts.v1.TxCompat.body_bytes": + x.BodyBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TxCompat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + value := x.AuthInfoBytes + return protoreflect.ValueOfBytes(value) + case "cosmos.accounts.v1.TxCompat.body_bytes": + value := x.BodyBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxCompat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + x.AuthInfoBytes = value.Bytes() + case "cosmos.accounts.v1.TxCompat.body_bytes": + x.BodyBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxCompat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + panic(fmt.Errorf("field auth_info_bytes of message cosmos.accounts.v1.TxCompat is not mutable")) + case "cosmos.accounts.v1.TxCompat.body_bytes": + panic(fmt.Errorf("field body_bytes of message cosmos.accounts.v1.TxCompat is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TxCompat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + return protoreflect.ValueOfBytes(nil) + case "cosmos.accounts.v1.TxCompat.body_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TxCompat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.TxCompat", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TxCompat) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxCompat) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TxCompat) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TxCompat) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TxCompat) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AuthInfoBytes) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BodyBytes) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TxCompat) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BodyBytes) > 0 { + i -= len(x.BodyBytes) + copy(dAtA[i:], x.BodyBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BodyBytes))) + i-- + dAtA[i] = 0x12 + } + if len(x.AuthInfoBytes) > 0 { + i -= len(x.AuthInfoBytes) + copy(dAtA[i:], x.AuthInfoBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthInfoBytes))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TxCompat) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxCompat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxCompat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthInfoBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AuthInfoBytes = append(x.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) + if x.AuthInfoBytes == nil { + x.AuthInfoBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BodyBytes = append(x.BodyBytes[:0], dAtA[iNdEx:postIndex]...) + if x.BodyBytes == nil { + x.BodyBytes = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1115,7 +1695,7 @@ func (x *UserOperationResponse) ProtoReflect() protoreflect.Message { } func (x *UserOperationResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1851,7 +2431,7 @@ type UserOperation struct { AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + AuthenticationData *anypb.Any `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` @@ -1876,6 +2456,12 @@ type UserOperation struct { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat *TxCompat `protobuf:"bytes,9,opt,name=tx_compat,json=txCompat,proto3" json:"tx_compat,omitempty"` } func (x *UserOperation) Reset() { @@ -1912,7 +2498,7 @@ func (x *UserOperation) GetAuthenticationMethod() string { return "" } -func (x *UserOperation) GetAuthenticationData() []byte { +func (x *UserOperation) GetAuthenticationData() *anypb.Any { if x != nil { return x.AuthenticationData } @@ -1954,6 +2540,63 @@ func (x *UserOperation) GetExecutionGasLimit() uint64 { return 0 } +func (x *UserOperation) GetTxCompat() *TxCompat { + if x != nil { + return x.TxCompat + } + return nil +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +type TxCompat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + AuthInfoBytes []byte `protobuf:"bytes,1,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` + // body_bytes contains the body bytes of the tx. + // must not be modified. + BodyBytes []byte `protobuf:"bytes,2,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` +} + +func (x *TxCompat) Reset() { + *x = TxCompat{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxCompat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxCompat) ProtoMessage() {} + +// Deprecated: Use TxCompat.ProtoReflect.Descriptor instead. +func (*TxCompat) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{1} +} + +func (x *TxCompat) GetAuthInfoBytes() []byte { + if x != nil { + return x.AuthInfoBytes + } + return nil +} + +func (x *TxCompat) GetBodyBytes() []byte { + if x != nil { + return x.BodyBytes + } + return nil +} + // UserOperationResponse defines the response of a UserOperation. // If the operation fails the error field will be populated. type UserOperationResponse struct { @@ -1983,7 +2626,7 @@ type UserOperationResponse struct { func (x *UserOperationResponse) Reset() { *x = UserOperationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1997,7 +2640,7 @@ func (*UserOperationResponse) ProtoMessage() {} // Deprecated: Use UserOperationResponse.ProtoReflect.Descriptor instead. func (*UserOperationResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{1} + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{2} } func (x *UserOperationResponse) GetAuthenticationGasUsed() uint64 { @@ -2050,72 +2693,82 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x03, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x04, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2f, 0x0a, 0x13, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, - 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xe5, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, - 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x50, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x17, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, + 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, - 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x17, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, + 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x39, 0x0a, + 0x09, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x52, 0x08, + 0x74, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x22, 0x51, 0x0a, 0x08, 0x54, 0x78, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, + 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe5, 0x02, 0x0a, 0x15, + 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, + 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x15, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x50, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x17, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x42, 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x17, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, + 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2130,22 +2783,25 @@ func file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP() []byte { return file_cosmos_accounts_v1_account_abstraction_proto_rawDescData } -var file_cosmos_accounts_v1_account_abstraction_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_accounts_v1_account_abstraction_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_accounts_v1_account_abstraction_proto_goTypes = []interface{}{ (*UserOperation)(nil), // 0: cosmos.accounts.v1.UserOperation - (*UserOperationResponse)(nil), // 1: cosmos.accounts.v1.UserOperationResponse - (*anypb.Any)(nil), // 2: google.protobuf.Any + (*TxCompat)(nil), // 1: cosmos.accounts.v1.TxCompat + (*UserOperationResponse)(nil), // 2: cosmos.accounts.v1.UserOperationResponse + (*anypb.Any)(nil), // 3: google.protobuf.Any } var file_cosmos_accounts_v1_account_abstraction_proto_depIdxs = []int32{ - 2, // 0: cosmos.accounts.v1.UserOperation.bundler_payment_messages:type_name -> google.protobuf.Any - 2, // 1: cosmos.accounts.v1.UserOperation.execution_messages:type_name -> google.protobuf.Any - 2, // 2: cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses:type_name -> google.protobuf.Any - 2, // 3: cosmos.accounts.v1.UserOperationResponse.execution_responses:type_name -> google.protobuf.Any - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // 0: cosmos.accounts.v1.UserOperation.authentication_data:type_name -> google.protobuf.Any + 3, // 1: cosmos.accounts.v1.UserOperation.bundler_payment_messages:type_name -> google.protobuf.Any + 3, // 2: cosmos.accounts.v1.UserOperation.execution_messages:type_name -> google.protobuf.Any + 1, // 3: cosmos.accounts.v1.UserOperation.tx_compat:type_name -> cosmos.accounts.v1.TxCompat + 3, // 4: cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses:type_name -> google.protobuf.Any + 3, // 5: cosmos.accounts.v1.UserOperationResponse.execution_responses:type_name -> google.protobuf.Any + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_accounts_v1_account_abstraction_proto_init() } @@ -2167,6 +2823,18 @@ func file_cosmos_accounts_v1_account_abstraction_proto_init() { } } file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxCompat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserOperationResponse); i { case 0: return &v.state @@ -2185,7 +2853,7 @@ func file_cosmos_accounts_v1_account_abstraction_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_v1_account_abstraction_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/cosmos/accounts/v1/account_abstraction.proto b/proto/cosmos/accounts/v1/account_abstraction.proto index 01fb36436fbc..8d279dad7824 100644 --- a/proto/cosmos/accounts/v1/account_abstraction.proto +++ b/proto/cosmos/accounts/v1/account_abstraction.proto @@ -17,7 +17,7 @@ message UserOperation { string authentication_method = 2; // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - bytes authentication_data = 3; + google.protobuf.Any authentication_data = 3; // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. uint64 authentication_gas_limit = 4; @@ -42,6 +42,25 @@ message UserOperation { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. uint64 execution_gas_limit = 8; + + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat tx_compat = 9; +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +message TxCompat { + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + bytes auth_info_bytes = 1; + // body_bytes contains the body bytes of the tx. + // must not be modified. + bytes body_bytes = 2; } // UserOperationResponse defines the response of a UserOperation. diff --git a/simapp/go.mod b/simapp/go.mod index 203395001d12..cf2c868ed1e4 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -33,7 +33,7 @@ require ( google.golang.org/protobuf v1.32.0 ) -require cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c +require cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index b5772b9b52dd..5ddf5043ad61 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -59,13 +59,28 @@ func TestAccountAbstraction(t *testing.T) { aliceAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aliceAddr) require.NoError(t, err) + t.Run("fail - tx compat in bundle is not allowed", func(t *testing.T) { + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: mockSignature, + ExecutionMessages: intoAny(t, &banktypes.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), // the sender is the AA, so it has the coins and wants to pay the bundler for the gas + }), + TxCompat: &accountsv1.TxCompat{}, + }) + require.Contains(t, resp.Error, accounts.ErrDisallowedTxCompatInBundle.Error()) + }) + t.Run("ok - pay bundler and exec not implemented", func(t *testing.T) { // we simulate executing an user operation in an abstracted account // which only implements the authentication. resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -78,7 +93,7 @@ func TestAccountAbstraction(t *testing.T) { ToAddress: aliceAddrStr, Amount: coins(t, "2000stake"), // as the real action the sender wants to send coins to alice }), - ExecutionGasLimit: 36000, + ExecutionGasLimit: 38000, }) require.Empty(t, resp.Error) // no error require.Len(t, resp.BundlerPaymentResponses, 1) @@ -97,7 +112,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: bundlerAddrStr, // abstracted account tries to send money from bundler to itself. @@ -124,7 +139,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -153,7 +168,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "invalid", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -183,7 +198,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -212,7 +227,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -241,7 +256,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaFullAddrStr, @@ -265,7 +280,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: nil, BundlerPaymentGasLimit: 50000, @@ -294,7 +309,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &nft.MsgSend{ ClassId: "omega-rare", @@ -308,7 +323,7 @@ func TestAccountAbstraction(t *testing.T) { ToAddress: aliceAddrStr, Amount: coins(t, "2000stake"), }), - ExecutionGasLimit: 36000, + ExecutionGasLimit: 38000, }) require.Empty(t, resp.Error) // no error }) @@ -336,3 +351,11 @@ func balanceIs(t *testing.T, ctx context.Context, app *simapp.SimApp, addr sdk.A balance := app.BankKeeper.GetAllBalances(ctx, addr) require.Equal(t, s, balance.String()) } + +var mockSignature = &codectypes.Any{TypeUrl: "signature", Value: []byte("signature")} + +func setupApp(t *testing.T) *simapp.SimApp { + t.Helper() + app := simapp.Setup(t, false) + return app +} diff --git a/tests/go.mod b/tests/go.mod index f55f99aef770..f56175e45015 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -34,7 +34,7 @@ require ( ) require ( - cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c + cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index ef8a952edbde..cb3164048fdf 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -59,7 +59,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.0 // indirect cosmossdk.io/store v1.0.1 // indirect - cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c // indirect + cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 // indirect cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190 // indirect diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 88b1f1da7351..fdca933a4bbc 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -17,6 +17,9 @@ var ( ErrBundlerPayment = errors.New("bundler payment failed") // ErrExecution is returned when the execution fails. ErrExecution = errors.New("execution failed") + // ErrDisallowedTxCompatInBundle is returned when the tx compat + // is populated in a bundle. + ErrDisallowedTxCompatInBundle = errors.New("tx compat field populated in bundle") ) // ExecuteUserOperation handles the execution of an abstracted account UserOperation. @@ -25,6 +28,13 @@ func (k Keeper) ExecuteUserOperation( bundler string, op *v1.UserOperation, ) *v1.UserOperationResponse { + // TxCompat field must not be allowed in a UserOperation sent from a bundle. + // Only the runtime can populate this field when an abstracted account sends + // a tx (not from a bundle) and this is converted into a UserOperation. + if op.TxCompat != nil { + return &v1.UserOperationResponse{Error: ErrDisallowedTxCompatInBundle.Error()} + } + resp := &v1.UserOperationResponse{} // authenticate diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 20357ba3e27b..52fafeec0c38 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -3,9 +3,6 @@ package accounts import ( "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "cosmossdk.io/core/event" "cosmossdk.io/x/accounts/internal/implementation" v1 "cosmossdk.io/x/accounts/v1" @@ -103,5 +100,15 @@ func (m msgServer) Execute(ctx context.Context, execute *v1.MsgExecute) (*v1.Msg } func (m msgServer) ExecuteBundle(ctx context.Context, req *v1.MsgExecuteBundle) (*v1.MsgExecuteBundleResponse, error) { - return nil, status.Error(codes.Unimplemented, "not implemented") + _, err := m.k.addressCodec.StringToBytes(req.Bundler) + if err != nil { + return nil, err + } + + resp := &v1.MsgExecuteBundleResponse{Responses: make([]*v1.UserOperationResponse, len(req.Operations))} + for i, op := range req.Operations { + resp.Responses[i] = m.k.ExecuteUserOperation(ctx, req.Bundler, op) + } + + return resp, nil } diff --git a/x/accounts/v1/account_abstraction.pb.go b/x/accounts/v1/account_abstraction.pb.go index 95ebb759fca7..f51cf1cc070a 100644 --- a/x/accounts/v1/account_abstraction.pb.go +++ b/x/accounts/v1/account_abstraction.pb.go @@ -34,7 +34,7 @@ type UserOperation struct { AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + AuthenticationData *types.Any `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` @@ -59,6 +59,12 @@ type UserOperation struct { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat *TxCompat `protobuf:"bytes,9,opt,name=tx_compat,json=txCompat,proto3" json:"tx_compat,omitempty"` } func (m *UserOperation) Reset() { *m = UserOperation{} } @@ -108,7 +114,7 @@ func (m *UserOperation) GetAuthenticationMethod() string { return "" } -func (m *UserOperation) GetAuthenticationData() []byte { +func (m *UserOperation) GetAuthenticationData() *types.Any { if m != nil { return m.AuthenticationData } @@ -150,6 +156,72 @@ func (m *UserOperation) GetExecutionGasLimit() uint64 { return 0 } +func (m *UserOperation) GetTxCompat() *TxCompat { + if m != nil { + return m.TxCompat + } + return nil +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +type TxCompat struct { + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + AuthInfoBytes []byte `protobuf:"bytes,1,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` + // body_bytes contains the body bytes of the tx. + // must not be modified. + BodyBytes []byte `protobuf:"bytes,2,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` +} + +func (m *TxCompat) Reset() { *m = TxCompat{} } +func (m *TxCompat) String() string { return proto.CompactTextString(m) } +func (*TxCompat) ProtoMessage() {} +func (*TxCompat) Descriptor() ([]byte, []int) { + return fileDescriptor_9f9bcc910ad46d4b, []int{1} +} +func (m *TxCompat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxCompat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxCompat.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 *TxCompat) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxCompat.Merge(m, src) +} +func (m *TxCompat) XXX_Size() int { + return m.Size() +} +func (m *TxCompat) XXX_DiscardUnknown() { + xxx_messageInfo_TxCompat.DiscardUnknown(m) +} + +var xxx_messageInfo_TxCompat proto.InternalMessageInfo + +func (m *TxCompat) GetAuthInfoBytes() []byte { + if m != nil { + return m.AuthInfoBytes + } + return nil +} + +func (m *TxCompat) GetBodyBytes() []byte { + if m != nil { + return m.BodyBytes + } + return nil +} + // UserOperationResponse defines the response of a UserOperation. // If the operation fails the error field will be populated. type UserOperationResponse struct { @@ -176,7 +248,7 @@ func (m *UserOperationResponse) Reset() { *m = UserOperationResponse{} } func (m *UserOperationResponse) String() string { return proto.CompactTextString(m) } func (*UserOperationResponse) ProtoMessage() {} func (*UserOperationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f9bcc910ad46d4b, []int{1} + return fileDescriptor_9f9bcc910ad46d4b, []int{2} } func (m *UserOperationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,6 +321,7 @@ func (m *UserOperationResponse) GetError() string { func init() { proto.RegisterType((*UserOperation)(nil), "cosmos.accounts.v1.UserOperation") + proto.RegisterType((*TxCompat)(nil), "cosmos.accounts.v1.TxCompat") proto.RegisterType((*UserOperationResponse)(nil), "cosmos.accounts.v1.UserOperationResponse") } @@ -257,36 +330,41 @@ func init() { } var fileDescriptor_9f9bcc910ad46d4b = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xe3, 0x24, 0x0d, 0x74, 0x00, 0x09, 0xa6, 0x49, 0xea, 0x76, 0x61, 0x45, 0x5d, 0x65, - 0x51, 0x8d, 0x55, 0x8a, 0xf8, 0x59, 0xf2, 0x27, 0x36, 0x14, 0x2a, 0x4b, 0xdd, 0xb0, 0xb1, 0x26, - 0xf6, 0x25, 0xb5, 0x88, 0x67, 0xa2, 0xb9, 0xe3, 0xaa, 0x79, 0x0b, 0xde, 0x0a, 0x96, 0x5d, 0xb2, - 0x44, 0x89, 0x78, 0x0f, 0x94, 0x19, 0xff, 0xc4, 0x71, 0x95, 0x5d, 0xac, 0x7b, 0xce, 0x3d, 0x27, - 0xdf, 0xcc, 0x90, 0xd3, 0x48, 0x62, 0x2a, 0xd1, 0xe7, 0x51, 0x24, 0x33, 0xa1, 0xd1, 0xbf, 0x39, - 0x2b, 0x7e, 0x87, 0x7c, 0x82, 0x5a, 0xf1, 0x48, 0x27, 0x52, 0xb0, 0xb9, 0x92, 0x5a, 0x52, 0x6a, - 0xd5, 0xac, 0x50, 0xb3, 0x9b, 0xb3, 0xe3, 0xa3, 0xa9, 0x94, 0xd3, 0x19, 0xf8, 0x46, 0x31, 0xc9, - 0xbe, 0xfb, 0x5c, 0x2c, 0xac, 0xfc, 0xe4, 0x57, 0x87, 0x3c, 0xb9, 0x42, 0x50, 0x5f, 0xe7, 0xa0, - 0xf8, 0x7a, 0x0d, 0x1d, 0x92, 0x1e, 0x82, 0x88, 0x41, 0xb9, 0xce, 0xc8, 0x19, 0xef, 0x07, 0xf9, - 0x17, 0x3d, 0x27, 0x03, 0x9e, 0xe9, 0x6b, 0x10, 0x3a, 0x89, 0x8c, 0x32, 0x4c, 0x41, 0x5f, 0xcb, - 0xd8, 0x6d, 0x1b, 0x59, 0xbf, 0x3e, 0xbc, 0x30, 0x33, 0xea, 0x93, 0x83, 0x2d, 0x53, 0xcc, 0x35, - 0x77, 0x3b, 0x23, 0x67, 0xfc, 0x38, 0xa0, 0xf5, 0xd1, 0x07, 0xae, 0x39, 0x7d, 0x4d, 0xdc, 0x2d, - 0xc3, 0x94, 0x63, 0x38, 0x4b, 0xd2, 0x44, 0xbb, 0xdd, 0x91, 0x33, 0xee, 0x06, 0xc3, 0xfa, 0xfc, - 0x13, 0xc7, 0xcf, 0xeb, 0x29, 0xfd, 0x42, 0xdc, 0x49, 0x26, 0xe2, 0x19, 0xa8, 0x70, 0xce, 0x17, - 0x29, 0x08, 0x1d, 0xa6, 0x80, 0xc8, 0xa7, 0x80, 0xee, 0xde, 0xa8, 0x33, 0x7e, 0xf4, 0xbc, 0xcf, - 0x2c, 0x07, 0x56, 0x70, 0x60, 0x6f, 0xc5, 0x22, 0x18, 0xe6, 0xae, 0x4b, 0x6b, 0xba, 0xc8, 0x3d, - 0xf4, 0x0d, 0x39, 0xda, 0xde, 0x57, 0x55, 0xe9, 0xd9, 0x2a, 0x75, 0x6b, 0x59, 0xe5, 0x3d, 0xa1, - 0x70, 0x0b, 0x51, 0x96, 0x53, 0xca, 0x4b, 0x3c, 0xd8, 0x51, 0xe2, 0x59, 0xa9, 0x2f, 0xf3, 0x19, - 0x39, 0xa8, 0x96, 0x54, 0xc9, 0x0f, 0x4d, 0x72, 0xa5, 0x2f, 0x42, 0x4f, 0xfe, 0xb5, 0xc9, 0xa0, - 0x76, 0x92, 0x01, 0xe0, 0x5c, 0x0a, 0x04, 0xfa, 0x92, 0x1c, 0xde, 0xc3, 0x34, 0x43, 0x88, 0xcd, - 0x11, 0x77, 0x83, 0x41, 0x03, 0xe9, 0x15, 0x42, 0x4c, 0x5f, 0x35, 0x89, 0x96, 0xc6, 0xb6, 0x35, - 0x36, 0x00, 0x18, 0xe3, 0x65, 0x13, 0x9d, 0xca, 0xcb, 0xa0, 0xdb, 0xd9, 0x81, 0xe1, 0xb0, 0xbe, - 0xaf, 0xf8, 0x07, 0x48, 0x4f, 0x37, 0x89, 0x96, 0x25, 0xec, 0x85, 0x78, 0xba, 0xc9, 0xc2, 0xe4, - 0x7f, 0xdc, 0x44, 0x57, 0x25, 0xef, 0xba, 0x05, 0xd5, 0xfa, 0x2a, 0xb4, 0x4f, 0xf6, 0x40, 0x29, - 0xa9, 0xcc, 0x69, 0xef, 0x07, 0xf6, 0xe3, 0xdd, 0x8b, 0xdf, 0x4b, 0xcf, 0xb9, 0x5b, 0x7a, 0xce, - 0xdf, 0xa5, 0xe7, 0xfc, 0x5c, 0x79, 0xad, 0xbb, 0x95, 0xd7, 0xfa, 0xb3, 0xf2, 0x5a, 0xdf, 0x8e, - 0xed, 0xd3, 0xc3, 0xf8, 0x07, 0x4b, 0xa4, 0x7f, 0xbb, 0xf9, 0x60, 0x27, 0x3d, 0x93, 0x76, 0xfe, - 0x3f, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xb6, 0x1b, 0x5c, 0xcd, 0x03, 0x00, 0x00, + // 536 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcf, 0x6f, 0xd3, 0x30, + 0x18, 0x6d, 0xda, 0xae, 0xb4, 0x86, 0x09, 0xf0, 0xda, 0x2e, 0x9b, 0x20, 0xaa, 0x7a, 0x40, 0x3d, + 0x4c, 0x8e, 0xc6, 0x10, 0xb0, 0x23, 0x1b, 0x13, 0x42, 0x62, 0x30, 0x22, 0x76, 0xe1, 0x12, 0x39, + 0x89, 0xdb, 0x45, 0x34, 0x76, 0x64, 0x3b, 0x53, 0xf3, 0x5f, 0x70, 0xe4, 0x4f, 0xe2, 0xb8, 0x23, + 0x47, 0xd4, 0x8a, 0xff, 0x03, 0xc5, 0xf9, 0xd5, 0x34, 0xd0, 0x9b, 0xfd, 0x7d, 0xef, 0x7d, 0xef, + 0xc5, 0xef, 0x53, 0xc0, 0x91, 0xcb, 0x44, 0xc0, 0x84, 0x89, 0x5d, 0x97, 0x45, 0x54, 0x0a, 0xf3, + 0xf6, 0x38, 0x3f, 0xdb, 0xd8, 0x11, 0x92, 0x63, 0x57, 0xfa, 0x8c, 0xa2, 0x90, 0x33, 0xc9, 0x20, + 0x4c, 0xd1, 0x28, 0x47, 0xa3, 0xdb, 0xe3, 0xc3, 0x83, 0x19, 0x63, 0xb3, 0x39, 0x31, 0x15, 0xc2, + 0x89, 0xa6, 0x26, 0xa6, 0x71, 0x0a, 0x1f, 0xff, 0x68, 0x83, 0xdd, 0x6b, 0x41, 0xf8, 0xa7, 0x90, + 0x70, 0x9c, 0x8c, 0x81, 0x43, 0xd0, 0x11, 0x84, 0x7a, 0x84, 0xeb, 0xda, 0x48, 0x9b, 0xf4, 0xac, + 0xec, 0x06, 0x4f, 0xc0, 0x00, 0x47, 0xf2, 0x86, 0x50, 0xe9, 0xbb, 0x0a, 0x69, 0x07, 0x44, 0xde, + 0x30, 0x4f, 0x6f, 0x2a, 0x58, 0xbf, 0xda, 0xbc, 0x54, 0x3d, 0x78, 0x01, 0xf6, 0x36, 0x48, 0x1e, + 0x96, 0x58, 0x6f, 0x8d, 0xb4, 0xc9, 0xfd, 0xe7, 0x7d, 0x94, 0xfa, 0x42, 0xb9, 0x2f, 0xf4, 0x86, + 0xc6, 0x16, 0xac, 0x12, 0xde, 0x62, 0x89, 0xe1, 0x6b, 0xa0, 0x6f, 0x8c, 0x99, 0x61, 0x61, 0xcf, + 0xfd, 0xc0, 0x97, 0x7a, 0x7b, 0xa4, 0x4d, 0xda, 0xd6, 0xb0, 0xda, 0x7f, 0x87, 0xc5, 0x87, 0xa4, + 0x0b, 0x3f, 0x02, 0xdd, 0x89, 0xa8, 0x37, 0x27, 0xdc, 0x0e, 0x71, 0x1c, 0x10, 0x2a, 0xed, 0x80, + 0x08, 0x81, 0x67, 0x44, 0xe8, 0x3b, 0xa3, 0xd6, 0x7f, 0x5d, 0x0c, 0x33, 0xd6, 0x55, 0x4a, 0xba, + 0xcc, 0x38, 0xf0, 0x14, 0x1c, 0x6c, 0xce, 0x2b, 0xad, 0x74, 0x52, 0x2b, 0x55, 0x6a, 0x61, 0xe5, + 0x1c, 0x40, 0xb2, 0x20, 0x6e, 0x94, 0xbd, 0x5d, 0x66, 0xe2, 0xde, 0x16, 0x13, 0x8f, 0x0b, 0x7c, + 0xa1, 0x8f, 0xc0, 0x5e, 0x39, 0xa4, 0x54, 0xee, 0x2a, 0xe5, 0x12, 0x5f, 0x88, 0x9e, 0x82, 0x9e, + 0x5c, 0xd8, 0x2e, 0x0b, 0x42, 0x2c, 0xf5, 0x9e, 0x7a, 0xf6, 0x27, 0xa8, 0xbe, 0x22, 0xe8, 0xcb, + 0xe2, 0x5c, 0x61, 0xac, 0xae, 0xcc, 0x4e, 0xe3, 0xcf, 0xa0, 0x9b, 0x57, 0xe1, 0x33, 0xf0, 0x30, + 0x79, 0x60, 0xdb, 0xa7, 0x53, 0x66, 0x3b, 0xb1, 0x24, 0x42, 0x6d, 0xc7, 0x03, 0x6b, 0x37, 0x29, + 0xbf, 0xa7, 0x53, 0x76, 0x96, 0x14, 0xe1, 0x53, 0x00, 0x1c, 0xe6, 0xc5, 0x19, 0xa4, 0xa9, 0x20, + 0xbd, 0xa4, 0xa2, 0xda, 0xe3, 0x3f, 0x4d, 0x30, 0xa8, 0x6c, 0x9b, 0x45, 0x44, 0xc8, 0xa8, 0x20, + 0xf0, 0x25, 0xd8, 0xff, 0x47, 0xc2, 0x91, 0x20, 0x9e, 0x12, 0x6a, 0x5b, 0x83, 0x5a, 0xc0, 0xd7, + 0x82, 0x78, 0xf0, 0x55, 0x3d, 0xdf, 0x82, 0xd8, 0x4c, 0x89, 0xb5, 0x38, 0x14, 0xf1, 0xaa, 0x1e, + 0x24, 0xcf, 0xcc, 0x08, 0xbd, 0xb5, 0x25, 0x94, 0xfd, 0xea, 0xbc, 0xfc, 0x0b, 0x04, 0x3c, 0x5a, + 0xcf, 0xb7, 0x30, 0x91, 0xae, 0xe7, 0xa3, 0xf5, 0x64, 0x94, 0xfe, 0xc5, 0x7a, 0x90, 0xa5, 0xf2, + 0xb6, 0x9d, 0x2c, 0xc7, 0x97, 0xa2, 0x7d, 0xb0, 0x43, 0x38, 0x67, 0x5c, 0xed, 0x5e, 0xcf, 0x4a, + 0x2f, 0x67, 0x2f, 0x7e, 0x2e, 0x0d, 0xed, 0x6e, 0x69, 0x68, 0xbf, 0x97, 0x86, 0xf6, 0x7d, 0x65, + 0x34, 0xee, 0x56, 0x46, 0xe3, 0xd7, 0xca, 0x68, 0x7c, 0x3d, 0x4c, 0xb3, 0x17, 0xde, 0x37, 0xe4, + 0x33, 0x73, 0xb1, 0xfe, 0x53, 0x71, 0x3a, 0x4a, 0xed, 0xe4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xb2, 0x84, 0x4a, 0x05, 0x71, 0x04, 0x00, 0x00, } func (m *UserOperation) Marshal() (dAtA []byte, err error) { @@ -309,6 +387,18 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TxCompat != nil { + { + size, err := m.TxCompat.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } if m.ExecutionGasLimit != 0 { i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.ExecutionGasLimit)) i-- @@ -352,10 +442,15 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x20 } - if len(m.AuthenticationData) > 0 { - i -= len(m.AuthenticationData) - copy(dAtA[i:], m.AuthenticationData) - i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthenticationData))) + if m.AuthenticationData != nil { + { + size, err := m.AuthenticationData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x1a } @@ -376,6 +471,43 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TxCompat) 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 *TxCompat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxCompat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BodyBytes) > 0 { + i -= len(m.BodyBytes) + copy(dAtA[i:], m.BodyBytes) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.BodyBytes))) + i-- + dAtA[i] = 0x12 + } + if len(m.AuthInfoBytes) > 0 { + i -= len(m.AuthInfoBytes) + copy(dAtA[i:], m.AuthInfoBytes) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthInfoBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *UserOperationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -474,8 +606,8 @@ func (m *UserOperation) Size() (n int) { if l > 0 { n += 1 + l + sovAccountAbstraction(uint64(l)) } - l = len(m.AuthenticationData) - if l > 0 { + if m.AuthenticationData != nil { + l = m.AuthenticationData.Size() n += 1 + l + sovAccountAbstraction(uint64(l)) } if m.AuthenticationGasLimit != 0 { @@ -499,6 +631,27 @@ func (m *UserOperation) Size() (n int) { if m.ExecutionGasLimit != 0 { n += 1 + sovAccountAbstraction(uint64(m.ExecutionGasLimit)) } + if m.TxCompat != nil { + l = m.TxCompat.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + return n +} + +func (m *TxCompat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AuthInfoBytes) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + l = len(m.BodyBytes) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } return n } @@ -639,7 +792,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAccountAbstraction @@ -649,24 +802,26 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthAccountAbstraction } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthAccountAbstraction } if postIndex > l { return io.ErrUnexpectedEOF } - m.AuthenticationData = append(m.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) if m.AuthenticationData == nil { - m.AuthenticationData = []byte{} + m.AuthenticationData = &types.Any{} + } + if err := m.AuthenticationData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 4: @@ -794,6 +949,160 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxCompat", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TxCompat == nil { + m.TxCompat = &TxCompat{} + } + if err := m.TxCompat.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccountAbstraction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxCompat) 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 ErrIntOverflowAccountAbstraction + } + 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: TxCompat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxCompat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthInfoBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthInfoBytes = append(m.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AuthInfoBytes == nil { + m.AuthInfoBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BodyBytes = append(m.BodyBytes[:0], dAtA[iNdEx:postIndex]...) + if m.BodyBytes == nil { + m.BodyBytes = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAccountAbstraction(dAtA[iNdEx:])