From f60a9ad7b1c8b220521d813586bbdc1c9312d55c Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 11 Jul 2022 13:36:31 +0100 Subject: [PATCH 01/11] adding new SignBytes type, generic membership verification implementation and tests --- docs/ibc/proto-docs.md | 20 + .../06-solomachine/types/client_state.go | 69 +++ .../06-solomachine/types/client_state_test.go | 419 ++++++++++++++ .../06-solomachine/types/solomachine.pb.go | 510 ++++++++++++++---- .../solomachine/v2/solomachine.proto | 13 + 5 files changed, 934 insertions(+), 97 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 523958ffe83..5a95cd30044 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -321,6 +321,7 @@ - [PacketCommitmentData](#ibc.lightclients.solomachine.v2.PacketCommitmentData) - [PacketReceiptAbsenceData](#ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData) - [SignBytes](#ibc.lightclients.solomachine.v2.SignBytes) + - [SignBytesV2](#ibc.lightclients.solomachine.v2.SignBytesV2) - [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) - [TimestampedSignatureData](#ibc.lightclients.solomachine.v2.TimestampedSignatureData) @@ -4737,6 +4738,25 @@ SignBytes defines the signed bytes used for signature verification. + + +### SignBytesV2 +SignBytesV2 defines the signed bytes used for signature verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | | +| `timestamp` | [uint64](#uint64) | | | +| `diversifier` | [string](#string) | | | +| `path` | [bytes](#bytes) | | the data path | +| `data` | [bytes](#bytes) | | marshaled data | + + + + + + ### SignatureAndData diff --git a/modules/light-clients/06-solomachine/types/client_state.go b/modules/light-clients/06-solomachine/types/client_state.go index 06dbccb6e64..5f4b4378756 100644 --- a/modules/light-clients/06-solomachine/types/client_state.go +++ b/modules/light-clients/06-solomachine/types/client_state.go @@ -442,6 +442,75 @@ func (cs *ClientState) VerifyMembership( value []byte, ) error { // TODO: Implement 06-solomachine VerifyMembership + if revision := height.GetRevisionNumber(); revision != 0 { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidHeight, "revision must be 0 for solomachine, got revision-number: %d", revision) + } + + // sequence is encoded in the revision height of height struct + sequence := height.GetRevisionHeight() + latestSequence := cs.GetLatestHeight().GetRevisionHeight() + if latestSequence != sequence { + return sdkerrors.Wrapf( + sdkerrors.ErrInvalidHeight, + "client state sequence != proof sequence (%d != %d)", latestSequence, sequence, + ) + } + + var merklePath commitmenttypes.MerklePath + if err := cdc.Unmarshal(path, &merklePath); err != nil { + return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal path into ICS 23 commitment merkle path") + } + + var timestampedSigData TimestampedSignatureData + if err := cdc.Unmarshal(proof, ×tampedSigData); err != nil { + return sdkerrors.Wrapf(err, "failed to unmarshal proof into type %T", timestampedSigData) + } + + timestamp := timestampedSigData.Timestamp + + if len(timestampedSigData.SignatureData) == 0 { + return sdkerrors.Wrap(ErrInvalidProof, "signature data cannot be empty") + } + + sigData, err := UnmarshalSignatureData(cdc, timestampedSigData.SignatureData) + if err != nil { + return err + } + + if cs.ConsensusState == nil { + return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "consensus state cannot be empty") + } + + if cs.ConsensusState.GetTimestamp() > timestamp { + return sdkerrors.Wrapf(ErrInvalidProof, "the consensus state timestamp is greater than the signature timestamp (%d >= %d)", cs.ConsensusState.GetTimestamp(), timestamp) + } + + publicKey, err := cs.ConsensusState.GetPubKey() + if err != nil { + return err + } + + signBytes := &SignBytesV2{ + Sequence: sequence, + Timestamp: timestamp, + Diversifier: cs.ConsensusState.Diversifier, + Path: []byte(merklePath.String()), + Data: value, + } + + signBz, err := cdc.Marshal(signBytes) + if err != nil { + return err + } + + if err := VerifySignature(publicKey, signBz, sigData); err != nil { + return err + } + + cs.Sequence++ + cs.ConsensusState.Timestamp = timestamp + setClientState(clientStore, cdc, cs) + return nil } diff --git a/modules/light-clients/06-solomachine/types/client_state_test.go b/modules/light-clients/06-solomachine/types/client_state_test.go index 3e0c4904b7b..e6f66065f71 100644 --- a/modules/light-clients/06-solomachine/types/client_state_test.go +++ b/modules/light-clients/06-solomachine/types/client_state_test.go @@ -144,6 +144,425 @@ func (suite *SoloMachineTestSuite) TestInitialize() { } } +func (suite *SoloMachineTestSuite) TestVerifyMembership() { + // test singlesig and multisig public keys + for _, solomachine := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { + + var ( + clientState *types.ClientState + err error + height clienttypes.Height + path []byte + proof []byte + signBytes types.SignBytesV2 + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "success: client state verification", + func() { + merklePath := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) + signBytes = types.SignBytesV2{ + Sequence: solomachine.GetHeight().GetRevisionHeight(), + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.ClientState"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + + }, + true, + }, + { + "success: consensus state verification", + func() { + merklePath := solomachine.GetConsensusStatePath(counterpartyClientIdentifier, height) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.ConsensusState"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: connection state verification", + func() { + merklePath := solomachine.GetConnectionStatePath(ibctesting.FirstConnectionID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.ConnectionState"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: channel state verification", + func() { + merklePath := solomachine.GetChannelStatePath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.ChannelState"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: next sequence recv verification", + func() { + merklePath := solomachine.GetNextSequenceRecvPath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.NextSequenceRecv"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: packet commitment verification", + func() { + merklePath := solomachine.GetPacketCommitmentPath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.PacketCommitment"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: packet acknowledgement verification", + func() { + merklePath := solomachine.GetPacketAcknowledgementPath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.PacketAcknowledgement"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "success: packet receipt verification", + func() { + merklePath := solomachine.GetPacketReceiptPath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = types.SignBytesV2{ + Sequence: solomachine.Sequence, + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine.PacketReceipt"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "consensus state in client state is nil", + func() { + clientState = types.NewClientState(1, nil, false) + }, + false, + }, + { + "client state latest height is less than sequence", + func() { + consensusState := &types.ConsensusState{ + Timestamp: solomachine.Time, + PublicKey: solomachine.ConsensusState().PublicKey, + } + + clientState = types.NewClientState(solomachine.Sequence-1, consensusState, false) + }, + false, + }, + { + "height revision number is not zero", + func() { + height = clienttypes.NewHeight(1, solomachine.GetHeight().GetRevisionHeight()) + }, + false, + }, + { + "malformed merkle path fails to unmarshal", + func() { + path = []byte("invalid path") + }, + false, + }, + { + "malformed proof fails to unmarshal", + func() { + merklePath := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof = []byte("invalid proof") + }, + false, + }, + { + "consensus state timestamp is greater than signature", + func() { + consensusState := &types.ConsensusState{ + Timestamp: solomachine.Time + 1, + PublicKey: solomachine.ConsensusState().PublicKey, + } + + clientState = types.NewClientState(solomachine.Sequence, consensusState, false) + }, + false, + }, + { + "signature data is nil", + func() { + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: nil, + Timestamp: solomachine.Time, + } + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + false, + }, + { + "consensus state public key is nil", + func() { + clientState.ConsensusState.PublicKey = nil + }, + false, + }, + { + "malformed signature data fails to unmarshal", + func() { + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: []byte("invalid signature data"), + Timestamp: solomachine.Time, + } + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + false, + }, + { + "proof verification failed", + func() { + signBytes.Data = []byte("invalid membership data value") + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + clientState = solomachine.ClientState() + height = clienttypes.NewHeight(solomachine.GetHeight().GetRevisionNumber(), solomachine.GetHeight().GetRevisionHeight()) + + merklePath := commitmenttypes.NewMerklePath("ibc", "solomachine") + signBytes = types.SignBytesV2{ + Sequence: solomachine.GetHeight().GetRevisionHeight(), + Timestamp: solomachine.Time, + Diversifier: solomachine.Diversifier, + Path: []byte(merklePath.String()), + Data: []byte("solomachine"), + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := solomachine.GenerateSignature(signBz) + + signatureDoc := &types.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: solomachine.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + + tc.malleate() + + var expSeq uint64 + if clientState.ConsensusState != nil { + expSeq = clientState.Sequence + 1 + } + + err = clientState.VerifyMembership( + suite.chainA.GetContext(), suite.store, suite.chainA.Codec, + height, 0, 0, // solomachine does not check delay periods + proof, path, signBytes.Data, + ) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expSeq, clientState.Sequence) + suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %s", suite.GetSequenceFromStore(), tc.name) + } else { + suite.Require().Error(err) + } + }) + } + } +} + func (suite *SoloMachineTestSuite) TestVerifyClientState() { // create client for tendermint so we can use client state for verification tmPath := ibctesting.NewPath(suite.chainA, suite.chainB) diff --git a/modules/light-clients/06-solomachine/types/solomachine.pb.go b/modules/light-clients/06-solomachine/types/solomachine.pb.go index 6eafde55d0c..3ef80f1fd92 100644 --- a/modules/light-clients/06-solomachine/types/solomachine.pb.go +++ b/modules/light-clients/06-solomachine/types/solomachine.pb.go @@ -347,6 +347,50 @@ func (m *TimestampedSignatureData) XXX_DiscardUnknown() { var xxx_messageInfo_TimestampedSignatureData proto.InternalMessageInfo +// SignBytesV2 defines the signed bytes used for signature verification. +type SignBytesV2 struct { + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` + // the data path + Path []byte `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + // marshaled data + Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *SignBytesV2) Reset() { *m = SignBytesV2{} } +func (m *SignBytesV2) String() string { return proto.CompactTextString(m) } +func (*SignBytesV2) ProtoMessage() {} +func (*SignBytesV2) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{6} +} +func (m *SignBytesV2) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignBytesV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignBytesV2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SignBytesV2) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignBytesV2.Merge(m, src) +} +func (m *SignBytesV2) XXX_Size() int { + return m.Size() +} +func (m *SignBytesV2) XXX_DiscardUnknown() { + xxx_messageInfo_SignBytesV2.DiscardUnknown(m) +} + +var xxx_messageInfo_SignBytesV2 proto.InternalMessageInfo + // SignBytes defines the signed bytes used for signature verification. type SignBytes struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` @@ -362,7 +406,7 @@ func (m *SignBytes) Reset() { *m = SignBytes{} } func (m *SignBytes) String() string { return proto.CompactTextString(m) } func (*SignBytes) ProtoMessage() {} func (*SignBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{6} + return fileDescriptor_141333b361aae010, []int{7} } func (m *SignBytes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -403,7 +447,7 @@ func (m *HeaderData) Reset() { *m = HeaderData{} } func (m *HeaderData) String() string { return proto.CompactTextString(m) } func (*HeaderData) ProtoMessage() {} func (*HeaderData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{7} + return fileDescriptor_141333b361aae010, []int{8} } func (m *HeaderData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -442,7 +486,7 @@ func (m *ClientStateData) Reset() { *m = ClientStateData{} } func (m *ClientStateData) String() string { return proto.CompactTextString(m) } func (*ClientStateData) ProtoMessage() {} func (*ClientStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{8} + return fileDescriptor_141333b361aae010, []int{9} } func (m *ClientStateData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +526,7 @@ func (m *ConsensusStateData) Reset() { *m = ConsensusStateData{} } func (m *ConsensusStateData) String() string { return proto.CompactTextString(m) } func (*ConsensusStateData) ProtoMessage() {} func (*ConsensusStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{9} + return fileDescriptor_141333b361aae010, []int{10} } func (m *ConsensusStateData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -522,7 +566,7 @@ func (m *ConnectionStateData) Reset() { *m = ConnectionStateData{} } func (m *ConnectionStateData) String() string { return proto.CompactTextString(m) } func (*ConnectionStateData) ProtoMessage() {} func (*ConnectionStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{10} + return fileDescriptor_141333b361aae010, []int{11} } func (m *ConnectionStateData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -562,7 +606,7 @@ func (m *ChannelStateData) Reset() { *m = ChannelStateData{} } func (m *ChannelStateData) String() string { return proto.CompactTextString(m) } func (*ChannelStateData) ProtoMessage() {} func (*ChannelStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{11} + return fileDescriptor_141333b361aae010, []int{12} } func (m *ChannelStateData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +646,7 @@ func (m *PacketCommitmentData) Reset() { *m = PacketCommitmentData{} } func (m *PacketCommitmentData) String() string { return proto.CompactTextString(m) } func (*PacketCommitmentData) ProtoMessage() {} func (*PacketCommitmentData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{12} + return fileDescriptor_141333b361aae010, []int{13} } func (m *PacketCommitmentData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -656,7 +700,7 @@ func (m *PacketAcknowledgementData) Reset() { *m = PacketAcknowledgement func (m *PacketAcknowledgementData) String() string { return proto.CompactTextString(m) } func (*PacketAcknowledgementData) ProtoMessage() {} func (*PacketAcknowledgementData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{13} + return fileDescriptor_141333b361aae010, []int{14} } func (m *PacketAcknowledgementData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -709,7 +753,7 @@ func (m *PacketReceiptAbsenceData) Reset() { *m = PacketReceiptAbsenceDa func (m *PacketReceiptAbsenceData) String() string { return proto.CompactTextString(m) } func (*PacketReceiptAbsenceData) ProtoMessage() {} func (*PacketReceiptAbsenceData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{14} + return fileDescriptor_141333b361aae010, []int{15} } func (m *PacketReceiptAbsenceData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -756,7 +800,7 @@ func (m *NextSequenceRecvData) Reset() { *m = NextSequenceRecvData{} } func (m *NextSequenceRecvData) String() string { return proto.CompactTextString(m) } func (*NextSequenceRecvData) ProtoMessage() {} func (*NextSequenceRecvData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{15} + return fileDescriptor_141333b361aae010, []int{16} } func (m *NextSequenceRecvData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -807,6 +851,7 @@ func init() { proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v2.Misbehaviour") proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v2.SignatureAndData") proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v2.TimestampedSignatureData") + proto.RegisterType((*SignBytesV2)(nil), "ibc.lightclients.solomachine.v2.SignBytesV2") proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v2.SignBytes") proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v2.HeaderData") proto.RegisterType((*ClientStateData)(nil), "ibc.lightclients.solomachine.v2.ClientStateData") @@ -824,93 +869,95 @@ func init() { } var fileDescriptor_141333b361aae010 = []byte{ - // 1373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x5f, 0x6f, 0xdb, 0x54, - 0x14, 0xaf, 0xb3, 0xac, 0x6b, 0x4e, 0xba, 0x36, 0x78, 0xd9, 0x96, 0x7a, 0x53, 0x62, 0x8c, 0x18, - 0x05, 0xb1, 0x84, 0x76, 0x62, 0x42, 0x13, 0x02, 0x1c, 0xc7, 0x63, 0xd9, 0x5a, 0x37, 0x38, 0x2e, - 0xb0, 0x09, 0xc9, 0x38, 0xce, 0x6d, 0x62, 0x2d, 0xf1, 0xcd, 0x62, 0x27, 0x59, 0x90, 0x90, 0x10, - 0x4f, 0x23, 0xe2, 0x81, 0x2f, 0x10, 0x09, 0x81, 0xf8, 0x1c, 0xbc, 0x21, 0x78, 0xdb, 0x23, 0x4f, - 0x01,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fa, 0xf3, 0xec, 0xc6, 0x5f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x08, 0x62, 0xbe, 0x82, 0x0d, 0x00, 0x00, + // 1399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x8f, 0xdb, 0xd4, + 0x16, 0x1f, 0xa7, 0xe9, 0x74, 0x72, 0x32, 0x9d, 0xc9, 0x73, 0xd3, 0x36, 0xe3, 0x56, 0x89, 0x9f, + 0x9f, 0x5e, 0xdf, 0x3c, 0x44, 0x13, 0x66, 0x2a, 0x2a, 0x54, 0x21, 0xc0, 0x71, 0x5c, 0x9a, 0x76, + 0xc6, 0x13, 0x1c, 0x4f, 0xa1, 0x15, 0x92, 0x71, 0x9c, 0x3b, 0x89, 0xd5, 0xc4, 0x37, 0x8d, 0x9d, + 0xa4, 0x41, 0x42, 0x42, 0xac, 0x4a, 0xc4, 0x82, 0x1d, 0xab, 0x48, 0x08, 0xc4, 0xe7, 0x60, 0x87, + 0x60, 0xd7, 0x25, 0xab, 0x80, 0xda, 0x6f, 0x90, 0x4f, 0x80, 0xec, 0x7b, 0x13, 0xdb, 0x99, 0x4e, + 0x46, 0xfc, 0xe9, 0xee, 0xde, 0xf3, 0xe7, 0x77, 0x7e, 0xe7, 0xdc, 0xe3, 0x73, 0xaf, 0x61, 0xc7, + 0xaa, 0x99, 0x85, 0x96, 0xd5, 0x68, 0xba, 0x66, 0xcb, 0x42, 0xb6, 0xeb, 0x14, 0x1c, 0xdc, 0xc2, + 0x6d, 0xc3, 0x6c, 0x5a, 0x36, 0x2a, 0xf4, 0x77, 0xc3, 0xdb, 0x7c, 0xa7, 0x8b, 0x5d, 0xcc, 0xe6, + 0xac, 0x9a, 0x99, 0x0f, 0xbb, 0xe4, 0xc3, 0x36, 0xfd, 0x5d, 0xee, 0x7f, 0x1e, 0xa6, 0x89, 0xbb, + 0xa8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, 0xd5, 0xdf, 0xc9, 0x07, 0xa0, + 0xb2, 0x5d, 0x57, 0x43, 0x8e, 0x34, 0x6e, 0x1d, 0x52, 0x12, 0x79, 0x6c, 0x2d, 0x0f, 0x7a, 0x13, + 0xce, 0xd1, 0x47, 0x19, 0x8d, 0x78, 0x35, 0x14, 0x91, 0xbe, 0xd6, 0xbc, 0x70, 0x64, 0xa9, 0xce, + 0x8c, 0x69, 0x94, 0xbb, 0x90, 0xae, 0x18, 0xe6, 0x23, 0xe4, 0x4a, 0xb8, 0xdd, 0xb6, 0xdc, 0x36, + 0xb2, 0xdd, 0x13, 0x23, 0x65, 0xbd, 0xf4, 0x66, 0x56, 0x7e, 0xb0, 0x75, 0x35, 0x24, 0x11, 0x1e, + 0xc0, 0x16, 0xc1, 0x12, 0xcd, 0x47, 0x36, 0x1e, 0xb4, 0x50, 0xbd, 0x81, 0x96, 0x02, 0x6e, 0xc3, + 0xa6, 0x11, 0x35, 0xa5, 0xa8, 0x8b, 0x62, 0x21, 0x0f, 0x19, 0x02, 0xad, 0x22, 0x13, 0x59, 0x1d, + 0x57, 0xac, 0x39, 0xde, 0x1c, 0x38, 0x09, 0x59, 0x68, 0x42, 0x5a, 0x41, 0x4f, 0xdc, 0x2a, 0x9d, + 0x17, 0x2a, 0x32, 0xfb, 0x27, 0xb2, 0x78, 0x1b, 0xce, 0xdb, 0xe8, 0x89, 0xab, 0x3b, 0xe8, 0xb1, + 0xde, 0x45, 0x66, 0x9f, 0xcc, 0x93, 0xf0, 0x05, 0x15, 0x51, 0x0b, 0x6a, 0xd2, 0x26, 0xd0, 0x1e, + 0xea, 0x6b, 0x5f, 0xc5, 0x61, 0x6d, 0x36, 0x18, 0xd8, 0xb7, 0xe0, 0x3f, 0x25, 0x51, 0x13, 0x75, + 0xed, 0x41, 0x45, 0xd6, 0x0f, 0x95, 0xb2, 0x52, 0xd6, 0xca, 0xe2, 0x5e, 0xf9, 0xa1, 0x5c, 0xd2, + 0x0f, 0x95, 0x6a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0x54, 0xc7, 0xde, 0x84, 0xab, 0x81, 0xbf, + 0x22, 0x7f, 0xa4, 0xe9, 0x55, 0xf9, 0x83, 0x43, 0x4f, 0xe5, 0xc1, 0xdc, 0x4f, 0xad, 0x11, 0xe2, + 0x9e, 0x66, 0xa6, 0xf0, 0xe4, 0x2c, 0x0f, 0xa9, 0xc0, 0xef, 0x8e, 0x2c, 0x96, 0x64, 0x35, 0x95, + 0x20, 0x27, 0x43, 0x76, 0x5c, 0xfc, 0xe9, 0xf7, 0xd9, 0x95, 0xe2, 0x27, 0x3f, 0x3f, 0xcf, 0x32, + 0xcf, 0x9e, 0x67, 0x99, 0xdf, 0x9f, 0x67, 0x99, 0xaf, 0x5f, 0x64, 0x57, 0x9e, 0xbd, 0xc8, 0xae, + 0xfc, 0xfa, 0x22, 0xbb, 0xf2, 0xf0, 0x76, 0xc3, 0x72, 0x9b, 0xbd, 0x5a, 0xde, 0xc4, 0xed, 0x82, + 0x89, 0x9d, 0x36, 0x76, 0x0a, 0x56, 0xcd, 0xbc, 0xde, 0xc0, 0x85, 0xfe, 0x8d, 0x42, 0x1b, 0xd7, + 0x7b, 0x2d, 0xe4, 0x90, 0x7f, 0xbd, 0xeb, 0xb3, 0x9f, 0xbd, 0x37, 0x6e, 0x5e, 0x0f, 0xff, 0xef, + 0x79, 0xd7, 0x8c, 0x53, 0x5b, 0xf5, 0xe7, 0xd9, 0x8d, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xec, + 0x4e, 0x21, 0x30, 0x1c, 0x0e, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { @@ -1220,6 +1267,60 @@ func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *SignBytesV2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignBytesV2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignBytesV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x2a + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x22 + } + if len(m.Diversifier) > 0 { + i -= len(m.Diversifier) + copy(dAtA[i:], m.Diversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Diversifier))) + i-- + dAtA[i] = 0x1a + } + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x10 + } + if m.Sequence != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SignBytes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1764,6 +1865,33 @@ func (m *TimestampedSignatureData) Size() (n int) { return n } +func (m *SignBytesV2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + l = len(m.Diversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + func (m *SignBytes) Size() (n int) { if m == nil { return 0 @@ -2848,6 +2976,194 @@ func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error { } return nil } +func (m *SignBytesV2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SignBytesV2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignBytesV2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Diversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *SignBytes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index f4f36910eb2..f088390468e 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -78,6 +78,19 @@ message TimestampedSignatureData { uint64 timestamp = 2; } +// SignBytesV2 defines the signed bytes used for signature verification. +message SignBytesV2 { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + uint64 timestamp = 2; + string diversifier = 3; + // the standardised data path + bytes path = 4; + // marshaled data + bytes data = 5; +} + // SignBytes defines the signed bytes used for signature verification. message SignBytes { option (gogoproto.goproto_getters) = false; From 21e874d569cdc7ed030cd05abb6a8138857d6d4f Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 11 Jul 2022 16:26:52 +0100 Subject: [PATCH 02/11] adding protodocs --- docs/ibc/proto-docs.md | 10 +++++----- .../06-solomachine/types/solomachine.pb.go | 11 +++++++---- .../ibc/lightclients/solomachine/v2/solomachine.proto | 11 +++++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 5a95cd30044..4c61726a968 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -4746,11 +4746,11 @@ SignBytesV2 defines the signed bytes used for signature verification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sequence` | [uint64](#uint64) | | | -| `timestamp` | [uint64](#uint64) | | | -| `diversifier` | [string](#string) | | | -| `path` | [bytes](#bytes) | | the data path | -| `data` | [bytes](#bytes) | | marshaled data | +| `sequence` | [uint64](#uint64) | | the sequence number | +| `timestamp` | [uint64](#uint64) | | the proof timestamp | +| `diversifier` | [string](#string) | | the public key diversifier | +| `path` | [bytes](#bytes) | | the standardised path bytes | +| `data` | [bytes](#bytes) | | the marshaled data bytes | diff --git a/modules/light-clients/06-solomachine/types/solomachine.pb.go b/modules/light-clients/06-solomachine/types/solomachine.pb.go index 3ef80f1fd92..49ad2df99af 100644 --- a/modules/light-clients/06-solomachine/types/solomachine.pb.go +++ b/modules/light-clients/06-solomachine/types/solomachine.pb.go @@ -349,12 +349,15 @@ var xxx_messageInfo_TimestampedSignatureData proto.InternalMessageInfo // SignBytesV2 defines the signed bytes used for signature verification. type SignBytesV2 struct { - Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // the sequence number + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + // the proof timestamp + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // the public key diversifier Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` - // the data path + // the standardised path bytes Path []byte `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` - // marshaled data + // the marshaled data bytes Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` } diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index f088390468e..32b98a7d4e1 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -82,12 +82,15 @@ message TimestampedSignatureData { message SignBytesV2 { option (gogoproto.goproto_getters) = false; - uint64 sequence = 1; - uint64 timestamp = 2; + // the sequence number + uint64 sequence = 1; + // the proof timestamp + uint64 timestamp = 2; + // the public key diversifier string diversifier = 3; - // the standardised data path + // the standardised path bytes bytes path = 4; - // marshaled data + // the marshaled data bytes bytes data = 5; } From 8bfb01d681b18c8181b50cf3c6f2b379b126364a Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 13 Jul 2022 09:52:21 +0100 Subject: [PATCH 03/11] updating comment --- modules/light-clients/06-solomachine/client_state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/light-clients/06-solomachine/client_state.go b/modules/light-clients/06-solomachine/client_state.go index 1e06bf53193..077155632a8 100644 --- a/modules/light-clients/06-solomachine/client_state.go +++ b/modules/light-clients/06-solomachine/client_state.go @@ -441,7 +441,7 @@ func (cs *ClientState) VerifyMembership( path []byte, value []byte, ) error { - // TODO: Implement 06-solomachine VerifyMembership + // TODO: Attempt to refactor code to smaller function if revision := height.GetRevisionNumber(); revision != 0 { return sdkerrors.Wrapf(sdkerrors.ErrInvalidHeight, "revision must be 0 for solomachine, got revision-number: %d", revision) } From 4d33a46053b0171bab9986752fd7123078620957 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 19 Jul 2022 14:50:23 +0200 Subject: [PATCH 04/11] refactor: solomachine misbehaviour checking (#1715) * adding SignatureAndDataV2 proto message type * updating misbehaviour checking * removing dead solomachine code (#1716) --- docs/ibc/proto-docs.md | 199 +- .../06-solomachine/client_state.go | 324 +- .../06-solomachine/client_state_test.go | 711 ---- modules/light-clients/06-solomachine/codec.go | 89 - .../06-solomachine/codec_test.go | 190 - .../light-clients/06-solomachine/errors.go | 1 - .../06-solomachine/misbehaviour.go | 6 +- .../06-solomachine/misbehaviour_handle.go | 25 +- .../06-solomachine/misbehaviour_test.go | 8 +- modules/light-clients/06-solomachine/proof.go | 433 --- .../06-solomachine/proof_test.go | 35 - .../06-solomachine/solomachine.go | 12 - .../06-solomachine/solomachine.pb.go | 3344 +++-------------- .../light-clients/06-solomachine/update.go | 20 +- .../06-solomachine/update_test.go | 20 +- .../solomachine/v2/solomachine.proto | 124 +- testing/solomachine.go | 42 +- 17 files changed, 715 insertions(+), 4868 deletions(-) delete mode 100644 modules/light-clients/06-solomachine/codec_test.go diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 4c61726a968..32546ed6568 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -307,26 +307,15 @@ - [DataType](#ibc.lightclients.solomachine.v1.DataType) - [ibc/lightclients/solomachine/v2/solomachine.proto](#ibc/lightclients/solomachine/v2/solomachine.proto) - - [ChannelStateData](#ibc.lightclients.solomachine.v2.ChannelStateData) - [ClientState](#ibc.lightclients.solomachine.v2.ClientState) - - [ClientStateData](#ibc.lightclients.solomachine.v2.ClientStateData) - - [ConnectionStateData](#ibc.lightclients.solomachine.v2.ConnectionStateData) - [ConsensusState](#ibc.lightclients.solomachine.v2.ConsensusState) - - [ConsensusStateData](#ibc.lightclients.solomachine.v2.ConsensusStateData) - [Header](#ibc.lightclients.solomachine.v2.Header) - [HeaderData](#ibc.lightclients.solomachine.v2.HeaderData) - [Misbehaviour](#ibc.lightclients.solomachine.v2.Misbehaviour) - - [NextSequenceRecvData](#ibc.lightclients.solomachine.v2.NextSequenceRecvData) - - [PacketAcknowledgementData](#ibc.lightclients.solomachine.v2.PacketAcknowledgementData) - - [PacketCommitmentData](#ibc.lightclients.solomachine.v2.PacketCommitmentData) - - [PacketReceiptAbsenceData](#ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData) - - [SignBytes](#ibc.lightclients.solomachine.v2.SignBytes) - [SignBytesV2](#ibc.lightclients.solomachine.v2.SignBytesV2) - - [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) + - [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) - [TimestampedSignatureData](#ibc.lightclients.solomachine.v2.TimestampedSignatureData) - - [DataType](#ibc.lightclients.solomachine.v2.DataType) - - [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) @@ -4493,23 +4482,6 @@ to preserve uniqueness of different data sign byte encodings. - - -### ChannelStateData -ChannelStateData returns the SignBytes data for channel state -verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `channel` | [ibc.core.channel.v1.Channel](#ibc.core.channel.v1.Channel) | | | - - - - - - ### ClientState @@ -4529,39 +4501,6 @@ state and if the client is frozen. - - -### ClientStateData -ClientStateData returns the SignBytes data for client state verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - - - -### ConnectionStateData -ConnectionStateData returns the SignBytes data for connection state -verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `connection` | [ibc.core.connection.v1.ConnectionEnd](#ibc.core.connection.v1.ConnectionEnd) | | | - - - - - - ### ConsensusState @@ -4581,23 +4520,6 @@ consensus state. - - -### ConsensusStateData -ConsensusStateData returns the SignBytes data for consensus state -verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - ### Header @@ -4644,94 +4566,8 @@ of a sequence and two signatures over different messages at that sequence. | ----- | ---- | ----- | ----------- | | `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated | | `sequence` | [uint64](#uint64) | | | -| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | -| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | - - - - - - - - -### NextSequenceRecvData -NextSequenceRecvData returns the SignBytes data for verification of the next -sequence to be received. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `next_seq_recv` | [uint64](#uint64) | | | - - - - - - - - -### PacketAcknowledgementData -PacketAcknowledgementData returns the SignBytes data for acknowledgement -verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `acknowledgement` | [bytes](#bytes) | | | - - - - - - - - -### PacketCommitmentData -PacketCommitmentData returns the SignBytes data for packet commitment -verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | -| `commitment` | [bytes](#bytes) | | | - - - - - - - - -### PacketReceiptAbsenceData -PacketReceiptAbsenceData returns the SignBytes data for -packet receipt absence verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [bytes](#bytes) | | | - - - - - - - - -### SignBytes -SignBytes defines the signed bytes used for signature verification. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sequence` | [uint64](#uint64) | | | -| `timestamp` | [uint64](#uint64) | | | -| `diversifier` | [string](#string) | | | -| `data_type` | [DataType](#ibc.lightclients.solomachine.v2.DataType) | | type of the data used | -| `data` | [bytes](#bytes) | | marshaled data | +| `signature_one` | [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) | | | +| `signature_two` | [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) | | | @@ -4757,17 +4593,17 @@ SignBytesV2 defines the signed bytes used for signature verification. - + -### SignatureAndData -SignatureAndData contains a signature and the data signed over to create that +### SignatureAndDataV2 +SignatureAndDataV2 contains a signature and the data signed over to create that signature. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `signature` | [bytes](#bytes) | | | -| `data_type` | [DataType](#ibc.lightclients.solomachine.v2.DataType) | | | +| `path` | [bytes](#bytes) | | | | `data` | [bytes](#bytes) | | | | `timestamp` | [uint64](#uint64) | | | @@ -4794,27 +4630,6 @@ signature. - - - -### DataType -DataType defines the type of solo machine proof being created. This is done -to preserve uniqueness of different data sign byte encodings. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| DATA_TYPE_UNINITIALIZED_UNSPECIFIED | 0 | Default State | -| DATA_TYPE_CLIENT_STATE | 1 | Data type for client state verification | -| DATA_TYPE_CONSENSUS_STATE | 2 | Data type for consensus state verification | -| DATA_TYPE_CONNECTION_STATE | 3 | Data type for connection state verification | -| DATA_TYPE_CHANNEL_STATE | 4 | Data type for channel state verification | -| DATA_TYPE_PACKET_COMMITMENT | 5 | Data type for packet commitment verification | -| DATA_TYPE_PACKET_ACKNOWLEDGEMENT | 6 | Data type for packet acknowledgement verification | -| DATA_TYPE_PACKET_RECEIPT_ABSENCE | 7 | Data type for packet receipt absence verification | -| DATA_TYPE_NEXT_SEQUENCE_RECV | 8 | Data type for next sequence recv verification | -| DATA_TYPE_HEADER | 9 | Data type for header verification | - - diff --git a/modules/light-clients/06-solomachine/client_state.go b/modules/light-clients/06-solomachine/client_state.go index 077155632a8..93e61b7c00a 100644 --- a/modules/light-clients/06-solomachine/client_state.go +++ b/modules/light-clients/06-solomachine/client_state.go @@ -105,329 +105,6 @@ func (cs ClientState) VerifyUpgradeAndUpdateState( return sdkerrors.Wrap(clienttypes.ErrInvalidUpgradeClient, "cannot upgrade solomachine client") } -// VerifyClientState verifies a proof of the client state of the running chain -// stored on the solo machine. -func (cs *ClientState) VerifyClientState( - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - prefix exported.Prefix, - counterpartyClientIdentifier string, - proof []byte, - clientState exported.ClientState, -) error { - // NOTE: the proof height sequence is incremented by one due to the connection handshake verification ordering - height = clienttypes.NewHeight(height.GetRevisionNumber(), height.GetRevisionHeight()+1) - - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullClientStatePath(counterpartyClientIdentifier)) - path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath) - if err != nil { - return err - } - - signBz, err := ClientStateSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, clientState) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyClientConsensusState verifies a proof of the consensus state of the -// running chain stored on the solo machine. -func (cs *ClientState) VerifyClientConsensusState( - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - counterpartyClientIdentifier string, - consensusHeight exported.Height, - prefix exported.Prefix, - proof []byte, - consensusState exported.ConsensusState, -) error { - // NOTE: the proof height sequence is incremented by two due to the connection handshake verification ordering - height = clienttypes.NewHeight(height.GetRevisionNumber(), height.GetRevisionHeight()+2) - - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullConsensusStatePath(counterpartyClientIdentifier, consensusHeight)) - path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath) - if err != nil { - return err - } - - signBz, err := ConsensusStateSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, consensusState) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyConnectionState verifies a proof of the connection state of the -// specified connection end stored on the target machine. -func (cs *ClientState) VerifyConnectionState( - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - prefix exported.Prefix, - proof []byte, - connectionID string, - connectionEnd exported.ConnectionI, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - connectionPath := commitmenttypes.NewMerklePath(host.ConnectionPath(connectionID)) - path, err := commitmenttypes.ApplyPrefix(prefix, connectionPath) - if err != nil { - return err - } - - signBz, err := ConnectionStateSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, connectionEnd) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyChannelState verifies a proof of the channel state of the specified -// channel end, under the specified port, stored on the target machine. -func (cs *ClientState) VerifyChannelState( - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - prefix exported.Prefix, - proof []byte, - portID, - channelID string, - channel exported.ChannelI, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - channelPath := commitmenttypes.NewMerklePath(host.ChannelPath(portID, channelID)) - path, err := commitmenttypes.ApplyPrefix(prefix, channelPath) - if err != nil { - return err - } - - signBz, err := ChannelStateSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, channel) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyPacketCommitment verifies a proof of an outgoing packet commitment at -// the specified port, specified channel, and specified sequence. -func (cs *ClientState) VerifyPacketCommitment( - ctx sdk.Context, - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - _ uint64, - _ uint64, - prefix exported.Prefix, - proof []byte, - portID, - channelID string, - packetSequence uint64, - commitmentBytes []byte, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - commitmentPath := commitmenttypes.NewMerklePath(host.PacketCommitmentPath(portID, channelID, packetSequence)) - path, err := commitmenttypes.ApplyPrefix(prefix, commitmentPath) - if err != nil { - return err - } - - signBz, err := PacketCommitmentSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, commitmentBytes) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyPacketAcknowledgement verifies a proof of an incoming packet -// acknowledgement at the specified port, specified channel, and specified sequence. -func (cs *ClientState) VerifyPacketAcknowledgement( - ctx sdk.Context, - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - _ uint64, - _ uint64, - prefix exported.Prefix, - proof []byte, - portID, - channelID string, - packetSequence uint64, - acknowledgement []byte, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - ackPath := commitmenttypes.NewMerklePath(host.PacketAcknowledgementPath(portID, channelID, packetSequence)) - path, err := commitmenttypes.ApplyPrefix(prefix, ackPath) - if err != nil { - return err - } - - signBz, err := PacketAcknowledgementSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, acknowledgement) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyPacketReceiptAbsence verifies a proof of the absence of an -// incoming packet receipt at the specified port, specified channel, and -// specified sequence. -func (cs *ClientState) VerifyPacketReceiptAbsence( - ctx sdk.Context, - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - _ uint64, - _ uint64, - prefix exported.Prefix, - proof []byte, - portID, - channelID string, - packetSequence uint64, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - receiptPath := commitmenttypes.NewMerklePath(host.PacketReceiptPath(portID, channelID, packetSequence)) - path, err := commitmenttypes.ApplyPrefix(prefix, receiptPath) - if err != nil { - return err - } - - signBz, err := PacketReceiptAbsenceSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - -// VerifyNextSequenceRecv verifies a proof of the next sequence number to be -// received of the specified channel at the specified port. -func (cs *ClientState) VerifyNextSequenceRecv( - ctx sdk.Context, - store sdk.KVStore, - cdc codec.BinaryCodec, - height exported.Height, - _ uint64, - _ uint64, - prefix exported.Prefix, - proof []byte, - portID, - channelID string, - nextSequenceRecv uint64, -) error { - publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, prefix, proof) - if err != nil { - return err - } - - nextSequenceRecvPath := commitmenttypes.NewMerklePath(host.NextSequenceRecvPath(portID, channelID)) - path, err := commitmenttypes.ApplyPrefix(prefix, nextSequenceRecvPath) - if err != nil { - return err - } - - signBz, err := NextSequenceRecvSignBytes(cdc, sequence, timestamp, cs.ConsensusState.Diversifier, path, nextSequenceRecv) - if err != nil { - return err - } - - if err := VerifySignature(publicKey, signBz, sigData); err != nil { - return err - } - - cs.Sequence++ - cs.ConsensusState.Timestamp = timestamp - setClientState(store, cdc, cs) - return nil -} - // VerifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the specified height. // The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). func (cs *ClientState) VerifyMembership( @@ -530,6 +207,7 @@ func (cs *ClientState) VerifyNonMembership( return nil } +// TODO: Remove function as no longer used // produceVerificationArgs perfoms the basic checks on the arguments that are // shared between the verification functions and returns the public key of the // consensus state, the unmarshalled proof representing the signature and timestamp diff --git a/modules/light-clients/06-solomachine/client_state_test.go b/modules/light-clients/06-solomachine/client_state_test.go index 2beb48dbbf4..5ef1014af28 100644 --- a/modules/light-clients/06-solomachine/client_state_test.go +++ b/modules/light-clients/06-solomachine/client_state_test.go @@ -2,8 +2,6 @@ package solomachine_test import ( clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" "github.com/cosmos/ibc-go/v3/modules/core/exported" solomachine "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine" @@ -18,13 +16,6 @@ const ( testPortID = "testportid" ) -var ( - prefix = &commitmenttypes.MerklePrefix{ - KeyPrefix: []byte("ibc"), - } - consensusHeight = clienttypes.ZeroHeight() -) - func (suite *SoloMachineTestSuite) TestStatus() { clientState := suite.solomachine.ClientState() // solo machine discards arguments @@ -563,708 +554,6 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { } } -func (suite *SoloMachineTestSuite) TestVerifyClientState() { - // create client for tendermint so we can use client state for verification - tmPath := ibctesting.NewPath(suite.chainA, suite.chainB) - suite.coordinator.SetupClients(tmPath) - clientState := suite.chainA.GetClientState(tmPath.EndpointA.ClientID) - path := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - value, err := solomachine.ClientStateSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, clientState) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - nil, - proof, - false, - }, - { - "consensus state in client state is nil", - solomachine.NewClientState(1, nil, false), - prefix, - proof, - false, - }, - { - "client state latest height is less than sequence", - solomachine.NewClientState(sm.Sequence-1, - &solomachine.ConsensusState{ - Timestamp: sm.Time, - PublicKey: sm.ConsensusState().PublicKey, - }, false), - prefix, - proof, - false, - }, - { - "consensus state timestamp is greater than signature", - solomachine.NewClientState(sm.Sequence, - &solomachine.ConsensusState{ - Timestamp: sm.Time + 1, - PublicKey: sm.ConsensusState().PublicKey, - }, false), - prefix, - proof, - false, - }, - - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - - var expSeq uint64 - if tc.clientState.ConsensusState != nil { - expSeq = tc.clientState.Sequence + 1 - } - - // NOTE: to replicate the ordering of connection handshake, we must decrement proof height by 1 - height := clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()-1) - - err := tc.clientState.VerifyClientState( - suite.store, suite.chainA.Codec, height, tc.prefix, counterpartyClientIdentifier, tc.proof, clientState, - ) - - if tc.expPass { - suite.Require().NoError(err) - suite.Require().Equal(expSeq, tc.clientState.Sequence) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %s", suite.GetSequenceFromStore(), tc.name) - } else { - suite.Require().Error(err) - } - }) - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyClientConsensusState() { - // create client for tendermint so we can use consensus state for verification - tmPath := ibctesting.NewPath(suite.chainA, suite.chainB) - suite.coordinator.SetupClients(tmPath) - clientState := suite.chainA.GetClientState(tmPath.EndpointA.ClientID) - consensusState, found := suite.chainA.GetConsensusState(tmPath.EndpointA.ClientID, clientState.GetLatestHeight()) - suite.Require().True(found) - - path := suite.solomachine.GetConsensusStatePath(counterpartyClientIdentifier, consensusHeight) - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - value, err := solomachine.ConsensusStateSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, consensusState) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - nil, - proof, - false, - }, - { - "consensus state in client state is nil", - solomachine.NewClientState(1, nil, false), - prefix, - proof, - false, - }, - { - "client state latest height is less than sequence", - solomachine.NewClientState(sm.Sequence-1, - &solomachine.ConsensusState{ - Timestamp: sm.Time, - PublicKey: sm.ConsensusState().PublicKey, - }, false), - prefix, - proof, - false, - }, - { - "consensus state timestamp is greater than signature", - solomachine.NewClientState(sm.Sequence, - &solomachine.ConsensusState{ - Timestamp: sm.Time + 1, - PublicKey: sm.ConsensusState().PublicKey, - }, false), - prefix, - proof, - false, - }, - - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - - var expSeq uint64 - if tc.clientState.ConsensusState != nil { - expSeq = tc.clientState.Sequence + 1 - } - - // NOTE: to replicate the ordering of connection handshake, we must decrement proof height by 1 - height := clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()-2) - - err := tc.clientState.VerifyClientConsensusState( - suite.store, suite.chainA.Codec, height, counterpartyClientIdentifier, consensusHeight, tc.prefix, tc.proof, consensusState, - ) - - if tc.expPass { - suite.Require().NoError(err) - suite.Require().Equal(expSeq, tc.clientState.Sequence) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %s", suite.GetSequenceFromStore(), tc.name) - } else { - suite.Require().Error(err) - } - }) - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyConnectionState() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) - conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) - - path := suite.solomachine.GetConnectionStatePath(testConnectionID) - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - value, err := solomachine.ConnectionStateSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, conn) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - commitmenttypes.NewMerklePrefix([]byte{}), - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - - err := tc.clientState.VerifyConnectionState( - suite.store, suite.chainA.Codec, sm.GetHeight(), tc.prefix, tc.proof, testConnectionID, conn, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, tc.clientState.Sequence) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyChannelState() { - counterparty := channeltypes.NewCounterparty(testPortID, testChannelID) - ch := channeltypes.NewChannel(channeltypes.OPEN, channeltypes.ORDERED, counterparty, []string{testConnectionID}, "1.0.0") - - path := suite.solomachine.GetChannelStatePath(testPortID, testChannelID) - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - value, err := solomachine.ChannelStateSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, ch) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - nil, - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - - err := tc.clientState.VerifyChannelState( - suite.store, suite.chainA.Codec, sm.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, ch, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, tc.clientState.Sequence) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyPacketCommitment() { - commitmentBytes := []byte("COMMITMENT BYTES") - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - path := sm.GetPacketCommitmentPath(testPortID, testChannelID) - - value, err := solomachine.PacketCommitmentSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, commitmentBytes) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - commitmenttypes.NewMerklePrefix([]byte{}), - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - ctx := suite.chainA.GetContext() - - err := tc.clientState.VerifyPacketCommitment( - ctx, suite.store, suite.chainA.Codec, sm.GetHeight(), 0, 0, tc.prefix, tc.proof, testPortID, testChannelID, sm.Sequence, commitmentBytes, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyPacketAcknowledgement() { - ack := []byte("ACK") - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - path := sm.GetPacketAcknowledgementPath(testPortID, testChannelID) - - value, err := solomachine.PacketAcknowledgementSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, ack) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - commitmenttypes.NewMerklePrefix([]byte{}), - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - ctx := suite.chainA.GetContext() - - err := tc.clientState.VerifyPacketAcknowledgement( - ctx, suite.store, suite.chainA.Codec, sm.GetHeight(), 0, 0, tc.prefix, tc.proof, testPortID, testChannelID, sm.Sequence, ack, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyPacketReceiptAbsence() { - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - // absence uses receipt path as well - path := sm.GetPacketReceiptPath(testPortID, testChannelID) - - value, err := solomachine.PacketReceiptAbsenceSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - commitmenttypes.NewMerklePrefix([]byte{}), - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - ctx := suite.chainA.GetContext() - - err := tc.clientState.VerifyPacketReceiptAbsence( - ctx, suite.store, suite.chainA.Codec, sm.GetHeight(), 0, 0, tc.prefix, tc.proof, testPortID, testChannelID, sm.Sequence, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - -func (suite *SoloMachineTestSuite) TestVerifyNextSeqRecv() { - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - nextSeqRecv := sm.Sequence + 1 - path := sm.GetNextSequenceRecvPath(testPortID, testChannelID) - - value, err := solomachine.NextSequenceRecvSignBytes(suite.chainA.Codec, sm.Sequence, sm.Time, sm.Diversifier, path, nextSeqRecv) - suite.Require().NoError(err) - - sig := sm.GenerateSignature(value) - signatureDoc := &solomachine.TimestampedSignatureData{ - SignatureData: sig, - Timestamp: sm.Time, - } - - proof, err := suite.chainA.Codec.Marshal(signatureDoc) - suite.Require().NoError(err) - - testCases := []struct { - name string - clientState *solomachine.ClientState - prefix exported.Prefix - proof []byte - expPass bool - }{ - { - "successful verification", - sm.ClientState(), - prefix, - proof, - true, - }, - { - "ApplyPrefix failed", - sm.ClientState(), - commitmenttypes.NewMerklePrefix([]byte{}), - proof, - false, - }, - { - "proof is nil", - sm.ClientState(), - prefix, - nil, - false, - }, - { - "proof verification failed", - sm.ClientState(), - prefix, - suite.GetInvalidProof(), - false, - }, - } - - for i, tc := range testCases { - tc := tc - - expSeq := tc.clientState.Sequence + 1 - ctx := suite.chainA.GetContext() - - err := tc.clientState.VerifyNextSequenceRecv( - ctx, suite.store, suite.chainA.Codec, sm.GetHeight(), 0, 0, tc.prefix, tc.proof, testPortID, testChannelID, nextSeqRecv, - ) - - if tc.expPass { - suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) - suite.Require().Equal(expSeq, tc.clientState.Sequence) - suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %d: %s", suite.GetSequenceFromStore(), i, tc.name) - } else { - suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) - } - } - } -} - func (suite *SoloMachineTestSuite) TestGetTimestampAtHeight() { tmPath := ibctesting.NewPath(suite.chainA, suite.chainB) suite.coordinator.SetupClients(tmPath) diff --git a/modules/light-clients/06-solomachine/codec.go b/modules/light-clients/06-solomachine/codec.go index a857433ed56..ed040d7b2c2 100644 --- a/modules/light-clients/06-solomachine/codec.go +++ b/modules/light-clients/06-solomachine/codec.go @@ -6,7 +6,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" "github.com/cosmos/ibc-go/v3/modules/core/exported" ) @@ -41,91 +40,3 @@ func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.Signatu return sigData, nil } - -// UnmarshalDataByType attempts to unmarshal the data to the specified type. An error is -// return if it fails. -func UnmarshalDataByType(cdc codec.BinaryCodec, dataType DataType, data []byte) (Data, error) { - if len(data) == 0 { - return nil, sdkerrors.Wrap(ErrInvalidSignatureAndData, "data cannot be empty") - } - - switch dataType { - case UNSPECIFIED: - return nil, sdkerrors.Wrap(ErrInvalidDataType, "data type cannot be UNSPECIFIED") - - case CLIENT: - clientData := &ClientStateData{} - if err := cdc.Unmarshal(data, clientData); err != nil { - return nil, err - } - - // unpack any - if _, err := clienttypes.UnpackClientState(clientData.ClientState); err != nil { - return nil, err - } - return clientData, nil - - case CONSENSUS: - consensusData := &ConsensusStateData{} - if err := cdc.Unmarshal(data, consensusData); err != nil { - return nil, err - } - - // unpack any - if _, err := clienttypes.UnpackConsensusState(consensusData.ConsensusState); err != nil { - return nil, err - } - return consensusData, nil - - case CONNECTION: - connectionData := &ConnectionStateData{} - if err := cdc.Unmarshal(data, connectionData); err != nil { - return nil, err - } - - return connectionData, nil - - case CHANNEL: - channelData := &ChannelStateData{} - if err := cdc.Unmarshal(data, channelData); err != nil { - return nil, err - } - - return channelData, nil - - case PACKETCOMMITMENT: - commitmentData := &PacketCommitmentData{} - if err := cdc.Unmarshal(data, commitmentData); err != nil { - return nil, err - } - - return commitmentData, nil - - case PACKETACKNOWLEDGEMENT: - ackData := &PacketAcknowledgementData{} - if err := cdc.Unmarshal(data, ackData); err != nil { - return nil, err - } - - return ackData, nil - - case PACKETRECEIPTABSENCE: - receiptAbsenceData := &PacketReceiptAbsenceData{} - if err := cdc.Unmarshal(data, receiptAbsenceData); err != nil { - return nil, err - } - - return receiptAbsenceData, nil - - case NEXTSEQUENCERECV: - nextSeqRecvData := &NextSequenceRecvData{} - if err := cdc.Unmarshal(data, nextSeqRecvData); err != nil { - return nil, err - } - - return nextSeqRecvData, nil - - default: - return nil, sdkerrors.Wrapf(ErrInvalidDataType, "unsupported data type %T", dataType) - } -} diff --git a/modules/light-clients/06-solomachine/codec_test.go b/modules/light-clients/06-solomachine/codec_test.go deleted file mode 100644 index ff7d5084043..00000000000 --- a/modules/light-clients/06-solomachine/codec_test.go +++ /dev/null @@ -1,190 +0,0 @@ -package solomachine_test - -import ( - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - solomachine "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine" - ibctesting "github.com/cosmos/ibc-go/v3/testing" -) - -func (suite SoloMachineTestSuite) TestUnmarshalDataByType() { - var ( - data []byte - err error - ) - - // test singlesig and multisig public keys - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - - cdc := suite.chainA.App.AppCodec() - cases := []struct { - name string - dataType solomachine.DataType - malleate func() - expPass bool - }{ - { - "empty data", solomachine.CLIENT, func() { - data = []byte{} - }, false, - }, - { - "unspecified", solomachine.UNSPECIFIED, func() { - path := sm.GetClientStatePath(counterpartyClientIdentifier) - data, err = solomachine.ClientStateDataBytes(cdc, path, sm.ClientState()) - suite.Require().NoError(err) - }, false, - }, - { - "client", solomachine.CLIENT, func() { - path := sm.GetClientStatePath(counterpartyClientIdentifier) - data, err = solomachine.ClientStateDataBytes(cdc, path, sm.ClientState()) - suite.Require().NoError(err) - }, true, - }, - { - "bad client (provides consensus state data)", solomachine.CLIENT, func() { - path := sm.GetConsensusStatePath(counterpartyClientIdentifier, clienttypes.NewHeight(0, 5)) - data, err = solomachine.ConsensusStateDataBytes(cdc, path, sm.ConsensusState()) - suite.Require().NoError(err) - }, false, - }, - { - "consensus", solomachine.CONSENSUS, func() { - path := sm.GetConsensusStatePath(counterpartyClientIdentifier, clienttypes.NewHeight(0, 5)) - data, err = solomachine.ConsensusStateDataBytes(cdc, path, sm.ConsensusState()) - suite.Require().NoError(err) - - }, true, - }, - { - "bad consensus (provides client state data)", solomachine.CONSENSUS, func() { - path := sm.GetClientStatePath(counterpartyClientIdentifier) - data, err = solomachine.ClientStateDataBytes(cdc, path, sm.ClientState()) - suite.Require().NoError(err) - }, false, - }, - { - "connection", solomachine.CONNECTION, func() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) - conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) - path := sm.GetConnectionStatePath("connectionID") - - data, err = solomachine.ConnectionStateDataBytes(cdc, path, conn) - suite.Require().NoError(err) - - }, true, - }, - { - "bad connection (uses channel data)", solomachine.CONNECTION, func() { - counterparty := channeltypes.NewCounterparty(testPortID, testChannelID) - ch := channeltypes.NewChannel(channeltypes.OPEN, channeltypes.ORDERED, counterparty, []string{testConnectionID}, "1.0.0") - path := sm.GetChannelStatePath("portID", "channelID") - - data, err = solomachine.ChannelStateDataBytes(cdc, path, ch) - suite.Require().NoError(err) - }, false, - }, - { - "channel", solomachine.CHANNEL, func() { - counterparty := channeltypes.NewCounterparty(testPortID, testChannelID) - ch := channeltypes.NewChannel(channeltypes.OPEN, channeltypes.ORDERED, counterparty, []string{testConnectionID}, "1.0.0") - path := sm.GetChannelStatePath("portID", "channelID") - - data, err = solomachine.ChannelStateDataBytes(cdc, path, ch) - suite.Require().NoError(err) - }, true, - }, - { - "bad channel (uses connection data)", solomachine.CHANNEL, func() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) - conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) - path := sm.GetConnectionStatePath("connectionID") - - data, err = solomachine.ConnectionStateDataBytes(cdc, path, conn) - suite.Require().NoError(err) - - }, false, - }, - { - "packet commitment", solomachine.PACKETCOMMITMENT, func() { - commitment := []byte("packet commitment") - path := sm.GetPacketCommitmentPath("portID", "channelID") - - data, err = solomachine.PacketCommitmentDataBytes(cdc, path, commitment) - suite.Require().NoError(err) - }, true, - }, - { - "bad packet commitment (uses next seq recv)", solomachine.PACKETCOMMITMENT, func() { - path := sm.GetNextSequenceRecvPath("portID", "channelID") - - data, err = solomachine.NextSequenceRecvDataBytes(cdc, path, 10) - suite.Require().NoError(err) - }, false, - }, - { - "packet acknowledgement", solomachine.PACKETACKNOWLEDGEMENT, func() { - commitment := []byte("packet acknowledgement") - path := sm.GetPacketAcknowledgementPath("portID", "channelID") - - data, err = solomachine.PacketAcknowledgementDataBytes(cdc, path, commitment) - suite.Require().NoError(err) - }, true, - }, - { - "bad packet acknowledgement (uses next sequence recv)", solomachine.PACKETACKNOWLEDGEMENT, func() { - path := sm.GetNextSequenceRecvPath("portID", "channelID") - - data, err = solomachine.NextSequenceRecvDataBytes(cdc, path, 10) - suite.Require().NoError(err) - }, false, - }, - { - "packet acknowledgement absence", solomachine.PACKETRECEIPTABSENCE, func() { - path := sm.GetPacketReceiptPath("portID", "channelID") - - data, err = solomachine.PacketReceiptAbsenceDataBytes(cdc, path) - suite.Require().NoError(err) - }, true, - }, - { - "next sequence recv", solomachine.NEXTSEQUENCERECV, func() { - path := sm.GetNextSequenceRecvPath("portID", "channelID") - - data, err = solomachine.NextSequenceRecvDataBytes(cdc, path, 10) - suite.Require().NoError(err) - }, true, - }, - { - "bad next sequence recv (uses packet commitment)", solomachine.NEXTSEQUENCERECV, func() { - commitment := []byte("packet commitment") - path := sm.GetPacketCommitmentPath("portID", "channelID") - - data, err = solomachine.PacketCommitmentDataBytes(cdc, path, commitment) - suite.Require().NoError(err) - }, false, - }, - } - - for _, tc := range cases { - tc := tc - - suite.Run(tc.name, func() { - tc.malleate() - - data, err := solomachine.UnmarshalDataByType(cdc, tc.dataType, data) - - if tc.expPass { - suite.Require().NoError(err) - suite.Require().NotNil(data) - } else { - suite.Require().Error(err) - suite.Require().Nil(data) - } - }) - } - } - -} diff --git a/modules/light-clients/06-solomachine/errors.go b/modules/light-clients/06-solomachine/errors.go index 73ca5999dbc..7f41349337d 100644 --- a/modules/light-clients/06-solomachine/errors.go +++ b/modules/light-clients/06-solomachine/errors.go @@ -14,5 +14,4 @@ var ( ErrInvalidSignatureAndData = sdkerrors.Register(SubModuleName, 4, "invalid signature and data") ErrSignatureVerificationFailed = sdkerrors.Register(SubModuleName, 5, "signature verification failed") ErrInvalidProof = sdkerrors.Register(SubModuleName, 6, "invalid solo machine proof") - ErrInvalidDataType = sdkerrors.Register(SubModuleName, 7, "invalid data type") ) diff --git a/modules/light-clients/06-solomachine/misbehaviour.go b/modules/light-clients/06-solomachine/misbehaviour.go index 145841e4b0e..1d1a5060a95 100644 --- a/modules/light-clients/06-solomachine/misbehaviour.go +++ b/modules/light-clients/06-solomachine/misbehaviour.go @@ -54,15 +54,15 @@ func (misbehaviour Misbehaviour) ValidateBasic() error { } // ValidateBasic ensures that the signature and data fields are non-empty. -func (sd SignatureAndData) ValidateBasic() error { +func (sd SignatureAndDataV2) ValidateBasic() error { if len(sd.Signature) == 0 { return sdkerrors.Wrap(ErrInvalidSignatureAndData, "signature cannot be empty") } if len(sd.Data) == 0 { return sdkerrors.Wrap(ErrInvalidSignatureAndData, "data for signature cannot be empty") } - if sd.DataType == UNSPECIFIED { - return sdkerrors.Wrap(ErrInvalidSignatureAndData, "data type cannot be UNSPECIFIED") + if len(sd.Path) == 0 { + return sdkerrors.Wrap(ErrInvalidSignatureAndData, "path for signature cannot be empty") } if sd.Timestamp == 0 { return sdkerrors.Wrap(ErrInvalidSignatureAndData, "timestamp cannot be 0") diff --git a/modules/light-clients/06-solomachine/misbehaviour_handle.go b/modules/light-clients/06-solomachine/misbehaviour_handle.go index c5f53239fd2..bb567ec0cb4 100644 --- a/modules/light-clients/06-solomachine/misbehaviour_handle.go +++ b/modules/light-clients/06-solomachine/misbehaviour_handle.go @@ -2,27 +2,28 @@ package solomachine import ( "github.com/cosmos/cosmos-sdk/codec" + + commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" ) // verifySignatureAndData verifies that the currently registered public key has signed // over the provided data and that the data is valid. The data is valid if it can be // unmarshaled into the specified data type. -func (cs ClientState) verifySignatureAndData(cdc codec.BinaryCodec, misbehaviour *Misbehaviour, sigAndData *SignatureAndData) error { - +func (cs ClientState) verifySignatureAndData(cdc codec.BinaryCodec, misbehaviour *Misbehaviour, sigAndData *SignatureAndDataV2) error { // do not check misbehaviour timestamp since we want to allow processing of past misbehaviour - - // ensure data can be unmarshaled to the specified data type - if _, err := UnmarshalDataByType(cdc, sigAndData.DataType, sigAndData.Data); err != nil { + if err := cdc.Unmarshal(sigAndData.Path, new(commitmenttypes.MerklePath)); err != nil { return err } - data, err := MisbehaviourSignBytes( - cdc, - misbehaviour.Sequence, sigAndData.Timestamp, - cs.ConsensusState.Diversifier, - sigAndData.DataType, - sigAndData.Data, - ) + signBytes := SignBytesV2{ + Sequence: misbehaviour.Sequence, + Timestamp: sigAndData.Timestamp, + Diversifier: cs.ConsensusState.Diversifier, + Path: sigAndData.Path, + Data: sigAndData.Data, + } + + data, err := cdc.Marshal(&signBytes) if err != nil { return err } diff --git a/modules/light-clients/06-solomachine/misbehaviour_test.go b/modules/light-clients/06-solomachine/misbehaviour_test.go index 0bb533a7660..552fc9c7e57 100644 --- a/modules/light-clients/06-solomachine/misbehaviour_test.go +++ b/modules/light-clients/06-solomachine/misbehaviour_test.go @@ -83,15 +83,15 @@ func (suite *SoloMachineTestSuite) TestMisbehaviourValidateBasic() { false, }, { - "data type for SignatureOne is unspecified", + "data path for SignatureOne is unspecified", func(misbehaviour *solomachine.Misbehaviour) { - misbehaviour.SignatureOne.DataType = solomachine.UNSPECIFIED + misbehaviour.SignatureOne.Path = []byte{} }, false, }, { - "data type for SignatureTwo is unspecified", + "data path for SignatureTwo is unspecified", func(misbehaviour *solomachine.Misbehaviour) { - misbehaviour.SignatureTwo.DataType = solomachine.UNSPECIFIED + misbehaviour.SignatureTwo.Path = []byte{} }, false, }, { diff --git a/modules/light-clients/06-solomachine/proof.go b/modules/light-clients/06-solomachine/proof.go index cdbd8f19983..386830340cf 100644 --- a/modules/light-clients/06-solomachine/proof.go +++ b/modules/light-clients/06-solomachine/proof.go @@ -1,17 +1,10 @@ package solomachine import ( - "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" - - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - "github.com/cosmos/ibc-go/v3/modules/core/exported" ) // VerifySignature verifies if the the provided public key generated the signature @@ -48,429 +41,3 @@ func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signin return nil } - -// MisbehaviourSignBytes returns the sign bytes for verification of misbehaviour. -func MisbehaviourSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - dataType DataType, - data []byte) ([]byte, error) { - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: dataType, - Data: data, - } - - return cdc.Marshal(signBytes) -} - -// HeaderSignBytes returns the sign bytes for verification of misbehaviour. -func HeaderSignBytes( - cdc codec.BinaryCodec, - header *Header, -) ([]byte, error) { - data := &HeaderData{ - NewPubKey: header.NewPublicKey, - NewDiversifier: header.NewDiversifier, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: header.Sequence, - Timestamp: header.Timestamp, - Diversifier: header.NewDiversifier, - DataType: HEADER, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// ClientStateSignBytes returns the sign bytes for verification of the -// client state. -func ClientStateSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - clientState exported.ClientState, -) ([]byte, error) { - dataBz, err := ClientStateDataBytes(cdc, path, clientState) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: CLIENT, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// ClientStateDataBytes returns the client state data bytes used in constructing -// SignBytes. -func ClientStateDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - clientState exported.ClientState, -) ([]byte, error) { - any, err := clienttypes.PackClientState(clientState) - if err != nil { - return nil, err - } - - data := &ClientStateData{ - Path: []byte(path.String()), - ClientState: any, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// ConsensusStateSignBytes returns the sign bytes for verification of the -// consensus state. -func ConsensusStateSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - consensusState exported.ConsensusState, -) ([]byte, error) { - dataBz, err := ConsensusStateDataBytes(cdc, path, consensusState) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: CONSENSUS, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// ConsensusStateDataBytes returns the consensus state data bytes used in constructing -// SignBytes. -func ConsensusStateDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - consensusState exported.ConsensusState, -) ([]byte, error) { - any, err := clienttypes.PackConsensusState(consensusState) - if err != nil { - return nil, err - } - - data := &ConsensusStateData{ - Path: []byte(path.String()), - ConsensusState: any, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// ConnectionStateSignBytes returns the sign bytes for verification of the -// connection state. -func ConnectionStateSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - connectionEnd exported.ConnectionI, -) ([]byte, error) { - dataBz, err := ConnectionStateDataBytes(cdc, path, connectionEnd) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: CONNECTION, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// ConnectionStateDataBytes returns the connection state data bytes used in constructing -// SignBytes. -func ConnectionStateDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - connectionEnd exported.ConnectionI, -) ([]byte, error) { - connection, ok := connectionEnd.(connectiontypes.ConnectionEnd) - if !ok { - return nil, sdkerrors.Wrapf( - connectiontypes.ErrInvalidConnection, - "expected type %T, got %T", connectiontypes.ConnectionEnd{}, connectionEnd, - ) - } - - data := &ConnectionStateData{ - Path: []byte(path.String()), - Connection: &connection, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// ChannelStateSignBytes returns the sign bytes for verification of the -// channel state. -func ChannelStateSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - channelEnd exported.ChannelI, -) ([]byte, error) { - dataBz, err := ChannelStateDataBytes(cdc, path, channelEnd) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: CHANNEL, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// ChannelStateDataBytes returns the channel state data bytes used in constructing -// SignBytes. -func ChannelStateDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - channelEnd exported.ChannelI, -) ([]byte, error) { - channel, ok := channelEnd.(channeltypes.Channel) - if !ok { - return nil, sdkerrors.Wrapf( - channeltypes.ErrInvalidChannel, - "expected channel type %T, got %T", channeltypes.Channel{}, channelEnd) - } - - data := &ChannelStateData{ - Path: []byte(path.String()), - Channel: &channel, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// PacketCommitmentSignBytes returns the sign bytes for verification of the -// packet commitment. -func PacketCommitmentSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - commitmentBytes []byte, -) ([]byte, error) { - dataBz, err := PacketCommitmentDataBytes(cdc, path, commitmentBytes) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: PACKETCOMMITMENT, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// PacketCommitmentDataBytes returns the packet commitment data bytes used in constructing -// SignBytes. -func PacketCommitmentDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - commitmentBytes []byte, -) ([]byte, error) { - data := &PacketCommitmentData{ - Path: []byte(path.String()), - Commitment: commitmentBytes, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// PacketAcknowledgementSignBytes returns the sign bytes for verification of -// the acknowledgement. -func PacketAcknowledgementSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - acknowledgement []byte, -) ([]byte, error) { - dataBz, err := PacketAcknowledgementDataBytes(cdc, path, acknowledgement) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: PACKETACKNOWLEDGEMENT, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// PacketAcknowledgementDataBytes returns the packet acknowledgement data bytes used in constructing -// SignBytes. -func PacketAcknowledgementDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - acknowledgement []byte, -) ([]byte, error) { - data := &PacketAcknowledgementData{ - Path: []byte(path.String()), - Acknowledgement: acknowledgement, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// PacketReceiptAbsenceSignBytes returns the sign bytes for verification -// of the absence of an receipt. -func PacketReceiptAbsenceSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, -) ([]byte, error) { - dataBz, err := PacketReceiptAbsenceDataBytes(cdc, path) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: PACKETRECEIPTABSENCE, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// PacketReceiptAbsenceDataBytes returns the packet receipt absence data bytes -// used in constructing SignBytes. -func PacketReceiptAbsenceDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer -) ([]byte, error) { - data := &PacketReceiptAbsenceData{ - Path: []byte(path.String()), - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} - -// NextSequenceRecvSignBytes returns the sign bytes for verification of the next -// sequence to be received. -func NextSequenceRecvSignBytes( - cdc codec.BinaryCodec, - sequence, timestamp uint64, - diversifier string, - path commitmenttypes.MerklePath, - nextSequenceRecv uint64, -) ([]byte, error) { - dataBz, err := NextSequenceRecvDataBytes(cdc, path, nextSequenceRecv) - if err != nil { - return nil, err - } - - signBytes := &SignBytes{ - Sequence: sequence, - Timestamp: timestamp, - Diversifier: diversifier, - DataType: NEXTSEQUENCERECV, - Data: dataBz, - } - - return cdc.Marshal(signBytes) -} - -// NextSequenceRecvDataBytes returns the next sequence recv data bytes used in constructing -// SignBytes. -func NextSequenceRecvDataBytes( - cdc codec.BinaryCodec, - path commitmenttypes.MerklePath, // nolint: interfacer - nextSequenceRecv uint64, -) ([]byte, error) { - data := &NextSequenceRecvData{ - Path: []byte(path.String()), - NextSeqRecv: nextSequenceRecv, - } - - dataBz, err := cdc.Marshal(data) - if err != nil { - return nil, err - } - - return dataBz, nil -} diff --git a/modules/light-clients/06-solomachine/proof_test.go b/modules/light-clients/06-solomachine/proof_test.go index dd7bb52ec1e..0ea96ee4116 100644 --- a/modules/light-clients/06-solomachine/proof_test.go +++ b/modules/light-clients/06-solomachine/proof_test.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" solomachine "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine" - ibctesting "github.com/cosmos/ibc-go/v3/testing" ) func (suite *SoloMachineTestSuite) TestVerifySignature() { @@ -66,37 +65,3 @@ func (suite *SoloMachineTestSuite) TestVerifySignature() { }) } } - -func (suite *SoloMachineTestSuite) TestClientStateSignBytes() { - cdc := suite.chainA.App.AppCodec() - - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - // success - path := sm.GetClientStatePath(counterpartyClientIdentifier) - bz, err := solomachine.ClientStateSignBytes(cdc, sm.Sequence, sm.Time, sm.Diversifier, path, sm.ClientState()) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - // nil client state - bz, err = solomachine.ClientStateSignBytes(cdc, sm.Sequence, sm.Time, sm.Diversifier, path, nil) - suite.Require().Error(err) - suite.Require().Nil(bz) - } -} - -func (suite *SoloMachineTestSuite) TestConsensusStateSignBytes() { - cdc := suite.chainA.App.AppCodec() - - for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - // success - path := sm.GetConsensusStatePath(counterpartyClientIdentifier, consensusHeight) - bz, err := solomachine.ConsensusStateSignBytes(cdc, sm.Sequence, sm.Time, sm.Diversifier, path, sm.ConsensusState()) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - // nil consensus state - bz, err = solomachine.ConsensusStateSignBytes(cdc, sm.Sequence, sm.Time, sm.Diversifier, path, nil) - suite.Require().Error(err) - suite.Require().Nil(bz) - } -} diff --git a/modules/light-clients/06-solomachine/solomachine.go b/modules/light-clients/06-solomachine/solomachine.go index e3d58781ea8..41511910bf4 100644 --- a/modules/light-clients/06-solomachine/solomachine.go +++ b/modules/light-clients/06-solomachine/solomachine.go @@ -3,8 +3,6 @@ package solomachine import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - - "github.com/cosmos/ibc-go/v3/modules/core/exported" ) // Interface implementation checks. @@ -32,13 +30,3 @@ func (h Header) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { return unpacker.UnpackAny(hd.NewPubKey, new(cryptotypes.PubKey)) } - -// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method -func (csd ClientStateData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - return unpacker.UnpackAny(csd.ClientState, new(exported.ClientState)) -} - -// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method -func (csd ConsensusStateData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - return unpacker.UnpackAny(csd.ConsensusState, new(exported.ConsensusState)) -} diff --git a/modules/light-clients/06-solomachine/solomachine.pb.go b/modules/light-clients/06-solomachine/solomachine.pb.go index 09635581335..0ea56245a5e 100644 --- a/modules/light-clients/06-solomachine/solomachine.pb.go +++ b/modules/light-clients/06-solomachine/solomachine.pb.go @@ -6,8 +6,6 @@ package solomachine import ( fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - types2 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -26,67 +24,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -type DataType int32 - -const ( - // Default State - UNSPECIFIED DataType = 0 - // Data type for client state verification - CLIENT DataType = 1 - // Data type for consensus state verification - CONSENSUS DataType = 2 - // Data type for connection state verification - CONNECTION DataType = 3 - // Data type for channel state verification - CHANNEL DataType = 4 - // Data type for packet commitment verification - PACKETCOMMITMENT DataType = 5 - // Data type for packet acknowledgement verification - PACKETACKNOWLEDGEMENT DataType = 6 - // Data type for packet receipt absence verification - PACKETRECEIPTABSENCE DataType = 7 - // Data type for next sequence recv verification - NEXTSEQUENCERECV DataType = 8 - // Data type for header verification - HEADER DataType = 9 -) - -var DataType_name = map[int32]string{ - 0: "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - 1: "DATA_TYPE_CLIENT_STATE", - 2: "DATA_TYPE_CONSENSUS_STATE", - 3: "DATA_TYPE_CONNECTION_STATE", - 4: "DATA_TYPE_CHANNEL_STATE", - 5: "DATA_TYPE_PACKET_COMMITMENT", - 6: "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - 7: "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - 8: "DATA_TYPE_NEXT_SEQUENCE_RECV", - 9: "DATA_TYPE_HEADER", -} - -var DataType_value = map[string]int32{ - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": 0, - "DATA_TYPE_CLIENT_STATE": 1, - "DATA_TYPE_CONSENSUS_STATE": 2, - "DATA_TYPE_CONNECTION_STATE": 3, - "DATA_TYPE_CHANNEL_STATE": 4, - "DATA_TYPE_PACKET_COMMITMENT": 5, - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": 6, - "DATA_TYPE_PACKET_RECEIPT_ABSENCE": 7, - "DATA_TYPE_NEXT_SEQUENCE_RECV": 8, - "DATA_TYPE_HEADER": 9, -} - -func (x DataType) String() string { - return proto.EnumName(DataType_name, int32(x)) -} - -func (DataType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{0} -} - // ClientState defines a solo machine client that tracks the current consensus // state and if the client is frozen. type ClientState struct { @@ -226,10 +163,10 @@ var xxx_messageInfo_Header proto.InternalMessageInfo // of a sequence and two signatures over different messages at that sequence. type Misbehaviour struct { // ClientID is deprecated - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` // Deprecated: Do not use. - Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - SignatureOne *SignatureAndData `protobuf:"bytes,3,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty" yaml:"signature_one"` - SignatureTwo *SignatureAndData `protobuf:"bytes,4,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty" yaml:"signature_two"` + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` // Deprecated: Do not use. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + SignatureOne *SignatureAndDataV2 `protobuf:"bytes,3,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty" yaml:"signature_one"` + SignatureTwo *SignatureAndDataV2 `protobuf:"bytes,4,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty" yaml:"signature_two"` } func (m *Misbehaviour) Reset() { *m = Misbehaviour{} } @@ -265,27 +202,27 @@ func (m *Misbehaviour) XXX_DiscardUnknown() { var xxx_messageInfo_Misbehaviour proto.InternalMessageInfo -// SignatureAndData contains a signature and the data signed over to create that +// SignatureAndDataV2 contains a signature and the data signed over to create that // signature. -type SignatureAndData struct { - Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` - DataType DataType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=ibc.lightclients.solomachine.v2.DataType" json:"data_type,omitempty" yaml:"data_type"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +type SignatureAndDataV2 struct { + Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + Path []byte `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *SignatureAndData) Reset() { *m = SignatureAndData{} } -func (m *SignatureAndData) String() string { return proto.CompactTextString(m) } -func (*SignatureAndData) ProtoMessage() {} -func (*SignatureAndData) Descriptor() ([]byte, []int) { +func (m *SignatureAndDataV2) Reset() { *m = SignatureAndDataV2{} } +func (m *SignatureAndDataV2) String() string { return proto.CompactTextString(m) } +func (*SignatureAndDataV2) ProtoMessage() {} +func (*SignatureAndDataV2) Descriptor() ([]byte, []int) { return fileDescriptor_141333b361aae010, []int{4} } -func (m *SignatureAndData) XXX_Unmarshal(b []byte) error { +func (m *SignatureAndDataV2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignatureAndDataV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SignatureAndData.Marshal(b, m, deterministic) + return xxx_messageInfo_SignatureAndDataV2.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -295,17 +232,17 @@ func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *SignatureAndData) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignatureAndData.Merge(m, src) +func (m *SignatureAndDataV2) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureAndDataV2.Merge(m, src) } -func (m *SignatureAndData) XXX_Size() int { +func (m *SignatureAndDataV2) XXX_Size() int { return m.Size() } -func (m *SignatureAndData) XXX_DiscardUnknown() { - xxx_messageInfo_SignatureAndData.DiscardUnknown(m) +func (m *SignatureAndDataV2) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureAndDataV2.DiscardUnknown(m) } -var xxx_messageInfo_SignatureAndData proto.InternalMessageInfo +var xxx_messageInfo_SignatureAndDataV2 proto.InternalMessageInfo // TimestampedSignatureData contains the signature data and the timestamp of the // signature. @@ -394,50 +331,6 @@ func (m *SignBytesV2) XXX_DiscardUnknown() { var xxx_messageInfo_SignBytesV2 proto.InternalMessageInfo -// SignBytes defines the signed bytes used for signature verification. -type SignBytes struct { - Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` - // type of the data used - DataType DataType `protobuf:"varint,4,opt,name=data_type,json=dataType,proto3,enum=ibc.lightclients.solomachine.v2.DataType" json:"data_type,omitempty" yaml:"data_type"` - // marshaled data - Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *SignBytes) Reset() { *m = SignBytes{} } -func (m *SignBytes) String() string { return proto.CompactTextString(m) } -func (*SignBytes) ProtoMessage() {} -func (*SignBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{7} -} -func (m *SignBytes) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignBytes.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignBytes) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignBytes.Merge(m, src) -} -func (m *SignBytes) XXX_Size() int { - return m.Size() -} -func (m *SignBytes) XXX_DiscardUnknown() { - xxx_messageInfo_SignBytes.DiscardUnknown(m) -} - -var xxx_messageInfo_SignBytes proto.InternalMessageInfo - // HeaderData returns the SignBytes data for update verification. type HeaderData struct { // header public key @@ -450,7 +343,7 @@ func (m *HeaderData) Reset() { *m = HeaderData{} } func (m *HeaderData) String() string { return proto.CompactTextString(m) } func (*HeaderData) ProtoMessage() {} func (*HeaderData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{8} + return fileDescriptor_141333b361aae010, []int{7} } func (m *HeaderData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -479,392 +372,15 @@ func (m *HeaderData) XXX_DiscardUnknown() { var xxx_messageInfo_HeaderData proto.InternalMessageInfo -// ClientStateData returns the SignBytes data for client state verification. -type ClientStateData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` -} - -func (m *ClientStateData) Reset() { *m = ClientStateData{} } -func (m *ClientStateData) String() string { return proto.CompactTextString(m) } -func (*ClientStateData) ProtoMessage() {} -func (*ClientStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{9} -} -func (m *ClientStateData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClientStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClientStateData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClientStateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClientStateData.Merge(m, src) -} -func (m *ClientStateData) XXX_Size() int { - return m.Size() -} -func (m *ClientStateData) XXX_DiscardUnknown() { - xxx_messageInfo_ClientStateData.DiscardUnknown(m) -} - -var xxx_messageInfo_ClientStateData proto.InternalMessageInfo - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -type ConsensusStateData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - ConsensusState *types.Any `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` -} - -func (m *ConsensusStateData) Reset() { *m = ConsensusStateData{} } -func (m *ConsensusStateData) String() string { return proto.CompactTextString(m) } -func (*ConsensusStateData) ProtoMessage() {} -func (*ConsensusStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{10} -} -func (m *ConsensusStateData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusStateData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConsensusStateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusStateData.Merge(m, src) -} -func (m *ConsensusStateData) XXX_Size() int { - return m.Size() -} -func (m *ConsensusStateData) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusStateData.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusStateData proto.InternalMessageInfo - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -type ConnectionStateData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Connection *types1.ConnectionEnd `protobuf:"bytes,2,opt,name=connection,proto3" json:"connection,omitempty"` -} - -func (m *ConnectionStateData) Reset() { *m = ConnectionStateData{} } -func (m *ConnectionStateData) String() string { return proto.CompactTextString(m) } -func (*ConnectionStateData) ProtoMessage() {} -func (*ConnectionStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{11} -} -func (m *ConnectionStateData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConnectionStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConnectionStateData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConnectionStateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConnectionStateData.Merge(m, src) -} -func (m *ConnectionStateData) XXX_Size() int { - return m.Size() -} -func (m *ConnectionStateData) XXX_DiscardUnknown() { - xxx_messageInfo_ConnectionStateData.DiscardUnknown(m) -} - -var xxx_messageInfo_ConnectionStateData proto.InternalMessageInfo - -// ChannelStateData returns the SignBytes data for channel state -// verification. -type ChannelStateData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Channel *types2.Channel `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` -} - -func (m *ChannelStateData) Reset() { *m = ChannelStateData{} } -func (m *ChannelStateData) String() string { return proto.CompactTextString(m) } -func (*ChannelStateData) ProtoMessage() {} -func (*ChannelStateData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{12} -} -func (m *ChannelStateData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChannelStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChannelStateData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChannelStateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelStateData.Merge(m, src) -} -func (m *ChannelStateData) XXX_Size() int { - return m.Size() -} -func (m *ChannelStateData) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelStateData.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelStateData proto.InternalMessageInfo - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -type PacketCommitmentData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Commitment []byte `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` -} - -func (m *PacketCommitmentData) Reset() { *m = PacketCommitmentData{} } -func (m *PacketCommitmentData) String() string { return proto.CompactTextString(m) } -func (*PacketCommitmentData) ProtoMessage() {} -func (*PacketCommitmentData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{13} -} -func (m *PacketCommitmentData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketCommitmentData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketCommitmentData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketCommitmentData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketCommitmentData.Merge(m, src) -} -func (m *PacketCommitmentData) XXX_Size() int { - return m.Size() -} -func (m *PacketCommitmentData) XXX_DiscardUnknown() { - xxx_messageInfo_PacketCommitmentData.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketCommitmentData proto.InternalMessageInfo - -func (m *PacketCommitmentData) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *PacketCommitmentData) GetCommitment() []byte { - if m != nil { - return m.Commitment - } - return nil -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -type PacketAcknowledgementData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Acknowledgement []byte `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` -} - -func (m *PacketAcknowledgementData) Reset() { *m = PacketAcknowledgementData{} } -func (m *PacketAcknowledgementData) String() string { return proto.CompactTextString(m) } -func (*PacketAcknowledgementData) ProtoMessage() {} -func (*PacketAcknowledgementData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{14} -} -func (m *PacketAcknowledgementData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketAcknowledgementData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketAcknowledgementData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketAcknowledgementData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketAcknowledgementData.Merge(m, src) -} -func (m *PacketAcknowledgementData) XXX_Size() int { - return m.Size() -} -func (m *PacketAcknowledgementData) XXX_DiscardUnknown() { - xxx_messageInfo_PacketAcknowledgementData.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketAcknowledgementData proto.InternalMessageInfo - -func (m *PacketAcknowledgementData) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *PacketAcknowledgementData) GetAcknowledgement() []byte { - if m != nil { - return m.Acknowledgement - } - return nil -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -type PacketReceiptAbsenceData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` -} - -func (m *PacketReceiptAbsenceData) Reset() { *m = PacketReceiptAbsenceData{} } -func (m *PacketReceiptAbsenceData) String() string { return proto.CompactTextString(m) } -func (*PacketReceiptAbsenceData) ProtoMessage() {} -func (*PacketReceiptAbsenceData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{15} -} -func (m *PacketReceiptAbsenceData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketReceiptAbsenceData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketReceiptAbsenceData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketReceiptAbsenceData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketReceiptAbsenceData.Merge(m, src) -} -func (m *PacketReceiptAbsenceData) XXX_Size() int { - return m.Size() -} -func (m *PacketReceiptAbsenceData) XXX_DiscardUnknown() { - xxx_messageInfo_PacketReceiptAbsenceData.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketReceiptAbsenceData proto.InternalMessageInfo - -func (m *PacketReceiptAbsenceData) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -type NextSequenceRecvData struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - NextSeqRecv uint64 `protobuf:"varint,2,opt,name=next_seq_recv,json=nextSeqRecv,proto3" json:"next_seq_recv,omitempty" yaml:"next_seq_recv"` -} - -func (m *NextSequenceRecvData) Reset() { *m = NextSequenceRecvData{} } -func (m *NextSequenceRecvData) String() string { return proto.CompactTextString(m) } -func (*NextSequenceRecvData) ProtoMessage() {} -func (*NextSequenceRecvData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{16} -} -func (m *NextSequenceRecvData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NextSequenceRecvData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NextSequenceRecvData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NextSequenceRecvData) XXX_Merge(src proto.Message) { - xxx_messageInfo_NextSequenceRecvData.Merge(m, src) -} -func (m *NextSequenceRecvData) XXX_Size() int { - return m.Size() -} -func (m *NextSequenceRecvData) XXX_DiscardUnknown() { - xxx_messageInfo_NextSequenceRecvData.DiscardUnknown(m) -} - -var xxx_messageInfo_NextSequenceRecvData proto.InternalMessageInfo - -func (m *NextSequenceRecvData) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *NextSequenceRecvData) GetNextSeqRecv() uint64 { - if m != nil { - return m.NextSeqRecv - } - return 0 -} - func init() { - proto.RegisterEnum("ibc.lightclients.solomachine.v2.DataType", DataType_name, DataType_value) proto.RegisterType((*ClientState)(nil), "ibc.lightclients.solomachine.v2.ClientState") proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.solomachine.v2.ConsensusState") proto.RegisterType((*Header)(nil), "ibc.lightclients.solomachine.v2.Header") proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v2.Misbehaviour") - proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v2.SignatureAndData") + proto.RegisterType((*SignatureAndDataV2)(nil), "ibc.lightclients.solomachine.v2.SignatureAndDataV2") proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v2.TimestampedSignatureData") proto.RegisterType((*SignBytesV2)(nil), "ibc.lightclients.solomachine.v2.SignBytesV2") - proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v2.SignBytes") proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v2.HeaderData") - proto.RegisterType((*ClientStateData)(nil), "ibc.lightclients.solomachine.v2.ClientStateData") - proto.RegisterType((*ConsensusStateData)(nil), "ibc.lightclients.solomachine.v2.ConsensusStateData") - proto.RegisterType((*ConnectionStateData)(nil), "ibc.lightclients.solomachine.v2.ConnectionStateData") - proto.RegisterType((*ChannelStateData)(nil), "ibc.lightclients.solomachine.v2.ChannelStateData") - proto.RegisterType((*PacketCommitmentData)(nil), "ibc.lightclients.solomachine.v2.PacketCommitmentData") - proto.RegisterType((*PacketAcknowledgementData)(nil), "ibc.lightclients.solomachine.v2.PacketAcknowledgementData") - proto.RegisterType((*PacketReceiptAbsenceData)(nil), "ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData") - proto.RegisterType((*NextSequenceRecvData)(nil), "ibc.lightclients.solomachine.v2.NextSequenceRecvData") } func init() { @@ -872,95 +388,57 @@ func init() { } var fileDescriptor_141333b361aae010 = []byte{ - // 1398 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x8f, 0xdb, 0xd4, - 0x16, 0x1f, 0xa7, 0xe9, 0x74, 0x72, 0x32, 0x9d, 0xc9, 0x73, 0xd3, 0x36, 0xe3, 0x56, 0x89, 0x9f, - 0x9f, 0x5e, 0xdf, 0x3c, 0x44, 0x13, 0x66, 0x2a, 0x2a, 0x54, 0x10, 0xe0, 0x38, 0x2e, 0x4d, 0x3b, - 0xe3, 0x09, 0x8e, 0xa7, 0xd0, 0x0a, 0xc9, 0x72, 0x9c, 0x3b, 0x89, 0xd5, 0xc4, 0x37, 0x8d, 0x9d, - 0xa4, 0x41, 0x42, 0x42, 0xac, 0x4a, 0xc4, 0x82, 0x1d, 0xab, 0x48, 0x08, 0xc4, 0xe7, 0x60, 0x87, - 0x60, 0xd7, 0x25, 0xab, 0x80, 0xda, 0x6f, 0x90, 0x4f, 0x80, 0xec, 0x7b, 0x13, 0xdb, 0x99, 0x4e, - 0x46, 0xfc, 0xe9, 0xee, 0xde, 0xf3, 0xe7, 0x77, 0x7e, 0xe7, 0xdc, 0xe3, 0x73, 0xaf, 0x61, 0x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6e, 0xaf, 0x4b, 0x8e, - 0x71, 0x5d, 0x0d, 0x04, 0xec, 0x21, 0x6c, 0xd8, 0x68, 0xa0, 0x87, 0x12, 0x8f, 0x2f, 0x49, 0x7c, - 0x6b, 0x3a, 0xc9, 0x5d, 0x24, 0x89, 0x47, 0xbd, 0x04, 0x75, 0xdd, 0x46, 0x83, 0xca, 0x3c, 0x7f, - 0x09, 0x36, 0x3d, 0x83, 0x70, 0x0d, 0xce, 0x7a, 0x35, 0x08, 0x37, 0xc4, 0x82, 0x81, 0xa0, 0x7a, - 0x4c, 0x4a, 0x81, 0x80, 0x16, 0xe1, 0x97, 0x18, 0xac, 0xef, 0x5b, 0x4e, 0x0d, 0x35, 0x8d, 0xbe, - 0x85, 0x7b, 0x5d, 0xf6, 0x06, 0x24, 0x48, 0xf3, 0xe9, 0x56, 0xdd, 0xaf, 0x45, 0xa2, 0x78, 0x29, - 0x68, 0xe8, 0xb9, 0x4a, 0xc8, 0x30, 0xea, 0x1a, 0xd9, 0x95, 0xeb, 0x91, 0xfa, 0xc5, 0x16, 0xea, - 0xd7, 0x81, 0xf3, 0xf3, 0x82, 0xe8, 0xd8, 0x9e, 0x35, 0xfb, 0xce, 0xa9, 0xcd, 0x5e, 0x9d, 0x79, - 0x89, 0x76, 0xbd, 0x64, 0xb8, 0x46, 0x31, 0x33, 0x9d, 0xe4, 0xd2, 0x84, 0x47, 0x04, 0x51, 0x50, - 0xd7, 0xe7, 0xfb, 0x03, 0x7b, 0x21, 0xa2, 0x3b, 0xc0, 0xb4, 0xe8, 0xff, 0x54, 0x44, 0x77, 0x80, - 0xc3, 0x11, 0xb5, 0x01, 0xa6, 0xb5, 0xfc, 0x89, 0x81, 0xd4, 0x22, 0x44, 0xb4, 0x41, 0x98, 0xc5, - 0x06, 0xf9, 0x04, 0x12, 0x75, 0xc3, 0x35, 0x74, 0x77, 0xd8, 0x21, 0x95, 0xdb, 0xd8, 0xfd, 0xff, - 0xa9, 0x34, 0x3d, 0x5c, 0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 0x00, 0x00, 0xff, 0xff, 0xbf, 0x5d, - 0x4b, 0xa2, 0x22, 0x0e, 0x00, 0x00, + // 790 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x3d, 0x6f, 0xdb, 0x46, + 0x18, 0x16, 0x69, 0xda, 0x90, 0x4e, 0xaa, 0xdc, 0x12, 0xb2, 0x41, 0xab, 0x85, 0x28, 0x70, 0x28, + 0xbc, 0x98, 0xac, 0x25, 0xa0, 0x83, 0xbb, 0xd4, 0xb2, 0x51, 0xf4, 0xc3, 0x45, 0x0d, 0xfa, 0x63, + 0xe8, 0x42, 0x1c, 0xc9, 0x13, 0x75, 0x28, 0xc5, 0x53, 0x79, 0x47, 0x09, 0xca, 0x10, 0x04, 0x99, + 0x32, 0x66, 0xcb, 0x1a, 0x04, 0xc8, 0xef, 0xc8, 0x9a, 0x25, 0x80, 0xc7, 0x4c, 0x42, 0x60, 0xff, + 0x03, 0xfd, 0x82, 0x80, 0x47, 0x4a, 0x24, 0x65, 0xc7, 0x06, 0x92, 0x6c, 0x77, 0xef, 0xe7, 0xf3, + 0x3e, 0xf7, 0xbc, 0x24, 0xd8, 0xc7, 0xb6, 0x63, 0xf8, 0xd8, 0x1b, 0x30, 0xc7, 0xc7, 0x28, 0x60, + 0xd4, 0xa0, 0xc4, 0x27, 0x43, 0xe8, 0x0c, 0x70, 0x80, 0x8c, 0x71, 0x27, 0x7f, 0xd5, 0x47, 0x21, + 0x61, 0x44, 0x56, 0xb1, 0xed, 0xe8, 0xf9, 0x14, 0x3d, 0x1f, 0x33, 0xee, 0x34, 0x1b, 0x1e, 0xf1, + 0x08, 0x8f, 0x35, 0xe2, 0x53, 0x92, 0xd6, 0xdc, 0xf1, 0x08, 0xf1, 0x7c, 0x64, 0xf0, 0x9b, 0x1d, + 0xf5, 0x0d, 0x18, 0x4c, 0x13, 0x97, 0xf6, 0x46, 0x04, 0x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0xb6, 0xe6, 0x33, 0xf5, 0xbb, 0x04, 0x44, 0x96, 0xa1, 0x99, 0x95, 0xe4, 0xf2, 0x17, 0x9a, 0xca, + 0x6d, 0x50, 0x75, 0xf1, 0x18, 0x85, 0x14, 0xf7, 0x31, 0x0a, 0x39, 0xed, 0x15, 0x33, 0x6f, 0x92, + 0x7f, 0x00, 0x15, 0x86, 0x87, 0x88, 0x32, 0x38, 0x1c, 0x71, 0x76, 0x25, 0x33, 0x33, 0xa4, 0x20, + 0x9f, 0x8a, 0x60, 0xe3, 0x77, 0x04, 0x5d, 0x14, 0xde, 0xfb, 0xc2, 0x85, 0x52, 0xe2, 0x4a, 0xa9, + 0xd8, 0x4b, 0xb1, 0x17, 0x40, 0x16, 0x85, 0xc9, 0x33, 0xd6, 0xcc, 0xcc, 0x20, 0x5f, 0x80, 0x7a, + 0x80, 0x26, 0x56, 0x6e, 0x70, 0xe9, 0x9e, 0xc1, 0x77, 0xe6, 0x33, 0x75, 0x2b, 0x19, 0xbc, 0x98, + 0xa5, 0x99, 0xb5, 0x00, 0x4d, 0x4e, 0x97, 0xf3, 0x1f, 0x81, 0xcd, 0x38, 0x20, 0xcf, 0xc1, 0x7a, + 0xcc, 0x41, 0x5e, 0x10, 0x2b, 0x01, 0x9a, 0x19, 0x23, 0x39, 0xce, 0x0c, 0x29, 0x09, 0xef, 0x44, + 0x50, 0xfb, 0x1b, 0x53, 0x1b, 0x0d, 0xe0, 0x18, 0x93, 0x28, 0x94, 0xbb, 0xa0, 0x92, 0x88, 0xcf, + 0xc2, 0x2e, 0xe7, 0xa2, 0xd2, 0xdb, 0xce, 0x04, 0xbd, 0x74, 0x69, 0x8a, 0x60, 0x96, 0x93, 0xdb, + 0x1f, 0x6e, 0x81, 0x3f, 0x71, 0x85, 0xbf, 0x10, 0x7c, 0xb3, 0x24, 0xc4, 0x22, 0xc1, 0x42, 0xec, + 0xdd, 0x07, 0xc5, 0x7e, 0xb6, 0xc8, 0x3a, 0x0c, 0xdc,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9e, 0xdf, 0xb4, + 0x4a, 0x57, 0x37, 0xad, 0xd2, 0xfb, 0x9b, 0x56, 0xe9, 0xdf, 0x13, 0x0f, 0xb3, 0x41, 0x64, 0xeb, + 0x0e, 0x19, 0x1a, 0x0e, 0xa1, 0x43, 0x42, 0x0d, 0x6c, 0x3b, 0x7b, 0x1e, 0x31, 0xc6, 0x5d, 0x63, + 0x48, 0xdc, 0xc8, 0x47, 0x34, 0xf9, 0x7f, 0xee, 0x2d, 0x7e, 0xa0, 0x3f, 0xfd, 0xbc, 0x97, 0x13, + 0xf9, 0x2f, 0xb9, 0xb3, 0xbd, 0xc1, 0x67, 0xec, 0x7e, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xf7, + 0xe0, 0x5f, 0x76, 0x07, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { @@ -1188,7 +666,7 @@ func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SignatureAndData) Marshal() (dAtA []byte, err error) { +func (m *SignatureAndDataV2) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1198,12 +676,12 @@ func (m *SignatureAndData) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error) { +func (m *SignatureAndDataV2) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SignatureAndDataV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1220,10 +698,12 @@ func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if m.DataType != 0 { - i = encodeVarintSolomachine(dAtA, i, uint64(m.DataType)) + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.Signature) > 0 { i -= len(m.Signature) @@ -1324,7 +804,7 @@ func (m *SignBytesV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SignBytes) Marshal() (dAtA []byte, err error) { +func (m *HeaderData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1334,74 +814,22 @@ func (m *SignBytes) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignBytes) MarshalTo(dAtA []byte) (int, error) { +func (m *HeaderData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SignBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x2a - } - if m.DataType != 0 { - i = encodeVarintSolomachine(dAtA, i, uint64(m.DataType)) + if len(m.NewDiversifier) > 0 { + i -= len(m.NewDiversifier) + copy(dAtA[i:], m.NewDiversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.NewDiversifier))) i-- - dAtA[i] = 0x20 - } - if len(m.Diversifier) > 0 { - i -= len(m.Diversifier) - copy(dAtA[i:], m.Diversifier) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Diversifier))) - i-- - dAtA[i] = 0x1a - } - if m.Timestamp != 0 { - i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x10 - } - if m.Sequence != 0 { - i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HeaderData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HeaderData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NewDiversifier) > 0 { - i -= len(m.NewDiversifier) - copy(dAtA[i:], m.NewDiversifier) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.NewDiversifier))) - i-- - dAtA[i] = 0x12 + dAtA[i] = 0x12 } if m.NewPubKey != nil { { @@ -1418,391 +846,84 @@ func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ClientStateData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintSolomachine(dAtA []byte, offset int, v uint64) int { + offset -= sovSolomachine(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *ClientStateData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *ClientStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *ClientState) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSolomachine(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) } - return len(dAtA) - i, nil -} - -func (m *ConsensusStateData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.IsFrozen { + n += 2 } - return dAtA[:n], nil -} - -func (m *ConsensusStateData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l if m.ConsensusState != nil { - { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSolomachine(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + l = m.ConsensusState.Size() + n += 1 + l + sovSolomachine(uint64(l)) } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa + if m.AllowUpdateAfterProposal { + n += 2 } - return len(dAtA) - i, nil + return n } -func (m *ConnectionStateData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *ConsensusState) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *ConnectionStateData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConnectionStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Connection != nil { - { - size, err := m.Connection.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSolomachine(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa + l = len(m.Diversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *ChannelStateData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) } - return dAtA[:n], nil -} - -func (m *ChannelStateData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *ChannelStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Header) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Channel != nil { - { - size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSolomachine(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) } - return len(dAtA) - i, nil -} - -func (m *PacketCommitmentData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) } - return dAtA[:n], nil -} - -func (m *PacketCommitmentData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketCommitmentData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Commitment) > 0 { - i -= len(m.Commitment) - copy(dAtA[i:], m.Commitment) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Commitment))) - i-- - dAtA[i] = 0x12 + if m.NewPublicKey != nil { + l = m.NewPublicKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa + l = len(m.NewDiversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *PacketAcknowledgementData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketAcknowledgementData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketAcknowledgementData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Acknowledgement) > 0 { - i -= len(m.Acknowledgement) - copy(dAtA[i:], m.Acknowledgement) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Acknowledgement))) - i-- - dAtA[i] = 0x12 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PacketReceiptAbsenceData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketReceiptAbsenceData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketReceiptAbsenceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NextSequenceRecvData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NextSequenceRecvData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NextSequenceRecvData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NextSeqRecv != 0 { - i = encodeVarintSolomachine(dAtA, i, uint64(m.NextSeqRecv)) - i-- - dAtA[i] = 0x10 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSolomachine(dAtA []byte, offset int, v uint64) int { - offset -= sovSolomachine(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ClientState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sequence != 0 { - n += 1 + sovSolomachine(uint64(m.Sequence)) - } - if m.IsFrozen { - n += 2 - } - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.AllowUpdateAfterProposal { - n += 2 - } - return n -} - -func (m *ConsensusState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PublicKey != nil { - l = m.PublicKey.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.Diversifier) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - return n -} - -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sequence != 0 { - n += 1 + sovSolomachine(uint64(m.Sequence)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.NewPublicKey != nil { - l = m.NewPublicKey.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.NewDiversifier) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n + return n } func (m *Misbehaviour) Size() (n int) { @@ -1811,1363 +932,115 @@ func (m *Misbehaviour) Size() (n int) { } var l int _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Sequence != 0 { - n += 1 + sovSolomachine(uint64(m.Sequence)) - } - if m.SignatureOne != nil { - l = m.SignatureOne.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.SignatureTwo != nil { - l = m.SignatureTwo.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *SignatureAndData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.DataType != 0 { - n += 1 + sovSolomachine(uint64(m.DataType)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - return n -} - -func (m *TimestampedSignatureData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SignatureData) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - return n -} - -func (m *SignBytesV2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sequence != 0 { - n += 1 + sovSolomachine(uint64(m.Sequence)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - l = len(m.Diversifier) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *SignBytes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sequence != 0 { - n += 1 + sovSolomachine(uint64(m.Sequence)) - } - if m.Timestamp != 0 { - n += 1 + sovSolomachine(uint64(m.Timestamp)) - } - l = len(m.Diversifier) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.DataType != 0 { - n += 1 + sovSolomachine(uint64(m.DataType)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *HeaderData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NewPubKey != nil { - l = m.NewPubKey.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.NewDiversifier) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *ClientStateData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *ConsensusStateData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *ConnectionStateData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Connection != nil { - l = m.Connection.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *ChannelStateData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.Channel != nil { - l = m.Channel.Size() - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *PacketCommitmentData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.Commitment) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *PacketAcknowledgementData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - l = len(m.Acknowledgement) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *PacketReceiptAbsenceData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - return n -} - -func (m *NextSequenceRecvData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovSolomachine(uint64(l)) - } - if m.NextSeqRecv != 0 { - n += 1 + sovSolomachine(uint64(m.NextSeqRecv)) - } - return n -} - -func sovSolomachine(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSolomachine(x uint64) (n int) { - return sovSolomachine(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ClientState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClientState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClientState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsFrozen", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsFrozen = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusState == nil { - m.ConsensusState = &ConsensusState{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterProposal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowUpdateAfterProposal = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsensusState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PublicKey == nil { - m.PublicKey = &types.Any{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Diversifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Header) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewPublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NewPublicKey == nil { - m.NewPublicKey = &types.Any{} - } - if err := m.NewPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewDiversifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Misbehaviour) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Misbehaviour: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Misbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignatureOne", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SignatureOne == nil { - m.SignatureOne = &SignatureAndData{} - } - if err := m.SignatureOne.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignatureTwo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SignatureTwo == nil { - m.SignatureTwo = &SignatureAndData{} - } - if err := m.SignatureTwo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignatureAndData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignatureAndData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignatureAndData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataType", wireType) - } - m.DataType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DataType |= DataType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimestampedSignatureData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimestampedSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignatureData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SignatureData = append(m.SignatureData[:0], dAtA[iNdEx:postIndex]...) - if m.SignatureData == nil { - m.SignatureData = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignBytesV2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignBytesV2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignBytesV2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Diversifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.SignatureOne != nil { + l = m.SignatureOne.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.SignatureTwo != nil { + l = m.SignatureTwo.Size() + n += 1 + l + sovSolomachine(uint64(l)) } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *SignatureAndDataV2) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + return n +} + +func (m *TimestampedSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SignatureData) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + return n +} + +func (m *SignBytesV2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + l = len(m.Diversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *HeaderData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NewPubKey != nil { + l = m.NewPubKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.NewDiversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func sovSolomachine(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSolomachine(x uint64) (n int) { + return sovSolomachine(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *SignBytes) Unmarshal(dAtA []byte) error { +func (m *ClientState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3190,10 +1063,10 @@ func (m *SignBytes) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignBytes: wiretype end group for non-group") + return fmt.Errorf("proto: ClientState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignBytes: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClientState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3217,9 +1090,9 @@ func (m *SignBytes) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IsFrozen", wireType) } - m.Timestamp = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3229,149 +1102,15 @@ func (m *SignBytes) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.IsFrozen = bool(v != 0) case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Diversifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataType", wireType) - } - m.DataType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DataType |= DataType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeaderData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HeaderData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeaderData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewPubKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3398,18 +1137,18 @@ func (m *HeaderData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NewPubKey == nil { - m.NewPubKey = &types.Any{} + if m.ConsensusState == nil { + m.ConsensusState = &ConsensusState{} } - if err := m.NewPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterProposal", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3419,24 +1158,12 @@ func (m *HeaderData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewDiversifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.AllowUpdateAfterProposal = bool(v != 0) default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -3458,7 +1185,7 @@ func (m *HeaderData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClientStateData) Unmarshal(dAtA []byte) error { +func (m *ConsensusState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3481,17 +1208,17 @@ func (m *ClientStateData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClientStateData: wiretype end group for non-group") + return fmt.Errorf("proto: ConsensusState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClientStateData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsensusState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3501,31 +1228,33 @@ func (m *ClientStateData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthSolomachine } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSolomachine } if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} + if m.PublicKey == nil { + m.PublicKey = &types.Any{} + } + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3535,28 +1264,43 @@ func (m *ClientStateData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthSolomachine } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSolomachine } if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClientState == nil { - m.ClientState = &types.Any{} + m.Diversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -3578,7 +1322,7 @@ func (m *ClientStateData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { +func (m *Header) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3601,15 +1345,53 @@ func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConsensusStateData: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusStateData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3636,14 +1418,14 @@ func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewPublicKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3670,13 +1452,45 @@ func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} + if m.NewPublicKey == nil { + m.NewPublicKey = &types.Any{} } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.NewPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewDiversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -3698,7 +1512,7 @@ func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConnectionStateData) Unmarshal(dAtA []byte) error { +func (m *Misbehaviour) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3721,17 +1535,17 @@ func (m *ConnectionStateData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConnectionStateData: wiretype end group for non-group") + return fmt.Errorf("proto: Misbehaviour: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConnectionStateData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Misbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3741,31 +1555,29 @@ func (m *ConnectionStateData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthSolomachine } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSolomachine } if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} - } + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connection", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) } - var msglen int + m.Sequence = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3775,83 +1587,16 @@ func (m *ConnectionStateData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Sequence |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Connection == nil { - m.Connection = &types1.ConnectionEnd{} - } - if err := m.Connection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSolomachine(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSolomachine - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChannelStateData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSolomachine - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChannelStateData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChannelStateData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignatureOne", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -3861,29 +1606,31 @@ func (m *ChannelStateData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthSolomachine } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSolomachine } if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} + if m.SignatureOne == nil { + m.SignatureOne = &SignatureAndDataV2{} + } + if err := m.SignatureOne.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignatureTwo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3910,10 +1657,10 @@ func (m *ChannelStateData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Channel == nil { - m.Channel = &types2.Channel{} + if m.SignatureTwo == nil { + m.SignatureTwo = &SignatureAndDataV2{} } - if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.SignatureTwo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3938,7 +1685,7 @@ func (m *ChannelStateData) Unmarshal(dAtA []byte) error { } return nil } -func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { +func (m *SignatureAndDataV2) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3961,13 +1708,47 @@ func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PacketCommitmentData: wiretype end group for non-group") + return fmt.Errorf("proto: SignatureAndDataV2: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PacketCommitmentData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignatureAndDataV2: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } @@ -4001,9 +1782,9 @@ func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { m.Path = []byte{} } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commitment", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4030,11 +1811,30 @@ func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Commitment = append(m.Commitment[:0], dAtA[iNdEx:postIndex]...) - if m.Commitment == nil { - m.Commitment = []byte{} + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -4056,7 +1856,7 @@ func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { } return nil } -func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { +func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4079,15 +1879,15 @@ func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PacketAcknowledgementData: wiretype end group for non-group") + return fmt.Errorf("proto: TimestampedSignatureData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PacketAcknowledgementData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TimestampedSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignatureData", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4114,16 +1914,16 @@ func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} + m.SignatureData = append(m.SignatureData[:0], dAtA[iNdEx:postIndex]...) + if m.SignatureData == nil { + m.SignatureData = []byte{} } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - var byteLen int + m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -4133,26 +1933,11 @@ func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Timestamp |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthSolomachine - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSolomachine - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) - if m.Acknowledgement == nil { - m.Acknowledgement = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -4174,7 +1959,7 @@ func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { } return nil } -func (m *PacketReceiptAbsenceData) Unmarshal(dAtA []byte) error { +func (m *SignBytesV2) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4197,13 +1982,83 @@ func (m *PacketReceiptAbsenceData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PacketReceiptAbsenceData: wiretype end group for non-group") + return fmt.Errorf("proto: SignBytesV2: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PacketReceiptAbsenceData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignBytesV2: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Diversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } @@ -4237,6 +2092,40 @@ func (m *PacketReceiptAbsenceData) Unmarshal(dAtA []byte) error { m.Path = []byte{} } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) @@ -4258,7 +2147,7 @@ func (m *PacketReceiptAbsenceData) Unmarshal(dAtA []byte) error { } return nil } -func (m *NextSequenceRecvData) Unmarshal(dAtA []byte) error { +func (m *HeaderData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4281,17 +2170,17 @@ func (m *NextSequenceRecvData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NextSequenceRecvData: wiretype end group for non-group") + return fmt.Errorf("proto: HeaderData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NextSequenceRecvData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: HeaderData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewPubKey", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -4301,31 +2190,33 @@ func (m *NextSequenceRecvData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthSolomachine } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSolomachine } if postIndex > l { return io.ErrUnexpectedEOF } - m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) - if m.Path == nil { - m.Path = []byte{} + if m.NewPubKey == nil { + m.NewPubKey = &types.Any{} + } + if err := m.NewPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextSeqRecv", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) } - m.NextSeqRecv = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSolomachine @@ -4335,11 +2226,24 @@ func (m *NextSequenceRecvData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NextSeqRecv |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewDiversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) diff --git a/modules/light-clients/06-solomachine/update.go b/modules/light-clients/06-solomachine/update.go index 1d903a6105a..f5a7c4c9a55 100644 --- a/modules/light-clients/06-solomachine/update.go +++ b/modules/light-clients/06-solomachine/update.go @@ -44,7 +44,25 @@ func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clien } // assert currently registered public key signed over the new public key with correct sequence - data, err := HeaderSignBytes(cdc, header) + headerData := &HeaderData{ + NewPubKey: header.NewPublicKey, + NewDiversifier: header.NewDiversifier, + } + + dataBz, err := cdc.Marshal(headerData) + if err != nil { + return err + } + + signBytes := &SignBytesV2{ + Sequence: header.Sequence, + Timestamp: header.Timestamp, + Diversifier: header.NewDiversifier, + Path: []byte{}, + Data: dataBz, + } + + data, err := cdc.Marshal(signBytes) if err != nil { return err } diff --git a/modules/light-clients/06-solomachine/update_test.go b/modules/light-clients/06-solomachine/update_test.go index 24dad99ab0b..282b7edb47f 100644 --- a/modules/light-clients/06-solomachine/update_test.go +++ b/modules/light-clients/06-solomachine/update_test.go @@ -101,11 +101,11 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { suite.Require().NoError(err) // generate invalid signature - signBytes := &solomachine.SignBytes{ + signBytes := &solomachine.SignBytesV2{ Sequence: cs.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, - DataType: solomachine.CLIENT, + Path: []byte("invalid signature data"), Data: dataBz, } @@ -258,11 +258,11 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { m := sm.CreateMisbehaviour() msg := []byte("DATA ONE") - signBytes := &solomachine.SignBytes{ + signBytes := &solomachine.SignBytesV2{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, - DataType: solomachine.CLIENT, + Path: []byte("invalid signature data"), Data: msg, } @@ -284,11 +284,11 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { m := sm.CreateMisbehaviour() msg := []byte("DATA TWO") - signBytes := &solomachine.SignBytes{ + signBytes := &solomachine.SignBytesV2{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, - DataType: solomachine.CLIENT, + Path: []byte("invalid signature data"), Data: msg, } @@ -341,11 +341,11 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { // Signature One msg := []byte("DATA ONE") // sequence used is plus 1 - signBytes := &solomachine.SignBytes{ + signBytes := &solomachine.SignBytesV2{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, - DataType: solomachine.CLIENT, + Path: []byte("invalid signature data"), Data: msg, } @@ -361,11 +361,11 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { msg = []byte("DATA TWO") // sequence used is minus 1 - signBytes = &solomachine.SignBytes{ + signBytes = &solomachine.SignBytesV2{ Sequence: sm.Sequence - 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, - DataType: solomachine.CLIENT, + Path: []byte("invalid signature data"), Data: msg, } data, err = suite.chainA.Codec.Marshal(signBytes) diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index f95c01fa045..6c03acae18e 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -4,8 +4,6 @@ package ibc.lightclients.solomachine.v2; option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine;solomachine"; -import "ibc/core/connection/v1/connection.proto"; -import "ibc/core/channel/v1/channel.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -54,20 +52,20 @@ message Misbehaviour { option (gogoproto.goproto_getters) = false; // ClientID is deprecated - string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; + string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndDataV2 signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndDataV2 signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; } -// SignatureAndData contains a signature and the data signed over to create that +// SignatureAndDataV2 contains a signature and the data signed over to create that // signature. -message SignatureAndData { +message SignatureAndDataV2 { option (gogoproto.goproto_getters) = false; - bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; - bytes data = 3; - uint64 timestamp = 4; + bytes signature = 1; + bytes path = 2; + bytes data = 3; + uint64 timestamp = 4; } // TimestampedSignatureData contains the signature data and the timestamp of the @@ -94,46 +92,6 @@ message SignBytesV2 { bytes data = 5; } -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - uint64 timestamp = 2; - string diversifier = 3; - // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; - // marshaled data - bytes data = 5; -} - -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -enum DataType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Data type for client state verification - DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; - // Data type for consensus state verification - DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; - // Data type for connection state verification - DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; - // Data type for channel state verification - DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; - // Data type for packet commitment verification - DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; - // Data type for packet acknowledgement verification - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; - // Data type for packet receipt absence verification - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; - // Data type for next sequence recv verification - DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; - // Data type for header verification - DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; -} - // HeaderData returns the SignBytes data for update verification. message HeaderData { option (gogoproto.goproto_getters) = false; @@ -143,65 +101,3 @@ message HeaderData { // header diversifier string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; } - -// ClientStateData returns the SignBytes data for client state verification. -message ClientStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -message ConsensusStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -message ConnectionStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.connection.v1.ConnectionEnd connection = 2; -} - -// ChannelStateData returns the SignBytes data for channel state -// verification. -message ChannelStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.channel.v1.Channel channel = 2; -} - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -message PacketCommitmentData { - bytes path = 1; - bytes commitment = 2; -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -message PacketAcknowledgementData { - bytes path = 1; - bytes acknowledgement = 2; -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -message PacketReceiptAbsenceData { - bytes path = 1; -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -message NextSequenceRecvData { - bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; -} diff --git a/testing/solomachine.go b/testing/solomachine.go index 5eea01fbb19..ee54c64b1ba 100644 --- a/testing/solomachine.go +++ b/testing/solomachine.go @@ -122,11 +122,11 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { dataBz, err := solo.cdc.Marshal(data) require.NoError(solo.t, err) - signBytes := &solomachinetypes.SignBytes{ + signBytes := &solomachinetypes.SignBytesV2{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, - DataType: solomachinetypes.HEADER, + Path: []byte{}, Data: dataBz, } @@ -155,52 +155,58 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { // CreateMisbehaviour constructs testing misbehaviour for the solo machine client // by signing over two different data bytes at the same sequence. func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { - path := solo.GetClientStatePath("counterparty") - dataOne, err := solomachinetypes.ClientStateDataBytes(solo.cdc, path, solo.ClientState()) + merklePath := solo.GetClientStatePath("counterparty") + path, err := solo.cdc.Marshal(&merklePath) require.NoError(solo.t, err) - path = solo.GetConsensusStatePath("counterparty", clienttypes.NewHeight(0, 1)) - dataTwo, err := solomachinetypes.ConsensusStateDataBytes(solo.cdc, path, solo.ConsensusState()) + data, err := solo.cdc.Marshal(solo.ClientState()) require.NoError(solo.t, err) - signBytes := &solomachinetypes.SignBytes{ + signBytes := &solomachinetypes.SignBytesV2{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, - DataType: solomachinetypes.CLIENT, - Data: dataOne, + Path: path, + Data: data, } bz, err := solo.cdc.Marshal(signBytes) require.NoError(solo.t, err) sig := solo.GenerateSignature(bz) - signatureOne := solomachinetypes.SignatureAndData{ + signatureOne := solomachinetypes.SignatureAndDataV2{ Signature: sig, - DataType: solomachinetypes.CLIENT, - Data: dataOne, + Path: path, + Data: data, Timestamp: solo.Time, } // misbehaviour signaturess can have different timestamps solo.Time++ - signBytes = &solomachinetypes.SignBytes{ + merklePath = solo.GetConsensusStatePath("counterparty", clienttypes.NewHeight(0, 1)) + path, err = solo.cdc.Marshal(&merklePath) + require.NoError(solo.t, err) + + data, err = solo.cdc.Marshal(solo.ConsensusState()) + require.NoError(solo.t, err) + + signBytes = &solomachinetypes.SignBytesV2{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, - DataType: solomachinetypes.CONSENSUS, - Data: dataTwo, + Path: path, + Data: data, } bz, err = solo.cdc.Marshal(signBytes) require.NoError(solo.t, err) sig = solo.GenerateSignature(bz) - signatureTwo := solomachinetypes.SignatureAndData{ + signatureTwo := solomachinetypes.SignatureAndDataV2{ Signature: sig, - DataType: solomachinetypes.CONSENSUS, - Data: dataTwo, + Path: path, + Data: data, Timestamp: solo.Time, } From 1c93ee6da9e9dd22477c6d283232d31bf29fa8b4 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 26 Jul 2022 18:55:53 +0200 Subject: [PATCH 05/11] updating tests with concrete ibc core types --- .../06-solomachine/client_state_test.go | 67 ++++++++++++++++--- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/modules/light-clients/06-solomachine/client_state_test.go b/modules/light-clients/06-solomachine/client_state_test.go index 5ef1014af28..ce05993abe7 100644 --- a/modules/light-clients/06-solomachine/client_state_test.go +++ b/modules/light-clients/06-solomachine/client_state_test.go @@ -1,7 +1,10 @@ package solomachine_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" "github.com/cosmos/ibc-go/v3/modules/core/exported" solomachine "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine" @@ -145,6 +148,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { height clienttypes.Height path []byte proof []byte + testingPath *ibctesting.Path signBytes solomachine.SignBytesV2 ) @@ -161,13 +165,17 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: client state verification", func() { + clientState = sm.ClientState() + clientStateBz, err := suite.chainA.Codec.Marshal(clientState) + suite.Require().NoError(err) + merklePath := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) signBytes = solomachine.SignBytesV2{ Sequence: sm.GetHeight().GetRevisionHeight(), Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.ClientState"), + Data: clientStateBz, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -192,13 +200,18 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: consensus state verification", func() { + clientState = sm.ClientState() + consensusState := clientState.ConsensusState + consensusStateBz, err := suite.chainA.Codec.Marshal(consensusState) + suite.Require().NoError(err) + merklePath := sm.GetConsensusStatePath(counterpartyClientIdentifier, height) signBytes = solomachine.SignBytesV2{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.ConsensusState"), + Data: consensusStateBz, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -222,13 +235,21 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: connection state verification", func() { + suite.coordinator.SetupConnections(testingPath) + + connectionEnd, found := suite.chainA.GetSimApp().IBCKeeper.ConnectionKeeper.GetConnection(suite.chainA.GetContext(), ibctesting.FirstConnectionID) + suite.Require().True(found) + + connectionEndBz, err := suite.chainA.Codec.Marshal(&connectionEnd) + suite.Require().NoError(err) + merklePath := sm.GetConnectionStatePath(ibctesting.FirstConnectionID) signBytes = solomachine.SignBytesV2{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.ConnectionState"), + Data: connectionEndBz, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -252,13 +273,22 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: channel state verification", func() { + suite.coordinator.SetupConnections(testingPath) + suite.coordinator.CreateMockChannels(testingPath) + + channelEnd, found := suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetChannel(suite.chainA.GetContext(), ibctesting.MockPort, ibctesting.FirstChannelID) + suite.Require().True(found) + + channelEndBz, err := suite.chainA.Codec.Marshal(&channelEnd) + suite.Require().NoError(err) + merklePath := sm.GetChannelStatePath(ibctesting.MockPort, ibctesting.FirstChannelID) signBytes = solomachine.SignBytesV2{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.ChannelState"), + Data: channelEndBz, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -282,13 +312,19 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: next sequence recv verification", func() { + suite.coordinator.SetupConnections(testingPath) + suite.coordinator.CreateMockChannels(testingPath) + + nextSeqRecv, found := suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetNextSequenceRecv(suite.chainA.GetContext(), ibctesting.MockPort, ibctesting.FirstChannelID) + suite.Require().True(found) + merklePath := sm.GetNextSequenceRecvPath(ibctesting.MockPort, ibctesting.FirstChannelID) signBytes = solomachine.SignBytesV2{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.NextSequenceRecv"), + Data: sdk.Uint64ToBigEndian(nextSeqRecv), } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -312,13 +348,25 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { { "success: packet commitment verification", func() { + packet := channeltypes.NewPacket( + ibctesting.MockPacketData, + 1, + ibctesting.MockPort, + ibctesting.FirstChannelID, + ibctesting.MockPort, + ibctesting.FirstChannelID, + clienttypes.NewHeight(0, 10), + 0, + ) + + commitmentBz := channeltypes.CommitPacket(suite.chainA.Codec, packet) merklePath := sm.GetPacketCommitmentPath(ibctesting.MockPort, ibctesting.FirstChannelID) signBytes = solomachine.SignBytesV2{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.PacketCommitment"), + Data: commitmentBz, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -348,7 +396,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.PacketAcknowledgement"), + Data: ibctesting.MockAcknowledgement, } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -378,7 +426,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { Timestamp: sm.Time, Diversifier: sm.Diversifier, Path: []byte(merklePath.String()), - Data: []byte("solomachine.PacketReceipt"), + Data: []byte{byte(1)}, // packet receipt is stored as a single byte } signBz, err := suite.chainA.Codec.Marshal(&signBytes) @@ -501,6 +549,9 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { tc := tc suite.Run(tc.name, func() { + suite.SetupTest() + testingPath = ibctesting.NewPath(suite.chainA, suite.chainB) + clientState = sm.ClientState() height = clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()) From e9b5801e2c767739d95784163d3b3e75dffae5d0 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 27 Jul 2022 22:35:31 +0200 Subject: [PATCH 06/11] refactor: solomachine generic VerifyNonMembership (#1720) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adding verification of non-membership with tests * refactor common code to produceVerificationArgs * removing unused produce args func * Update modules/light-clients/06-solomachine/client_state_test.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- .../06-solomachine/client_state.go | 96 +++---- .../06-solomachine/client_state_test.go | 235 ++++++++++++++++++ 2 files changed, 273 insertions(+), 58 deletions(-) diff --git a/modules/light-clients/06-solomachine/client_state.go b/modules/light-clients/06-solomachine/client_state.go index 93e61b7c00a..6c6c56f72d9 100644 --- a/modules/light-clients/06-solomachine/client_state.go +++ b/modules/light-clients/06-solomachine/client_state.go @@ -118,19 +118,9 @@ func (cs *ClientState) VerifyMembership( path []byte, value []byte, ) error { - // TODO: Attempt to refactor code to smaller function - if revision := height.GetRevisionNumber(); revision != 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidHeight, "revision must be 0 for solomachine, got revision-number: %d", revision) - } - - // sequence is encoded in the revision height of height struct - sequence := height.GetRevisionHeight() - latestSequence := cs.GetLatestHeight().GetRevisionHeight() - if latestSequence != sequence { - return sdkerrors.Wrapf( - sdkerrors.ErrInvalidHeight, - "client state sequence != proof sequence (%d != %d)", latestSequence, sequence, - ) + publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, proof) + if err != nil { + return err } var merklePath commitmenttypes.MerklePath @@ -138,35 +128,6 @@ func (cs *ClientState) VerifyMembership( return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal path into ICS 23 commitment merkle path") } - var timestampedSigData TimestampedSignatureData - if err := cdc.Unmarshal(proof, ×tampedSigData); err != nil { - return sdkerrors.Wrapf(err, "failed to unmarshal proof into type %T", timestampedSigData) - } - - timestamp := timestampedSigData.Timestamp - - if len(timestampedSigData.SignatureData) == 0 { - return sdkerrors.Wrap(ErrInvalidProof, "signature data cannot be empty") - } - - sigData, err := UnmarshalSignatureData(cdc, timestampedSigData.SignatureData) - if err != nil { - return err - } - - if cs.ConsensusState == nil { - return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "consensus state cannot be empty") - } - - if cs.ConsensusState.GetTimestamp() > timestamp { - return sdkerrors.Wrapf(ErrInvalidProof, "the consensus state timestamp is greater than the signature timestamp (%d >= %d)", cs.ConsensusState.GetTimestamp(), timestamp) - } - - publicKey, err := cs.ConsensusState.GetPubKey() - if err != nil { - return err - } - signBytes := &SignBytesV2{ Sequence: sequence, Timestamp: timestamp, @@ -203,11 +164,40 @@ func (cs *ClientState) VerifyNonMembership( proof []byte, path []byte, ) error { - // TODO: Implement 06-solomachine VerifyNonMembership + publicKey, sigData, timestamp, sequence, err := produceVerificationArgs(cdc, cs, height, proof) + if err != nil { + return err + } + + var merklePath commitmenttypes.MerklePath + if err := cdc.Unmarshal(path, &merklePath); err != nil { + return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal path into ICS 23 commitment merkle path") + } + + signBytes := &SignBytesV2{ + Sequence: sequence, + Timestamp: timestamp, + Diversifier: cs.ConsensusState.Diversifier, + Path: []byte(merklePath.String()), + Data: nil, + } + + signBz, err := cdc.Marshal(signBytes) + if err != nil { + return err + } + + if err := VerifySignature(publicKey, signBz, sigData); err != nil { + return err + } + + cs.Sequence++ + cs.ConsensusState.Timestamp = timestamp + setClientState(clientStore, cdc, cs) + return nil } -// TODO: Remove function as no longer used // produceVerificationArgs perfoms the basic checks on the arguments that are // shared between the verification functions and returns the public key of the // consensus state, the unmarshalled proof representing the signature and timestamp @@ -216,34 +206,22 @@ func produceVerificationArgs( cdc codec.BinaryCodec, cs *ClientState, height exported.Height, - prefix exported.Prefix, proof []byte, ) (cryptotypes.PubKey, signing.SignatureData, uint64, uint64, error) { if revision := height.GetRevisionNumber(); revision != 0 { return nil, nil, 0, 0, sdkerrors.Wrapf(sdkerrors.ErrInvalidHeight, "revision must be 0 for solomachine, got revision-number: %d", revision) } - // sequence is encoded in the revision height of height struct - sequence := height.GetRevisionHeight() - if prefix == nil { - return nil, nil, 0, 0, sdkerrors.Wrap(commitmenttypes.ErrInvalidPrefix, "prefix cannot be empty") - } - - _, ok := prefix.(*commitmenttypes.MerklePrefix) - if !ok { - return nil, nil, 0, 0, sdkerrors.Wrapf(commitmenttypes.ErrInvalidPrefix, "invalid prefix type %T, expected MerklePrefix", prefix) - } if proof == nil { return nil, nil, 0, 0, sdkerrors.Wrap(ErrInvalidProof, "proof cannot be empty") } - timestampedSigData := &TimestampedSignatureData{} - if err := cdc.Unmarshal(proof, timestampedSigData); err != nil { + var timestampedSigData TimestampedSignatureData + if err := cdc.Unmarshal(proof, ×tampedSigData); err != nil { return nil, nil, 0, 0, sdkerrors.Wrapf(err, "failed to unmarshal proof into type %T", timestampedSigData) } timestamp := timestampedSigData.Timestamp - if len(timestampedSigData.SignatureData) == 0 { return nil, nil, 0, 0, sdkerrors.Wrap(ErrInvalidProof, "signature data cannot be empty") } @@ -257,6 +235,8 @@ func produceVerificationArgs( return nil, nil, 0, 0, sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "consensus state cannot be empty") } + // sequence is encoded in the revision height of height struct + sequence := height.GetRevisionHeight() latestSequence := cs.GetLatestHeight().GetRevisionHeight() if latestSequence != sequence { return nil, nil, 0, 0, sdkerrors.Wrapf( diff --git a/modules/light-clients/06-solomachine/client_state_test.go b/modules/light-clients/06-solomachine/client_state_test.go index ce05993abe7..984bb1b1547 100644 --- a/modules/light-clients/06-solomachine/client_state_test.go +++ b/modules/light-clients/06-solomachine/client_state_test.go @@ -536,6 +536,13 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { }, false, }, + { + "proof is nil", + func() { + proof = nil + }, + false, + }, { "proof verification failed", func() { @@ -605,6 +612,234 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { } } +func (suite *SoloMachineTestSuite) TestVerifyNonMembership() { + // test singlesig and multisig public keys + for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { + + var ( + clientState *solomachine.ClientState + err error + height clienttypes.Height + path []byte + proof []byte + signBytes solomachine.SignBytesV2 + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "success: packet receipt absence verification", + func() { + merklePath := suite.solomachine.GetPacketReceiptPath(ibctesting.MockPort, ibctesting.FirstChannelID) + signBytes = solomachine.SignBytesV2{ + Sequence: sm.GetHeight().GetRevisionHeight(), + Timestamp: sm.Time, + Diversifier: sm.Diversifier, + Path: []byte(merklePath.String()), + Data: nil, + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := sm.GenerateSignature(signBz) + + signatureDoc := &solomachine.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: sm.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + true, + }, + { + "consensus state in client state is nil", + func() { + clientState = solomachine.NewClientState(1, nil, false) + }, + false, + }, + { + "client state latest height is less than sequence", + func() { + consensusState := &solomachine.ConsensusState{ + Timestamp: sm.Time, + PublicKey: sm.ConsensusState().PublicKey, + } + + clientState = solomachine.NewClientState(sm.Sequence-1, consensusState, false) + }, + false, + }, + { + "height revision number is not zero", + func() { + height = clienttypes.NewHeight(1, sm.GetHeight().GetRevisionHeight()) + }, + false, + }, + { + "malformed merkle path fails to unmarshal", + func() { + path = []byte("invalid path") + }, + false, + }, + { + "malformed proof fails to unmarshal", + func() { + merklePath := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof = []byte("invalid proof") + }, + false, + }, + { + "consensus state timestamp is greater than signature", + func() { + consensusState := &solomachine.ConsensusState{ + Timestamp: sm.Time + 1, + PublicKey: sm.ConsensusState().PublicKey, + } + + clientState = solomachine.NewClientState(sm.Sequence, consensusState, false) + }, + false, + }, + { + "signature data is nil", + func() { + signatureDoc := &solomachine.TimestampedSignatureData{ + SignatureData: nil, + Timestamp: sm.Time, + } + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + false, + }, + { + "consensus state public key is nil", + func() { + clientState.ConsensusState.PublicKey = nil + }, + false, + }, + { + "malformed signature data fails to unmarshal", + func() { + signatureDoc := &solomachine.TimestampedSignatureData{ + SignatureData: []byte("invalid signature data"), + Timestamp: sm.Time, + } + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + false, + }, + { + "proof is nil", + func() { + proof = nil + }, + false, + }, + { + "proof verification failed", + func() { + signBytes.Data = []byte("invalid non-membership data value") + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := sm.GenerateSignature(signBz) + + signatureDoc := &solomachine.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: sm.Time, + } + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + clientState = sm.ClientState() + height = clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()) + + merklePath := commitmenttypes.NewMerklePath("ibc", "solomachine") + signBytes = solomachine.SignBytesV2{ + Sequence: sm.GetHeight().GetRevisionHeight(), + Timestamp: sm.Time, + Diversifier: sm.Diversifier, + Path: []byte(merklePath.String()), + Data: nil, + } + + signBz, err := suite.chainA.Codec.Marshal(&signBytes) + suite.Require().NoError(err) + + sig := sm.GenerateSignature(signBz) + + signatureDoc := &solomachine.TimestampedSignatureData{ + SignatureData: sig, + Timestamp: sm.Time, + } + + path, err = suite.chainA.Codec.Marshal(&merklePath) + suite.Require().NoError(err) + + proof, err = suite.chainA.Codec.Marshal(signatureDoc) + suite.Require().NoError(err) + + tc.malleate() + + var expSeq uint64 + if clientState.ConsensusState != nil { + expSeq = clientState.Sequence + 1 + } + + err = clientState.VerifyNonMembership( + suite.chainA.GetContext(), suite.store, suite.chainA.Codec, + height, 0, 0, // solomachine does not check delay periods + proof, path, + ) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expSeq, clientState.Sequence) + suite.Require().Equal(expSeq, suite.GetSequenceFromStore(), "sequence not updated in the store (%d) on valid test case %s", suite.GetSequenceFromStore(), tc.name) + } else { + suite.Require().Error(err) + } + }) + } + } +} + func (suite *SoloMachineTestSuite) TestGetTimestampAtHeight() { tmPath := ibctesting.NewPath(suite.chainA, suite.chainB) suite.coordinator.SetupClients(tmPath) From eaa5210fdb4ad35c8bd002ded79ac60e685de46d Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 27 Jul 2022 23:03:28 +0200 Subject: [PATCH 07/11] removing V2 suffix from SignBytes and SignatureAndData types --- docs/ibc/proto-docs.md | 20 +- .../06-solomachine/client_state.go | 4 +- .../06-solomachine/client_state_test.go | 26 +-- .../06-solomachine/misbehaviour.go | 2 +- .../06-solomachine/misbehaviour_handle.go | 4 +- .../06-solomachine/solomachine.pb.go | 205 +++++++++--------- .../light-clients/06-solomachine/update.go | 2 +- .../06-solomachine/update_test.go | 10 +- .../solomachine/v2/solomachine.proto | 16 +- testing/solomachine.go | 10 +- 10 files changed, 149 insertions(+), 150 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 32546ed6568..bc6bf559631 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -312,8 +312,8 @@ - [Header](#ibc.lightclients.solomachine.v2.Header) - [HeaderData](#ibc.lightclients.solomachine.v2.HeaderData) - [Misbehaviour](#ibc.lightclients.solomachine.v2.Misbehaviour) - - [SignBytesV2](#ibc.lightclients.solomachine.v2.SignBytesV2) - - [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) + - [SignBytes](#ibc.lightclients.solomachine.v2.SignBytes) + - [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) - [TimestampedSignatureData](#ibc.lightclients.solomachine.v2.TimestampedSignatureData) - [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) @@ -4566,18 +4566,18 @@ of a sequence and two signatures over different messages at that sequence. | ----- | ---- | ----- | ----------- | | `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated | | `sequence` | [uint64](#uint64) | | | -| `signature_one` | [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) | | | -| `signature_two` | [SignatureAndDataV2](#ibc.lightclients.solomachine.v2.SignatureAndDataV2) | | | +| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | +| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | - + -### SignBytesV2 -SignBytesV2 defines the signed bytes used for signature verification. +### SignBytes +SignBytes defines the signed bytes used for signature verification. | Field | Type | Label | Description | @@ -4593,10 +4593,10 @@ SignBytesV2 defines the signed bytes used for signature verification. - + -### SignatureAndDataV2 -SignatureAndDataV2 contains a signature and the data signed over to create that +### SignatureAndData +SignatureAndData contains a signature and the data signed over to create that signature. diff --git a/modules/light-clients/06-solomachine/client_state.go b/modules/light-clients/06-solomachine/client_state.go index 6c6c56f72d9..159ea5052f6 100644 --- a/modules/light-clients/06-solomachine/client_state.go +++ b/modules/light-clients/06-solomachine/client_state.go @@ -128,7 +128,7 @@ func (cs *ClientState) VerifyMembership( return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal path into ICS 23 commitment merkle path") } - signBytes := &SignBytesV2{ + signBytes := &SignBytes{ Sequence: sequence, Timestamp: timestamp, Diversifier: cs.ConsensusState.Diversifier, @@ -174,7 +174,7 @@ func (cs *ClientState) VerifyNonMembership( return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal path into ICS 23 commitment merkle path") } - signBytes := &SignBytesV2{ + signBytes := &SignBytes{ Sequence: sequence, Timestamp: timestamp, Diversifier: cs.ConsensusState.Diversifier, diff --git a/modules/light-clients/06-solomachine/client_state_test.go b/modules/light-clients/06-solomachine/client_state_test.go index 984bb1b1547..49fedc102a9 100644 --- a/modules/light-clients/06-solomachine/client_state_test.go +++ b/modules/light-clients/06-solomachine/client_state_test.go @@ -149,7 +149,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { path []byte proof []byte testingPath *ibctesting.Path - signBytes solomachine.SignBytesV2 + signBytes solomachine.SignBytes ) testCases := []struct { @@ -170,7 +170,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { suite.Require().NoError(err) merklePath := suite.solomachine.GetClientStatePath(counterpartyClientIdentifier) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.GetHeight().GetRevisionHeight(), Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -206,7 +206,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { suite.Require().NoError(err) merklePath := sm.GetConsensusStatePath(counterpartyClientIdentifier, height) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -244,7 +244,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { suite.Require().NoError(err) merklePath := sm.GetConnectionStatePath(ibctesting.FirstConnectionID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -283,7 +283,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { suite.Require().NoError(err) merklePath := sm.GetChannelStatePath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -319,7 +319,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { suite.Require().True(found) merklePath := sm.GetNextSequenceRecvPath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -361,7 +361,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { commitmentBz := channeltypes.CommitPacket(suite.chainA.Codec, packet) merklePath := sm.GetPacketCommitmentPath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -391,7 +391,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { "success: packet acknowledgement verification", func() { merklePath := sm.GetPacketAcknowledgementPath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -421,7 +421,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { "success: packet receipt verification", func() { merklePath := sm.GetPacketReceiptPath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -563,7 +563,7 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() { height = clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()) merklePath := commitmenttypes.NewMerklePath("ibc", "solomachine") - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.GetHeight().GetRevisionHeight(), Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -622,7 +622,7 @@ func (suite *SoloMachineTestSuite) TestVerifyNonMembership() { height clienttypes.Height path []byte proof []byte - signBytes solomachine.SignBytesV2 + signBytes solomachine.SignBytes ) testCases := []struct { @@ -639,7 +639,7 @@ func (suite *SoloMachineTestSuite) TestVerifyNonMembership() { "success: packet receipt absence verification", func() { merklePath := suite.solomachine.GetPacketReceiptPath(ibctesting.MockPort, ibctesting.FirstChannelID) - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.GetHeight().GetRevisionHeight(), Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -791,7 +791,7 @@ func (suite *SoloMachineTestSuite) TestVerifyNonMembership() { height = clienttypes.NewHeight(sm.GetHeight().GetRevisionNumber(), sm.GetHeight().GetRevisionHeight()) merklePath := commitmenttypes.NewMerklePath("ibc", "solomachine") - signBytes = solomachine.SignBytesV2{ + signBytes = solomachine.SignBytes{ Sequence: sm.GetHeight().GetRevisionHeight(), Timestamp: sm.Time, Diversifier: sm.Diversifier, diff --git a/modules/light-clients/06-solomachine/misbehaviour.go b/modules/light-clients/06-solomachine/misbehaviour.go index 1d1a5060a95..e023c02df79 100644 --- a/modules/light-clients/06-solomachine/misbehaviour.go +++ b/modules/light-clients/06-solomachine/misbehaviour.go @@ -54,7 +54,7 @@ func (misbehaviour Misbehaviour) ValidateBasic() error { } // ValidateBasic ensures that the signature and data fields are non-empty. -func (sd SignatureAndDataV2) ValidateBasic() error { +func (sd SignatureAndData) ValidateBasic() error { if len(sd.Signature) == 0 { return sdkerrors.Wrap(ErrInvalidSignatureAndData, "signature cannot be empty") } diff --git a/modules/light-clients/06-solomachine/misbehaviour_handle.go b/modules/light-clients/06-solomachine/misbehaviour_handle.go index bb567ec0cb4..80eb3f04097 100644 --- a/modules/light-clients/06-solomachine/misbehaviour_handle.go +++ b/modules/light-clients/06-solomachine/misbehaviour_handle.go @@ -9,13 +9,13 @@ import ( // verifySignatureAndData verifies that the currently registered public key has signed // over the provided data and that the data is valid. The data is valid if it can be // unmarshaled into the specified data type. -func (cs ClientState) verifySignatureAndData(cdc codec.BinaryCodec, misbehaviour *Misbehaviour, sigAndData *SignatureAndDataV2) error { +func (cs ClientState) verifySignatureAndData(cdc codec.BinaryCodec, misbehaviour *Misbehaviour, sigAndData *SignatureAndData) error { // do not check misbehaviour timestamp since we want to allow processing of past misbehaviour if err := cdc.Unmarshal(sigAndData.Path, new(commitmenttypes.MerklePath)); err != nil { return err } - signBytes := SignBytesV2{ + signBytes := SignBytes{ Sequence: misbehaviour.Sequence, Timestamp: sigAndData.Timestamp, Diversifier: cs.ConsensusState.Diversifier, diff --git a/modules/light-clients/06-solomachine/solomachine.pb.go b/modules/light-clients/06-solomachine/solomachine.pb.go index 0ea56245a5e..b2fb6ef30a2 100644 --- a/modules/light-clients/06-solomachine/solomachine.pb.go +++ b/modules/light-clients/06-solomachine/solomachine.pb.go @@ -163,10 +163,10 @@ var xxx_messageInfo_Header proto.InternalMessageInfo // of a sequence and two signatures over different messages at that sequence. type Misbehaviour struct { // ClientID is deprecated - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` // Deprecated: Do not use. - Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - SignatureOne *SignatureAndDataV2 `protobuf:"bytes,3,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty" yaml:"signature_one"` - SignatureTwo *SignatureAndDataV2 `protobuf:"bytes,4,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty" yaml:"signature_two"` + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` // Deprecated: Do not use. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + SignatureOne *SignatureAndData `protobuf:"bytes,3,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty" yaml:"signature_one"` + SignatureTwo *SignatureAndData `protobuf:"bytes,4,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty" yaml:"signature_two"` } func (m *Misbehaviour) Reset() { *m = Misbehaviour{} } @@ -202,27 +202,27 @@ func (m *Misbehaviour) XXX_DiscardUnknown() { var xxx_messageInfo_Misbehaviour proto.InternalMessageInfo -// SignatureAndDataV2 contains a signature and the data signed over to create that +// SignatureAndData contains a signature and the data signed over to create that // signature. -type SignatureAndDataV2 struct { +type SignatureAndData struct { Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` Path []byte `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *SignatureAndDataV2) Reset() { *m = SignatureAndDataV2{} } -func (m *SignatureAndDataV2) String() string { return proto.CompactTextString(m) } -func (*SignatureAndDataV2) ProtoMessage() {} -func (*SignatureAndDataV2) Descriptor() ([]byte, []int) { +func (m *SignatureAndData) Reset() { *m = SignatureAndData{} } +func (m *SignatureAndData) String() string { return proto.CompactTextString(m) } +func (*SignatureAndData) ProtoMessage() {} +func (*SignatureAndData) Descriptor() ([]byte, []int) { return fileDescriptor_141333b361aae010, []int{4} } -func (m *SignatureAndDataV2) XXX_Unmarshal(b []byte) error { +func (m *SignatureAndData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SignatureAndDataV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SignatureAndDataV2.Marshal(b, m, deterministic) + return xxx_messageInfo_SignatureAndData.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -232,17 +232,17 @@ func (m *SignatureAndDataV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *SignatureAndDataV2) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignatureAndDataV2.Merge(m, src) +func (m *SignatureAndData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureAndData.Merge(m, src) } -func (m *SignatureAndDataV2) XXX_Size() int { +func (m *SignatureAndData) XXX_Size() int { return m.Size() } -func (m *SignatureAndDataV2) XXX_DiscardUnknown() { - xxx_messageInfo_SignatureAndDataV2.DiscardUnknown(m) +func (m *SignatureAndData) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureAndData.DiscardUnknown(m) } -var xxx_messageInfo_SignatureAndDataV2 proto.InternalMessageInfo +var xxx_messageInfo_SignatureAndData proto.InternalMessageInfo // TimestampedSignatureData contains the signature data and the timestamp of the // signature. @@ -284,8 +284,8 @@ func (m *TimestampedSignatureData) XXX_DiscardUnknown() { var xxx_messageInfo_TimestampedSignatureData proto.InternalMessageInfo -// SignBytesV2 defines the signed bytes used for signature verification. -type SignBytesV2 struct { +// SignBytes defines the signed bytes used for signature verification. +type SignBytes struct { // the sequence number Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // the proof timestamp @@ -298,18 +298,18 @@ type SignBytesV2 struct { Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` } -func (m *SignBytesV2) Reset() { *m = SignBytesV2{} } -func (m *SignBytesV2) String() string { return proto.CompactTextString(m) } -func (*SignBytesV2) ProtoMessage() {} -func (*SignBytesV2) Descriptor() ([]byte, []int) { +func (m *SignBytes) Reset() { *m = SignBytes{} } +func (m *SignBytes) String() string { return proto.CompactTextString(m) } +func (*SignBytes) ProtoMessage() {} +func (*SignBytes) Descriptor() ([]byte, []int) { return fileDescriptor_141333b361aae010, []int{6} } -func (m *SignBytesV2) XXX_Unmarshal(b []byte) error { +func (m *SignBytes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SignBytesV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SignBytesV2.Marshal(b, m, deterministic) + return xxx_messageInfo_SignBytes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -319,17 +319,17 @@ func (m *SignBytesV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *SignBytesV2) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignBytesV2.Merge(m, src) +func (m *SignBytes) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignBytes.Merge(m, src) } -func (m *SignBytesV2) XXX_Size() int { +func (m *SignBytes) XXX_Size() int { return m.Size() } -func (m *SignBytesV2) XXX_DiscardUnknown() { - xxx_messageInfo_SignBytesV2.DiscardUnknown(m) +func (m *SignBytes) XXX_DiscardUnknown() { + xxx_messageInfo_SignBytes.DiscardUnknown(m) } -var xxx_messageInfo_SignBytesV2 proto.InternalMessageInfo +var xxx_messageInfo_SignBytes proto.InternalMessageInfo // HeaderData returns the SignBytes data for update verification. type HeaderData struct { @@ -377,9 +377,9 @@ func init() { proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.solomachine.v2.ConsensusState") proto.RegisterType((*Header)(nil), "ibc.lightclients.solomachine.v2.Header") proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v2.Misbehaviour") - proto.RegisterType((*SignatureAndDataV2)(nil), "ibc.lightclients.solomachine.v2.SignatureAndDataV2") + proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v2.SignatureAndData") proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v2.TimestampedSignatureData") - proto.RegisterType((*SignBytesV2)(nil), "ibc.lightclients.solomachine.v2.SignBytesV2") + proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v2.SignBytes") proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v2.HeaderData") } @@ -388,57 +388,56 @@ func init() { } var fileDescriptor_141333b361aae010 = []byte{ - // 790 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x3d, 0x6f, 0xdb, 0x46, - 0x18, 0x16, 0x69, 0xda, 0x90, 0x4e, 0xaa, 0xdc, 0x12, 0xb2, 0x41, 0xab, 0x85, 0x28, 0x70, 0x28, - 0xbc, 0x98, 0xac, 0x25, 0xa0, 0x83, 0xbb, 0xd4, 0xb2, 0x51, 0xf4, 0xc3, 0x45, 0x0d, 0xfa, 0x63, - 0xe8, 0x42, 0x1c, 0xc9, 0x13, 0x75, 0x28, 0xc5, 0x53, 0x79, 0x47, 0x09, 0xca, 0x10, 0x04, 0x99, - 0x32, 0x66, 0xcb, 0x1a, 0x04, 0xc8, 0xef, 0xc8, 0x9a, 0x25, 0x80, 0xc7, 0x4c, 0x42, 0x60, 0xff, - 0x03, 0xfd, 0x82, 0x80, 0x47, 0x4a, 0x24, 0x65, 0xc7, 0x06, 0x92, 0x6c, 0x77, 0xef, 0xe7, 0xf3, - 0x3e, 0xf7, 0xbc, 0x24, 0xd8, 0xc7, 0xb6, 0x63, 0xf8, 0xd8, 0x1b, 0x30, 0xc7, 0xc7, 0x28, 0x60, - 0xd4, 0xa0, 0xc4, 0x27, 0x43, 0xe8, 0x0c, 0x70, 0x80, 0x8c, 0x71, 0x27, 0x7f, 0xd5, 0x47, 0x21, - 0x61, 0x44, 0x56, 0xb1, 0xed, 0xe8, 0xf9, 0x14, 0x3d, 0x1f, 0x33, 0xee, 0x34, 0x1b, 0x1e, 0xf1, - 0x08, 0x8f, 0x35, 0xe2, 0x53, 0x92, 0xd6, 0xdc, 0xf1, 0x08, 0xf1, 0x7c, 0x64, 0xf0, 0x9b, 0x1d, - 0x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x3c, 0x82, 0xbe, 0x78, 0x04, 0xfd, 0x30, 0x98, 0xf6, - 0xb6, 0xe6, 0x33, 0xf5, 0xbb, 0x04, 0x44, 0x96, 0xa1, 0x99, 0x95, 0xe4, 0xf2, 0x17, 0x9a, 0xca, - 0x6d, 0x50, 0x75, 0xf1, 0x18, 0x85, 0x14, 0xf7, 0x31, 0x0a, 0x39, 0xed, 0x15, 0x33, 0x6f, 0x92, - 0x7f, 0x00, 0x15, 0x86, 0x87, 0x88, 0x32, 0x38, 0x1c, 0x71, 0x76, 0x25, 0x33, 0x33, 0xa4, 0x20, - 0x9f, 0x8a, 0x60, 0xe3, 0x77, 0x04, 0x5d, 0x14, 0xde, 0xfb, 0xc2, 0x85, 0x52, 0xe2, 0x4a, 0xa9, - 0xd8, 0x4b, 0xb1, 0x17, 0x40, 0x16, 0x85, 0xc9, 0x33, 0xd6, 0xcc, 0xcc, 0x20, 0x5f, 0x80, 0x7a, - 0x80, 0x26, 0x56, 0x6e, 0x70, 0xe9, 0x9e, 0xc1, 0x77, 0xe6, 0x33, 0x75, 0x2b, 0x19, 0xbc, 0x98, - 0xa5, 0x99, 0xb5, 0x00, 0x4d, 0x4e, 0x97, 0xf3, 0x1f, 0x81, 0xcd, 0x38, 0x20, 0xcf, 0xc1, 0x7a, - 0xcc, 0x41, 0x5e, 0x10, 0x2b, 0x01, 0x9a, 0x19, 0x23, 0x39, 0xce, 0x0c, 0x29, 0x09, 0xef, 0x44, - 0x50, 0xfb, 0x1b, 0x53, 0x1b, 0x0d, 0xe0, 0x18, 0x93, 0x28, 0x94, 0xbb, 0xa0, 0x92, 0x88, 0xcf, - 0xc2, 0x2e, 0xe7, 0xa2, 0xd2, 0xdb, 0xce, 0x04, 0xbd, 0x74, 0x69, 0x8a, 0x60, 0x96, 0x93, 0xdb, - 0x1f, 0x6e, 0x81, 0x3f, 0x71, 0x85, 0xbf, 0x10, 0x7c, 0xb3, 0x24, 0xc4, 0x22, 0xc1, 0x42, 0xec, - 0xd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, 0xc2, 0xd5, 0x75, 0x4b, 0xf8, 0x70, 0xdd, 0x12, 0x9e, 0xdf, 0xb4, - 0x4a, 0x57, 0x37, 0xad, 0xd2, 0xfb, 0x9b, 0x56, 0xe9, 0xdf, 0x13, 0x0f, 0xb3, 0x41, 0x64, 0xeb, - 0x0e, 0x19, 0x1a, 0x0e, 0xa1, 0x43, 0x42, 0x0d, 0x6c, 0x3b, 0x7b, 0x1e, 0x31, 0xc6, 0x5d, 0x63, - 0x48, 0xdc, 0xc8, 0x47, 0x34, 0xf9, 0x7f, 0xee, 0x2d, 0x7e, 0xa0, 0x3f, 0xfd, 0xbc, 0x97, 0x13, - 0xf9, 0x2f, 0xb9, 0xb3, 0xbd, 0xc1, 0x67, 0xec, 0x7e, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xf7, - 0xe0, 0x5f, 0x76, 0x07, 0x00, 0x00, + // 784 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x4f, 0xe3, 0x46, + 0x18, 0x8e, 0x8d, 0x41, 0xc9, 0x24, 0x0d, 0xd4, 0x0a, 0xc8, 0xa4, 0x55, 0x1c, 0xf9, 0x50, 0x71, + 0xc1, 0x2e, 0x41, 0xea, 0x81, 0x5e, 0x4a, 0x40, 0x55, 0x3f, 0xa8, 0x8a, 0x0c, 0x5c, 0x7a, 0xb1, + 0xc6, 0xf6, 0xc4, 0x19, 0xd5, 0xf1, 0xb8, 0x9e, 0x71, 0xa2, 0x54, 0x3d, 0x54, 0x3d, 0xf5, 0xd8, + 0x4b, 0xef, 0x55, 0xa5, 0xfe, 0x8e, 0x5e, 0x77, 0x6f, 0x1c, 0xf7, 0x14, 0xad, 0xe0, 0x1f, 0xe4, + 0x17, 0xac, 0x3c, 0x76, 0xe2, 0x0f, 0x58, 0x90, 0x76, 0xf7, 0x36, 0xf3, 0x7e, 0x3e, 0xef, 0x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0x70, 0xc4, 0x50, 0x64, 0x85, 0x11, 0x09, 0x09, 0x85, + 0xbe, 0x22, 0x71, 0xe8, 0x9f, 0x2d, 0x17, 0xaa, 0x96, 0x16, 0x7c, 0x22, 0x58, 0x33, 0x15, 0xee, + 0xbd, 0xe1, 0xce, 0xd3, 0xc4, 0x77, 0x99, 0xb9, 0x4e, 0xa4, 0x3f, 0xff, 0x51, 0x6b, 0xda, 0xbf, + 0x02, 0x68, 0x97, 0xb1, 0xca, 0xdf, 0x01, 0x10, 0xc6, 0xb6, 0x8f, 0x1d, 0xeb, 0x67, 0x34, 0xe7, + 0x34, 0x36, 0x07, 0x1d, 0x3d, 0x7d, 0x04, 0x7d, 0xf5, 0x08, 0xfa, 0x69, 0x30, 0x1f, 0xee, 0x2e, + 0x17, 0xea, 0xc7, 0x29, 0x88, 0x3c, 0x43, 0x33, 0x1b, 0xe9, 0xe5, 0x7b, 0x34, 0x97, 0xfb, 0xa0, + 0xe9, 0xe2, 0x29, 0x8a, 0x28, 0x1e, 0x61, 0x14, 0x71, 0xda, 0x1b, 0x66, 0xd1, 0x24, 0x7f, 0x0a, + 0x1a, 0x0c, 0x4f, 0x10, 0x65, 0x70, 0x12, 0x72, 0x76, 0x25, 0x33, 0x37, 0x64, 0x20, 0xff, 0x10, + 0xc1, 0xd6, 0x37, 0x08, 0xba, 0x28, 0x7a, 0xf2, 0x85, 0x4b, 0xa5, 0xc4, 0x4a, 0xa9, 0xc4, 0x4b, + 0xb1, 0x17, 0x40, 0x16, 0x47, 0xe9, 0x33, 0xb6, 0xcc, 0xdc, 0x20, 0xdf, 0x80, 0x76, 0x80, 0x66, + 0x56, 0x61, 0x70, 0xe9, 0x89, 0xc1, 0xf7, 0x97, 0x0b, 0x75, 0x37, 0x1d, 0xbc, 0x9c, 0xa5, 0x99, + 0xad, 0x00, 0xcd, 0x2e, 0xd7, 0xf3, 0x9f, 0x81, 0xed, 0x24, 0xa0, 0xc8, 0xc1, 0x66, 0xc2, 0x41, + 0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, 0xbe, 0xc7, 0x52, 0x55, 0xf6, 0x7b, 0xe3, 0xe1, 0x7e, 0xaf, + 0x88, 0x93, 0x1e, 0x21, 0x6e, 0x33, 0x27, 0x2e, 0xc3, 0xf5, 0x9f, 0x00, 0x40, 0xba, 0xe9, 0x7c, + 0x94, 0x0b, 0xd0, 0xcc, 0xf6, 0xeb, 0xd9, 0x6f, 0x51, 0x22, 0x7d, 0xb9, 0xb4, 0x92, 0xd9, 0xc7, + 0x28, 0xdd, 0xc7, 0xb7, 0x2c, 0xa3, 0xf8, 0x6e, 0xcb, 0x38, 0x1c, 0xbd, 0xb8, 0xeb, 0x09, 0xb7, + 0x77, 0x3d, 0xe1, 0xf5, 0x5d, 0x4f, 0xf8, 0xeb, 0xbe, 0x57, 0xbb, 0xbd, 0xef, 0xd5, 0x5e, 0xdd, + 0xf7, 0x6a, 0x3f, 0x5d, 0x78, 0x98, 0x8d, 0x63, 0x5b, 0x77, 0xc8, 0xc4, 0x70, 0x08, 0x9d, 0x10, + 0x6a, 0x60, 0xdb, 0x39, 0xf4, 0x88, 0x31, 0x3d, 0x36, 0x26, 0xc4, 0x8d, 0x7d, 0x44, 0xd3, 0xff, + 0xe6, 0xe1, 0xea, 0xc7, 0xf9, 0xf9, 0x17, 0x87, 0x05, 0x79, 0x7f, 0x59, 0x38, 0xdb, 0x5b, 0x7c, + 0xc6, 0xe3, 0x37, 0x01, 0x00, 0x00, 0xff, 0xff, 0x72, 0x66, 0x37, 0x98, 0x6e, 0x07, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { @@ -666,7 +665,7 @@ func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SignatureAndDataV2) Marshal() (dAtA []byte, err error) { +func (m *SignatureAndData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -676,12 +675,12 @@ func (m *SignatureAndDataV2) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignatureAndDataV2) MarshalTo(dAtA []byte) (int, error) { +func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SignatureAndDataV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -750,7 +749,7 @@ func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *SignBytesV2) Marshal() (dAtA []byte, err error) { +func (m *SignBytes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -760,12 +759,12 @@ func (m *SignBytesV2) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignBytesV2) MarshalTo(dAtA []byte) (int, error) { +func (m *SignBytes) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SignBytesV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SignBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -950,7 +949,7 @@ func (m *Misbehaviour) Size() (n int) { return n } -func (m *SignatureAndDataV2) Size() (n int) { +func (m *SignatureAndData) Size() (n int) { if m == nil { return 0 } @@ -990,7 +989,7 @@ func (m *TimestampedSignatureData) Size() (n int) { return n } -func (m *SignBytesV2) Size() (n int) { +func (m *SignBytes) Size() (n int) { if m == nil { return 0 } @@ -1622,7 +1621,7 @@ func (m *Misbehaviour) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.SignatureOne == nil { - m.SignatureOne = &SignatureAndDataV2{} + m.SignatureOne = &SignatureAndData{} } if err := m.SignatureOne.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1658,7 +1657,7 @@ func (m *Misbehaviour) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.SignatureTwo == nil { - m.SignatureTwo = &SignatureAndDataV2{} + m.SignatureTwo = &SignatureAndData{} } if err := m.SignatureTwo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1685,7 +1684,7 @@ func (m *Misbehaviour) Unmarshal(dAtA []byte) error { } return nil } -func (m *SignatureAndDataV2) Unmarshal(dAtA []byte) error { +func (m *SignatureAndData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1708,10 +1707,10 @@ func (m *SignatureAndDataV2) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignatureAndDataV2: wiretype end group for non-group") + return fmt.Errorf("proto: SignatureAndData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignatureAndDataV2: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignatureAndData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1959,7 +1958,7 @@ func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error { } return nil } -func (m *SignBytesV2) Unmarshal(dAtA []byte) error { +func (m *SignBytes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1982,10 +1981,10 @@ func (m *SignBytesV2) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignBytesV2: wiretype end group for non-group") + return fmt.Errorf("proto: SignBytes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignBytesV2: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignBytes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/modules/light-clients/06-solomachine/update.go b/modules/light-clients/06-solomachine/update.go index f5a7c4c9a55..c3160d2d267 100644 --- a/modules/light-clients/06-solomachine/update.go +++ b/modules/light-clients/06-solomachine/update.go @@ -54,7 +54,7 @@ func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clien return err } - signBytes := &SignBytesV2{ + signBytes := &SignBytes{ Sequence: header.Sequence, Timestamp: header.Timestamp, Diversifier: header.NewDiversifier, diff --git a/modules/light-clients/06-solomachine/update_test.go b/modules/light-clients/06-solomachine/update_test.go index 282b7edb47f..8832b8c8ace 100644 --- a/modules/light-clients/06-solomachine/update_test.go +++ b/modules/light-clients/06-solomachine/update_test.go @@ -101,7 +101,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { suite.Require().NoError(err) // generate invalid signature - signBytes := &solomachine.SignBytesV2{ + signBytes := &solomachine.SignBytes{ Sequence: cs.Sequence, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -258,7 +258,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { m := sm.CreateMisbehaviour() msg := []byte("DATA ONE") - signBytes := &solomachine.SignBytesV2{ + signBytes := &solomachine.SignBytes{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -284,7 +284,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { m := sm.CreateMisbehaviour() msg := []byte("DATA TWO") - signBytes := &solomachine.SignBytesV2{ + signBytes := &solomachine.SignBytes{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -341,7 +341,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { // Signature One msg := []byte("DATA ONE") // sequence used is plus 1 - signBytes := &solomachine.SignBytesV2{ + signBytes := &solomachine.SignBytes{ Sequence: sm.Sequence + 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, @@ -361,7 +361,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { msg = []byte("DATA TWO") // sequence used is minus 1 - signBytes = &solomachine.SignBytesV2{ + signBytes = &solomachine.SignBytes{ Sequence: sm.Sequence - 1, Timestamp: sm.Time, Diversifier: sm.Diversifier, diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index 6c03acae18e..313b3b66508 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -52,15 +52,15 @@ message Misbehaviour { option (gogoproto.goproto_getters) = false; // ClientID is deprecated - string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndDataV2 signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndDataV2 signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; + string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; } -// SignatureAndDataV2 contains a signature and the data signed over to create that +// SignatureAndData contains a signature and the data signed over to create that // signature. -message SignatureAndDataV2 { +message SignatureAndData { option (gogoproto.goproto_getters) = false; bytes signature = 1; bytes path = 2; @@ -76,8 +76,8 @@ message TimestampedSignatureData { uint64 timestamp = 2; } -// SignBytesV2 defines the signed bytes used for signature verification. -message SignBytesV2 { +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { option (gogoproto.goproto_getters) = false; // the sequence number diff --git a/testing/solomachine.go b/testing/solomachine.go index ee54c64b1ba..bb0d43c97b7 100644 --- a/testing/solomachine.go +++ b/testing/solomachine.go @@ -122,7 +122,7 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { dataBz, err := solo.cdc.Marshal(data) require.NoError(solo.t, err) - signBytes := &solomachinetypes.SignBytesV2{ + signBytes := &solomachinetypes.SignBytes{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, @@ -162,7 +162,7 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { data, err := solo.cdc.Marshal(solo.ClientState()) require.NoError(solo.t, err) - signBytes := &solomachinetypes.SignBytesV2{ + signBytes := &solomachinetypes.SignBytes{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, @@ -174,7 +174,7 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { require.NoError(solo.t, err) sig := solo.GenerateSignature(bz) - signatureOne := solomachinetypes.SignatureAndDataV2{ + signatureOne := solomachinetypes.SignatureAndData{ Signature: sig, Path: path, Data: data, @@ -191,7 +191,7 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { data, err = solo.cdc.Marshal(solo.ConsensusState()) require.NoError(solo.t, err) - signBytes = &solomachinetypes.SignBytesV2{ + signBytes = &solomachinetypes.SignBytes{ Sequence: solo.Sequence, Timestamp: solo.Time, Diversifier: solo.Diversifier, @@ -203,7 +203,7 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { require.NoError(solo.t, err) sig = solo.GenerateSignature(bz) - signatureTwo := solomachinetypes.SignatureAndDataV2{ + signatureTwo := solomachinetypes.SignatureAndData{ Signature: sig, Path: path, Data: data, From 4cb9308c9ef9a285ad4fabf44fdb9c311a11007e Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 1 Aug 2022 15:49:15 +0200 Subject: [PATCH 08/11] use current diversifier when verifying header details --- modules/light-clients/06-solomachine/update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/light-clients/06-solomachine/update.go b/modules/light-clients/06-solomachine/update.go index c3160d2d267..d514603f784 100644 --- a/modules/light-clients/06-solomachine/update.go +++ b/modules/light-clients/06-solomachine/update.go @@ -57,7 +57,7 @@ func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clien signBytes := &SignBytes{ Sequence: header.Sequence, Timestamp: header.Timestamp, - Diversifier: header.NewDiversifier, + Diversifier: cs.ConsensusState.Diversifier, Path: []byte{}, Data: dataBz, } From 8bfdfdb316d11d615a700ddcbbb5c0abfe2b97e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:09:50 +0200 Subject: [PATCH 09/11] Add test for new diversifier for solomachine (#1860) * add test for successful new diversifier * add changelog entry * fix tests --- CHANGELOG.md | 1 + modules/core/02-client/types/codec_test.go | 2 +- modules/core/02-client/types/msgs_test.go | 5 +-- .../06-solomachine/header_test.go | 2 +- .../06-solomachine/update_test.go | 31 ++++++++++++------- testing/solomachine.go | 8 +++-- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c670b35a8c9..370a4731e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (light-clients/solomachine) [#1839](https://github.com/cosmos/ibc-go/issues/1839) Fixed usage of the new diversifier in validation of changing diversifiers for the solo machine. The current diversifier must sign over the new diversifier. * (modules/core/04-channel) [\#1130](https://github.com/cosmos/ibc-go/pull/1130) Call `packet.GetSequence()` rather than passing func in `WriteAcknowledgement` log output * (apps/29-fee) [\#1278](https://github.com/cosmos/ibc-go/pull/1278) The URI path for the query to get all incentivized packets for a specifc channel did not follow the same format as the rest of queries. * (07-tendermint) [\#1674](https://github.com/cosmos/ibc-go/pull/1674) Submitted ClientState is zeroed out before checking the proof in order to prevent the proposal from containing information governance is not actually voting on. diff --git a/modules/core/02-client/types/codec_test.go b/modules/core/02-client/types/codec_test.go index 2db68dbb244..5dd9b99620c 100644 --- a/modules/core/02-client/types/codec_test.go +++ b/modules/core/02-client/types/codec_test.go @@ -118,7 +118,7 @@ func (suite *TypesTestSuite) TestPackClientMessage() { }{ { "solo machine header", - ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2).CreateHeader(), + ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2).CreateHeader("solomachine"), true, }, { diff --git a/modules/core/02-client/types/msgs_test.go b/modules/core/02-client/types/msgs_test.go index c51ebfce957..03148e73686 100644 --- a/modules/core/02-client/types/msgs_test.go +++ b/modules/core/02-client/types/msgs_test.go @@ -204,7 +204,7 @@ func (suite *TypesTestSuite) TestMarshalMsgUpdateClient() { { "solo machine client", func() { soloMachine := ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2) - msg, err = types.NewMsgUpdateClient(soloMachine.ClientID, soloMachine.CreateHeader(), suite.chainA.SenderAccount.GetAddress().String()) + msg, err = types.NewMsgUpdateClient(soloMachine.ClientID, soloMachine.CreateHeader(soloMachine.Diversifier), suite.chainA.SenderAccount.GetAddress().String()) suite.Require().NoError(err) }, }, @@ -293,7 +293,8 @@ func (suite *TypesTestSuite) TestMsgUpdateClient_ValidateBasic() { "valid - solomachine header", func() { soloMachine := ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2) - msg, err = types.NewMsgUpdateClient(soloMachine.ClientID, soloMachine.CreateHeader(), suite.chainA.SenderAccount.GetAddress().String()) + msg, err = types.NewMsgUpdateClient(soloMachine.ClientID, soloMachine.CreateHeader(soloMachine.Diversifier), suite.chainA.SenderAccount.GetAddress().String()) + suite.Require().NoError(err) }, true, diff --git a/modules/light-clients/06-solomachine/header_test.go b/modules/light-clients/06-solomachine/header_test.go index 5b02b41c555..a2b96ea7d62 100644 --- a/modules/light-clients/06-solomachine/header_test.go +++ b/modules/light-clients/06-solomachine/header_test.go @@ -10,7 +10,7 @@ func (suite *SoloMachineTestSuite) TestHeaderValidateBasic() { // test singlesig and multisig public keys for _, sm := range []*ibctesting.Solomachine{suite.solomachine, suite.solomachineMulti} { - header := sm.CreateHeader() + header := sm.CreateHeader(sm.Diversifier) cases := []struct { name string diff --git a/modules/light-clients/06-solomachine/update_test.go b/modules/light-clients/06-solomachine/update_test.go index 8832b8c8ace..e205886bc25 100644 --- a/modules/light-clients/06-solomachine/update_test.go +++ b/modules/light-clients/06-solomachine/update_test.go @@ -29,7 +29,14 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { { "successful header", func() { - clientMsg = sm.CreateHeader() + clientMsg = sm.CreateHeader(sm.Diversifier) + }, + true, + }, + { + "successful header with new diversifier", + func() { + clientMsg = sm.CreateHeader(sm.Diversifier + "0") }, true, }, @@ -51,7 +58,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { "wrong sequence in header", func() { // store in temp before assigning to interface type - h := sm.CreateHeader() + h := sm.CreateHeader(sm.Diversifier) h.Sequence++ clientMsg = h }, @@ -60,7 +67,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { { "invalid header Signature", func() { - h := sm.CreateHeader() + h := sm.CreateHeader(sm.Diversifier) h.Signature = suite.GetInvalidProof() clientMsg = h }, false, @@ -68,7 +75,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { { "invalid timestamp in header", func() { - h := sm.CreateHeader() + h := sm.CreateHeader(sm.Diversifier) h.Timestamp-- clientMsg = h }, false, @@ -78,7 +85,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { func() { sm.Sequence++ - clientMsg = sm.CreateHeader() + clientMsg = sm.CreateHeader(sm.Diversifier) }, false, }, @@ -87,7 +94,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { func() { // store in temp before assinging to interface type cs := sm.ClientState() - h := sm.CreateHeader() + h := sm.CreateHeader(sm.Diversifier) publicKey, err := codectypes.NewAnyWithValue(sm.PublicKey) suite.NoError(err) @@ -128,7 +135,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { // store in temp before assinging to interface type cs := sm.ClientState() oldPubKey := sm.PublicKey - h := sm.CreateHeader() + h := sm.CreateHeader(sm.Diversifier) // generate invalid signature data := append(sdk.Uint64ToBigEndian(cs.Sequence), oldPubKey.Bytes()...) @@ -144,7 +151,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() { "consensus state public key is nil - header", func() { clientState.ConsensusState.PublicKey = nil - clientMsg = sm.CreateHeader() + clientMsg = sm.CreateHeader(sm.Diversifier) }, false, }, @@ -309,7 +316,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { badMisbehaviour := sm.CreateMisbehaviour() // update public key to a new one - sm.CreateHeader() + sm.CreateHeader(sm.Diversifier) m := sm.CreateMisbehaviour() // set SignatureOne to use the wrong signature @@ -323,7 +330,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageMisbehaviour() { badMisbehaviour := sm.CreateMisbehaviour() // update public key to a new one - sm.CreateHeader() + sm.CreateHeader(sm.Diversifier) m := sm.CreateMisbehaviour() // set SignatureTwo to use the wrong signature @@ -421,7 +428,7 @@ func (suite *SoloMachineTestSuite) TestUpdateState() { "successful update", func() { clientState = sm.ClientState() - clientMsg = sm.CreateHeader() + clientMsg = sm.CreateHeader(sm.Diversifier) }, true, }, @@ -491,7 +498,7 @@ func (suite *SoloMachineTestSuite) TestCheckForMisbehaviour() { { "normal header returns false", func() { - clientMsg = sm.CreateHeader() + clientMsg = sm.CreateHeader(sm.Diversifier) }, false, }, diff --git a/testing/solomachine.go b/testing/solomachine.go index bb0d43c97b7..f0cd445d1db 100644 --- a/testing/solomachine.go +++ b/testing/solomachine.go @@ -107,7 +107,8 @@ func (solo *Solomachine) GetHeight() exported.Height { // CreateHeader generates a new private/public key pair and creates the // necessary signature to construct a valid solo machine header. -func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { +// A new diversifier will be used as well +func (solo *Solomachine) CreateHeader(newDiversifier string) *solomachinetypes.Header { // generate new private keys and signature for header newPrivKeys, newPubKeys, newPubKey := GenerateKeys(solo.t, uint64(len(solo.PrivateKeys))) @@ -116,7 +117,7 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { data := &solomachinetypes.HeaderData{ NewPubKey: publicKey, - NewDiversifier: solo.Diversifier, + NewDiversifier: newDiversifier, } dataBz, err := solo.cdc.Marshal(data) @@ -140,7 +141,7 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { Timestamp: solo.Time, Signature: sig, NewPublicKey: publicKey, - NewDiversifier: solo.Diversifier, + NewDiversifier: newDiversifier, } // assumes successful header update @@ -148,6 +149,7 @@ func (solo *Solomachine) CreateHeader() *solomachinetypes.Header { solo.PrivateKeys = newPrivKeys solo.PublicKeys = newPubKeys solo.PublicKey = newPubKey + solo.Diversifier = newDiversifier return header } From 0167cccff81de25d7da4be4ff186f8cd0629593a Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 2 Aug 2022 16:30:29 +0200 Subject: [PATCH 10/11] restoring solomachine/v2 protos, updadting v2 codegen path and adding solomachine/v3 protobuf defs --- docs/ibc/proto-docs.md | 344 +- .../02-client/migrations/v6/solomachine.pb.go | 4127 +++++++++++++++++ .../06-solomachine/solomachine.pb.go | 110 +- .../solomachine/v2/solomachine.proto | 124 +- .../solomachine/v3/solomachine.proto | 103 + testing/sdk_test.go | 279 -- 6 files changed, 4731 insertions(+), 356 deletions(-) create mode 100644 modules/core/02-client/migrations/v6/solomachine.pb.go create mode 100644 proto/ibc/lightclients/solomachine/v3/solomachine.proto delete mode 100644 testing/sdk_test.go diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index bc6bf559631..4cde071460e 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -307,15 +307,35 @@ - [DataType](#ibc.lightclients.solomachine.v1.DataType) - [ibc/lightclients/solomachine/v2/solomachine.proto](#ibc/lightclients/solomachine/v2/solomachine.proto) + - [ChannelStateData](#ibc.lightclients.solomachine.v2.ChannelStateData) - [ClientState](#ibc.lightclients.solomachine.v2.ClientState) + - [ClientStateData](#ibc.lightclients.solomachine.v2.ClientStateData) + - [ConnectionStateData](#ibc.lightclients.solomachine.v2.ConnectionStateData) - [ConsensusState](#ibc.lightclients.solomachine.v2.ConsensusState) + - [ConsensusStateData](#ibc.lightclients.solomachine.v2.ConsensusStateData) - [Header](#ibc.lightclients.solomachine.v2.Header) - [HeaderData](#ibc.lightclients.solomachine.v2.HeaderData) - [Misbehaviour](#ibc.lightclients.solomachine.v2.Misbehaviour) + - [NextSequenceRecvData](#ibc.lightclients.solomachine.v2.NextSequenceRecvData) + - [PacketAcknowledgementData](#ibc.lightclients.solomachine.v2.PacketAcknowledgementData) + - [PacketCommitmentData](#ibc.lightclients.solomachine.v2.PacketCommitmentData) + - [PacketReceiptAbsenceData](#ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData) - [SignBytes](#ibc.lightclients.solomachine.v2.SignBytes) - [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) - [TimestampedSignatureData](#ibc.lightclients.solomachine.v2.TimestampedSignatureData) + - [DataType](#ibc.lightclients.solomachine.v2.DataType) + +- [ibc/lightclients/solomachine/v3/solomachine.proto](#ibc/lightclients/solomachine/v3/solomachine.proto) + - [ClientState](#ibc.lightclients.solomachine.v3.ClientState) + - [ConsensusState](#ibc.lightclients.solomachine.v3.ConsensusState) + - [Header](#ibc.lightclients.solomachine.v3.Header) + - [HeaderData](#ibc.lightclients.solomachine.v3.HeaderData) + - [Misbehaviour](#ibc.lightclients.solomachine.v3.Misbehaviour) + - [SignBytes](#ibc.lightclients.solomachine.v3.SignBytes) + - [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData) + - [TimestampedSignatureData](#ibc.lightclients.solomachine.v3.TimestampedSignatureData) + - [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) @@ -4482,6 +4502,23 @@ to preserve uniqueness of different data sign byte encodings. + + +### ChannelStateData +ChannelStateData returns the SignBytes data for channel state +verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `channel` | [ibc.core.channel.v1.Channel](#ibc.core.channel.v1.Channel) | | | + + + + + + ### ClientState @@ -4501,6 +4538,39 @@ state and if the client is frozen. + + +### ClientStateData +ClientStateData returns the SignBytes data for client state verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### ConnectionStateData +ConnectionStateData returns the SignBytes data for connection state +verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `connection` | [ibc.core.connection.v1.ConnectionEnd](#ibc.core.connection.v1.ConnectionEnd) | | | + + + + + + ### ConsensusState @@ -4520,6 +4590,23 @@ consensus state. + + +### ConsensusStateData +ConsensusStateData returns the SignBytes data for consensus state +verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + ### Header @@ -4564,7 +4651,7 @@ of a sequence and two signatures over different messages at that sequence. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated | +| `client_id` | [string](#string) | | | | `sequence` | [uint64](#uint64) | | | | `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | | `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v2.SignatureAndData) | | | @@ -4574,12 +4661,263 @@ of a sequence and two signatures over different messages at that sequence. + + +### NextSequenceRecvData +NextSequenceRecvData returns the SignBytes data for verification of the next +sequence to be received. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `next_seq_recv` | [uint64](#uint64) | | | + + + + + + + + +### PacketAcknowledgementData +PacketAcknowledgementData returns the SignBytes data for acknowledgement +verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `acknowledgement` | [bytes](#bytes) | | | + + + + + + + + +### PacketCommitmentData +PacketCommitmentData returns the SignBytes data for packet commitment +verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | +| `commitment` | [bytes](#bytes) | | | + + + + + + + + +### PacketReceiptAbsenceData +PacketReceiptAbsenceData returns the SignBytes data for +packet receipt absence verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [bytes](#bytes) | | | + + + + + + ### SignBytes SignBytes defines the signed bytes used for signature verification. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | | +| `timestamp` | [uint64](#uint64) | | | +| `diversifier` | [string](#string) | | | +| `data_type` | [DataType](#ibc.lightclients.solomachine.v2.DataType) | | type of the data used | +| `data` | [bytes](#bytes) | | marshaled data | + + + + + + + + +### SignatureAndData +SignatureAndData contains a signature and the data signed over to create that +signature. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signature` | [bytes](#bytes) | | | +| `data_type` | [DataType](#ibc.lightclients.solomachine.v2.DataType) | | | +| `data` | [bytes](#bytes) | | | +| `timestamp` | [uint64](#uint64) | | | + + + + + + + + +### TimestampedSignatureData +TimestampedSignatureData contains the signature data and the timestamp of the +signature. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signature_data` | [bytes](#bytes) | | | +| `timestamp` | [uint64](#uint64) | | | + + + + + + + + + + +### DataType +DataType defines the type of solo machine proof being created. This is done +to preserve uniqueness of different data sign byte encodings. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| DATA_TYPE_UNINITIALIZED_UNSPECIFIED | 0 | Default State | +| DATA_TYPE_CLIENT_STATE | 1 | Data type for client state verification | +| DATA_TYPE_CONSENSUS_STATE | 2 | Data type for consensus state verification | +| DATA_TYPE_CONNECTION_STATE | 3 | Data type for connection state verification | +| DATA_TYPE_CHANNEL_STATE | 4 | Data type for channel state verification | +| DATA_TYPE_PACKET_COMMITMENT | 5 | Data type for packet commitment verification | +| DATA_TYPE_PACKET_ACKNOWLEDGEMENT | 6 | Data type for packet acknowledgement verification | +| DATA_TYPE_PACKET_RECEIPT_ABSENCE | 7 | Data type for packet receipt absence verification | +| DATA_TYPE_NEXT_SEQUENCE_RECV | 8 | Data type for next sequence recv verification | +| DATA_TYPE_HEADER | 9 | Data type for header verification | + + + + + + + + + + + +

Top

+ +## ibc/lightclients/solomachine/v3/solomachine.proto + + + + + +### ClientState +ClientState defines a solo machine client that tracks the current consensus +state and if the client is frozen. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | latest sequence of the client state | +| `is_frozen` | [bool](#bool) | | frozen sequence of the solo machine | +| `consensus_state` | [ConsensusState](#ibc.lightclients.solomachine.v3.ConsensusState) | | | +| `allow_update_after_proposal` | [bool](#bool) | | when set to true, will allow governance to update a solo machine client. The client will be unfrozen if it is frozen. | + + + + + + + + +### ConsensusState +ConsensusState defines a solo machine consensus state. The sequence of a +consensus state is contained in the "height" key used in storing the +consensus state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public key of the solo machine | +| `diversifier` | [string](#string) | | diversifier allows the same public key to be re-used across different solo machine clients (potentially on different chains) without being considered misbehaviour. | +| `timestamp` | [uint64](#uint64) | | | + + + + + + + + +### Header +Header defines a solo machine consensus header + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | sequence to update solo machine public key at | +| `timestamp` | [uint64](#uint64) | | | +| `signature` | [bytes](#bytes) | | | +| `new_public_key` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `new_diversifier` | [string](#string) | | | + + + + + + + + +### HeaderData +HeaderData returns the SignBytes data for update verification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `new_pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | header public key | +| `new_diversifier` | [string](#string) | | header diversifier | + + + + + + + + +### Misbehaviour +Misbehaviour defines misbehaviour for a solo machine which consists +of a sequence and two signatures over different messages at that sequence. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | **Deprecated.** ClientID is deprecated | +| `sequence` | [uint64](#uint64) | | | +| `signature_one` | [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData) | | | +| `signature_two` | [SignatureAndData](#ibc.lightclients.solomachine.v3.SignatureAndData) | | | + + + + + + + + +### SignBytes +SignBytes defines the signed bytes used for signature verification. + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `sequence` | [uint64](#uint64) | | the sequence number | @@ -4593,7 +4931,7 @@ SignBytes defines the signed bytes used for signature verification. - + ### SignatureAndData SignatureAndData contains a signature and the data signed over to create that @@ -4612,7 +4950,7 @@ signature. - + ### TimestampedSignatureData TimestampedSignatureData contains the signature data and the timestamp of the diff --git a/modules/core/02-client/migrations/v6/solomachine.pb.go b/modules/core/02-client/migrations/v6/solomachine.pb.go new file mode 100644 index 00000000000..c92f04029f2 --- /dev/null +++ b/modules/core/02-client/migrations/v6/solomachine.pb.go @@ -0,0 +1,4127 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/lightclients/solomachine/v2/solomachine.proto + +package v6 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" + types2 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// DataType defines the type of solo machine proof being created. This is done +// to preserve uniqueness of different data sign byte encodings. +type DataType int32 + +const ( + // Default State + UNSPECIFIED DataType = 0 + // Data type for client state verification + CLIENT DataType = 1 + // Data type for consensus state verification + CONSENSUS DataType = 2 + // Data type for connection state verification + CONNECTION DataType = 3 + // Data type for channel state verification + CHANNEL DataType = 4 + // Data type for packet commitment verification + PACKETCOMMITMENT DataType = 5 + // Data type for packet acknowledgement verification + PACKETACKNOWLEDGEMENT DataType = 6 + // Data type for packet receipt absence verification + PACKETRECEIPTABSENCE DataType = 7 + // Data type for next sequence recv verification + NEXTSEQUENCERECV DataType = 8 + // Data type for header verification + HEADER DataType = 9 +) + +var DataType_name = map[int32]string{ + 0: "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + 1: "DATA_TYPE_CLIENT_STATE", + 2: "DATA_TYPE_CONSENSUS_STATE", + 3: "DATA_TYPE_CONNECTION_STATE", + 4: "DATA_TYPE_CHANNEL_STATE", + 5: "DATA_TYPE_PACKET_COMMITMENT", + 6: "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + 7: "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + 8: "DATA_TYPE_NEXT_SEQUENCE_RECV", + 9: "DATA_TYPE_HEADER", +} + +var DataType_value = map[string]int32{ + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": 0, + "DATA_TYPE_CLIENT_STATE": 1, + "DATA_TYPE_CONSENSUS_STATE": 2, + "DATA_TYPE_CONNECTION_STATE": 3, + "DATA_TYPE_CHANNEL_STATE": 4, + "DATA_TYPE_PACKET_COMMITMENT": 5, + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": 6, + "DATA_TYPE_PACKET_RECEIPT_ABSENCE": 7, + "DATA_TYPE_NEXT_SEQUENCE_RECV": 8, + "DATA_TYPE_HEADER": 9, +} + +func (x DataType) String() string { + return proto.EnumName(DataType_name, int32(x)) +} + +func (DataType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{0} +} + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +type ClientState struct { + // latest sequence of the client state + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + // frozen sequence of the solo machine + IsFrozen bool `protobuf:"varint,2,opt,name=is_frozen,json=isFrozen,proto3" json:"is_frozen,omitempty" yaml:"is_frozen"` + ConsensusState *ConsensusState `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` + // when set to true, will allow governance to update a solo machine client. + // The client will be unfrozen if it is frozen. + AllowUpdateAfterProposal bool `protobuf:"varint,4,opt,name=allow_update_after_proposal,json=allowUpdateAfterProposal,proto3" json:"allow_update_after_proposal,omitempty" yaml:"allow_update_after_proposal"` +} + +func (m *ClientState) Reset() { *m = ClientState{} } +func (m *ClientState) String() string { return proto.CompactTextString(m) } +func (*ClientState) ProtoMessage() {} +func (*ClientState) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{0} +} +func (m *ClientState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientState.Merge(m, src) +} +func (m *ClientState) XXX_Size() int { + return m.Size() +} +func (m *ClientState) XXX_DiscardUnknown() { + xxx_messageInfo_ClientState.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientState proto.InternalMessageInfo + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +type ConsensusState struct { + // public key of the solo machine + PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" yaml:"public_key"` + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + Diversifier string `protobuf:"bytes,2,opt,name=diversifier,proto3" json:"diversifier,omitempty"` + Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *ConsensusState) Reset() { *m = ConsensusState{} } +func (m *ConsensusState) String() string { return proto.CompactTextString(m) } +func (*ConsensusState) ProtoMessage() {} +func (*ConsensusState) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{1} +} +func (m *ConsensusState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusState.Merge(m, src) +} +func (m *ConsensusState) XXX_Size() int { + return m.Size() +} +func (m *ConsensusState) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusState.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusState proto.InternalMessageInfo + +// Header defines a solo machine consensus header +type Header struct { + // sequence to update solo machine public key at + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` + NewPublicKey *types.Any `protobuf:"bytes,4,opt,name=new_public_key,json=newPublicKey,proto3" json:"new_public_key,omitempty" yaml:"new_public_key"` + NewDiversifier string `protobuf:"bytes,5,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty" yaml:"new_diversifier"` +} + +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{2} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(m, src) +} +func (m *Header) XXX_Size() int { + return m.Size() +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +type Misbehaviour struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + SignatureOne *SignatureAndData `protobuf:"bytes,3,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty" yaml:"signature_one"` + SignatureTwo *SignatureAndData `protobuf:"bytes,4,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty" yaml:"signature_two"` +} + +func (m *Misbehaviour) Reset() { *m = Misbehaviour{} } +func (m *Misbehaviour) String() string { return proto.CompactTextString(m) } +func (*Misbehaviour) ProtoMessage() {} +func (*Misbehaviour) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{3} +} +func (m *Misbehaviour) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Misbehaviour.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Misbehaviour) XXX_Merge(src proto.Message) { + xxx_messageInfo_Misbehaviour.Merge(m, src) +} +func (m *Misbehaviour) XXX_Size() int { + return m.Size() +} +func (m *Misbehaviour) XXX_DiscardUnknown() { + xxx_messageInfo_Misbehaviour.DiscardUnknown(m) +} + +var xxx_messageInfo_Misbehaviour proto.InternalMessageInfo + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +type SignatureAndData struct { + Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + DataType DataType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=ibc.lightclients.solomachine.v2.DataType" json:"data_type,omitempty" yaml:"data_type"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *SignatureAndData) Reset() { *m = SignatureAndData{} } +func (m *SignatureAndData) String() string { return proto.CompactTextString(m) } +func (*SignatureAndData) ProtoMessage() {} +func (*SignatureAndData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{4} +} +func (m *SignatureAndData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignatureAndData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SignatureAndData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureAndData.Merge(m, src) +} +func (m *SignatureAndData) XXX_Size() int { + return m.Size() +} +func (m *SignatureAndData) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureAndData.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureAndData proto.InternalMessageInfo + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +type TimestampedSignatureData struct { + SignatureData []byte `protobuf:"bytes,1,opt,name=signature_data,json=signatureData,proto3" json:"signature_data,omitempty" yaml:"signature_data"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *TimestampedSignatureData) Reset() { *m = TimestampedSignatureData{} } +func (m *TimestampedSignatureData) String() string { return proto.CompactTextString(m) } +func (*TimestampedSignatureData) ProtoMessage() {} +func (*TimestampedSignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{5} +} +func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TimestampedSignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TimestampedSignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimestampedSignatureData.Merge(m, src) +} +func (m *TimestampedSignatureData) XXX_Size() int { + return m.Size() +} +func (m *TimestampedSignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_TimestampedSignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_TimestampedSignatureData proto.InternalMessageInfo + +// SignBytes defines the signed bytes used for signature verification. +type SignBytes struct { + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` + // type of the data used + DataType DataType `protobuf:"varint,4,opt,name=data_type,json=dataType,proto3,enum=ibc.lightclients.solomachine.v2.DataType" json:"data_type,omitempty" yaml:"data_type"` + // marshaled data + Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *SignBytes) Reset() { *m = SignBytes{} } +func (m *SignBytes) String() string { return proto.CompactTextString(m) } +func (*SignBytes) ProtoMessage() {} +func (*SignBytes) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{6} +} +func (m *SignBytes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignBytes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SignBytes) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignBytes.Merge(m, src) +} +func (m *SignBytes) XXX_Size() int { + return m.Size() +} +func (m *SignBytes) XXX_DiscardUnknown() { + xxx_messageInfo_SignBytes.DiscardUnknown(m) +} + +var xxx_messageInfo_SignBytes proto.InternalMessageInfo + +// HeaderData returns the SignBytes data for update verification. +type HeaderData struct { + // header public key + NewPubKey *types.Any `protobuf:"bytes,1,opt,name=new_pub_key,json=newPubKey,proto3" json:"new_pub_key,omitempty" yaml:"new_pub_key"` + // header diversifier + NewDiversifier string `protobuf:"bytes,2,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty" yaml:"new_diversifier"` +} + +func (m *HeaderData) Reset() { *m = HeaderData{} } +func (m *HeaderData) String() string { return proto.CompactTextString(m) } +func (*HeaderData) ProtoMessage() {} +func (*HeaderData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{7} +} +func (m *HeaderData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HeaderData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HeaderData) XXX_Merge(src proto.Message) { + xxx_messageInfo_HeaderData.Merge(m, src) +} +func (m *HeaderData) XXX_Size() int { + return m.Size() +} +func (m *HeaderData) XXX_DiscardUnknown() { + xxx_messageInfo_HeaderData.DiscardUnknown(m) +} + +var xxx_messageInfo_HeaderData proto.InternalMessageInfo + +// ClientStateData returns the SignBytes data for client state verification. +type ClientStateData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` +} + +func (m *ClientStateData) Reset() { *m = ClientStateData{} } +func (m *ClientStateData) String() string { return proto.CompactTextString(m) } +func (*ClientStateData) ProtoMessage() {} +func (*ClientStateData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{8} +} +func (m *ClientStateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientStateData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientStateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientStateData.Merge(m, src) +} +func (m *ClientStateData) XXX_Size() int { + return m.Size() +} +func (m *ClientStateData) XXX_DiscardUnknown() { + xxx_messageInfo_ClientStateData.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientStateData proto.InternalMessageInfo + +// ConsensusStateData returns the SignBytes data for consensus state +// verification. +type ConsensusStateData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + ConsensusState *types.Any `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` +} + +func (m *ConsensusStateData) Reset() { *m = ConsensusStateData{} } +func (m *ConsensusStateData) String() string { return proto.CompactTextString(m) } +func (*ConsensusStateData) ProtoMessage() {} +func (*ConsensusStateData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{9} +} +func (m *ConsensusStateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusStateData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusStateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusStateData.Merge(m, src) +} +func (m *ConsensusStateData) XXX_Size() int { + return m.Size() +} +func (m *ConsensusStateData) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusStateData.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusStateData proto.InternalMessageInfo + +// ConnectionStateData returns the SignBytes data for connection state +// verification. +type ConnectionStateData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Connection *types1.ConnectionEnd `protobuf:"bytes,2,opt,name=connection,proto3" json:"connection,omitempty"` +} + +func (m *ConnectionStateData) Reset() { *m = ConnectionStateData{} } +func (m *ConnectionStateData) String() string { return proto.CompactTextString(m) } +func (*ConnectionStateData) ProtoMessage() {} +func (*ConnectionStateData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{10} +} +func (m *ConnectionStateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionStateData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectionStateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionStateData.Merge(m, src) +} +func (m *ConnectionStateData) XXX_Size() int { + return m.Size() +} +func (m *ConnectionStateData) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionStateData.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionStateData proto.InternalMessageInfo + +// ChannelStateData returns the SignBytes data for channel state +// verification. +type ChannelStateData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Channel *types2.Channel `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` +} + +func (m *ChannelStateData) Reset() { *m = ChannelStateData{} } +func (m *ChannelStateData) String() string { return proto.CompactTextString(m) } +func (*ChannelStateData) ProtoMessage() {} +func (*ChannelStateData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{11} +} +func (m *ChannelStateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChannelStateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChannelStateData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChannelStateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelStateData.Merge(m, src) +} +func (m *ChannelStateData) XXX_Size() int { + return m.Size() +} +func (m *ChannelStateData) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelStateData.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelStateData proto.InternalMessageInfo + +// PacketCommitmentData returns the SignBytes data for packet commitment +// verification. +type PacketCommitmentData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Commitment []byte `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` +} + +func (m *PacketCommitmentData) Reset() { *m = PacketCommitmentData{} } +func (m *PacketCommitmentData) String() string { return proto.CompactTextString(m) } +func (*PacketCommitmentData) ProtoMessage() {} +func (*PacketCommitmentData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{12} +} +func (m *PacketCommitmentData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketCommitmentData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketCommitmentData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketCommitmentData) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketCommitmentData.Merge(m, src) +} +func (m *PacketCommitmentData) XXX_Size() int { + return m.Size() +} +func (m *PacketCommitmentData) XXX_DiscardUnknown() { + xxx_messageInfo_PacketCommitmentData.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketCommitmentData proto.InternalMessageInfo + +func (m *PacketCommitmentData) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *PacketCommitmentData) GetCommitment() []byte { + if m != nil { + return m.Commitment + } + return nil +} + +// PacketAcknowledgementData returns the SignBytes data for acknowledgement +// verification. +type PacketAcknowledgementData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Acknowledgement []byte `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` +} + +func (m *PacketAcknowledgementData) Reset() { *m = PacketAcknowledgementData{} } +func (m *PacketAcknowledgementData) String() string { return proto.CompactTextString(m) } +func (*PacketAcknowledgementData) ProtoMessage() {} +func (*PacketAcknowledgementData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{13} +} +func (m *PacketAcknowledgementData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketAcknowledgementData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketAcknowledgementData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketAcknowledgementData) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketAcknowledgementData.Merge(m, src) +} +func (m *PacketAcknowledgementData) XXX_Size() int { + return m.Size() +} +func (m *PacketAcknowledgementData) XXX_DiscardUnknown() { + xxx_messageInfo_PacketAcknowledgementData.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketAcknowledgementData proto.InternalMessageInfo + +func (m *PacketAcknowledgementData) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *PacketAcknowledgementData) GetAcknowledgement() []byte { + if m != nil { + return m.Acknowledgement + } + return nil +} + +// PacketReceiptAbsenceData returns the SignBytes data for +// packet receipt absence verification. +type PacketReceiptAbsenceData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (m *PacketReceiptAbsenceData) Reset() { *m = PacketReceiptAbsenceData{} } +func (m *PacketReceiptAbsenceData) String() string { return proto.CompactTextString(m) } +func (*PacketReceiptAbsenceData) ProtoMessage() {} +func (*PacketReceiptAbsenceData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{14} +} +func (m *PacketReceiptAbsenceData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketReceiptAbsenceData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketReceiptAbsenceData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketReceiptAbsenceData) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketReceiptAbsenceData.Merge(m, src) +} +func (m *PacketReceiptAbsenceData) XXX_Size() int { + return m.Size() +} +func (m *PacketReceiptAbsenceData) XXX_DiscardUnknown() { + xxx_messageInfo_PacketReceiptAbsenceData.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketReceiptAbsenceData proto.InternalMessageInfo + +func (m *PacketReceiptAbsenceData) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +// NextSequenceRecvData returns the SignBytes data for verification of the next +// sequence to be received. +type NextSequenceRecvData struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + NextSeqRecv uint64 `protobuf:"varint,2,opt,name=next_seq_recv,json=nextSeqRecv,proto3" json:"next_seq_recv,omitempty" yaml:"next_seq_recv"` +} + +func (m *NextSequenceRecvData) Reset() { *m = NextSequenceRecvData{} } +func (m *NextSequenceRecvData) String() string { return proto.CompactTextString(m) } +func (*NextSequenceRecvData) ProtoMessage() {} +func (*NextSequenceRecvData) Descriptor() ([]byte, []int) { + return fileDescriptor_141333b361aae010, []int{15} +} +func (m *NextSequenceRecvData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NextSequenceRecvData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NextSequenceRecvData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NextSequenceRecvData) XXX_Merge(src proto.Message) { + xxx_messageInfo_NextSequenceRecvData.Merge(m, src) +} +func (m *NextSequenceRecvData) XXX_Size() int { + return m.Size() +} +func (m *NextSequenceRecvData) XXX_DiscardUnknown() { + xxx_messageInfo_NextSequenceRecvData.DiscardUnknown(m) +} + +var xxx_messageInfo_NextSequenceRecvData proto.InternalMessageInfo + +func (m *NextSequenceRecvData) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *NextSequenceRecvData) GetNextSeqRecv() uint64 { + if m != nil { + return m.NextSeqRecv + } + return 0 +} + +func init() { + proto.RegisterEnum("ibc.lightclients.solomachine.v2.DataType", DataType_name, DataType_value) + proto.RegisterType((*ClientState)(nil), "ibc.lightclients.solomachine.v2.ClientState") + proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.solomachine.v2.ConsensusState") + proto.RegisterType((*Header)(nil), "ibc.lightclients.solomachine.v2.Header") + proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v2.Misbehaviour") + proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v2.SignatureAndData") + proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v2.TimestampedSignatureData") + proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v2.SignBytes") + proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v2.HeaderData") + proto.RegisterType((*ClientStateData)(nil), "ibc.lightclients.solomachine.v2.ClientStateData") + proto.RegisterType((*ConsensusStateData)(nil), "ibc.lightclients.solomachine.v2.ConsensusStateData") + proto.RegisterType((*ConnectionStateData)(nil), "ibc.lightclients.solomachine.v2.ConnectionStateData") + proto.RegisterType((*ChannelStateData)(nil), "ibc.lightclients.solomachine.v2.ChannelStateData") + proto.RegisterType((*PacketCommitmentData)(nil), "ibc.lightclients.solomachine.v2.PacketCommitmentData") + proto.RegisterType((*PacketAcknowledgementData)(nil), "ibc.lightclients.solomachine.v2.PacketAcknowledgementData") + proto.RegisterType((*PacketReceiptAbsenceData)(nil), "ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData") + proto.RegisterType((*NextSequenceRecvData)(nil), "ibc.lightclients.solomachine.v2.NextSequenceRecvData") +} + +func init() { + proto.RegisterFile("ibc/lightclients/solomachine/v2/solomachine.proto", fileDescriptor_141333b361aae010) +} + +var fileDescriptor_141333b361aae010 = []byte{ + // 1373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x5f, 0x8f, 0xdb, 0x44, + 0x10,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, 0xdd, 0x8b, 0xfc, 0xca, + 0xb3, 0x17, 0xf9, 0x95, 0xdf, 0x5f, 0xe4, 0x57, 0x1e, 0xde, 0x6e, 0x38, 0xb8, 0xd9, 0xab, 0x17, + 0x2d, 0xd4, 0x16, 0x2d, 0xe4, 0xb5, 0x91, 0x27, 0x3a, 0x75, 0xeb, 0x7a, 0x03, 0x89, 0xfd, 0x1b, + 0x62, 0x1b, 0xd9, 0xbd, 0x16, 0xf4, 0xc8, 0x2f, 0xcd, 0x3b, 0xbb, 0xd7, 0xc9, 0x48, 0x14, 0xdb, + 0x4e, 0xa3, 0x6b, 0xfa, 0x33, 0xc1, 0x13, 0xfb, 0x37, 0xeb, 0xab, 0xc1, 0x24, 0xbb, 0xf1, 0x57, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0xf1, 0xad, 0x65, 0x7a, 0x0d, 0x00, 0x00, +} + +func (m *ClientState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowUpdateAfterProposal { + i-- + if m.AllowUpdateAfterProposal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.IsFrozen { + i-- + if m.IsFrozen { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Sequence != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ConsensusState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x18 + } + if len(m.Diversifier) > 0 { + i -= len(m.Diversifier) + copy(dAtA[i:], m.Diversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Diversifier))) + i-- + dAtA[i] = 0x12 + } + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Header) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Header) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewDiversifier) > 0 { + i -= len(m.NewDiversifier) + copy(dAtA[i:], m.NewDiversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.NewDiversifier))) + i-- + dAtA[i] = 0x2a + } + if m.NewPublicKey != nil { + { + size, err := m.NewPublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x10 + } + if m.Sequence != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Misbehaviour) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SignatureTwo != nil { + { + size, err := m.SignatureTwo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SignatureOne != nil { + { + size, err := m.SignatureOne.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Sequence != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignatureAndData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x20 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if m.DataType != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.DataType)) + i-- + dAtA[i] = 0x10 + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x10 + } + if len(m.SignatureData) > 0 { + i -= len(m.SignatureData) + copy(dAtA[i:], m.SignatureData) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.SignatureData))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignBytes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignBytes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignBytes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x2a + } + if m.DataType != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.DataType)) + i-- + dAtA[i] = 0x20 + } + if len(m.Diversifier) > 0 { + i -= len(m.Diversifier) + copy(dAtA[i:], m.Diversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Diversifier))) + i-- + dAtA[i] = 0x1a + } + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x10 + } + if m.Sequence != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HeaderData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HeaderData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewDiversifier) > 0 { + i -= len(m.NewDiversifier) + copy(dAtA[i:], m.NewDiversifier) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.NewDiversifier))) + i-- + dAtA[i] = 0x12 + } + if m.NewPubKey != nil { + { + size, err := m.NewPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClientStateData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientStateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusStateData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusStateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConnectionStateData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectionStateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Connection != nil { + { + size, err := m.Connection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChannelStateData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChannelStateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChannelStateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Channel != nil { + { + size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSolomachine(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PacketCommitmentData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketCommitmentData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketCommitmentData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Commitment) > 0 { + i -= len(m.Commitment) + copy(dAtA[i:], m.Commitment) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Commitment))) + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PacketAcknowledgementData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketAcknowledgementData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketAcknowledgementData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Acknowledgement) > 0 { + i -= len(m.Acknowledgement) + copy(dAtA[i:], m.Acknowledgement) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Acknowledgement))) + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PacketReceiptAbsenceData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketReceiptAbsenceData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketReceiptAbsenceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NextSequenceRecvData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NextSequenceRecvData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NextSequenceRecvData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextSeqRecv != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.NextSeqRecv)) + i-- + dAtA[i] = 0x10 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSolomachine(dAtA []byte, offset int, v uint64) int { + offset -= sovSolomachine(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ClientState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.IsFrozen { + n += 2 + } + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.AllowUpdateAfterProposal { + n += 2 + } + return n +} + +func (m *ConsensusState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Diversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + return n +} + +func (m *Header) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.NewPublicKey != nil { + l = m.NewPublicKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.NewDiversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *Misbehaviour) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.SignatureOne != nil { + l = m.SignatureOne.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.SignatureTwo != nil { + l = m.SignatureTwo.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *SignatureAndData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.DataType != 0 { + n += 1 + sovSolomachine(uint64(m.DataType)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + return n +} + +func (m *TimestampedSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SignatureData) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + return n +} + +func (m *SignBytes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovSolomachine(uint64(m.Sequence)) + } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } + l = len(m.Diversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.DataType != 0 { + n += 1 + sovSolomachine(uint64(m.DataType)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *HeaderData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NewPubKey != nil { + l = m.NewPubKey.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.NewDiversifier) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *ClientStateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *ConsensusStateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *ConnectionStateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Connection != nil { + l = m.Connection.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *ChannelStateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.Channel != nil { + l = m.Channel.Size() + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *PacketCommitmentData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Commitment) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *PacketAcknowledgementData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + l = len(m.Acknowledgement) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *PacketReceiptAbsenceData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + return n +} + +func (m *NextSequenceRecvData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovSolomachine(uint64(l)) + } + if m.NextSeqRecv != 0 { + n += 1 + sovSolomachine(uint64(m.NextSeqRecv)) + } + return n +} + +func sovSolomachine(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSolomachine(x uint64) (n int) { + return sovSolomachine(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ClientState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsFrozen", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsFrozen = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &ConsensusState{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterProposal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowUpdateAfterProposal = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PublicKey == nil { + m.PublicKey = &types.Any{} + } + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Diversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Header) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Header: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewPublicKey == nil { + m.NewPublicKey = &types.Any{} + } + if err := m.NewPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewDiversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Misbehaviour) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Misbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Misbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignatureOne", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SignatureOne == nil { + m.SignatureOne = &SignatureAndData{} + } + if err := m.SignatureOne.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignatureTwo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SignatureTwo == nil { + m.SignatureTwo = &SignatureAndData{} + } + if err := m.SignatureTwo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignatureAndData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SignatureAndData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignatureAndData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataType", wireType) + } + m.DataType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataType |= DataType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimestampedSignatureData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimestampedSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignatureData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignatureData = append(m.SignatureData[:0], dAtA[iNdEx:postIndex]...) + if m.SignatureData == nil { + m.SignatureData = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignBytes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SignBytes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignBytes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Diversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataType", wireType) + } + m.DataType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataType |= DataType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HeaderData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HeaderData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HeaderData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewPubKey == nil { + m.NewPubKey = &types.Any{} + } + if err := m.NewPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewDiversifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewDiversifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientStateData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientStateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientStateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusStateData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusStateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusStateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionStateData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConnectionStateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectionStateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Connection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Connection == nil { + m.Connection = &types1.ConnectionEnd{} + } + if err := m.Connection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChannelStateData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChannelStateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChannelStateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Channel == nil { + m.Channel = &types2.Channel{} + } + if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketCommitmentData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketCommitmentData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketCommitmentData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitment", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commitment = append(m.Commitment[:0], dAtA[iNdEx:postIndex]...) + if m.Commitment == nil { + m.Commitment = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketAcknowledgementData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketAcknowledgementData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketAcknowledgementData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.Acknowledgement == nil { + m.Acknowledgement = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketReceiptAbsenceData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketReceiptAbsenceData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketReceiptAbsenceData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NextSequenceRecvData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NextSequenceRecvData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NextSequenceRecvData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSolomachine + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSolomachine + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = append(m.Path[:0], dAtA[iNdEx:postIndex]...) + if m.Path == nil { + m.Path = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSeqRecv", wireType) + } + m.NextSeqRecv = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSeqRecv |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSolomachine(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSolomachine + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSolomachine(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSolomachine + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSolomachine + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSolomachine + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSolomachine + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSolomachine + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSolomachine + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSolomachine = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSolomachine = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSolomachine = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/light-clients/06-solomachine/solomachine.pb.go b/modules/light-clients/06-solomachine/solomachine.pb.go index b2fb6ef30a2..dbc9ad634aa 100644 --- a/modules/light-clients/06-solomachine/solomachine.pb.go +++ b/modules/light-clients/06-solomachine/solomachine.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/lightclients/solomachine/v2/solomachine.proto +// source: ibc/lightclients/solomachine/v3/solomachine.proto package solomachine @@ -41,7 +41,7 @@ func (m *ClientState) Reset() { *m = ClientState{} } func (m *ClientState) String() string { return proto.CompactTextString(m) } func (*ClientState) ProtoMessage() {} func (*ClientState) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{0} + return fileDescriptor_264187157b9220a4, []int{0} } func (m *ClientState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -87,7 +87,7 @@ func (m *ConsensusState) Reset() { *m = ConsensusState{} } func (m *ConsensusState) String() string { return proto.CompactTextString(m) } func (*ConsensusState) ProtoMessage() {} func (*ConsensusState) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{1} + return fileDescriptor_264187157b9220a4, []int{1} } func (m *ConsensusState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +130,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{2} + return fileDescriptor_264187157b9220a4, []int{2} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -173,7 +173,7 @@ func (m *Misbehaviour) Reset() { *m = Misbehaviour{} } func (m *Misbehaviour) String() string { return proto.CompactTextString(m) } func (*Misbehaviour) ProtoMessage() {} func (*Misbehaviour) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{3} + return fileDescriptor_264187157b9220a4, []int{3} } func (m *Misbehaviour) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -215,7 +215,7 @@ func (m *SignatureAndData) Reset() { *m = SignatureAndData{} } func (m *SignatureAndData) String() string { return proto.CompactTextString(m) } func (*SignatureAndData) ProtoMessage() {} func (*SignatureAndData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{4} + return fileDescriptor_264187157b9220a4, []int{4} } func (m *SignatureAndData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -255,7 +255,7 @@ func (m *TimestampedSignatureData) Reset() { *m = TimestampedSignatureDa func (m *TimestampedSignatureData) String() string { return proto.CompactTextString(m) } func (*TimestampedSignatureData) ProtoMessage() {} func (*TimestampedSignatureData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{5} + return fileDescriptor_264187157b9220a4, []int{5} } func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,7 +302,7 @@ func (m *SignBytes) Reset() { *m = SignBytes{} } func (m *SignBytes) String() string { return proto.CompactTextString(m) } func (*SignBytes) ProtoMessage() {} func (*SignBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{6} + return fileDescriptor_264187157b9220a4, []int{6} } func (m *SignBytes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -343,7 +343,7 @@ func (m *HeaderData) Reset() { *m = HeaderData{} } func (m *HeaderData) String() string { return proto.CompactTextString(m) } func (*HeaderData) ProtoMessage() {} func (*HeaderData) Descriptor() ([]byte, []int) { - return fileDescriptor_141333b361aae010, []int{7} + return fileDescriptor_264187157b9220a4, []int{7} } func (m *HeaderData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -373,25 +373,25 @@ func (m *HeaderData) XXX_DiscardUnknown() { var xxx_messageInfo_HeaderData proto.InternalMessageInfo func init() { - proto.RegisterType((*ClientState)(nil), "ibc.lightclients.solomachine.v2.ClientState") - proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.solomachine.v2.ConsensusState") - proto.RegisterType((*Header)(nil), "ibc.lightclients.solomachine.v2.Header") - proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v2.Misbehaviour") - proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v2.SignatureAndData") - proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v2.TimestampedSignatureData") - proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v2.SignBytes") - proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v2.HeaderData") + proto.RegisterType((*ClientState)(nil), "ibc.lightclients.solomachine.v3.ClientState") + proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.solomachine.v3.ConsensusState") + proto.RegisterType((*Header)(nil), "ibc.lightclients.solomachine.v3.Header") + proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.solomachine.v3.Misbehaviour") + proto.RegisterType((*SignatureAndData)(nil), "ibc.lightclients.solomachine.v3.SignatureAndData") + proto.RegisterType((*TimestampedSignatureData)(nil), "ibc.lightclients.solomachine.v3.TimestampedSignatureData") + proto.RegisterType((*SignBytes)(nil), "ibc.lightclients.solomachine.v3.SignBytes") + proto.RegisterType((*HeaderData)(nil), "ibc.lightclients.solomachine.v3.HeaderData") } func init() { - proto.RegisterFile("ibc/lightclients/solomachine/v2/solomachine.proto", fileDescriptor_141333b361aae010) + proto.RegisterFile("ibc/lightclients/solomachine/v3/solomachine.proto", fileDescriptor_264187157b9220a4) } -var fileDescriptor_141333b361aae010 = []byte{ - // 784 bytes of a gzipped FileDescriptorProto +var fileDescriptor_264187157b9220a4 = []byte{ + // 783 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x4f, 0xe3, 0x46, 0x18, 0x8e, 0x8d, 0x41, 0xc9, 0x24, 0x0d, 0xd4, 0x0a, 0xc8, 0xa4, 0x55, 0x1c, 0xf9, 0x50, 0x71, - 0xc1, 0x2e, 0x41, 0xea, 0x81, 0x5e, 0x4a, 0x40, 0x55, 0x3f, 0xa8, 0x8a, 0x0c, 0x5c, 0x7a, 0xb1, + 0xc1, 0x2e, 0x44, 0xea, 0x81, 0x5e, 0x4a, 0x40, 0x55, 0x3f, 0xa8, 0x8a, 0x0c, 0x5c, 0x7a, 0xb1, 0xc6, 0xf6, 0xc4, 0x19, 0xd5, 0xf1, 0xb8, 0x9e, 0x71, 0xa2, 0x54, 0x3d, 0x54, 0x3d, 0xf5, 0xd8, 0x4b, 0xef, 0x55, 0xa5, 0xfe, 0x8e, 0x5e, 0x77, 0x6f, 0x1c, 0xf7, 0x14, 0xad, 0xe0, 0x1f, 0xe4, 0x17, 0xac, 0x3c, 0x76, 0xe2, 0x0f, 0x58, 0x90, 0x76, 0xf7, 0x36, 0xf3, 0x7e, 0x3e, 0xef, 0x33, @@ -404,40 +404,40 @@ var fileDescriptor_141333b361aae010 = []byte{ 0x23, 0xd0, 0xc0, 0xd4, 0x1a, 0x45, 0xe4, 0x57, 0x14, 0x28, 0x62, 0x5f, 0x38, 0xa8, 0x0f, 0x3b, 0xcb, 0x85, 0xba, 0x33, 0x87, 0x13, 0xff, 0x44, 0x5b, 0xbb, 0x34, 0xb3, 0x8e, 0xe9, 0xd7, 0xfc, 0x28, 0x33, 0xb0, 0xed, 0x90, 0x80, 0xa2, 0x80, 0xc6, 0xd4, 0xa2, 0x49, 0x07, 0x65, 0xa3, 0x2f, - 0x1c, 0x34, 0x07, 0x86, 0xfe, 0xcc, 0x28, 0xfa, 0xd9, 0x2a, 0x8f, 0x03, 0x1b, 0x76, 0x97, 0x0b, - 0x75, 0x2f, 0xed, 0x54, 0xa9, 0xa8, 0x99, 0x6d, 0xa7, 0x14, 0x2b, 0x23, 0xf0, 0x09, 0xf4, 0x7d, - 0x32, 0xb3, 0xe2, 0xd0, 0x85, 0x0c, 0x59, 0x70, 0xc4, 0x50, 0x64, 0x85, 0x11, 0x09, 0x09, 0x85, - 0xbe, 0x22, 0x71, 0xe8, 0x9f, 0x2d, 0x17, 0xaa, 0x96, 0x16, 0x7c, 0x22, 0x58, 0x33, 0x15, 0xee, - 0xbd, 0xe1, 0xce, 0xd3, 0xc4, 0x77, 0x99, 0xb9, 0x4e, 0xa4, 0x3f, 0xff, 0x51, 0x6b, 0xda, 0xbf, - 0x02, 0x68, 0x97, 0xb1, 0xca, 0xdf, 0x01, 0x10, 0xc6, 0xb6, 0x8f, 0x1d, 0xeb, 0x67, 0x34, 0xe7, - 0x34, 0x36, 0x07, 0x1d, 0x3d, 0x7d, 0x04, 0x7d, 0xf5, 0x08, 0xfa, 0x69, 0x30, 0x1f, 0xee, 0x2e, - 0x17, 0xea, 0xc7, 0x29, 0x88, 0x3c, 0x43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30, 0x1b, 0xc7, 0xb6, 0xee, 0x90, 0x89, 0xe1, 0x10, 0x3a, 0x21, + 0xd4, 0xc0, 0xb6, 0x73, 0xe8, 0x91, 0xe4, 0x9f, 0x38, 0x21, 0x6e, 0xec, 0x23, 0x9a, 0xfe, 0x37, + 0x0f, 0x57, 0x3f, 0xce, 0xcf, 0xbf, 0x38, 0x2c, 0xc8, 0xfb, 0xcb, 0xc2, 0xd9, 0xde, 0xe2, 0x33, + 0x0e, 0xde, 0x04, 0x00, 0x00, 0xff, 0xff, 0x49, 0x19, 0x81, 0xe4, 0x6e, 0x07, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index 313b3b66508..5b828483bfc 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -2,8 +2,10 @@ syntax = "proto3"; package ibc.lightclients.solomachine.v2; -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine;solomachine"; +option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/migrations/v6"; +import "ibc/core/connection/v1/connection.proto"; +import "ibc/core/channel/v1/channel.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -50,22 +52,20 @@ message Header { // of a sequence and two signatures over different messages at that sequence. message Misbehaviour { option (gogoproto.goproto_getters) = false; - - // ClientID is deprecated - string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; } // SignatureAndData contains a signature and the data signed over to create that // signature. message SignatureAndData { option (gogoproto.goproto_getters) = false; - bytes signature = 1; - bytes path = 2; - bytes data = 3; - uint64 timestamp = 4; + bytes signature = 1; + DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; + bytes data = 3; + uint64 timestamp = 4; } // TimestampedSignatureData contains the signature data and the timestamp of the @@ -80,18 +80,42 @@ message TimestampedSignatureData { message SignBytes { option (gogoproto.goproto_getters) = false; - // the sequence number - uint64 sequence = 1; - // the proof timestamp - uint64 timestamp = 2; - // the public key diversifier + uint64 sequence = 1; + uint64 timestamp = 2; string diversifier = 3; - // the standardised path bytes - bytes path = 4; - // the marshaled data bytes + // type of the data used + DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; + // marshaled data bytes data = 5; } +// DataType defines the type of solo machine proof being created. This is done +// to preserve uniqueness of different data sign byte encodings. +enum DataType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // Data type for client state verification + DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; + // Data type for consensus state verification + DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; + // Data type for connection state verification + DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; + // Data type for channel state verification + DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; + // Data type for packet commitment verification + DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; + // Data type for packet acknowledgement verification + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; + // Data type for packet receipt absence verification + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; + // Data type for next sequence recv verification + DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; + // Data type for header verification + DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; +} + // HeaderData returns the SignBytes data for update verification. message HeaderData { option (gogoproto.goproto_getters) = false; @@ -101,3 +125,65 @@ message HeaderData { // header diversifier string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; } + +// ClientStateData returns the SignBytes data for client state verification. +message ClientStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateData returns the SignBytes data for consensus state +// verification. +message ConsensusStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; +} + +// ConnectionStateData returns the SignBytes data for connection state +// verification. +message ConnectionStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.connection.v1.ConnectionEnd connection = 2; +} + +// ChannelStateData returns the SignBytes data for channel state +// verification. +message ChannelStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.channel.v1.Channel channel = 2; +} + +// PacketCommitmentData returns the SignBytes data for packet commitment +// verification. +message PacketCommitmentData { + bytes path = 1; + bytes commitment = 2; +} + +// PacketAcknowledgementData returns the SignBytes data for acknowledgement +// verification. +message PacketAcknowledgementData { + bytes path = 1; + bytes acknowledgement = 2; +} + +// PacketReceiptAbsenceData returns the SignBytes data for +// packet receipt absence verification. +message PacketReceiptAbsenceData { + bytes path = 1; +} + +// NextSequenceRecvData returns the SignBytes data for verification of the next +// sequence to be received. +message NextSequenceRecvData { + bytes path = 1; + uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; +} \ No newline at end of file diff --git a/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/proto/ibc/lightclients/solomachine/v3/solomachine.proto new file mode 100644 index 00000000000..63ce566782d --- /dev/null +++ b/proto/ibc/lightclients/solomachine/v3/solomachine.proto @@ -0,0 +1,103 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v3; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine;solomachine"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; + ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // when set to true, will allow governance to update a solo machine client. + // The client will be unfrozen if it is frozen. + bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + // sequence to update solo machine public key at + uint64 sequence = 1; + uint64 timestamp = 2; + bytes signature = 3; + google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; + string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + // ClientID is deprecated + string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + bytes signature = 1; + bytes path = 2; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + // the sequence number + uint64 sequence = 1; + // the proof timestamp + uint64 timestamp = 2; + // the public key diversifier + string diversifier = 3; + // the standardised path bytes + bytes path = 4; + // the marshaled data bytes + bytes data = 5; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; + // header diversifier + string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} diff --git a/testing/sdk_test.go b/testing/sdk_test.go deleted file mode 100644 index 415c61eee11..00000000000 --- a/testing/sdk_test.go +++ /dev/null @@ -1,279 +0,0 @@ -package ibctesting_test - -import ( - "fmt" - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/rest" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" - authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/spf13/cobra" - "github.com/stretchr/testify/suite" - tmrand "github.com/tendermint/tendermint/libs/rand" - dbm "github.com/tendermint/tm-db" - - ibcclientcli "github.com/cosmos/ibc-go/v3/modules/core/02-client/client/cli" - "github.com/cosmos/ibc-go/v3/testing/simapp" - "github.com/cosmos/ibc-go/v3/testing/simapp/params" -) - -/* - This file contains tests from the SDK which had to deleted during the migration of - the IBC module from the SDK into this repository. https://github.com/cosmos/cosmos-sdk/pull/8735 - - They can be removed once the SDK deprecates amino. -*/ - -type IntegrationTestSuite struct { - suite.Suite - - cfg network.Config - network *network.Network -} - -func (s *IntegrationTestSuite) SetupSuite() { - s.T().Log("setting up integration test suite") - - cfg := DefaultConfig() - - cfg.NumValidators = 2 - - s.cfg = cfg - s.network = network.New(s.T(), cfg) - - kb := s.network.Validators[0].ClientCtx.Keyring - _, _, err := kb.NewMnemonic("newAccount", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) - s.Require().NoError(err) - - account1, _, err := kb.NewMnemonic("newAccount1", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) - s.Require().NoError(err) - - account2, _, err := kb.NewMnemonic("newAccount2", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) - s.Require().NoError(err) - - multi := kmultisig.NewLegacyAminoPubKey(2, []cryptotypes.PubKey{account1.GetPubKey(), account2.GetPubKey()}) - _, err = kb.SaveMultisig("multi", multi) - s.Require().NoError(err) - - _, err = s.network.WaitForHeight(1) - s.Require().NoError(err) - - s.Require().NoError(s.network.WaitForNextBlock()) -} - -func TestIntegrationTestSuite(t *testing.T) { - suite.Run(t, new(IntegrationTestSuite)) -} - -// NewAppConstructor returns a new simapp AppConstructor -func NewAppConstructor(encodingCfg params.EncodingConfig) network.AppConstructor { - return func(val network.Validator) servertypes.Application { - return simapp.NewSimApp( - val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0, - encodingCfg, - simapp.EmptyAppOptions{}, - baseapp.SetPruning(storetypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), - baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), - ) - } -} - -// DefaultConfig returns a sane default configuration suitable for nearly all -// testing requirements. -func DefaultConfig() network.Config { - encCfg := simapp.MakeTestEncodingConfig() - - return network.Config{ - Codec: encCfg.Marshaler, - TxConfig: encCfg.TxConfig, - LegacyAmino: encCfg.Amino, - InterfaceRegistry: encCfg.InterfaceRegistry, - AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: NewAppConstructor(encCfg), - GenesisState: simapp.ModuleBasics.DefaultGenesis(encCfg.Marshaler), - TimeoutCommit: 2 * time.Second, - ChainID: "chain-" + tmrand.NewRand().Str(6), - NumValidators: 4, - BondDenom: sdk.DefaultBondDenom, - MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), - AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), - StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), - BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), - PruningStrategy: storetypes.PruningOptionNothing, - CleanupDir: true, - SigningAlgo: string(hd.Secp256k1Type), - KeyringOptions: []keyring.Option{}, - } -} - -func (s *IntegrationTestSuite) TearDownSuite() { - s.T().Log("tearing down integration test suite") - s.network.Cleanup() -} - -// TestLegacyRestErrMessages creates two IBC txs, one that fails, one that -// succeeds, and make sure we cannot query any of them (with pretty error msg). -// Our intension is to test the error message of querying a message which is -// signed with proto, since IBC won't support legacy amino at all we are -// considering a message from IBC module. -func (s *IntegrationTestSuite) TestLegacyRestErrMessages() { - val := s.network.Validators[0] - - // Write client state json to temp file, used for an IBC message. - // Generated by printing the result of cdc.MarshalIntefaceJSON on - // a solo machine client state - clientStateJSON := testutil.WriteToNewTempFile( - s.T(), - `{"@type":"/ibc.lightclients.solomachine.v2.ClientState","sequence":"1","is_frozen":false,"consensus_state":{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AtK50+5pJOoaa04qqAqrnyAqsYrwrR/INnA6UPIaYZlp"},"diversifier":"testing","timestamp":"10"},"allow_update_after_proposal":false}`, - ) - - badClientStateJSON := testutil.WriteToNewTempFile( - s.T(), - `{"@type":"/ibc.lightclients.solomachine.v2.ClientState","sequence":"1","is_frozen":false,"consensus_state":{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AtK50+5pJOoaa04qqAqrnyAqsYrwrR/INnA6UPIaYZlp"},"diversifier":"DIFFERENT","timestamp":"10"},"allow_update_after_proposal":false}`, - ) - - // Write consensus json to temp file, used for an IBC message. - // Generated by printing the result of cdc.MarshalIntefaceJSON on - // a solo machine consensus state - consensusJSON := testutil.WriteToNewTempFile( - s.T(), - `{"@type":"/ibc.lightclients.solomachine.v2.ConsensusState","public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AtK50+5pJOoaa04qqAqrnyAqsYrwrR/INnA6UPIaYZlp"},"diversifier":"testing","timestamp":"10"}`, - ) - - testCases := []struct { - desc string - cmd *cobra.Command - args []string - code uint32 - }{ - { - "Failing IBC message", - ibcclientcli.NewCreateClientCmd(), - []string{ - badClientStateJSON.Name(), // path to client state json - consensusJSON.Name(), // path to consensus json, - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=foobar", flags.FlagNote), - }, - uint32(8), - }, - { - "Successful IBC message", - ibcclientcli.NewCreateClientCmd(), - []string{ - clientStateJSON.Name(), // path to client state json - consensusJSON.Name(), // path to consensus json, - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=foobar", flags.FlagNote), - }, - uint32(0), - }, - } - - for _, tc := range testCases { - s.Run(fmt.Sprintf("Case %s", tc.desc), func() { - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, tc.cmd, tc.args) - s.Require().NoError(err) - var txRes sdk.TxResponse - s.Require().NoError(val.ClientCtx.JSONCodec.UnmarshalJSON(out.Bytes(), &txRes)) - s.Require().Equal(tc.code, txRes.Code) - - s.Require().NoError(s.network.WaitForNextBlock()) - - s.testQueryIBCTx(txRes, tc.cmd, tc.args) - }) - } -} - -// testQueryIBCTx is a helper function to test querying txs which: -// - show an error message on legacy REST endpoints -// - succeed using gRPC -// In practice, we call this function on IBC txs. -func (s *IntegrationTestSuite) testQueryIBCTx(txRes sdk.TxResponse, cmd *cobra.Command, args []string) { - val := s.network.Validators[0] - - errMsg := "this transaction cannot be displayed via legacy REST endpoints, because it does not support" + - " Amino serialization. Please either use CLI, gRPC, gRPC-gateway, or directly query the Tendermint RPC" + - " endpoint to query this transaction. The new REST endpoint (via gRPC-gateway) is " - - // Test that legacy endpoint return the above error message on IBC txs. - testCases := []struct { - desc string - url string - }{ - { - "Query by hash", - fmt.Sprintf("%s/txs/%s", val.APIAddress, txRes.TxHash), - }, - { - "Query by height", - fmt.Sprintf("%s/txs?tx.height=%d", val.APIAddress, txRes.Height), - }, - } - - for _, tc := range testCases { - s.Run(fmt.Sprintf("Case %s", tc.desc), func() { - txJSON, err := rest.GetRequest(tc.url) - s.Require().NoError(err) - - var errResp rest.ErrorResponse - s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(txJSON, &errResp)) - - s.Require().Contains(errResp.Error, errMsg) - }) - } - - // try fetching the txn using gRPC req, it will fetch info since it has proto codec. - grpcJSON, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", val.APIAddress, txRes.TxHash)) - s.Require().NoError(err) - - var getTxRes txtypes.GetTxResponse - s.Require().NoError(val.ClientCtx.JSONCodec.UnmarshalJSON(grpcJSON, &getTxRes)) - s.Require().Equal(getTxRes.Tx.Body.Memo, "foobar") - - // generate broadcast only txn. - args = append(args, fmt.Sprintf("--%s=true", flags.FlagGenerateOnly)) - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - s.Require().NoError(err) - - txFile := testutil.WriteToNewTempFile(s.T(), string(out.Bytes())) - txFileName := txFile.Name() - - // encode the generated txn. - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, authcli.GetEncodeCommand(), []string{txFileName}) - s.Require().NoError(err) - - bz, err := val.ClientCtx.LegacyAmino.MarshalJSON(authrest.DecodeReq{Tx: string(out.Bytes())}) - s.Require().NoError(err) - - // try to decode the txn using legacy rest, it fails. - res, err := rest.PostRequest(fmt.Sprintf("%s/txs/decode", val.APIAddress), "application/json", bz) - s.Require().NoError(err) - - var errResp rest.ErrorResponse - s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(res, &errResp)) - s.Require().Contains(errResp.Error, errMsg) -} From 51582914333297bbd0f0afe88b1f170ee22c50f5 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 2 Aug 2022 16:46:12 +0200 Subject: [PATCH 11/11] adding changelog entries --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370a4731e70..176830f33d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (transfer) [\#1250](https://github.com/cosmos/ibc-go/pull/1250) Deprecate `GetTransferAccount` since the `transfer` module account is never used. * (06-solomachine) [\#1679](https://github.com/cosmos/ibc-go/pull/1679) Remove `types` sub-package from `06-solomachine` lightclient directory. * (07-tendermint) [\#1677](https://github.com/cosmos/ibc-go/pull/1677) Remove `types` sub-package from `07-tendermint` lightclient directory. +* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Bump `06-solomachine` protobuf version from `v2` to `v3`. +* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Removed `DataType` enum and associated message types from `06-solomachine`. `DataType` has been removed from `SignBytes` and `SignatureAndData` in favour of `path`. ### State Machine Breaking