IntersectMBO / IntersectMBO/plutus

Better debugging/trace story for on-chain code

Open
#3,164 2 comments 10 reactions 0 assignees View on GitHub
Objective status: triaged
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Currently, debugging Validator code running on-chain is painful since there is no equivalent of `Show` which compiles to plutus core.

For me, the debugging story has been:

- Use traceIfFalse with a descriptive error on all boolean conditions of the Validator.

- Look at the trace output given by failing tests to get a view of the TxInfo for the ScriptContext.

The above are good sometimes but when the time comes to properly trace execution, the picture is a lot worse. We end up having to insert conditional traceErrors and manually binary search to find out values...

In #3142, @ak3n mentioned Data may be a builtin in future, which might enable some better options.

Meanwhile: what are our best options for debugging on-chain code currently? Would it be viable (if a bit painful) to use the CEK machine API?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.