Commit Graph

249 Commits

Author SHA1 Message Date
KtorZ b5047d623a
Update to pallas=0.31.0 2024-11-19 14:53:36 +01:00
microproofs 18054eed1a
chore: Release 2024-11-13 15:17:53 -05:00
KtorZ 51a8ddcc0b
Document test output JSON schema through '--help'
The help manual is getting a bit large, but fortunately, we can resort
  to a simpler/more compact version using `-h`.
2024-11-13 14:59:20 +01:00
microproofs 7966cc0165
Finish up decision tree and rework it a bit to closely follow how the paper handles wild card patterns 2024-11-01 19:34:48 -04:00
microproofs a7741ec286
chore: Release 2024-10-19 13:45:54 -04:00
microproofs 356d845a9a
chore: Release 2024-10-01 16:14:25 -04:00
KtorZ ac9c71e32a
Try to bundle openssl with the Aiken binary to avoid core dumps on Linux 2024-09-22 18:12:26 +02:00
microproofs 3d77b5c378
chore: Release 2024-09-20 14:05:15 -04:00
microproofs 7047c7720e
chore: Release 2024-09-13 16:52:20 -04:00
KtorZ 0905146140
chore: Release 2024-09-10 13:25:04 +02:00
rvcas be31a7ce38
chore: Release 2024-09-03 17:01:41 -04:00
rvcas 20ac89fc33
chore: reset version 2024-09-03 17:01:24 -04:00
KtorZ c21466831c
Bump versions to 1.1.0, in anticipation. 2024-08-29 09:12:37 +02:00
KtorZ e31c6de04e
Adjust module organization to facilitate resurrection of the playground.
The playground doesn't / cannot depend on aiken-project because that becomes a gigantic pain. So instead, we try to keep essential stuff inside aiken-lang when possible.
2024-08-29 09:12:37 +02:00
KtorZ 745f14ccb2
Adjust doc to support blockquote alerts. 2024-08-28 15:28:49 +02:00
KtorZ b78aee2acc
Use pallas==0.30.1 2024-08-27 20:17:56 +02:00
KtorZ 05a3d5fb2a
Revert "Switch back to pallas crates release now that 0.30.0 is out."
This reverts commit 7435dfd0e5.
2024-08-23 16:07:11 +02:00
KtorZ 7435dfd0e5
Switch back to pallas crates release now that 0.30.0 is out. 2024-08-23 15:59:05 +02:00
KtorZ b479a289cf
Implement source linker and add URL to source code in generated docs.
Long overdue.
2024-08-22 16:37:48 +02:00
KtorZ f244b9c496
Add support for protocol parameters (except cost models)
We can now simulate transactions with protocol parameters voting
  procedures. Cost models remain to be done, though.
2024-08-13 10:56:29 +02:00
KtorZ 50dad1fdfe
Test proposal procedures through Aiken. 2024-08-13 10:56:29 +02:00
KtorZ cfca0da4e9
Add (partial) support for simulating contract with proposal procedures
This covers every proposal procedures but protocol parameters, this
  one is yet to be done. It spans over 30+ fields, and felt like it is a
  big enough piece to tackle it on its own.
2024-08-13 10:56:29 +02:00
KtorZ 6b6bace8a5
test 'mint' purpose and script context creation.
Alongside a bunch of other stuff from the coverage list. In
  particular, the mint transaction contains:

  - reference inputs
  - multiple outputs, with assets, and type-0, type-1 and type-6
    addresses.
  - an output with a datum hash
  - an output with an inline script
  - carries an extra datum witness, preimage of the embedded hash
  - mint, with 2 policies purposely ordered wrongly, with 1 and 2
    assets purposely ordered wrong. One of the mint is actually a
    burn (i.e. negative quantity)
2024-08-13 10:56:29 +02:00
KtorZ 821f7bd8c7
Fix ToPlutusData serializer for V3
This is intense, as we still want to preserve the serializer for V1 &
  V2, and I've tried as much as possible to avoid polluting the
  application layer with many enum types such as:

  ```
  pub enum TxOut {
    V1(TransactionOutput),
    V2(TransactionOutput),
    V3(TransactionOutput),
  }
  ```

  Those types make working with the script context cumbersome, and are
  only truly required to provide different serialisation strategies. So
  instead, we keep one top-level `TxInfo V1/V2/V3` type, and we ensure
  to pass serialization strategies as type wrappers.

  This way, the strategy propagates through the structure up until it's
  eliminated when it reaches the relevant types.

  All-in-all, this strikes a correct balance between maintainability and
  repetition; and it makes it possible to define _different but mostly
  identical_ encoders for the various versions.

  With it, I've been able to successfully encode a V3 script context and
  match it against one produced using the Haskell libraries. More to
  come.
2024-08-13 10:55:23 +02:00
KtorZ ff4a480242
Upgrade pallas to v0.0.29, and start support for simulating transactions carrying Plutus v3 scripts. 2024-08-13 10:55:22 +02:00
KtorZ f5c4e185d4 Redact compiledCode & hash in generated blueprint tests
The point of those tests is to ensure that blueprints are generated
  properly, irrespective of the generated code. It is annoying to
  constantly get those test failing every time we introduce an
  optimization or something that would slightly change the generated
  UPLC.
