Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptic failure report in test execution #3488

Closed
abailly-iohk opened this issue Jul 5, 2021 · 2 comments
Closed

Cryptic failure report in test execution #3488

abailly-iohk opened this issue Jul 5, 2021 · 2 comments
Assignees
Labels

Comments

@abailly-iohk
Copy link
Contributor

Area

[X] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
[X] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
[] Marlowe Related to Marlowe
[] Other Any other topic (Playgrounds, etc.)

Summary

When some endpoint call fails to validate the transaction it builds, an error is reported on the previous endpoint call, without any information whatsoever about the original cause.

Steps to reproduce

  1. Checkout hydra-poc repository for given branch.
  2. run nix-shell && cabal test hydra-plutus at the top-level (assuming nix is correctly installed and configured)
  3. The test fails showing something like:
      [INFO] Slot 6: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
                       Receive endpoint call: Object (fromList [("tag",String "collectCom"),("value",Object (fromList [("unEndpointValue",Array [Object (fromList [("getPubKeyHash
",String "21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9")]),Array [Object (fromList [("txOutAddress",Object (fromList [("addressCredential",Object (fromList [(
"contents",Object (fromList [("getPubKeyHash",String "21fe31dfa154a261626bf854046fd2271b7bed4b6abe45aa58877ef47f9721b9")])),("tag",String "PubKeyCredential")])),("addressStakingC
redential",Null)])),("txOutDatumHash",Null),("txOutValue",Object (fromList [("getValue",Array [Array [Object (fromList [("unCurrencySymbol",String "")]),Array [Array [Object (fro
mList [("unTokenName",String "")]),Number 1000.0]]]])]))]),Object (fromList [("txOutAddress",Object (fromList [("addressCredential",Object (fromList [("contents",Object (fromList
 [("getPubKeyHash",String "39f713d0a644253f04529421b9f51b9b08979d08295959c4f3990ee617f5139f")])),("tag",String "PubKeyCredential")])),("addressStakingCredential",Null)])),("txOut
DatumHash",Null),("txOutValue",Object (fromList [("getValue",Array [Array [Object (fromList [("unCurrencySymbol",String "")]),Array [Array [Object (fromList [("unTokenName",Strin
g "")]),Number 1000.0]]]])]))])]])]))])
      [WARNING] Slot 6: W1: handleTx failed: ValidationError (ScriptFailure (EvaluationError ["Missing signature","checkScriptContext failed","Missing datum","checkScriptContext
failed"]))
      [WARNING] Slot 6: 00000000-0000-4000-8000-000000000000 {Contract instance for wallet 1}:
                          Contract instance stopped with error: WalletError (ValidationError (ScriptFailure (EvaluationError ["Missing signature","checkScriptContext failed","Mis
sing datum","checkScriptContext failed"])))
        src/Plutus/Contract/Test.hs:247:

Expected behavior

The test is expected to fail because the computed amountValue which is used in this validation step is certainly incorrect.

However, the failure happens when the close endpoint is called, not the collectCom as reported in the above error. Furthermore, the ScriptFailure error shows a list of failures which are all equally uninformative instead of telling us what exactly failed. Note that adding traceIfFailed does not help much.

System info (please complete the following information):

  • OS: Ubuntu
  • Version: 20.04
  • Plutus version : 5e20b2d
@luigy luigy self-assigned this Jul 21, 2021
@ch1bo
Copy link

ch1bo commented Jul 30, 2021

#3601 may be related as we also see unexpected failures there (failing in collectCom instead of close) upon seemingly unrelated changes

@abailly-iohk
Copy link
Contributor Author

Closing in favour of #3648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants