diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e92fea92aa..1df5346f190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,8 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (modules/light-clients/06-solomachine) [\#122](https://github.com/cosmos/ibc-go/pull/122) Fix solo machine merkle prefix casting bug. * (modules/light-clients/06-solomachine) [\#120](https://github.com/cosmos/ibc-go/pull/120) Fix solo machine handshake verification bug. + ### API Breaking * (modules/core) [\#109](https://github.com/cosmos/ibc-go/pull/109) Remove connection and channel handshake CLI commands. diff --git a/modules/light-clients/06-solomachine/spec/01_concepts.md b/modules/light-clients/06-solomachine/spec/01_concepts.md index de486b71b1a..a121803f43c 100644 --- a/modules/light-clients/06-solomachine/spec/01_concepts.md +++ b/modules/light-clients/06-solomachine/spec/01_concepts.md @@ -108,6 +108,9 @@ timestampedSignatureData := &types.TimestampedSignatureData{ proof, err := cdc.MarshalBinaryBare(timestampedSignatureData) ``` +NOTE: At the end of this process, the sequence associated with the key needs to be updated. +The sequence must be incremented each time proof is generated. + ## Updates By Header An update by a header will only succeed if: diff --git a/modules/light-clients/06-solomachine/types/client_state.go b/modules/light-clients/06-solomachine/types/client_state.go index c208e23b333..efa740cab6a 100644 --- a/modules/light-clients/06-solomachine/types/client_state.go +++ b/modules/light-clients/06-solomachine/types/client_state.go @@ -435,7 +435,7 @@ func produceVerificationArgs( return nil, nil, 0, 0, sdkerrors.Wrap(commitmenttypes.ErrInvalidPrefix, "prefix cannot be empty") } - _, ok := prefix.(commitmenttypes.MerklePrefix) + _, ok := prefix.(*commitmenttypes.MerklePrefix) if !ok { return nil, nil, 0, 0, sdkerrors.Wrapf(commitmenttypes.ErrInvalidPrefix, "invalid prefix type %T, expected MerklePrefix", prefix) } 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 6c7661ef629..654ab1baf19 100644 --- a/modules/light-clients/06-solomachine/types/client_state_test.go +++ b/modules/light-clients/06-solomachine/types/client_state_test.go @@ -19,7 +19,9 @@ const ( ) var ( - prefix = commitmenttypes.NewMerklePrefix([]byte("ibc")) + prefix = &commitmenttypes.MerklePrefix{ + KeyPrefix: []byte("ibc"), + } consensusHeight = clienttypes.ZeroHeight() ) @@ -387,7 +389,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientConsensusState() { } func (suite *SoloMachineTestSuite) TestVerifyConnectionState() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, prefix) + counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) path := suite.solomachine.GetConnectionStatePath(testConnectionID) diff --git a/modules/light-clients/06-solomachine/types/codec_test.go b/modules/light-clients/06-solomachine/types/codec_test.go index d4589be6a43..e635cb8c65f 100644 --- a/modules/light-clients/06-solomachine/types/codec_test.go +++ b/modules/light-clients/06-solomachine/types/codec_test.go @@ -67,7 +67,7 @@ func (suite SoloMachineTestSuite) TestUnmarshalDataByType() { }, { "connection", types.CONNECTION, func() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, prefix) + counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) path := solomachine.GetConnectionStatePath("connectionID") @@ -98,7 +98,7 @@ func (suite SoloMachineTestSuite) TestUnmarshalDataByType() { }, { "bad channel (uses connection data)", types.CHANNEL, func() { - counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, prefix) + counterparty := connectiontypes.NewCounterparty("clientB", testConnectionID, *prefix) conn := connectiontypes.NewConnectionEnd(connectiontypes.OPEN, "clientA", counterparty, connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions()), 0) path := solomachine.GetConnectionStatePath("connectionID")