You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to see if we can achieve the following goal using the minihaskell backend (as opposed to going via LLVM).
Validity predicates
The first few VPs can be very simple. These neeed to be able to compile through LLVM to WASM and be compatible with the validity predicate interface of the Anoma ledger.
For background on the validity predicate interface of the Anoma ledger, see vp_template for the interface a validity predicate needs to provide - we’ll need to have this validate_tx interface provided by the WASM output of MiniJuvix. See here for some functions that should be available (as extern in > MiniJuvix) to validity predicates written in the MiniJuvix frontend, which then need to be compiled to appropriate calls in the LLVM/WASM (they are already defined using the C FFI, so hopefully this should be straightforward to implement).
For this issue we will see if we compile the minihaskell output to WASM, including the aroma FFI calls.
The text was updated successfully, but these errors were encountered:
We tried using the asterius Haskell to WebAssembly compiler.
A validity predicate must be made available to the WASM runtime as a top-level function with a particular type-signature. So we need to be able to export Haskell functions via FFI using Asteruius.
We tried using foreign export javascript as described in tweag blog and in the Asterius test case. But this did not make the exported symbol available in the WASM output.
There's an open issue from 2020 for the same issue with exporting Haskell symbols that has not been looked at by maintainers of Asterius.
It seems like Asterius is not maintained. For example the project roadmap has not been updated since Q3 2021.
In summary we didn't find a way to get the FFI to work and so we can't use Asterius to compile validity predicates for use on the Anoma ledger.
See https://hackmd.io/A72oR4wYR-msPuFmU8f5rg?view
We want to see if we can achieve the following goal using the minihaskell backend (as opposed to going via LLVM).
For this issue we will see if we compile the minihaskell output to WASM, including the aroma FFI calls.
The text was updated successfully, but these errors were encountered: