Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Calculate ex units on server #360

Closed bladyjoker closed 2 years ago

bladyjoker commented 2 years ago

To successfully run Plutus Scripts we need correct execution units (xu) budget calculations to be performed.

Options that we've scoped out so far that will get us there asap are:

  1. Ogmios evaluateTx method
  2. mlabs-haskell/bot-plutus-interface implementation (using cardano-node lib)

It would be good to know how the 2 methods compare in terms of xus calculated.

ngua commented 2 years ago

Related: #174

ngua commented 2 years ago

For reference, the BPI approach: https://github.com/mlabs-haskell/bot-plutus-interface/blob/91b18e1d73227d21a99007cb1568341dfa6c3391/src/BotPlutusInterface/CardanoCLI.hs#L514

ngua commented 2 years ago

We'll go with the server now, it will be faster and less error-prone to implement

ngua commented 2 years ago

Since the tx deserialization code is untested (and bugs are fairly likely given our past experiences with CSL integration), I'm going to use the server to take care of this. I'm planning on extending finalizeTx to take care of it