Plutonomicon / plutarch-plutus

Typed eDSL for writing UPLC /ˈpluː.tɑːk/
MIT License
123 stars 64 forks source link

Add trace message codifier #709

Open SeungheonOh opened 3 months ago

SeungheonOh commented 3 months ago

Small utility function to turn long messages into code table.

L-as commented 2 months ago

My thoughts:

(Feel free to disregard of course, this isn't a "request change" review.)

SeungheonOh commented 2 months ago

This is per @bladyjoker 's request. I see this being very useful. IMO, not having any trace for mainnet script was a huge mistake, at least for Liqwid. Anytime script threw up, it was massive pain to recreate that with scripts with tracing to actually figure out what went wrong. Codifying error messages would save a lot of efforts without not much cost since it will be reference script anyways.

As for UTF-8 codes, I think that is a good idea. I change it to support UTF-8 tags.

Also, for having this on Plutarch's compile time, this was made to be external tool so that it can be used on already existing scripts as well. Also, deep integration to Plutarch was too much effort; this is small and portable. Maybe if we can get more funding on Plutarch, we can tackle this.

L-as commented 2 months ago

That makes more sense, but FWIW you should be able to just use the same inputs for the script to figure out why it failed.

SeungheonOh commented 2 months ago

Not really, in case of Liqwid, we'd need to deploy extra sets of scripts which will cost few hundred Ada and make changes to offchain in some annoying way. So, rather, we have this utility that extracts CBOR and input UTXOs in their resolved form into JSON. We import that to Haskell project and run the CEK manually. It is less painful for sure, but still immensely annoying. Not to mention, this is very offchain framework dependent.