From 80e7d32e8fff9d31ce60ef0e6224514ec5fe74a0 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 10 Jan 2025 16:37:46 +0100 Subject: [PATCH 1/4] fix(x/tx): add unordered and timeout timestamp fields in textual signing --- x/tx/CHANGELOG.md | 8 + .../textual/internal/textualpb/buf.lock | 26 +- .../textual/internal/textualpb/buf.yaml | 2 + .../textual/internal/textualpb/textual.proto | 3 + .../internal/textualpb/textual.pulsar.go | 550 ++++++++---------- x/tx/signing/textual/tx.go | 4 + 6 files changed, 287 insertions(+), 306 deletions(-) diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 958cd9ac19b4..1720fdb22e0d 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -33,6 +33,14 @@ Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos- ## [Unreleased] +## [v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.1) - 2025-01-06 + +* [#](https://github.com/cosmos/cosmos-sdk/pull/) Sign over unordered and timeout timestamp fields. + +## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.0) - 2025-01-06 + +Identical to v1.0.0-alpha.3. + ## [v1.0.0-alpha.3](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.0-alpha.3) - 2024-12-16 ### Bug Fixes diff --git a/x/tx/signing/textual/internal/textualpb/buf.lock b/x/tx/signing/textual/internal/textualpb/buf.lock index 259bd9ce82b1..ca09fbb4fad6 100644 --- a/x/tx/signing/textual/internal/textualpb/buf.lock +++ b/x/tx/signing/textual/internal/textualpb/buf.lock @@ -4,8 +4,30 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 6652e3443c3b4504bb3bf82e73a7e409 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 7e6f6e774e29406da95bd61cdcdbc8bc + digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/x/tx/signing/textual/internal/textualpb/buf.yaml b/x/tx/signing/textual/internal/textualpb/buf.yaml index 5aee45ac2b4f..9e1bb8366908 100644 --- a/x/tx/signing/textual/internal/textualpb/buf.yaml +++ b/x/tx/signing/textual/internal/textualpb/buf.yaml @@ -1,7 +1,9 @@ version: v1 deps: + - buf.build/cosmos/cosmos-sdk - buf.build/cosmos/cosmos-proto - buf.build/cosmos/gogo-proto + - buf.build/protocolbuffers/wellknowntypes:v23.4 lint: use: - DEFAULT diff --git a/x/tx/signing/textual/internal/textualpb/textual.proto b/x/tx/signing/textual/internal/textualpb/textual.proto index cddfc99d6e6b..0f9273472932 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.proto +++ b/x/tx/signing/textual/internal/textualpb/textual.proto @@ -4,6 +4,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/tx/v1beta1/tx.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; // TextualData represents all the information needed to generate // the textual SignDoc (which is []Screen encoded to CBOR). It is meant to be @@ -83,4 +84,6 @@ message Envelope { repeated google.protobuf.Any extension_options = 16; repeated google.protobuf.Any non_critical_extension_options = 17; string hash_of_raw_bytes = 18; + bool unordered = 19; + google.protobuf.Timestamp timeout_timestamp = 20; } diff --git a/x/tx/signing/textual/internal/textualpb/textual.pulsar.go b/x/tx/signing/textual/internal/textualpb/textual.pulsar.go index 14b94260756f..050fd821a6cd 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.pulsar.go +++ b/x/tx/signing/textual/internal/textualpb/textual.pulsar.go @@ -11,6 +11,7 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -1344,57 +1345,6 @@ func (x *_Envelope_8_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Envelope_11_list)(nil) - -type _Envelope_11_list struct { - list *[]*v1beta1.Coin -} - -func (x *_Envelope_11_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Envelope_11_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Envelope_11_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_Envelope_11_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Envelope_11_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Envelope_11_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Envelope_11_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Envelope_11_list) IsValid() bool { - return x.list != nil -} - var _ protoreflect.List = (*_Envelope_15_list)(nil) type _Envelope_15_list struct { @@ -1560,14 +1510,14 @@ var ( fd_Envelope_fees protoreflect.FieldDescriptor fd_Envelope_fee_payer protoreflect.FieldDescriptor fd_Envelope_fee_granter protoreflect.FieldDescriptor - fd_Envelope_tip protoreflect.FieldDescriptor - fd_Envelope_tipper protoreflect.FieldDescriptor fd_Envelope_gas_limit protoreflect.FieldDescriptor fd_Envelope_timeout_height protoreflect.FieldDescriptor fd_Envelope_other_signer protoreflect.FieldDescriptor fd_Envelope_extension_options protoreflect.FieldDescriptor fd_Envelope_non_critical_extension_options protoreflect.FieldDescriptor fd_Envelope_hash_of_raw_bytes protoreflect.FieldDescriptor + fd_Envelope_unordered protoreflect.FieldDescriptor + fd_Envelope_timeout_timestamp protoreflect.FieldDescriptor ) func init() { @@ -1583,14 +1533,14 @@ func init() { fd_Envelope_fees = md_Envelope.Fields().ByName("fees") fd_Envelope_fee_payer = md_Envelope.Fields().ByName("fee_payer") fd_Envelope_fee_granter = md_Envelope.Fields().ByName("fee_granter") - fd_Envelope_tip = md_Envelope.Fields().ByName("tip") - fd_Envelope_tipper = md_Envelope.Fields().ByName("tipper") fd_Envelope_gas_limit = md_Envelope.Fields().ByName("gas_limit") fd_Envelope_timeout_height = md_Envelope.Fields().ByName("timeout_height") fd_Envelope_other_signer = md_Envelope.Fields().ByName("other_signer") fd_Envelope_extension_options = md_Envelope.Fields().ByName("extension_options") fd_Envelope_non_critical_extension_options = md_Envelope.Fields().ByName("non_critical_extension_options") fd_Envelope_hash_of_raw_bytes = md_Envelope.Fields().ByName("hash_of_raw_bytes") + fd_Envelope_unordered = md_Envelope.Fields().ByName("unordered") + fd_Envelope_timeout_timestamp = md_Envelope.Fields().ByName("timeout_timestamp") } var _ protoreflect.Message = (*fastReflection_Envelope)(nil) @@ -1718,18 +1668,6 @@ func (x *fastReflection_Envelope) Range(f func(protoreflect.FieldDescriptor, pro return } } - if len(x.Tip) != 0 { - value := protoreflect.ValueOfList(&_Envelope_11_list{list: &x.Tip}) - if !f(fd_Envelope_tip, value) { - return - } - } - if x.Tipper != "" { - value := protoreflect.ValueOfString(x.Tipper) - if !f(fd_Envelope_tipper, value) { - return - } - } if x.GasLimit != uint64(0) { value := protoreflect.ValueOfUint64(x.GasLimit) if !f(fd_Envelope_gas_limit, value) { @@ -1766,6 +1704,18 @@ func (x *fastReflection_Envelope) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.Unordered != false { + value := protoreflect.ValueOfBool(x.Unordered) + if !f(fd_Envelope_unordered, value) { + return + } + } + if x.TimeoutTimestamp != nil { + value := protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) + if !f(fd_Envelope_timeout_timestamp, value) { + return + } + } } // Has reports whether a field is populated. @@ -1801,10 +1751,6 @@ func (x *fastReflection_Envelope) Has(fd protoreflect.FieldDescriptor) bool { return x.FeePayer != "" case "Envelope.fee_granter": return x.FeeGranter != "" - case "Envelope.tip": - return len(x.Tip) != 0 - case "Envelope.tipper": - return x.Tipper != "" case "Envelope.gas_limit": return x.GasLimit != uint64(0) case "Envelope.timeout_height": @@ -1817,6 +1763,10 @@ func (x *fastReflection_Envelope) Has(fd protoreflect.FieldDescriptor) bool { return len(x.NonCriticalExtensionOptions) != 0 case "Envelope.hash_of_raw_bytes": return x.HashOfRawBytes != "" + case "Envelope.unordered": + return x.Unordered != false + case "Envelope.timeout_timestamp": + return x.TimeoutTimestamp != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -1853,10 +1803,6 @@ func (x *fastReflection_Envelope) Clear(fd protoreflect.FieldDescriptor) { x.FeePayer = "" case "Envelope.fee_granter": x.FeeGranter = "" - case "Envelope.tip": - x.Tip = nil - case "Envelope.tipper": - x.Tipper = "" case "Envelope.gas_limit": x.GasLimit = uint64(0) case "Envelope.timeout_height": @@ -1869,6 +1815,10 @@ func (x *fastReflection_Envelope) Clear(fd protoreflect.FieldDescriptor) { x.NonCriticalExtensionOptions = nil case "Envelope.hash_of_raw_bytes": x.HashOfRawBytes = "" + case "Envelope.unordered": + x.Unordered = false + case "Envelope.timeout_timestamp": + x.TimeoutTimestamp = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -1921,15 +1871,6 @@ func (x *fastReflection_Envelope) Get(descriptor protoreflect.FieldDescriptor) p case "Envelope.fee_granter": value := x.FeeGranter return protoreflect.ValueOfString(value) - case "Envelope.tip": - if len(x.Tip) == 0 { - return protoreflect.ValueOfList(&_Envelope_11_list{}) - } - listValue := &_Envelope_11_list{list: &x.Tip} - return protoreflect.ValueOfList(listValue) - case "Envelope.tipper": - value := x.Tipper - return protoreflect.ValueOfString(value) case "Envelope.gas_limit": value := x.GasLimit return protoreflect.ValueOfUint64(value) @@ -1957,6 +1898,12 @@ func (x *fastReflection_Envelope) Get(descriptor protoreflect.FieldDescriptor) p case "Envelope.hash_of_raw_bytes": value := x.HashOfRawBytes return protoreflect.ValueOfString(value) + case "Envelope.unordered": + value := x.Unordered + return protoreflect.ValueOfBool(value) + case "Envelope.timeout_timestamp": + value := x.TimeoutTimestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2001,12 +1948,6 @@ func (x *fastReflection_Envelope) Set(fd protoreflect.FieldDescriptor, value pro x.FeePayer = value.Interface().(string) case "Envelope.fee_granter": x.FeeGranter = value.Interface().(string) - case "Envelope.tip": - lv := value.List() - clv := lv.(*_Envelope_11_list) - x.Tip = *clv.list - case "Envelope.tipper": - x.Tipper = value.Interface().(string) case "Envelope.gas_limit": x.GasLimit = value.Uint() case "Envelope.timeout_height": @@ -2025,6 +1966,10 @@ func (x *fastReflection_Envelope) Set(fd protoreflect.FieldDescriptor, value pro x.NonCriticalExtensionOptions = *clv.list case "Envelope.hash_of_raw_bytes": x.HashOfRawBytes = value.Interface().(string) + case "Envelope.unordered": + x.Unordered = value.Bool() + case "Envelope.timeout_timestamp": + x.TimeoutTimestamp = value.Message().Interface().(*timestamppb.Timestamp) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2062,12 +2007,6 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto } value := &_Envelope_8_list{list: &x.Fees} return protoreflect.ValueOfList(value) - case "Envelope.tip": - if x.Tip == nil { - x.Tip = []*v1beta1.Coin{} - } - value := &_Envelope_11_list{list: &x.Tip} - return protoreflect.ValueOfList(value) case "Envelope.other_signer": if x.OtherSigner == nil { x.OtherSigner = []*v1beta11.SignerInfo{} @@ -2086,6 +2025,11 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto } value := &_Envelope_17_list{list: &x.NonCriticalExtensionOptions} return protoreflect.ValueOfList(value) + case "Envelope.timeout_timestamp": + if x.TimeoutTimestamp == nil { + x.TimeoutTimestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) case "Envelope.chain_id": panic(fmt.Errorf("field chain_id of message Envelope is not mutable")) case "Envelope.account_number": @@ -2100,14 +2044,14 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field fee_payer of message Envelope is not mutable")) case "Envelope.fee_granter": panic(fmt.Errorf("field fee_granter of message Envelope is not mutable")) - case "Envelope.tipper": - panic(fmt.Errorf("field tipper of message Envelope is not mutable")) case "Envelope.gas_limit": panic(fmt.Errorf("field gas_limit of message Envelope is not mutable")) case "Envelope.timeout_height": panic(fmt.Errorf("field timeout_height of message Envelope is not mutable")) case "Envelope.hash_of_raw_bytes": panic(fmt.Errorf("field hash_of_raw_bytes of message Envelope is not mutable")) + case "Envelope.unordered": + panic(fmt.Errorf("field unordered of message Envelope is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2144,11 +2088,6 @@ func (x *fastReflection_Envelope) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfString("") case "Envelope.fee_granter": return protoreflect.ValueOfString("") - case "Envelope.tip": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Envelope_11_list{list: &list}) - case "Envelope.tipper": - return protoreflect.ValueOfString("") case "Envelope.gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "Envelope.timeout_height": @@ -2164,6 +2103,11 @@ func (x *fastReflection_Envelope) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfList(&_Envelope_17_list{list: &list}) case "Envelope.hash_of_raw_bytes": return protoreflect.ValueOfString("") + case "Envelope.unordered": + return protoreflect.ValueOfBool(false) + case "Envelope.timeout_timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2275,16 +2219,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Tip) > 0 { - for _, e := range x.Tip { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Tipper) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.GasLimit != 0 { n += 1 + runtime.Sov(uint64(x.GasLimit)) } @@ -2313,6 +2247,13 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + if x.Unordered { + n += 3 + } + if x.TimeoutTimestamp != nil { + l = options.Size(x.TimeoutTimestamp) + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2342,6 +2283,34 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.TimeoutTimestamp != nil { + encoded, err := options.Marshal(x.TimeoutTimestamp) + 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] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if x.Unordered { + i-- + if x.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } if len(x.HashOfRawBytes) > 0 { i -= len(x.HashOfRawBytes) copy(dAtA[i:], x.HashOfRawBytes) @@ -2413,29 +2382,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x68 } - if len(x.Tipper) > 0 { - i -= len(x.Tipper) - copy(dAtA[i:], x.Tipper) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tipper))) - i-- - dAtA[i] = 0x62 - } - if len(x.Tip) > 0 { - for iNdEx := len(x.Tip) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Tip[iNdEx]) - 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] = 0x5a - } - } if len(x.FeeGranter) > 0 { i -= len(x.FeeGranter) copy(dAtA[i:], x.FeeGranter) @@ -2878,72 +2824,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { } x.FeeGranter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", 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 - } - x.Tip = append(x.Tip, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip[len(x.Tip)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tipper", wireType) - } - var stringLen 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++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - 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.Tipper = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 13: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) @@ -3116,6 +2996,62 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { } x.HashOfRawBytes = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 19: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unordered", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Unordered = bool(v != 0) + case 20: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", 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.TimeoutTimestamp == nil { + x.TimeoutTimestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TimeoutTimestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3165,7 +3101,7 @@ const ( ) // TextualData represents all the information needed to generate -// the textual SignDoc (which is []Screen encoded to XBOR). It is meant to be +// the textual SignDoc (which is []Screen encoded to CBOR). It is meant to be // used as an internal type in Textual's implementations. type TextualData struct { state protoimpl.MessageState @@ -3228,7 +3164,8 @@ func (x *TextualData) GetSignerData() *SignerData { // isn't included in the transaction body itself. // // It is the same struct as signing.SignerData, but only used internally -// in Textual because we need it as a proto.Message. +// in Textual because we need it as a proto.Message. If that struct is updated, +// then this proto SignerData also needs to be modified. type SignerData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3337,14 +3274,14 @@ type Envelope struct { Fees []*v1beta1.Coin `protobuf:"bytes,8,rep,name=fees,proto3" json:"fees,omitempty"` FeePayer string `protobuf:"bytes,9,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` FeeGranter string `protobuf:"bytes,10,opt,name=fee_granter,json=feeGranter,proto3" json:"fee_granter,omitempty"` - Tip []*v1beta1.Coin `protobuf:"bytes,11,rep,name=tip,proto3" json:"tip,omitempty"` - Tipper string `protobuf:"bytes,12,opt,name=tipper,proto3" json:"tipper,omitempty"` GasLimit uint64 `protobuf:"varint,13,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` TimeoutHeight uint64 `protobuf:"varint,14,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` OtherSigner []*v1beta11.SignerInfo `protobuf:"bytes,15,rep,name=other_signer,json=otherSigner,proto3" json:"other_signer,omitempty"` ExtensionOptions []*anypb.Any `protobuf:"bytes,16,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*anypb.Any `protobuf:"bytes,17,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` HashOfRawBytes string `protobuf:"bytes,18,opt,name=hash_of_raw_bytes,json=hashOfRawBytes,proto3" json:"hash_of_raw_bytes,omitempty"` + Unordered bool `protobuf:"varint,19,opt,name=unordered,proto3" json:"unordered,omitempty"` + TimeoutTimestamp *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` } func (x *Envelope) Reset() { @@ -3437,20 +3374,6 @@ func (x *Envelope) GetFeeGranter() string { return "" } -func (x *Envelope) GetTip() []*v1beta1.Coin { - if x != nil { - return x.Tip - } - return nil -} - -func (x *Envelope) GetTipper() string { - if x != nil { - return x.Tipper - } - return "" -} - func (x *Envelope) GetGasLimit() uint64 { if x != nil { return x.GasLimit @@ -3493,6 +3416,20 @@ func (x *Envelope) GetHashOfRawBytes() string { return "" } +func (x *Envelope) GetUnordered() bool { + if x != nil { + return x.Unordered + } + return false +} + +func (x *Envelope) GetTimeoutTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.TimeoutTimestamp + } + return nil +} + var File_textual_proto protoreflect.FileDescriptor var file_textual_proto_rawDesc = []byte{ @@ -3504,80 +3441,84 @@ var file_textual_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x82, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x49, - 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xd2, 0xb4, 0x2d, 0x0d, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, - 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 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, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, - 0xfc, 0x05, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x05, 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, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 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, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x2d, 0x0a, - 0x04, 0x66, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x66, 0x65, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x65, 0x65, - 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x66, 0x65, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x03, 0x74, 0x69, - 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, - 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x12, - 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x0e, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x40, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 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, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x59, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, - 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 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, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x69, - 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6f, 0x66, 0x5f, 0x72, - 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x68, 0x61, 0x73, 0x68, 0x4f, 0x66, 0x52, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x3c, - 0x42, 0x0c, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x74, - 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, + 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xd2, 0xb4, 0x2d, 0x0d, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, + 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 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, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x22, 0x9e, 0x06, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x05, 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, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 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, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x2d, + 0x0a, 0x04, 0x66, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x66, 0x65, 0x65, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x65, + 0x65, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x66, 0x65, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, + 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x40, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, + 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x12, 0x41, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 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, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x59, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, + 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 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, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x29, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6f, 0x66, 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x68, 0x61, 0x73, 0x68, + 0x4f, 0x66, 0x52, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, + 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x10, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x3e, 0x42, 0x0c, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3594,12 +3535,13 @@ func file_textual_proto_rawDescGZIP() []byte { var file_textual_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_textual_proto_goTypes = []interface{}{ - (*TextualData)(nil), // 0: TextualData - (*SignerData)(nil), // 1: SignerData - (*Envelope)(nil), // 2: Envelope - (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin - (*v1beta11.SignerInfo)(nil), // 5: cosmos.tx.v1beta1.SignerInfo + (*TextualData)(nil), // 0: TextualData + (*SignerData)(nil), // 1: SignerData + (*Envelope)(nil), // 2: Envelope + (*anypb.Any)(nil), // 3: google.protobuf.Any + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*v1beta11.SignerInfo)(nil), // 5: cosmos.tx.v1beta1.SignerInfo + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp } var file_textual_proto_depIdxs = []int32{ 1, // 0: TextualData.signer_data:type_name -> SignerData @@ -3607,10 +3549,10 @@ var file_textual_proto_depIdxs = []int32{ 3, // 2: Envelope.public_key:type_name -> google.protobuf.Any 3, // 3: Envelope.message:type_name -> google.protobuf.Any 4, // 4: Envelope.fees:type_name -> cosmos.base.v1beta1.Coin - 4, // 5: Envelope.tip:type_name -> cosmos.base.v1beta1.Coin - 5, // 6: Envelope.other_signer:type_name -> cosmos.tx.v1beta1.SignerInfo - 3, // 7: Envelope.extension_options:type_name -> google.protobuf.Any - 3, // 8: Envelope.non_critical_extension_options:type_name -> google.protobuf.Any + 5, // 5: Envelope.other_signer:type_name -> cosmos.tx.v1beta1.SignerInfo + 3, // 6: Envelope.extension_options:type_name -> google.protobuf.Any + 3, // 7: Envelope.non_critical_extension_options:type_name -> google.protobuf.Any + 6, // 8: Envelope.timeout_timestamp:type_name -> google.protobuf.Timestamp 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 501189e3e5d6..540b24096537 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -79,6 +79,8 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S FeeGranter: txAuthInfo.Fee.Granter, GasLimit: txAuthInfo.Fee.GasLimit, TimeoutHeight: txBody.TimeoutHeight, + TimeoutTimestamp: txBody.TimeoutTimestamp, + Unordered: txBody.Unordered, ExtensionOptions: txBody.ExtensionOptions, NonCriticalExtensionOptions: txBody.NonCriticalExtensionOptions, HashOfRawBytes: getHash(textualData.BodyBytes, textualData.AuthInfoBytes), @@ -229,6 +231,8 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Messages: envelope.Message, Memo: envelope.Memo, TimeoutHeight: envelope.TimeoutHeight, + TimeoutTimestamp: envelope.TimeoutTimestamp, + Unordered: envelope.Unordered, ExtensionOptions: envelope.ExtensionOptions, NonCriticalExtensionOptions: envelope.NonCriticalExtensionOptions, } From 1b8c4b9ea5ee3c7a9c648df419d47d1c83eb6156 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 10 Jan 2025 16:39:31 +0100 Subject: [PATCH 2/4] cl --- x/tx/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 1720fdb22e0d..7a943040ee48 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -35,7 +35,7 @@ Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos- ## [v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.1) - 2025-01-06 -* [#](https://github.com/cosmos/cosmos-sdk/pull/) Sign over unordered and timeout timestamp fields. +* [#23324](https://github.com/cosmos/cosmos-sdk/pull/23324) Sign over unordered and timeout timestamp fields. ## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.0) - 2025-01-06 From 4964118e330f07f7ff4816b437299b9cc12aca64 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 17 Jan 2025 02:14:51 +0100 Subject: [PATCH 3/4] add test --- x/tx/signing/textual/internal/testdata/tx.json | 6 +++++- x/tx/signing/textual/tx.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/x/tx/signing/textual/internal/testdata/tx.json b/x/tx/signing/textual/internal/testdata/tx.json index bbafe3b14120..98bb9db58f32 100644 --- a/x/tx/signing/textual/internal/testdata/tx.json +++ b/x/tx/signing/textual/internal/testdata/tx.json @@ -232,6 +232,8 @@ ], "memo": "> ⚛️\\u269B⚛️ ", "timeout_height": 20, + "unordered": true, + "timeout_timestamp": "2042-01-01T00:00:20Z", "extension_options": [ { "@type": "/cosmos.base.v1beta1.Coin", @@ -385,7 +387,9 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } + { "title": "Hash of raw bytes", "content": "9c8e99e281e501bb8778b0361dd574c764e54d96ba354a8abc9ccd2ea18e3e06", "expert": true }, + { "title": "Unordered", "content": "True", "expert": true }, + {"title": "Timeout timestamp", "content": "2042-01-01T00:00:20Z", "expert": true} ] } ] diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 540b24096537..f49012870df3 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -127,6 +127,8 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S "Fee granter": {}, "Gas limit": {}, "Timeout height": {}, + "Timeout timestamp": {}, + "Unordered": {}, "Other signer": {}, "Extension options": {}, "Non critical extension options": {}, From 0ba837f72b38a97533cd9bb64e8ae9c6d8945ca3 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 17 Jan 2025 11:26:57 +0100 Subject: [PATCH 4/4] today --- x/tx/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 7a943040ee48..5ba2b8d3f04f 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -33,7 +33,7 @@ Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos- ## [Unreleased] -## [v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.1) - 2025-01-06 +## [v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.1) - 2025-01-17 * [#23324](https://github.com/cosmos/cosmos-sdk/pull/23324) Sign over unordered and timeout timestamp fields.