From 3396134b92069d6724d19b4107fff098f6e39a91 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Mon, 17 Apr 2023 10:45:59 -0400 Subject: [PATCH 1/2] Fix verifyTransactionOutputProofat_ --- src/Chainweb/SPV/VerifyProof.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Chainweb/SPV/VerifyProof.hs b/src/Chainweb/SPV/VerifyProof.hs index 39ae2977a3..64310675b7 100644 --- a/src/Chainweb/SPV/VerifyProof.hs +++ b/src/Chainweb/SPV/VerifyProof.hs @@ -170,9 +170,12 @@ verifyTransactionOutputProofAt_ -> TransactionOutputProof SHA512t_256 -> BlockHash -> IO TransactionOutput -verifyTransactionOutputProofAt_ bdb proof@(TransactionOutputProof _cid p) ctx = do - unlessM (ancestorOf bdb h ctx) $ throwM - $ SpvExceptionVerificationFailed "target header is not in the chain" +verifyTransactionOutputProofAt_ bdb proof@(TransactionOutputProof tgt p) ctx = do + case tgt of + ProofTargetChain _cid -> + unlessM (ancestorOf bdb h ctx) $ throwM + $ SpvExceptionVerificationFailed "target header is not in the chain" + ProofTargetCrossNetwork _net -> return () proofSubject p where h = runTransactionOutputProof proof From b8952a43800adbc1c37832185cebec75e72f4c9d Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Mon, 17 Apr 2023 11:15:02 -0400 Subject: [PATCH 2/2] Fix target chain encoding, change pact pin (stop checking yield provenance) --- cabal.project | 2 +- src/Chainweb/SPV.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index 49723525c9..b139572abf 100644 --- a/cabal.project +++ b/cabal.project @@ -54,7 +54,7 @@ package yet-another-logger source-repository-package type: git location: https://github.com/kadena-io/pact.git - tag: 842fbc4256b3cbbde337dbeaa393b649a26f1574 + tag: 1484c15af7f3514524e5986f061f950c030d34b6 source-repository-package type: git diff --git a/src/Chainweb/SPV.hs b/src/Chainweb/SPV.hs index ef6efa0399..8079f8e4fd 100644 --- a/src/Chainweb/SPV.hs +++ b/src/Chainweb/SPV.hs @@ -198,9 +198,9 @@ data ProofTarget = ProofTargetChain !ChainId | ProofTargetCrossNetwork !Text deriving anyclass NFData instance ToJSON ProofTarget where - toJSON (ProofTargetChain cid) = toJSON cid + toJSON (ProofTargetChain cid) = toJSON (toText cid) toJSON (ProofTargetCrossNetwork subtgt) = toJSON ("crossnet:" <> subtgt) - toEncoding (ProofTargetChain cid) = toEncoding cid + toEncoding (ProofTargetChain cid) = toEncoding (toText cid) toEncoding (ProofTargetCrossNetwork subtgt) = toEncoding ("crossnet:" <> subtgt) instance FromJSON ProofTarget where