From 5dd302e8b770a1e50ceb34e7cbe8cddf666206f7 Mon Sep 17 00:00:00 2001 From: beer-1 Date: Wed, 28 Aug 2024 23:20:01 +0900 Subject: [PATCH] add comments --- api/opinit/opchild/v1/query.pulsar.go | 273 +++++++++++++------------- proto/opinit/opchild/v1/query.proto | 6 +- x/opchild/client/cli/tx.go | 3 +- x/opchild/client/cli/tx_test.go | 3 +- x/opchild/keeper/querier.go | 20 +- x/opchild/types/query.pb.go | 154 +++++++-------- x/opchild/types/query.pb.gw.go | 18 +- x/ophost/client/cli/tx.go | 26 ++- x/ophost/client/cli/tx_test.go | 114 ++++++++++- x/ophost/client/cli/types.go | 33 +--- 10 files changed, 367 insertions(+), 283 deletions(-) diff --git a/api/opinit/opchild/v1/query.pulsar.go b/api/opinit/opchild/v1/query.pulsar.go index ccf7add..4d4d98f 100644 --- a/api/opinit/opchild/v1/query.pulsar.go +++ b/api/opinit/opchild/v1/query.pulsar.go @@ -5826,14 +5826,14 @@ func (x *fastReflection_QueryBaseDenomResponse) ProtoMethods() *protoiface.Metho } var ( - md_QueryForceWithdrawalProofsRequest protoreflect.MessageDescriptor - fd_QueryForceWithdrawalProofsRequest_l2_sequence protoreflect.FieldDescriptor + md_QueryForceWithdrawalProofsRequest protoreflect.MessageDescriptor + fd_QueryForceWithdrawalProofsRequest_sequence protoreflect.FieldDescriptor ) func init() { file_opinit_opchild_v1_query_proto_init() md_QueryForceWithdrawalProofsRequest = File_opinit_opchild_v1_query_proto.Messages().ByName("QueryForceWithdrawalProofsRequest") - fd_QueryForceWithdrawalProofsRequest_l2_sequence = md_QueryForceWithdrawalProofsRequest.Fields().ByName("l2_sequence") + fd_QueryForceWithdrawalProofsRequest_sequence = md_QueryForceWithdrawalProofsRequest.Fields().ByName("sequence") } var _ protoreflect.Message = (*fastReflection_QueryForceWithdrawalProofsRequest)(nil) @@ -5901,9 +5901,9 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Interface() protorefl // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.L2Sequence != uint64(0) { - value := protoreflect.ValueOfUint64(x.L2Sequence) - if !f(fd_QueryForceWithdrawalProofsRequest_l2_sequence, value) { + if x.Sequence != uint64(0) { + value := protoreflect.ValueOfUint64(x.Sequence) + if !f(fd_QueryForceWithdrawalProofsRequest_sequence, value) { return } } @@ -5922,8 +5922,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Range(f func(protoref // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": - return x.L2Sequence != uint64(0) + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": + return x.Sequence != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.QueryForceWithdrawalProofsRequest")) @@ -5940,8 +5940,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Has(fd protoreflect.F // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": - x.L2Sequence = uint64(0) + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": + x.Sequence = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.QueryForceWithdrawalProofsRequest")) @@ -5958,8 +5958,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Clear(fd protoreflect // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": - value := x.L2Sequence + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": + value := x.Sequence return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { @@ -5981,8 +5981,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Get(descriptor protor // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": - x.L2Sequence = value.Uint() + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": + x.Sequence = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.QueryForceWithdrawalProofsRequest")) @@ -6003,8 +6003,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Set(fd protoreflect.F // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryForceWithdrawalProofsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": - panic(fmt.Errorf("field l2_sequence of message opinit.opchild.v1.QueryForceWithdrawalProofsRequest is not mutable")) + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": + panic(fmt.Errorf("field sequence of message opinit.opchild.v1.QueryForceWithdrawalProofsRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.QueryForceWithdrawalProofsRequest")) @@ -6018,7 +6018,7 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) Mutable(fd protorefle // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryForceWithdrawalProofsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.l2_sequence": + case "opinit.opchild.v1.QueryForceWithdrawalProofsRequest.sequence": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { @@ -6089,8 +6089,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) ProtoMethods() *proto var n int var l int _ = l - if x.L2Sequence != 0 { - n += 1 + runtime.Sov(uint64(x.L2Sequence)) + if x.Sequence != 0 { + n += 1 + runtime.Sov(uint64(x.Sequence)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -6121,8 +6121,8 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) ProtoMethods() *proto i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.L2Sequence != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.L2Sequence)) + if x.Sequence != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) i-- dAtA[i] = 0x8 } @@ -6177,9 +6177,9 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) ProtoMethods() *proto switch fieldNum { case 1: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field L2Sequence", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) } - x.L2Sequence = 0 + x.Sequence = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6189,7 +6189,7 @@ func (x *fastReflection_QueryForceWithdrawalProofsRequest) ProtoMethods() *proto } b := dAtA[iNdEx] iNdEx++ - x.L2Sequence |= uint64(b&0x7F) << shift + x.Sequence |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -7313,8 +7313,8 @@ type QueryForceWithdrawalProofsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // l2_sequence is the sequence number of the l2 block. - L2Sequence uint64 `protobuf:"varint,1,opt,name=l2_sequence,json=l2Sequence,proto3" json:"l2_sequence,omitempty"` + // sequence is the sequence number of the withdrawal. + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } func (x *QueryForceWithdrawalProofsRequest) Reset() { @@ -7337,9 +7337,9 @@ func (*QueryForceWithdrawalProofsRequest) Descriptor() ([]byte, []int) { return file_opinit_opchild_v1_query_proto_rawDescGZIP(), []int{14} } -func (x *QueryForceWithdrawalProofsRequest) GetL2Sequence() uint64 { +func (x *QueryForceWithdrawalProofsRequest) GetSequence() uint64 { if x != nil { - return x.L2Sequence + return x.Sequence } return 0 } @@ -7483,123 +7483,122 @@ var file_opinit_opchild_v1_query_proto_rawDesc = []byte{ 0x37, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, - 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x44, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, + 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3f, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x6c, 0x32, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x6c, 0x32, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xa8, - 0x02, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x42, 0x24, 0xc8, - 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2e, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x52, 0x07, 0x61, 0x70, 0x70, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x63, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, - 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x61, 0x70, 0x70, - 0x48, 0x61, 0x73, 0x68, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x32, 0xf4, 0x09, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x8f, 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, - 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xa8, 0x02, 0x0a, 0x22, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x42, 0x24, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, + 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, + 0x2e, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x70, 0x70, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x63, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x32, 0xf1, 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x8f, + 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, - 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x28, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, - 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, - 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, - 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x7d, 0x12, 0x90, 0x01, 0x0a, 0x0a, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, - 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, + 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1f, 0x12, 0x1d, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x12, 0x9c, 0x01, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x28, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, - 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x72, 0x69, 0x64, - 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x7f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x25, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x26, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, - 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x4e, 0x65, 0x78, - 0x74, 0x4c, 0x31, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6f, 0x70, - 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x31, 0x53, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x70, 0x69, - 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x31, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, - 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x6c, 0x31, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0xa1, 0x01, 0x0a, - 0x0e, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x32, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x2d, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x32, 0x53, - 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, + 0x12, 0x2d, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x7b, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, + 0x90, 0x01, 0x0a, 0x0a, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x32, 0x53, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, - 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x6f, 0x70, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, 0x70, 0x69, 0x6e, + 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x12, 0x7f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x6f, + 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x88, 0xe7, 0xb0, + 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, + 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x31, 0x53, 0x65, + 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, + 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x31, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, + 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, + 0x65, 0x78, 0x74, 0x4c, 0x31, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x25, 0x12, 0x23, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x31, 0x5f, 0x73, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x4e, 0x65, 0x78, 0x74, + 0x4c, 0x32, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6f, 0x70, 0x69, + 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x32, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x70, 0x69, 0x6e, + 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x32, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, + 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x6c, 0x32, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x09, + 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x28, 0x2e, 0x6f, 0x70, 0x69, 0x6e, + 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, + 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x32, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x94, 0x01, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x28, - 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, - 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x32, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, - 0x12, 0x25, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, - 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, - 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xc6, 0x01, 0x0a, 0x15, 0x46, 0x6f, 0x72, 0x63, + 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x7d, 0x12, 0xc3, 0x01, 0x0a, 0x15, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x34, 0x2e, 0x6f, + 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x73, 0x12, 0x34, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, - 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, - 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x6f, 0x70, - 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x6c, 0x32, 0x5f, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, - 0x42, 0xc8, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, - 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x4f, 0x50, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x69, 0x6e, - 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x70, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x4f, 0x58, 0xaa, 0x02, 0x11, - 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x11, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, - 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x3a, 0x3a, - 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, + 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x42, 0xc8, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, + 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, + 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x4f, 0x50, 0x69, 0x6e, 0x69, 0x74, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4f, 0x4f, 0x58, 0xaa, 0x02, 0x11, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x4f, + 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x4f, 0x70, 0x69, 0x6e, + 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, + 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x3a, 0x3a, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/opinit/opchild/v1/query.proto b/proto/opinit/opchild/v1/query.proto index 7466e2e..e5d3c63 100644 --- a/proto/opinit/opchild/v1/query.proto +++ b/proto/opinit/opchild/v1/query.proto @@ -61,7 +61,7 @@ service Query { rpc ForceWithdrawalProofs(QueryForceWithdrawalProofsRequest) returns (QueryForceWithdrawalProofsResponse) { option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/opinit/opchild/v1/withdrawals/{l2_sequence}/proofs"; + option (google.api.http).get = "/opinit/opchild/v1/withdrawals/{sequence}/proofs"; } } @@ -140,8 +140,8 @@ message QueryBaseDenomResponse { // QueryForceWithdrawalProofsRequest is request type for the Query/ForceWithdrawalProofs RPC method. message QueryForceWithdrawalProofsRequest { - // l2_sequence is the sequence number of the l2 block. - uint64 l2_sequence = 1; + // sequence is the sequence number of the withdrawal. + uint64 sequence = 1; } // QueryForceWithdrawalProofsResponse is response type for the Query/ForceWithdrawalProofs RPC method. diff --git a/x/opchild/client/cli/tx.go b/x/opchild/client/cli/tx.go index f7d4b4a..b97e4aa 100644 --- a/x/opchild/client/cli/tx.go +++ b/x/opchild/client/cli/tx.go @@ -299,7 +299,7 @@ func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { return err } - origConfig := ophostcli.BridgeCliConfig{} + var origConfig ophostcli.BridgeCliConfig err = json.Unmarshal(configBytes, &origConfig) if err != nil { return err @@ -328,6 +328,7 @@ func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { SubmissionStartHeight: submissionStartHeight, Metadata: []byte(origConfig.Metadata), BatchInfo: origConfig.BatchInfo, + OracleEnabled: origConfig.OracleEnabled, } if err = bridgeConfig.ValidateWithNoAddrValidation(); err != nil { diff --git a/x/opchild/client/cli/tx_test.go b/x/opchild/client/cli/tx_test.go index 70f9b46..d98b187 100644 --- a/x/opchild/client/cli/tx_test.go +++ b/x/opchild/client/cli/tx_test.go @@ -439,7 +439,8 @@ func (s *CLITestSuite) TestNewSetBridgeInfo() { "batch_info": { "submitter": "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", "chain_type": "INITIA" - } + }, + "oracle_enabled": true }`) s.NoError(err) diff --git a/x/opchild/keeper/querier.go b/x/opchild/keeper/querier.go index 48eacf5..09c3b77 100644 --- a/x/opchild/keeper/querier.go +++ b/x/opchild/keeper/querier.go @@ -105,9 +105,11 @@ func (q Querier) BaseDenom(ctx context.Context, req *types.QueryBaseDenomRequest return &types.QueryBaseDenomResponse{BaseDenom: baseDenom}, nil } -// ForceWithdrawalProofs returns the force withdrawal proofs +// ForceWithdrawalProofs returns the force withdrawal proofs. // // @dev: This query is not deterministic and should only be used for off-chain. +// @dev: The caller must use the height query to get the app hash and commitment proof at the specific height. +// The height should be the L2 block number contained in the output submitted to L1, and this height should be higher than the block where the withdrawal occurred. func (q Querier) ForceWithdrawalProofs(ctx context.Context, req *types.QueryForceWithdrawalProofsRequest) (*types.QueryForceWithdrawalProofsResponse, error) { if q.clientCtx == nil { return nil, status.Error(codes.Internal, "client context is not set") @@ -120,8 +122,20 @@ func (q Querier) ForceWithdrawalProofs(ctx context.Context, req *types.QueryForc return nil, status.Error(codes.Internal, err.Error()) } - sequence := req.L2Sequence - commitmentProof, err := types.QueryCommitmentProof(q.baseAppQuerier, height-1, types.WithdrawalCommitmentKey(sequence)) + sequence := req.Sequence + if ok, err := q.Commitments.Has(ctx, sequence); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } else if !ok { + return nil, status.Errorf(codes.NotFound, "withdrawal commitment %d not found at height %d", sequence, height) + } + + commitmentProof, err := types.QueryCommitmentProof( + q.baseAppQuerier, + // we should compute the `height-1` here because the app hash of a block is + // the one that is committed in the previous block. + height-1, + types.WithdrawalCommitmentKey(sequence), + ) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/opchild/types/query.pb.go b/x/opchild/types/query.pb.go index 34c7aa1..3d9376a 100644 --- a/x/opchild/types/query.pb.go +++ b/x/opchild/types/query.pb.go @@ -651,8 +651,8 @@ func (m *QueryBaseDenomResponse) GetBaseDenom() string { // QueryForceWithdrawalProofsRequest is request type for the Query/ForceWithdrawalProofs RPC method. type QueryForceWithdrawalProofsRequest struct { - // l2_sequence is the sequence number of the l2 block. - L2Sequence uint64 `protobuf:"varint,1,opt,name=l2_sequence,json=l2Sequence,proto3" json:"l2_sequence,omitempty"` + // sequence is the sequence number of the withdrawal. + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } func (m *QueryForceWithdrawalProofsRequest) Reset() { *m = QueryForceWithdrawalProofsRequest{} } @@ -688,9 +688,9 @@ func (m *QueryForceWithdrawalProofsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryForceWithdrawalProofsRequest proto.InternalMessageInfo -func (m *QueryForceWithdrawalProofsRequest) GetL2Sequence() uint64 { +func (m *QueryForceWithdrawalProofsRequest) GetSequence() uint64 { if m != nil { - return m.L2Sequence + return m.Sequence } return 0 } @@ -780,72 +780,72 @@ func init() { func init() { proto.RegisterFile("opinit/opchild/v1/query.proto", fileDescriptor_15cfbb5d02a763ec) } var fileDescriptor_15cfbb5d02a763ec = []byte{ - // 1040 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0xe3, 0xb4, 0x09, 0xec, 0x4b, 0x49, 0xdb, 0x69, 0x42, 0x37, 0x9b, 0x64, 0x37, 0x0c, - 0x24, 0xdd, 0x06, 0xad, 0xcd, 0xba, 0x54, 0x48, 0x15, 0x12, 0xb0, 0x2a, 0x0d, 0x95, 0x10, 0x0d, - 0x1b, 0x09, 0x10, 0x97, 0x65, 0x76, 0xed, 0xec, 0x5a, 0x5a, 0x7b, 0x5c, 0x7b, 0x92, 0x26, 0x8a, - 0x22, 0x24, 0x4e, 0xdc, 0xa8, 0x04, 0x47, 0x2e, 0xdc, 0x2a, 0x71, 0xe1, 0xc0, 0xdf, 0x80, 0x7a, - 0xac, 0xe0, 0xc2, 0x29, 0x42, 0x09, 0x12, 0xf7, 0x8a, 0x3f, 0x00, 0x79, 0x66, 0xec, 0xb1, 0xb3, - 0x76, 0xb2, 0xe5, 0x92, 0xc4, 0xf3, 0x7e, 0x7c, 0x3f, 0x7e, 0xf3, 0xf2, 0x95, 0x61, 0x99, 0xfa, - 0x8e, 0xe7, 0x30, 0x83, 0xfa, 0xbd, 0x81, 0x33, 0xb4, 0x8c, 0xdd, 0xa6, 0xf1, 0x70, 0xc7, 0x0e, - 0xf6, 0x75, 0x3f, 0xa0, 0x8c, 0xa2, 0xab, 0x22, 0xac, 0xcb, 0xb0, 0xbe, 0xdb, 0xac, 0x5c, 0x25, - 0xae, 0xe3, 0x51, 0x83, 0xff, 0x14, 0x59, 0x95, 0x6a, 0x8f, 0xba, 0x36, 0xeb, 0x6e, 0x33, 0xa3, - 0x17, 0xec, 0xfb, 0x8c, 0x46, 0x5d, 0xfc, 0x80, 0xd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xff, 0x32, 0x2a, - 0x4f, 0x43, 0x3f, 0x68, 0x50, 0x4a, 0xcc, 0xb3, 0x78, 0xf5, 0x4f, 0xdb, 0x71, 0xf1, 0xea, 0x8f, - 0x38, 0x31, 0x36, 0x15, 0xd4, 0x0d, 0xb4, 0x9a, 0xb7, 0x58, 0x89, 0x4f, 0x1b, 0x07, 0xfc, 0xd7, - 0x21, 0xfa, 0x4d, 0x83, 0xf9, 0x5c, 0x4f, 0x45, 0x6f, 0x17, 0x09, 0x9f, 0xe5, 0xe4, 0x95, 0xdb, - 0x2f, 0x58, 0x25, 0xd1, 0xdf, 0x57, 0xe8, 0xb7, 0xd1, 0xad, 0x1c, 0xf4, 0x47, 0x49, 0x65, 0x68, - 0x1c, 0xa4, 0xe6, 0x7a, 0x28, 0xbe, 0x97, 0xc3, 0xd6, 0xc6, 0xd3, 0xe3, 0xaa, 0xf6, 0xec, 0xb8, - 0xaa, 0xfd, 0x75, 0x5c, 0xd5, 0x1e, 0x9f, 0x54, 0x27, 0x9e, 0x9d, 0x54, 0x27, 0xfe, 0x3c, 0xa9, - 0x4e, 0x7c, 0xd9, 0xe8, 0x3b, 0x6c, 0xb0, 0xd3, 0x8d, 0x3c, 0xd6, 0x88, 0xda, 0x3a, 0xa4, 0x31, - 0x24, 0xdd, 0xd0, 0x78, 0xb0, 0xc9, 0x45, 0xf6, 0x12, 0x19, 0xfe, 0x89, 0xda, 0x9d, 0xe6, 0xdf, - 0xa8, 0xb7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xcd, 0x64, 0x2e, 0xe1, 0x0b, 0x00, 0x00, + // 1039 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0xb3, 0x69, 0x13, 0xea, 0x97, 0x92, 0xb6, 0xd3, 0x84, 0x3a, 0x4e, 0xe2,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, 0xad, 0x51, 0xc2, 0x67, 0x99, 0x78, 0xe9, 0xed, + 0x17, 0xac, 0xd2, 0xe8, 0xef, 0xa5, 0xe8, 0x16, 0xba, 0x9d, 0x83, 0xfe, 0x28, 0xa9, 0x0c, 0xc9, + 0x61, 0x3c, 0xd4, 0x23, 0xf5, 0x9d, 0x1c, 0xd6, 0x37, 0x9f, 0x9e, 0x94, 0x8d, 0x67, 0x27, 0x65, + 0xe3, 0xaf, 0x93, 0xb2, 0xf1, 0xf8, 0xb4, 0x3c, 0xf1, 0xec, 0xb4, 0x3c, 0xf1, 0xe7, 0x69, 0x79, + 0xe2, 0xcb, 0x6a, 0xc7, 0x11, 0xdd, 0xdd, 0x56, 0x64, 0xb0, 0x24, 0xea, 0xe9, 0xd0, 0x6a, 0x8f, + 0xb6, 0x42, 0xf2, 0x60, 0x4b, 0x2a, 0xec, 0x27, 0x1a, 0xf2, 0xd3, 0xb4, 0x35, 0x2d, 0xbf, 0x4d, + 0xdf, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x77, 0xb0, 0x7d, 0x2c, 0xd9, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1639,8 +1639,8 @@ func (m *QueryForceWithdrawalProofsRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l - if m.L2Sequence != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.L2Sequence)) + if m.Sequence != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Sequence)) i-- dAtA[i] = 0x8 } @@ -1878,8 +1878,8 @@ func (m *QueryForceWithdrawalProofsRequest) Size() (n int) { } var l int _ = l - if m.L2Sequence != 0 { - n += 1 + sovQuery(uint64(m.L2Sequence)) + if m.Sequence != 0 { + n += 1 + sovQuery(uint64(m.Sequence)) } return n } @@ -2977,9 +2977,9 @@ func (m *QueryForceWithdrawalProofsRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L2Sequence", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) } - m.L2Sequence = 0 + m.Sequence = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2989,7 +2989,7 @@ func (m *QueryForceWithdrawalProofsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.L2Sequence |= uint64(b&0x7F) << shift + m.Sequence |= uint64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/opchild/types/query.pb.gw.go b/x/opchild/types/query.pb.gw.go index 958443b..e3932d6 100644 --- a/x/opchild/types/query.pb.gw.go +++ b/x/opchild/types/query.pb.gw.go @@ -260,15 +260,15 @@ func request_Query_ForceWithdrawalProofs_0(ctx context.Context, marshaler runtim _ = err ) - val, ok = pathParams["l2_sequence"] + val, ok = pathParams["sequence"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "l2_sequence") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequence") } - protoReq.L2Sequence, err = runtime.Uint64(val) + protoReq.Sequence, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "l2_sequence", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequence", err) } msg, err := client.ForceWithdrawalProofs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -287,15 +287,15 @@ func local_request_Query_ForceWithdrawalProofs_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["l2_sequence"] + val, ok = pathParams["sequence"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "l2_sequence") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequence") } - protoReq.L2Sequence, err = runtime.Uint64(val) + protoReq.Sequence, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "l2_sequence", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequence", err) } msg, err := server.ForceWithdrawalProofs(ctx, &protoReq) @@ -712,7 +712,7 @@ var ( pattern_Query_BaseDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"opinit", "opchild", "v1", "base_denom", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ForceWithdrawalProofs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"opinit", "opchild", "v1", "withdrawals", "l2_sequence", "proofs"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ForceWithdrawalProofs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"opinit", "opchild", "v1", "withdrawals", "sequence", "proofs"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/ophost/client/cli/tx.go b/x/ophost/client/cli/tx.go index 95a1dfc..04e32f2 100644 --- a/x/ophost/client/cli/tx.go +++ b/x/ophost/client/cli/tx.go @@ -120,7 +120,7 @@ func NewCreateBridge(ac address.Codec) *cobra.Command { return err } - origConfig := BridgeCliConfig{} + var origConfig BridgeCliConfig err = json.Unmarshal(configBytes, &origConfig) if err != nil { @@ -150,6 +150,7 @@ func NewCreateBridge(ac address.Codec) *cobra.Command { SubmissionStartHeight: submissionStartHeight, Metadata: []byte(origConfig.Metadata), BatchInfo: origConfig.BatchInfo, + OracleEnabled: origConfig.OracleEnabled, } if err = config.Validate(ac); err != nil { @@ -335,12 +336,12 @@ func NewFinalizeTokenWithdrawal(ac address.Codec) *cobra.Command { Where withrawal-info.json contains: { - "bridge_id": 1, - "output_index": 0, - "withdrawal_proofs": [ "base64-encoded proof1", "proof2", ... ], + "bridge_id": "1", + "output_index": "1", + "sequence": "1", "sender" : "bech32-address", - "sequence": 0, - "amount": "10000000uinit", + "amount": {"amount": "10000000", "denom": "uinit"}, + "withdrawal_proofs": [ "base64-encoded proof1", "proof2", ... ], "version": "base64-encoded version", "storage_root": "base64-encoded storage-root", "last_block_hash": "base64-encoded latest-block-hash" @@ -358,8 +359,8 @@ func NewFinalizeTokenWithdrawal(ac address.Codec) *cobra.Command { if err != nil { return err } - withdrawalInfo := MsgFinalizeTokenWithdrawal{} - err = json.Unmarshal(withdrawalBytes, &withdrawalInfo) + var withdrawalInfo types.MsgFinalizeTokenWithdrawal + err = clientCtx.Codec.UnmarshalJSON(withdrawalBytes, &withdrawalInfo) if err != nil { return err } @@ -370,11 +371,6 @@ func NewFinalizeTokenWithdrawal(ac address.Codec) *cobra.Command { return fmt.Errorf("sender address is required") } - amount, err := sdk.ParseCoinNormalized(withdrawalInfo.Amount) - if err != nil { - return err - } - receiver, err := ac.BytesToString(clientCtx.GetFromAddress()) if err != nil { return err @@ -387,7 +383,7 @@ func NewFinalizeTokenWithdrawal(ac address.Codec) *cobra.Command { withdrawalInfo.WithdrawalProofs, sender, receiver, - amount, + withdrawalInfo.Amount, withdrawalInfo.Version, withdrawalInfo.StorageRoot, withdrawalInfo.LastBlockHash, @@ -421,7 +417,7 @@ func NewForceTokenWithdrawal(ac address.Codec) *cobra.Command { "output_index": "1", "sequence": "1", "sender" : "bech32-address", - "amount": "10000000uinit", + "amount": {"amount": "10000000", "denom": "uinit"}, "commitment_proof": {"ops":[{"type":"ics23:iavl","key":"","data":""}, ...]}, "app_hash": "base64-encoded app-hash", "app_hash_proof": {"total": 1, "index": 1, "leaf_hash": "base64-encoded leaf-hash", "aunts": ["base64-encoded aunts"]}, diff --git a/x/ophost/client/cli/tx_test.go b/x/ophost/client/cli/tx_test.go index 282aa31..4a83445 100644 --- a/x/ophost/client/cli/tx_test.go +++ b/x/ophost/client/cli/tx_test.go @@ -175,7 +175,8 @@ func (s *CLITestSuite) TestNewCreateBridge() { "batch_info": { "submitter": "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", "chain_type": "CELESTIA" - } + }, + "oracle_enabled": true }`) s.NoError(err) @@ -515,14 +516,14 @@ func (s *CLITestSuite) TestNewFinalizeTokenWithdrawal() { _, err = invalidConfig.WriteString(`{}`) s.NoError(err) _, err = validConfig.WriteString(`{ - "bridge_id": 1, - "output_index": 1180, + "bridge_id": "1", + "output_index": "1180", "withdrawal_proofs": [ "q6T8JJm7AdbD4rgZ3BjanRHdE1x7aLZwp36pPrOOey4=" ], "sender": "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", - "sequence": 5, - "amount": "100uinit", + "sequence": "5", + "amount": {"amount": "100", "denom": "uinit"}, "version": "AQ==", "storage_root": "KGlalV+mBHC7YFOLNX3g9LLzmyvP7QCm42HKo9N3Lu8=", "last_block_hash": "6oFdc+PEkXVJAo5IpXJ91vbCT9FNuKCz5VSlaFmxG+Y=" @@ -579,6 +580,109 @@ func (s *CLITestSuite) TestNewFinalizeTokenWithdrawal() { } } +//nolint:dupl +func (s *CLITestSuite) TestNewForceWithdrawal() { + require := s.Require() + cmd := cli.NewForceTokenWithdrawal(s.ac) + + addr0, err := s.ac.BytesToString(s.addrs[0]) + s.NoError(err) + + invalidConfig, err := os.CreateTemp("/tmp", "force_withdrawal_info") + require.NoError(err) + defer os.Remove(invalidConfig.Name()) + validConfig, err := os.CreateTemp("/tmp", "force_withdrawal_info") + require.NoError(err) + defer os.Remove(validConfig.Name()) + + _, err = invalidConfig.WriteString(`{}`) + s.NoError(err) + _, err = validConfig.WriteString(`{ + "bridge_id": "1", + "output_index": "1180", + "sequence": "5", + "sender": "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", + "amount": {"amount": "100", "denom": "uinit"}, + "commitment_proof": {"ops": [{ + "type": "ics23:iavl", + "key": "IwAAAAAAAAAB", + "data": "CpMCCgkjAAAAAAAAAAESIMtX9/DuZvK6Ly5Ofai5mysOIMcc1smtkWGcJ9oE5Of6GgsIARgBIAEqAwACPCIpCAESJQIEPCDkbki1CAPOMl4Ctcyzudf7s8Zp4r+XHyHcj4hiCi1L5yAiKQgBEiUGCkAgAH/09hE0xKNYZmvloM+7ctsEYu/HQrlxV5ZxN4ImjHIgIikIARIlCBpAIJ0yvyT/hmehmQlXWKgYi417k187zU3n7lrVfUs5rDtuICIrCAESBAomQCAaISB6C9R6RalaXaXNuZGvXREt/d2Q5+TOzKlOdaamN42TPyIpCAESJQxYQCCQjCpw17bW9Bs834jmy4Vzo+UgMtoKUHzkMOhLUgyFnCA=" + }, + { + "type": "ics23:simple", + "key": "b3BjaGlsZA==", + "data": "Cv0BCgdvcGNoaWxkEiA5Hk4w8gqHwNcz/a+Fwx6e6b3Y5ZJ8/3NWw221YiLm/RoJCAEYASABKgEAIiUIARIhAUHASkLkeZTU28swYO7deS17Yj8b9h9PdJi9Xj4RGWZqIiUIARIhAV+QXBx9gArOP6US8yedcqldayaUyBfSAuixPNGd9nQxIicIARIBARogFhYnngyIgDM5RQ7IZQ35ljkp499OXrHC/5ZW2Z+2I+kiJwgBEgEBGiBOU4xO6+ZWJUItAU20nVBj3BQqfUH+BCSkmuHMEAQzqCIlCAESIQG33+cAibPmm9NGEZ6REEzPVaua/bAJQBspD5drk5UDjQ==" + } + ] + }, + "app_hash": "YokP3+yupFP2knNBqfJVFMa64FusQ4a3/B27UbfAX+c=", + "app_hash_proof": { + "total": "14", + "index": "10", + "leaf_hash": "62Ov0/tOgXUg7KHKcVwOc0GYCIWoftO7jjaSOgcLBPU=", + "aunts": [ + "n7nHUzyvHSGNo69tJ39rEBxC48O3XXhCQtpmNgTdU8I=", + "u32kdXs9V+sV711i+qWhv8/ouUNED+IcloCESsG2tXY=", + "zW9k0LARqw0as3I22ood9j21lGzEJAuQVrEZ741bzJU=", + "LSh6zkBwp78gIuPh2qWg05Thz1UihCkIdMCV1hhguOA=" + ] + }, + "version": "AQ==", + "storage_root": "KGlalV+mBHC7YFOLNX3g9LLzmyvP7QCm42HKo9N3Lu8=", + "last_block_hash": "6oFdc+PEkXVJAo5IpXJ91vbCT9FNuKCz5VSlaFmxG+Y=" + }`) + s.NoError(err) + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message + }{ + { + "invalid transaction (invalid force withdrawal info)", + []string{ + invalidConfig.Name(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, addr0), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), + }, + true, 0, &sdk.TxResponse{}, + }, + { + "valid transaction", + []string{ + validConfig.Name(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, addr0), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), + }, + false, 0, &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) + if tc.expectErr { + require.Error(err) + } else { + require.NoError(err, "test: %s\noutput: %s", tc.name, out.String()) + err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType) + require.NoError(err, out.String(), "test: %s, output\n:", tc.name, out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + require.Equal(tc.expectedCode, txResp.Code, + "test: %s, output\n:", tc.name, out.String()) + } + }) + } +} + func TestCLITestSuite(t *testing.T) { suite.Run(t, new(CLITestSuite)) } diff --git a/x/ophost/client/cli/types.go b/x/ophost/client/cli/types.go index da61e0f..132a3b5 100644 --- a/x/ophost/client/cli/types.go +++ b/x/ophost/client/cli/types.go @@ -1,7 +1,6 @@ package cli import ( - v1 "github.com/cometbft/cometbft/api/cometbft/crypto/v1" "github.com/initia-labs/OPinit/x/ophost/types" ) @@ -15,35 +14,5 @@ type BridgeCliConfig struct { SubmissionStartHeight string `json:"submission_start_height"` Metadata string `json:"metadata"` BatchInfo types.BatchInfo `json:"batch_info"` -} - -// MsgFinalizeTokenWithdrawal is a message to remove a validator from designated list -// -// NOTE: it is a modified MsgFinalizeTokenWithdrawal from x/ophost/types/tx.pb.go to make unmarshal easier -type MsgFinalizeTokenWithdrawal struct { - BridgeId uint64 `protobuf:"varint,2,opt,name=bridge_id,json=bridgeId,proto3" json:"bridge_id,omitempty" yaml:"bridge_id"` - OutputIndex uint64 `protobuf:"varint,3,opt,name=output_index,json=outputIndex,proto3" json:"output_index,omitempty" yaml:"output_index"` - WithdrawalProofs [][]byte `protobuf:"bytes,4,rep,name=withdrawal_proofs,json=withdrawalProofs,proto3" json:"withdrawal_proofs,omitempty"` - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - Sequence uint64 `protobuf:"varint,6,opt,name=sequence,proto3" json:"sequence,omitempty" yaml:"sequence"` - Amount string `protobuf:"bytes,7,opt,name=amount,proto3" json:"amount" yaml:"amount"` - Version []byte `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty" yaml:"version"` - StorageRoot []byte `protobuf:"bytes,10,opt,name=storage_root,json=storageRoot,proto3" json:"storage_root,omitempty" yaml:"storage_root"` - LastBlockHash []byte `protobuf:"bytes,11,opt,name=last_block_hash,json=latestBlockHash,proto3" json:"last_block_hash,omitempty" yaml:"last_block_hash"` -} - -// MsgForceTokenWithdrawal is a message to force a token withdrawal from L2 to L1. -type MsgForceTokenWithdrawal struct { - // anyone can force a token withdrawal from L2 to L1 even this is not the receiver. - BridgeId uint64 `protobuf:"varint,2,opt,name=bridge_id,json=bridgeId,proto3" json:"bridge_id,omitempty" yaml:"bridge_id"` - OutputIndex uint64 `protobuf:"varint,3,opt,name=output_index,json=outputIndex,proto3" json:"output_index,omitempty" yaml:"output_index"` - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty" yaml:"sequence"` - Sender string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount" yaml:"amount"` - CommitmentProof v1.ProofOps `protobuf:"bytes,7,opt,name=commitment_proof,json=commitmentProof,proto3" json:"commitment_proof" yaml:"commitment_proof"` - AppHash []byte `protobuf:"bytes,8,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty" yaml:"app_hash"` - AppHashProof v1.Proof `protobuf:"bytes,9,opt,name=app_hash_proof,json=appHashProof,proto3" json:"app_hash_proof" yaml:"app_hash_proof"` - Version []byte `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty" yaml:"version"` - StorageRoot []byte `protobuf:"bytes,11,opt,name=storage_root,json=storageRoot,proto3" json:"storage_root,omitempty" yaml:"storage_root"` - LastBlockHash []byte `protobuf:"bytes,12,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty" yaml:"last_block_hash"` + OracleEnabled bool `json:"oracle_enabled"` }