diff --git a/core/connection.go b/core/connection.go index ab4c0878..380c6652 100644 --- a/core/connection.go +++ b/core/connection.go @@ -193,7 +193,7 @@ func createConnectionStep(src, dst *ProvableChain) (*RelayMsgs, error) { if len(srcUpdateHeaders) > 0 { out.Dst = append(out.Dst, dst.Path().UpdateClients(srcUpdateHeaders, addr)...) } - out.Dst = append(out.Dst, dst.Path().ConnAck(src.Path(), srcCsRes, srcConn, srcConsRes, addr)) + out.Dst = append(out.Dst, dst.Path().ConnAck(src.Path(), srcCsRes, srcConn, srcConsRes, dstHostConsProof, addr)) // Handshake has started on dst end (2 steps done), relay `connOpenAck` and `updateClient` to src end case srcConn.Connection.State == conntypes.INIT && dstConn.Connection.State == conntypes.TRYOPEN: @@ -202,7 +202,7 @@ func createConnectionStep(src, dst *ProvableChain) (*RelayMsgs, error) { if len(dstUpdateHeaders) > 0 { out.Src = append(out.Src, src.Path().UpdateClients(dstUpdateHeaders, addr)...) } - out.Src = append(out.Src, src.Path().ConnAck(dst.Path(), dstCsRes, dstConn, dstConsRes, addr)) + out.Src = append(out.Src, src.Path().ConnAck(dst.Path(), dstCsRes, dstConn, dstConsRes, srcHostConsProof, addr)) // Handshake has confirmed on dst (3 steps done), relay `connOpenConfirm` and `updateClient` to src end case srcConn.Connection.State == conntypes.TRYOPEN && dstConn.Connection.State == conntypes.OPEN: diff --git a/core/pathEnd.go b/core/pathEnd.go index f786bea2..c9e4f984 100644 --- a/core/pathEnd.go +++ b/core/pathEnd.go @@ -128,13 +128,14 @@ func (pe *PathEnd) ConnAck( dstClientState *clienttypes.QueryClientStateResponse, dstConnState *conntypes.QueryConnectionResponse, dstConsState *clienttypes.QueryConsensusStateResponse, + hostConsensusStateProof []byte, signer sdk.AccAddress, ) sdk.Msg { cs, err := clienttypes.UnpackClientState(dstClientState.ClientState) if err != nil { panic(err) } - return conntypes.NewMsgConnectionOpenAck( + msg := conntypes.NewMsgConnectionOpenAck( pe.ConnectionID, dst.ConnectionID, cs, @@ -146,6 +147,11 @@ func (pe *PathEnd) ConnAck( conntypes.ExportedVersionsToProto(conntypes.GetCompatibleVersions())[0], signer.String(), ) + msg.HostConsensusStateProof = hostConsensusStateProof + if err = msg.ValidateBasic(); err != nil { + panic(err) + } + return msg } // ConnConfirm creates a MsgConnectionOpenAck