2024-08-08 00:39:44 -04:00
KtorZ 91e0e2493a
Provide better errors on unknown type in cyclic definitions.
Let's consider the following case:

  ```
  type Var =
    Integer

  type Vars =
    List<Var>
  ```

  This incorrectly reports an infinite cycle; due to the inability to
  properly type-check `Var` which is also a dependent var of `Vars`. Yet
  the real issue here being that `Integer` is an unknown type.

  This commit also upgrades miette to 7.2.0, so that we can also display
  a better error output when the problem is actually a cycle.
2024-08-06 19:24:48 +02:00
KtorZ 4645257e62
Prune pallas dependencies.
Using 'pallas' as a dependency brings utxo-rpc other annoying dependencies such as _tokyo_. This not only makes the overall build longer, but it also prevents it to even work when targetting wasm.
2024-08-03 14:14:49 +02:00
rvcas 4645fd3e28
chore: Release 2024-07-25 08:28:15 -04:00
KtorZ 49190b485a
chore: Release 2024-07-25 09:58:06 +02:00
KtorZ 216dab99d4
chore: Release 2024-06-06 11:19:34 +02:00
hade ad3c9f24b7
chore: minimal pallas dependencies 2024-05-30 15:09:05 +07:00
rvcas 338fc0eba6
chore: Release 2024-05-23 16:45:10 -04:00
rvcas ff50d4d2cf
chore: Release 2024-05-23 16:23:59 -04:00
rvcas c3ad52b50f
feat: add compiler version to aiken.toml 2024-05-22 15:35:57 -04:00
Christopher Valerio 949f16f34a
rebase from main 2024-04-28 17:04:40 -06:00
dependabot[bot] 2abf626e25 chore(deps): bump h2 from 0.3.24 to 0.3.26
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 12:26:51 -04:00
rvcas 075668b52e
chore: Release 2024-03-25 22:09:37 -04:00
KtorZ 4e8042fd06
chore: Release 2024-03-22 16:10:17 +01:00
rvcas 2b5ed95df5 feat: serialize as cbor 2024-03-08 19:19:07 -05:00
rvcas fe6710935d feat: impl serde on errythang 2024-03-08 19:19:07 -05:00
KtorZ a9d596f4cb
Memoize simplification steps during property-based shrinking.
I've been benchmarking that through the shrink of 'large' lists, and the cache brings about 1.5x speed increase. For small and simple cases, the cache as no visible effects (positive or negative).
2024-03-08 18:58:51 +01:00
KtorZ bff822ea7f
Rework unit test report to leverage new reification
And also provide slightly better errors when traces, or trace-if-false operators are present.
2024-03-07 01:20:40 +01:00
microproofs b146db8c95 update package dependency 2024-03-05 10:23:29 -05:00
dependabot[bot] 52795692d6 Bump mio from 0.8.10 to 0.8.11
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 10:18:01 -05:00
KtorZ 362acd43a3
Rework and optimize PRNG
Using ByteArrays as vectors on-chain is a lot more efficient than relying on actul Data's list of values. From the Rust end, it doesn't change much as we were already manipulating vectors anyway.
2024-03-04 14:27:16 +01:00
KtorZ 7a2537432a
Accept an optional --seed parameter for check, otherwise default to random.
Also, show the seed on failure.
2024-03-03 20:36:01 +01:00
KtorZ 14f1025f0b
Display counterexamples as Aiken values instead of raw UPLC. 2024-03-03 19:33:24 +01:00
KtorZ 3762473a60
Add preliminary plumbing to run property test through the CLI.
This is very very rough at the moment. But it does a couple of thing:

  1. The 'ArgVia' now contains an Expr/TypedExpr which should unify to a Fuzzer. This is to avoid having to introduce custom logic to handle fuzzer referencing. So this now accepts function call, field access etc.. so long as they unify to the right thing.

  2. I've done quite a lot of cleanup in aiken-project mostly around the tests and the naming surrounding them. What we used to call 'Script' is now called 'Test' and is an enum between UnitTest (ex-Script) and PropertyTest. I've moved some boilerplate and relevant function under those module Impl.

  3. I've completed the end-to-end pipeline of:
     - Compiling the property test
     - Compiling the fuzzer
     - Generating an initial seed
     - Running property tests sequentially, threading the seed through each step.

   An interesting finding is that, I had to wrap the prop test in a similar wrapper that we use for validator, to ensure we convert primitive types wrapped in Data back to UPLC terms. This is necessary because the fuzzer return a ProtoPair (and soon an Array) which holds 'Data'.

  At the moment, we do nothing with the size, though the size should ideally grow after each iteration (up to a certain cap).

  In addition, there are a couple of todo/fixme that I left in the code as reminders of what's left to do beyond the obvious (error and success reporting, testing, etc..)
2024-03-03 19:33:24 +01:00
rvcas d698f76e3c
fix(codegen): builtin calls for g1 and g2 where flipped
closes #840
2024-02-29 12:13:51 -05:00