Skip to content

Commit

Permalink
Add separate error for fanout commit mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Dec 12, 2024
1 parent d660d0e commit b564f8d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions hydra-cluster/test/Test/DirectChainSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do
\aliceChain@DirectChainTest{postTx} -> do
-- Scenario
(aliceExternalVk, aliceExternalSk) <- generate genKeyPair
someUTxO <- seedFromFaucet node aliceExternalVk 1_000_000 (contramap FromFaucet tracer)
someUTxOToCommit <- seedFromFaucet node aliceExternalVk 1_000_000 (contramap FromFaucet tracer)
someUTxO <- seedFromFaucet node aliceExternalVk 2_000_000 (contramap FromFaucet tracer)
someUTxOToCommit <- seedFromFaucet node aliceExternalVk 2_000_000 (contramap FromFaucet tracer)
participants <- loadParticipants [Alice]
let headParameters = HeadParameters cperiod [alice]
postTx $ InitTx{participants, headParameters}
Expand Down
2 changes: 1 addition & 1 deletion hydra-plutus/scripts/mHead.plutus

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-plutus/scripts/vCommit.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "hydra-vCommit-0.19.0-358-gcaa1a6f63",
"description": "hydra-vCommit-0.19.0-382-g89210da22",
"cborHex": "5902af5902ac010100323232323232323232322533300332323232325332330093001300b37540042646464a66666602800c2646464a66601e60060022a66602660246ea80245400803854ccc03cc01c00454ccc04cc048dd50048a80100700718081baa0081533300d3001300f37540042646464646464a6660266016602a6ea80344cc00cc01130103d87980003370e6660026eacc064c068c068c068c068c058dd50079bae30053016375400c91010b487964726148656164563100480044c94ccc050c020c058dd50008998021802a6103d87a8000300c333002375660346036602e6ea8c068c05cdd50009bae30063017375400e9110b4879647261486561645631001533015491054c35373b39001632533301800114c103d87a80001300333019301a0014bd701bac30053016375401e44464a66602c601c60306ea8004520001375a603860326ea8004c94ccc058c038c060dd50008a6103d87a8000132330010013756603a60346ea8008894ccc070004530103d87a8000132323232533301c337220100042a66603866e3c0200084c02ccc084dd4000a5eb80530103d87a8000133006006003375a603c0066eb8c070008c080008c078004c8cc004004010894ccc06c0045300103d87a8000132323232533301b337220100042a66603666e3c0200084c028cc080dd3000a5eb80530103d87a80001330060060033756603a0066eb8c06c008c07c008c074004dd2a400044a666024002294454cc04c0085894ccc040c010c048dd50008a4903433031001491034330320023015301630160013013301037540042a6601c9201054c34373b350016370e900000580580580598089809001180800098061baa002370e90010b1806980700118060009806001180500098031baa00114984d95854cc0092401054c34333b3500165734ae7155ceaab9e5573eae815d0aba257481"
}
2 changes: 1 addition & 1 deletion hydra-plutus/scripts/vDeposit.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "hydra-vDeposit-0.19.0-358-gcaa1a6f63",
"description": "hydra-vDeposit-0.19.0-382-g89210da22",
"cborHex": "59045b590458010100323232323232323232322533300332323232325332330093001300b37540042646464a66666602800c2646464a66601e6006002264a66602800201e264a666666032002020020020020264a66602c60320062a00a0226eb8004c058004c048dd50048a9998079803800899299980a000807899299999980c800808008008099299980b180c8018a8028089bad00101030160013012375401201c60206ea802054ccc034c004c03cdd5001099191919191929998099803980a9baa00d13253330143300430054c103d87e80003371e6eb8c00cc05cdd50038008998021802a60103d87980003322325333017300f30193754002266e24dd6980e980d1baa00100213300730084c103d87a80004a0600a60326ea8c010c064dd50011803180b9baa010375a6004602e6ea801c5281bae30193016375401a264a66602866008600a980103d87c80003322325333017300f30193754002266e20008dd6980e980d1baa00113300730084c103d87b80004a0600a60326ea8c014c064dd50011803180b9baa010375a6004602e6ea801c4c8c8c8c8cc020c02530103d87d80003371e646e48004ccc00ccc008ccc004004dd61802180d9baa01400523766002911002233714004002646e48004ccc00ccc008c8cc004004dd61802980e1baa00c22533301e00114bd70099911919800800801912999811000899811801a5eb804c8c94ccc080cdd79991192999811980d98129baa001133225333025337100040022980103d879800015333025337100020042980103d87b800014c103d87a8000375a6022604c6ea800cdd6980898131baa002100133225333024337200040022980103d8798000153330243371e0040022980103d87a800014c103d87b8000375c6022604a6ea8008dd7180898129baa001300f3023375400a601e60466ea800930103d8798000133025005003133025002330040040013026002302400133002002302100130200012375c600e60386ea80052201002233714004002444a66603466e24005200014bd700a99980f0010a5eb804cc07cc080008ccc00c00cc084008cdc0000a400244646600200200644a66603c002297ae013301f37526006604000266004004604200244464666002002008006444a66603e004200226660060066044004660080026eb8c0840088c06cc070c0700045281bad30193016375401a4603260340024603000244a666024002294454cc04c008528119299980898028008a490344303100153330113009001149010344303200153330113370e90020008a490344303300153330113370e90030008a490344303400153330113370e90040008a49034430350014910344303600301237540024602a602c602c602c602c602c602c602c002602660206ea800854cc039241054c35353b350016370e900000580580580598089809001180800098061baa002370e90010b1806980700118060009806001180500098031baa00114984d95854cc0092401054c35313b3500165734ae7155ceaab9e5573eae815d0aba257481"
}
2 changes: 1 addition & 1 deletion hydra-plutus/scripts/vHead.plutus

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-plutus/scripts/vInitial.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "hydra-vInitial-0.19.0-358-gcaa1a6f63",
"description": "hydra-vInitial-0.19.0-382-g89210da22",
"cborHex": "590a68590a6501010033232323232323232323223225333005323232323253323300b3001300d37540042646464a66666602c00c26464646464a66602660080022a66602e602c6ea802c5400804854ccc04cc0240044c94ccc06000404c4c94cccccc0740040500504c94ccc068c07400c4cc020004894ccc0700085401c4c94cccccc0840044ccc0240044c008c08000c060060060060060c078008054dd600080a00a180d000980b1baa00b012301437540142a666022600460266ea80104c8c8c8c8c8c8c94ccc060c024c068dd5008099802248103493031003370e6660026eacc018c06cdd5009003a4410b487964726148656164563100480044cc8c8c8c8c8c8c8c8c8c8c8c8c8c8c88c8c8c8c8c94cccccc0d40040080084c8cc080004894ccc0d00084c8c94ccc0c8cc07924103493133003371e0426eb8c058c0d4dd50040a999819191919299981a981300089811249034930350015333035302b001132533303a0011302349103493036001533303a303d001133022491034930320032323300100100622533303d00114a0264a66607466e3cdd718200010020a511330030030013040001375c60780022604692010349303600323300100100322533303b00114bd700991919299981d18181bad303d00313303f37520026600a00a00426600a00a0046eb8c0ec008c0fc008c0f40044c08924010349303600301a001330183301d0020224bd6f7b6301bac303830393039303930393039303930393039303537540582a6660646603c92103493134003375e6040606a6ea80b1300101a000153330323301e49103493033003371266e00c048004c048ccc050cc04c00894ccc0ccc090c0d4dd500089bab3010303637546020606c6ea8c0e4c0d8dd50008a5eb7bdb1812f5bded8c002a60246660286602601446eacc040c0d8dd5000a5eb7bdb1800544cc0300080145280a5014a02940cc058c94ccc0c8c0a0c0d0dd50008a60103d87a80001301d33037300f30353754601e606a6ea8c0e0c0d4dd5000a5eb80cc034dd6180c981a1baa02b0254bd6f7b6301980780491929998191811981a1baa0011301d3303730383035375400297ae013010490103493135003300d3758603260686ea80ac0044c94cccccc0e400454ccc0c4c088c0ccdd5000899299981b000803899299999981d800899299981c000804899299999981e800805005005005099299981d181e801899981300209803981e8040058059bae001303a001303a00200800800800830380013034375400200c00c00c00c00c606c0046eb0004008008c024c0bcdd50010980c2491f4661696c656420746f206465636f6465206c6f636b65645f636f6d6d69747300533302e0011300849103493132001533302e303100113232533302c301d0011300a49103493039001533302c30220011300a490103493130001323253333330360021533302e301f30303754004264a66606600200426464a66606a00200826464a66606e00200c264a66666607800200e00e00e00e264a666072607800620120106eb8004c0e4004c0e4008c0dc004c0dc008c0d4004c0c4dd500100080080080080089805a4903493131003032302f3754004605a6ea8004c0c00044c02124010349313200330080012300e302d375400264660020026eb0c034c0b0dd50119129998170008a5eb804c8c94ccc0b0c94ccc0b4c08cc0bcdd5000899b8f02a375c606660606ea8004528180a18179baa3014302f37540042660620046600800800226600800800260640046060002600200244464646464a6660600042a666060006294400400454ccc0bc0044c06124103493037001533302f0021301849010349303800132323232533302f30203031375400826466038921034930340053330303371e6eccc034c0ccdd50009bae300d303337540062a66606066ebcc060c0ccdd5000980c18199baa003133300b00b00400214a02940c0d4c0c8dd50020a503035005303300430330023031001375860600046eb0c0bcc0c0004cc0b4dd3801198169ba70014bd701119198008008019129998160008a6103d87a800013232533302a3375e6024605a6ea80080144c054cc0bc0092f5c02660080080026060004605c0024605460560024a660480022c44646600200200644a666052002297ae013302a3003302b00133002002302c001233300a00148810048810022323300100100322533302700114bd700998141ba63003302900133002002302a00122232333001001004003222533302800210011333003003302b00233004001375660540044464666002002006004444a66604c004200226466600800860540066644646600200200a44a66605600226605866ec0dd48021ba60034bd6f7b630099191919299981599b90008002133030337606ea4020dd30038028a99981599b8f008002132533302c301d302e375400226606266ec0dd4804981918179baa001004100432533302c533303000114a22940530103d87a80001301733031374c00297ae03233300100100800222253330320021001132333004004303600333223233001001005225333037001133038337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc0dccdc800400109981e19bb037520106ea001c01454ccc0dccdc7804001099299981c1814981d1baa00113303d337606ea4024c0f8c0ecdd5000802080219299981c18148008a60103d87a8000130233303d375000297ae03370000e00226607866ec0dd48011ba800133006006003375a60720066eb8c0dc008c0ec008c0e4004dd718188009bad30320013034002133030337606ea4008dd3000998030030019bab302d003375c6056004605e004605a0026eb8c094004dd598130009814001118119812181200091299980e9809980f9baa002100113756604660406ea8008c004004894ccc07c0045200013370090011980100118110009180f8009bac301e301b375402044464a6660366022603a6ea8004520001375a6042603c6ea8004c94ccc06cc044c074dd50008a6103d87a80001323300100137566044603e6ea8008894ccc084004530103d87a80001323232325333021337220100042a66604266e3c0200084c030cc098dd4000a5eb80530103d87a8000133006006003375a60460066eb8c084008c094008c08c004cc01000c00888c8cc00400400c894ccc078004530103d87a8000132323232533301e3372200e0042a66603c66e3c01c0084c024cc08cdd3000a5eb80530103d87a8000133006006003375660400066eb8c078008c088008c080004dd2a400044a66602c00229444c00c00894cc054004588c064c068c068c068c068004dd7180b980a1baa0041533012491054c36323b3500162225333013300430153754006264a666030002004264a66666603a00200600600600626464a66603600200a264a66666604000200c00c00c264a66603a60400062a01000e6eb4004018c074004c07400cdd7000980d000980b1baa003001370e9000111919800800801911980180098010010068068068069809980a001180900098071baa002370e90010b1807980800118070009807001180600098041baa00114984d958dd70008a998012481054c35383b3500165734ae7155ceaab9e5573eae815d0aba257489811e581c3e5a776bcee213e3dfd15806952a10ac5590e3e97d09d62eb99266b20001"
}
2 changes: 1 addition & 1 deletion hydra-plutus/src/Hydra/Contract/Head.hs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ checkFanout ScriptContext{scriptContextTxInfo = txInfo} closedDatum numberOfFano
fannedOutUtxoHash == utxoHash

hasSameCommitUTxOHash =
traceIfFalse $(errorCode FanoutUTxOToDecommitHashMismatch) $
traceIfFalse $(errorCode FanoutUTxOToCommitHashMismatch) $
alphaUTxOHash == commitUtxoHash

hasSameUTxOToDecommitHash =
Expand Down
2 changes: 2 additions & 0 deletions hydra-plutus/src/Hydra/Contract/HeadError.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ data HeadError
| FanoutUTxOHashMismatch
| LowerBoundBeforeContestationDeadline
| FanoutNoLowerBoundDefined
| FanoutUTxOToCommitHashMismatch
| FanoutUTxOToDecommitHashMismatch
| DepositNotSpent
| DepositInputNotFound
Expand Down Expand Up @@ -122,3 +123,4 @@ instance ToErrorCode HeadError where
FailedCloseUsedDec -> "H51"
FailedCloseUnusedInc -> "H52"
FailedCloseUsedInc -> "H53"
FanoutUTxOToCommitHashMismatch -> "H54"

0 comments on commit b564f8d

Please sign in to comment.