diff --git a/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md new file mode 100644 index 00000000..e8b44591 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md @@ -0,0 +1,24 @@ +# Benchmark Implementation Notes + +**Scenario**: `factorial_naive_recursion` + +**Submission ID**: `Scalus_0.17.0_Unisay_vanrossem` + +## Implementation Details + +- **Compiler**: `Scalus 0.17.0` +- **Implementation Approach**: `naive recursive` +- **Compilation Flags**: `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)` +- **Track**: preview (`min_plutus_version = 1.60.0.0`) + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Source Code + +- See [source/README.md](source/README.md) for source code and reproducibility instructions + +## Notes + +Same naive-recursive Scalus 0.17.0 source as the current-track `Scalus_0.17.0_Unisay/` submission, recompiled with the van Rossem target protocol version to enable `case-on-builtins` and batch-6 builtins. Invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. diff --git a/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/factorial.uplc b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/factorial.uplc new file mode 100644 index 00000000..5b24a538 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/factorial.uplc @@ -0,0 +1,26 @@ +(program + 1.1.0 + [ + (lam + a-0 + [ + (lam b-1 [ a-0 (lam c-2 [ [ b-1 b-1 ] c-2 ]) ]) + (lam b-1 [ a-0 (lam c-2 [ [ b-1 b-1 ] c-2 ]) ]) + ] + ) + (lam + d-3 + (lam + e-4 + (case + [ [ (builtin lessThanEqualsInteger) e-4 ] (con integer 0) ] + [ + [ (builtin multiplyInteger) e-4 ] + [ d-3 [ [ (builtin subtractInteger) e-4 ] (con integer 1) ] ] + ] + (con integer 1) + ) + ) + ) + ] +) diff --git a/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json new file mode 100644 index 00000000..4b67706a --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json @@ -0,0 +1,26 @@ +{ + "compiler": { + "name": "Scalus", + "version": "0.17.0", + "commit_hash": "553d4d420166d87efad7220ce288e0961cfe17c0" + }, + "compilation_config": { + "optimization_level": "Scalus", + "target": "uplc", + "flags": ["Scalus", "vanRossem"], + "min_plutus_version": "1.60.0.0" + }, + "contributors": [ + { + "name": "Unisay", + "organization": "Intersect MBO" + } + ], + "submission": { + "date": "2026-05-06T12:00:00Z", + "source_available": true, + "source_repository": "https://github.com/Unisay/scalus-cape-submissions", + "source_commit_hash": "becb41d62cb2832001de1541ff2dcde0d3ac92c6", + "implementation_notes": "Preview submission targeting the van Rossem hard fork (Cardano protocol version 11, projected late-June 2026). Same naive-recursive Scalus 0.17.0 source as the corresponding current-track Scalus_0.17.0_Unisay/ submission, recompiled with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). Evaluated on `PlutusVM.makePlutusV3VM(MajorProtocolVersion.vanRossemPV)` against the same input as `cape-tests.json`. Invalid on mainnet until the hard fork activates; routed to the preview report via `min_plutus_version = 1.60.0.0`." + } +} diff --git a/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json new file mode 100644 index 00000000..a21a9f97 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json @@ -0,0 +1,109 @@ +{ + "evaluations": [ + { + "cpu_units": 347937, + "description": "Factorial of 0 should return 1 (mathematical definition)", + "execution_result": "success", + "memory_units": 2001, + "name": "factorial_0" + }, + { + "cpu_units": 999935, + "description": "Factorial of 1 should return 1", + "execution_result": "success", + "memory_units": 4606, + "name": "factorial_1" + }, + { + "cpu_units": 1651933, + "description": "Factorial of 2 should return 2", + "execution_result": "success", + "memory_units": 7211, + "name": "factorial_2" + }, + { + "cpu_units": 2303931, + "description": "Factorial of 3 should return 6", + "execution_result": "success", + "memory_units": 9816, + "name": "factorial_3" + }, + { + "cpu_units": 2955929, + "description": "Factorial of 4 should return 24", + "execution_result": "success", + "memory_units": 12421, + "name": "factorial_4" + }, + { + "cpu_units": 3607927, + "description": "Factorial of 5 should return 120", + "execution_result": "success", + "memory_units": 15026, + "name": "factorial_5" + }, + { + "cpu_units": 5563921, + "description": "Factorial of 8 should return 40320", + "execution_result": "success", + "memory_units": 22841, + "name": "factorial_8" + }, + { + "cpu_units": 6867917, + "description": "Factorial of 10 should return 3628800 (original benchmark target)", + "execution_result": "success", + "memory_units": 28051, + "name": "factorial_10" + }, + { + "cpu_units": 8171913, + "description": "Factorial of 12 should return 479001600", + "execution_result": "success", + "memory_units": 33261, + "name": "factorial_12" + }, + { + "cpu_units": 347937, + "description": "Factorial of negative number should return 1 based on current implementation (n <= 0 case)", + "execution_result": "success", + "memory_units": 2001, + "name": "factorial_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.52.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.0204297825, + "block_memory_budget_pct": 0.05364677419354839, + "cpu_units": { + "maximum": 8171913, + "median": 2629930, + "minimum": 347937, + "sum": 32819280, + "sum_negative": 0, + "sum_positive": 32819280 + }, + "execution_fee_lovelace": 10285, + "memory_units": { + "maximum": 33261, + "median": 11118, + "minimum": 2001, + "sum": 137235, + "sum_negative": 0, + "sum_positive": 137235 + }, + "reference_script_fee_lovelace": 690, + "script_size_bytes": 46, + "scripts_per_block": 1864, + "scripts_per_tx": 420, + "term_size": 41, + "total_fee_lovelace": 10975, + "tx_cpu_budget_pct": 0.08171913, + "tx_memory_budget_pct": 0.23757857142857144 + }, + "scenario": "factorial_naive_recursion", + "timestamp": "2026-05-06T13:50:26Z", + "version": "1.0.0" +} diff --git a/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md new file mode 100644 index 00000000..2e68def0 --- /dev/null +++ b/submissions/factorial_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md @@ -0,0 +1,38 @@ +# Scalus Factorial Naive Recursion Implementation (vanRossem preview) + +**Source Code**: [FactorialNaiveRecursion.scala](https://github.com/Unisay/scalus-cape-submissions/blob/becb41d62cb2832001de1541ff2dcde0d3ac92c6/src/factorial_naive_recursion/FactorialNaiveRecursion.scala) + +**Repository**: + +**Commit**: `becb41d62cb2832001de1541ff2dcde0d3ac92c6` + +**Path**: `src/factorial_naive_recursion/FactorialNaiveRecursion.scala` + +The Scala source is identical to the current-track `Scalus_0.17.0_Unisay/` submission. The difference is in the compile command: this preview artifact is produced with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). The same `@main factorial_naive_recursion.compileFactorialNaiveRecursion` writes both the current-track and the vanRossem artifact in one run. + +The output is invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. + +## Reproducing the Compilation + +1. Clone the repository: + + ```bash + git clone https://github.com/Unisay/scalus-cape-submissions + cd scalus-cape-submissions + ``` + +2. Check out the specific commit: + + ```bash + git checkout becb41d62cb2832001de1541ff2dcde0d3ac92c6 + ``` + +3. Run the @main object: + + ```bash + sbt 'runMain factorial_naive_recursion.compileFactorialNaiveRecursion' + ``` + +4. The compiled UPLC output should match `factorial.uplc` in this submission (it is written to `src/factorial_naive_recursion/factorial-vanrossem.uplc` upstream). + +For detailed build instructions and environment setup, see the repository README. diff --git a/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md new file mode 100644 index 00000000..107225fa --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/README.md @@ -0,0 +1,24 @@ +# Benchmark Implementation Notes + +**Scenario**: `fibonacci_naive_recursion` + +**Submission ID**: `Scalus_0.17.0_Unisay_vanrossem` + +## Implementation Details + +- **Compiler**: `Scalus 0.17.0` +- **Implementation Approach**: `naive recursive` +- **Compilation Flags**: `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)` +- **Track**: preview (`min_plutus_version = 1.60.0.0`) + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Source Code + +- See [source/README.md](source/README.md) for source code and reproducibility instructions + +## Notes + +Same naive-recursive Scalus 0.17.0 source as the current-track `Scalus_0.17.0_Unisay/` submission, recompiled with the van Rossem target protocol version to enable `case-on-builtins` and batch-6 builtins. Invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. diff --git a/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/fibonacci.uplc b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/fibonacci.uplc new file mode 100644 index 00000000..78bf6476 --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/fibonacci.uplc @@ -0,0 +1,33 @@ +(program + 1.1.0 + [ + (lam + a-0 + [ + (lam b-1 [ a-0 (lam c-2 [ [ b-1 b-1 ] c-2 ]) ]) + (lam b-1 [ a-0 (lam c-2 [ [ b-1 b-1 ] c-2 ]) ]) + ] + ) + (lam + d-3 + (lam + e-4 + (case + [ [ (builtin lessThanEqualsInteger) e-4 ] (con integer 1) ] + (case + [ [ (builtin equalsInteger) e-4 ] (con integer 2) ] + [ + [ + (builtin addInteger) + [ d-3 [ [ (builtin subtractInteger) e-4 ] (con integer 1) ] ] + ] + [ d-3 [ [ (builtin subtractInteger) e-4 ] (con integer 2) ] ] + ] + (con integer 1) + ) + e-4 + ) + ) + ) + ] +) diff --git a/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json new file mode 100644 index 00000000..4b67706a --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metadata.json @@ -0,0 +1,26 @@ +{ + "compiler": { + "name": "Scalus", + "version": "0.17.0", + "commit_hash": "553d4d420166d87efad7220ce288e0961cfe17c0" + }, + "compilation_config": { + "optimization_level": "Scalus", + "target": "uplc", + "flags": ["Scalus", "vanRossem"], + "min_plutus_version": "1.60.0.0" + }, + "contributors": [ + { + "name": "Unisay", + "organization": "Intersect MBO" + } + ], + "submission": { + "date": "2026-05-06T12:00:00Z", + "source_available": true, + "source_repository": "https://github.com/Unisay/scalus-cape-submissions", + "source_commit_hash": "becb41d62cb2832001de1541ff2dcde0d3ac92c6", + "implementation_notes": "Preview submission targeting the van Rossem hard fork (Cardano protocol version 11, projected late-June 2026). Same naive-recursive Scalus 0.17.0 source as the corresponding current-track Scalus_0.17.0_Unisay/ submission, recompiled with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). Evaluated on `PlutusVM.makePlutusV3VM(MajorProtocolVersion.vanRossemPV)` against the same input as `cape-tests.json`. Invalid on mainnet until the hard fork activates; routed to the preview report via `min_plutus_version = 1.60.0.0`." + } +} diff --git a/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json new file mode 100644 index 00000000..0085063a --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/metrics.json @@ -0,0 +1,116 @@ +{ + "evaluations": [ + { + "cpu_units": 347937, + "description": "Fibonacci of 0 should return 0", + "execution_result": "success", + "memory_units": 2001, + "name": "fibonacci_0" + }, + { + "cpu_units": 347937, + "description": "Fibonacci of 1 should return 1", + "execution_result": "success", + "memory_units": 2001, + "name": "fibonacci_1" + }, + { + "cpu_units": 496270, + "description": "Fibonacci of 2 should return 1", + "execution_result": "success", + "memory_units": 2602, + "name": "fibonacci_2" + }, + { + "cpu_units": 1803901, + "description": "Fibonacci of 3 should return 2", + "execution_result": "success", + "memory_units": 8011, + "name": "fibonacci_3" + }, + { + "cpu_units": 6023460, + "description": "Fibonacci of 5 should return 5", + "execution_result": "success", + "memory_units": 25440, + "name": "fibonacci_5" + }, + { + "cpu_units": 28428886, + "description": "Fibonacci of 8 should return 21", + "execution_result": "success", + "memory_units": 117994, + "name": "fibonacci_8" + }, + { + "cpu_units": 76003333, + "description": "Fibonacci of 10 should return 55", + "execution_result": "success", + "memory_units": 314521, + "name": "fibonacci_10" + }, + { + "cpu_units": 852616757, + "description": "Fibonacci of 15 should return 610", + "execution_result": "success", + "memory_units": 3522659, + "name": "fibonacci_15" + }, + { + "cpu_units": 9465344294, + "description": "Fibonacci of 20 should return 6765", + "execution_result": "success", + "memory_units": 39101258, + "name": "fibonacci_20" + }, + { + "cpu_units": 104981960625, + "description": "Fibonacci of 25 should return 75025 (original benchmark target)", + "execution_result": "success", + "memory_units": 433673985, + "name": "fibonacci_25" + }, + { + "cpu_units": 347937, + "description": "Fibonacci of negative number should return the negative number itself based on current implementation", + "execution_result": "success", + "memory_units": 2001, + "name": "fibonacci_negative" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.52.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 262.4549015625, + "block_memory_budget_pct": 699.4741693548388, + "cpu_units": { + "maximum": 104981960625, + "median": 6023460, + "minimum": 347937, + "sum": 115413721337, + "sum_negative": 0, + "sum_positive": 115413721337 + }, + "execution_fee_lovelace": 35831102, + "memory_units": { + "maximum": 433673985, + "median": 25440, + "minimum": 2001, + "sum": 476772473, + "sum_negative": 0, + "sum_positive": 476772473 + }, + "reference_script_fee_lovelace": 915, + "script_size_bytes": 61, + "scripts_per_block": 0, + "scripts_per_tx": 0, + "term_size": 54, + "total_fee_lovelace": 35832017, + "tx_cpu_budget_pct": 1049.81960625, + "tx_memory_budget_pct": 3097.6713214285714 + }, + "scenario": "fibonacci_naive_recursion", + "timestamp": "2026-05-06T13:50:27Z", + "version": "1.0.0" +} diff --git a/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md new file mode 100644 index 00000000..54addfcf --- /dev/null +++ b/submissions/fibonacci_naive_recursion/Scalus_0.17.0_Unisay_vanrossem/source/README.md @@ -0,0 +1,38 @@ +# Scalus Fibonacci Naive Recursion Implementation (vanRossem preview) + +**Source Code**: [FibonacciNaiveRecursion.scala](https://github.com/Unisay/scalus-cape-submissions/blob/becb41d62cb2832001de1541ff2dcde0d3ac92c6/src/fibonacci_naive_recursion/FibonacciNaiveRecursion.scala) + +**Repository**: + +**Commit**: `becb41d62cb2832001de1541ff2dcde0d3ac92c6` + +**Path**: `src/fibonacci_naive_recursion/FibonacciNaiveRecursion.scala` + +The Scala source is identical to the current-track `Scalus_0.17.0_Unisay/` submission. The difference is in the compile command: this preview artifact is produced with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). The same `@main fibonacci_naive_recursion.compileFibonacciNaiveRecursion` writes both the current-track and the vanRossem artifact in one run. + +The output is invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. + +## Reproducing the Compilation + +1. Clone the repository: + + ```bash + git clone https://github.com/Unisay/scalus-cape-submissions + cd scalus-cape-submissions + ``` + +2. Check out the specific commit: + + ```bash + git checkout becb41d62cb2832001de1541ff2dcde0d3ac92c6 + ``` + +3. Run the @main object: + + ```bash + sbt 'runMain fibonacci_naive_recursion.compileFibonacciNaiveRecursion' + ``` + +4. The compiled UPLC output should match `fibonacci.uplc` in this submission (it is written to `src/fibonacci_naive_recursion/fibonacci-vanrossem.uplc` upstream). + +For detailed build instructions and environment setup, see the repository README. diff --git a/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/README.md b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/README.md new file mode 100644 index 00000000..50bb7b67 --- /dev/null +++ b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/README.md @@ -0,0 +1,24 @@ +# Benchmark Implementation Notes + +**Scenario**: `htlc` + +**Submission ID**: `Scalus_0.17.0_Unisay_vanrossem` + +## Implementation Details + +- **Compiler**: `Scalus 0.17.0` +- **Implementation Approach**: `idiomatic @Compile spending validator, Data -> Unit, derived FromData/ToData` +- **Compilation Flags**: `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)` +- **Track**: preview (`min_plutus_version = 1.60.0.0`) + +## Performance Results + +- See [metrics.json](metrics.json) for detailed performance measurements + +## Source Code + +- See [source/README.md](source/README.md) for source code and reproducibility instructions + +## Notes + +Same Scalus 0.17.0 HTLC validator source as the current-track `Scalus_0.17.0_Unisay/` submission (production-safe validity-range convention from #170: claim reads upper bound, refund reads lower bound — both finite, strict), recompiled with the van Rossem target protocol version to enable `case-on-builtins` and batch-6 builtins. CPU/MEM measured against a minimal `ScriptContext` harness (`src/htlc/HtlcHarness.scala`) covering both `Claim` and `Refund` redeemers. Invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. diff --git a/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/htlc.uplc b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/htlc.uplc new file mode 100644 index 00000000..675f7a8a --- /dev/null +++ b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/htlc.uplc @@ -0,0 +1,1214 @@ +(program + 1.1.0 + (case + (constr + 0 + (force (builtin dropList)) + (force (force (builtin fstPair))) + (force (builtin headList)) + (force (builtin mkCons)) + (force (force (builtin sndPair))) + (force (builtin tailList)) + ) + (lam + a-0 + (lam + b-1 + (lam + c-2 + (lam + d-3 + (lam + e-4 + (lam + f-5 + [ + (lam + g-6 + [ + (lam + h-7 + [ + (lam + i-8 + [ + (lam + j-9 + [ + (lam + k-10 + [ + (lam + l-11 + [ + (lam + m-12 + (lam + n-13 + [ + (lam + o-14 + [ + (lam + p-15 + [ + (lam + q-16 + (case + [ b-1 q-16 ] + (error) + [ + (lam + r-17 + [ + (lam + s-18 + [ + (lam + t-19 + [ + (lam + u-20 + [ + (lam + v-21 + (case + [ + b-1 + t-19 + ] + (case + (constr + 0 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + o-14 + ] + ] + ] + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + r-17 + ] + ] + ] + s-18 + [ + (builtin + unBData + ) + [ + c-2 + [ + e-4 + t-19 + ] + ] + ] + ) + (lam + w-22 + (lam + x-23 + (lam + y-24 + (lam + z-25 + [ + (lam + aa-26 + [ + (lam + ab-27 + [ + (lam + ac-28 + (case + [ + [ + (builtin + equalsInteger + ) + [ + (builtin + unIData + ) + [ + [ + l-11 + w-22 + ] + [ + [ + m-12 + w-22 + ] + x-23 + ] + ] + ] + ] + (con + integer + 1 + ) + ] + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + (builtin + lessThanInteger + ) + [ + (lam + ad-29 + [ + (lam + ae-30 + (case + [ + b-1 + ae-30 + ] + (error + + ) + [ + (lam + af-31 + (case + (case + [ + b-1 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + ad-29 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + [ + [ + (builtin + subtractInteger + ) + [ + (builtin + unIData + ) + [ + c-2 + af-31 + ] + ] + ] + (con + integer + 1 + ) + ] + [ + (builtin + unIData + ) + [ + c-2 + af-31 + ] + ] + ) + ) + [ + e-4 + ae-30 + ] + ] + (error + + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + c-2 + ad-29 + ] + ] + ] + ) + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + v-21 + w-22 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + [ + (builtin + unIData + ) + [ + c-2 + [ + u-20 + y-24 + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + i-8 + w-22 + ] + [ + j-9 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + y-24 + ] + ] + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + (builtin + equalsByteString + ) + [ + (builtin + sha2_256 + ) + z-25 + ] + ] + [ + (builtin + unBData + ) + [ + c-2 + [ + p-15 + y-24 + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + ) + ) + ) + ) + (case + (constr + 0 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + o-14 + ] + ] + ] + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + r-17 + ] + ] + ] + s-18 + ) + (lam + ag-32 + (lam + ah-33 + (lam + ai-34 + [ + (lam + aj-35 + [ + (lam + ak-36 + (case + [ + [ + (builtin + equalsInteger + ) + [ + (builtin + unIData + ) + [ + [ + l-11 + ag-32 + ] + [ + [ + m-12 + ag-32 + ] + ah-33 + ] + ] + ] + ] + (con + integer + 1 + ) + ] + (error + + ) + (con + unit + () + ) + ) + ) + (case + [ + [ + (builtin + lessThanInteger + ) + [ + (builtin + unIData + ) + [ + c-2 + [ + u-20 + ai-34 + ] + ] + ] + ] + [ + (lam + al-37 + [ + (lam + am-38 + (case + [ + b-1 + am-38 + ] + (error + + ) + [ + (lam + an-39 + (case + (case + [ + b-1 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + al-37 + ] + ] + ] + ] + (con + bool + False + ) + (con + bool + True + ) + ) + [ + [ + (builtin + addInteger + ) + [ + (builtin + unIData + ) + [ + c-2 + an-39 + ] + ] + ] + (con + integer + 1 + ) + ] + [ + (builtin + unIData + ) + [ + c-2 + an-39 + ] + ] + ) + ) + [ + e-4 + am-38 + ] + ] + (error + + ) + ) + ) + [ + (builtin + unConstrData + ) + [ + c-2 + al-37 + ] + ] + ] + ) + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + v-21 + ag-32 + ] + ] + ] + ] + ] + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + (case + [ + [ + i-8 + ag-32 + ] + [ + j-9 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + ai-34 + ] + ] + ] + ] + ] + (error + + ) + (con + unit + () + ) + ) + ] + ) + ) + ) + ) + ) + ) + [ + a-0 + (con + integer + 7 + ) + ] + ] + ) + [ + a-0 + (con + integer + 3 + ) + ] + ] + ) + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + o-14 + ] + ] + ] + ] + ) + [ + (lam + ao-40 + (case + [ + b-1 + ao-40 + ] + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + e-4 + ao-40 + ] + ] + ] + ] + (error) + ) + ) + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + r-17 + ] + ] + ] + ] + ] + ) + [ e-4 q-16 ] + ] + (error) + (error) + (error) + (error) + ) + ) + [ + (builtin unConstrData) + [ c-2 [ p-15 o-14 ] ] + ] + ] + ) + [ a-0 (con integer 2) ] + ] + ) + [ + e-4 + [ + (builtin unConstrData) n-13 + ] + ] + ] + ) + ) + (lam + ap-41 + (lam + aq-42 + [ + (lam + ar-43 + (case + [ b-1 ar-43 ] + [ + (lam + as-44 + (case + [ b-1 as-44 ] + (error) + [ + (builtin unBData) + [ + c-2 [ e-4 as-44 ] + ] + ] + ) + ) + [ + (builtin unConstrData) + [ + c-2 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + e-4 + ar-43 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + (error) + ) + ) + [ + (builtin unConstrData) + [ + [ + (lam + at-45 + (lam + au-46 + [ + [ h-7 at-45 ] + [ + (lam + av-47 + (lam + aw-48 + [ + [ + (builtin + equalsData + ) + [ + c-2 + [ + e-4 + [ + (builtin + unConstrData + ) + aw-48 + ] + ] + ] + ] + av-47 + ] + ) + ) + [ + [ + (builtin + constrData + ) + (con + integer 0 + ) + ] + au-46 + ] + ] + ] + ) + ) + [ + (builtin unListData) + [ c-2 ap-41 ] + ] + ] + aq-42 + ] + ] + ] + ) + ) + ] + ) + (lam + ax-49 + (lam + ay-50 + [ + [ + (lam + az-51 + (lam + ba-52 + (case + (constr + 0 + az-51 + (con data (I 0)) + (lam + bb-53 + [ + (lam + bc-54 + (lam + bd-55 + [ + (builtin iData) + (case + [ + ba-52 bd-55 + ] + bc-54 + [ + [ + (builtin + addInteger + ) + bc-54 + ] + (con + integer 1 + ) + ] + ) + ] + ) + ) + [ + (builtin unIData) + bb-53 + ] + ] + ) + ) + k-10 + ) + ) + ) + [ + (builtin unListData) + [ c-2 ax-49 ] + ] + ] + (lam + be-56 + [ + (lam + bf-57 + (case + [ b-1 bf-57 ] + (con bool False) + [ + [ + (builtin + equalsByteString + ) + [ + (builtin unBData) + [ c-2 [ e-4 bf-57 ] ] + ] + ] + ay-50 + ] + ) + ) + [ + (builtin unConstrData) + [ + c-2 + [ + e-4 + [ + (builtin unConstrData) + [ + c-2 + [ + e-4 + [ + (builtin + unConstrData + ) + [ + c-2 + [ + f-5 + [ + e-4 + [ + (builtin + unConstrData + ) + be-56 + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ) + ] + ) + ) + ] + ) + [ + g-6 + (lam + k-10 + (lam + bg-58 + (lam + bh-59 + (lam + bi-60 + (case + bg-58 + (lam + bj-61 + (lam + bk-62 + (case + (constr + 0 + bk-62 + [ [ bi-60 bh-59 ] bj-61 ] + bi-60 + ) + k-10 + ) + ) + ) + bh-59 + ) + ) + ) + ) + ) + ] + ] + ) + (lam + bl-63 + [ + (lam + bm-64 + (case + [ b-1 bm-64 ] + [ + (builtin unBData) [ c-2 [ e-4 bm-64 ] ] + ] + (error) + ) + ) + [ (builtin unConstrData) [ c-2 bl-63 ] ] + ] + ) + ] + ) + (lam + bn-65 + (lam + bo-66 + (case + (constr + 0 + [ + (builtin unListData) + [ c-2 [ [ a-0 (con integer 8) ] bn-65 ] ] + ] + [ (builtin bData) bo-66 ] + (lam + bp-67 + [ + (lam + bq-68 + (lam + br-69 + [ + [ (builtin equalsByteString) bq-68 ] + [ (builtin unBData) br-69 ] + ] + ) + ) + [ (builtin unBData) bp-67 ] + ] + ) + ) + (lam + bs-70 + (lam + bt-71 + (lam + bu-72 + (case + (case + [ + b-1 + [ + (builtin unConstrData) + [ + [ h-7 bs-70 ] + (lam + bv-73 + [ + [ + (builtin equalsData) bv-73 + ] + bt-71 + ] + ) + ] + ] + ] + (con bool False) + (con bool True) + ) + (con bool True) + (con bool False) + ) + ) + ) + ) + ) + ) + ) + ] + ) + [ + g-6 + (lam + h-7 + (lam + bw-74 + (lam + bx-75 + (case + bw-74 + (lam + by-76 + (lam + bz-77 + (case + [ bx-75 by-76 ] + [ [ h-7 bz-77 ] bx-75 ] + [ + [ (builtin constrData) (con integer 0) ] + [ [ d-3 by-76 ] (con (list data) []) ] + ] + ) + ) + ) + (con data (Constr 1 [])) + ) + ) + ) + ) + ] + ] + ) + (lam + ca-78 + [ + (lam + cb-79 [ ca-78 (lam cc-80 [ [ cb-79 cb-79 ] cc-80 ]) ] + ) + (lam + cb-79 [ ca-78 (lam cc-80 [ [ cb-79 cb-79 ] cc-80 ]) ] + ) + ] + ) + ] + ) + ) + ) + ) + ) + ) + ) +) diff --git a/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metadata.json b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metadata.json new file mode 100644 index 00000000..cff336ec --- /dev/null +++ b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metadata.json @@ -0,0 +1,26 @@ +{ + "compiler": { + "name": "Scalus", + "version": "0.17.0", + "commit_hash": "553d4d420166d87efad7220ce288e0961cfe17c0" + }, + "compilation_config": { + "optimization_level": "Scalus", + "target": "uplc", + "flags": ["Scalus", "vanRossem"], + "min_plutus_version": "1.60.0.0" + }, + "contributors": [ + { + "name": "Unisay", + "organization": "Intersect MBO" + } + ], + "submission": { + "date": "2026-05-06T12:00:00Z", + "source_available": true, + "source_repository": "https://github.com/Unisay/scalus-cape-submissions", + "source_commit_hash": "becb41d62cb2832001de1541ff2dcde0d3ac92c6", + "implementation_notes": "Preview submission targeting the van Rossem hard fork (Cardano protocol version 11, projected late-June 2026). Same Scalus 0.17.0 HTLC spending validator source as the corresponding current-track Scalus_0.17.0_Unisay/ submission (`@Compile object HTLCValidator`, `Data -> Unit`; claim reads upper bound, refund reads lower bound — both finite, strict, per the HTLC convention from IntersectMBO/UPLC-CAPE#170), recompiled with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). CPU/MEM measured against a minimal `ScriptContext` harness (`src/htlc/HtlcHarness.scala`) covering both `Claim` and `Refund` redeemers, evaluated on `PlutusVM.makePlutusV3VM(MajorProtocolVersion.vanRossemPV)`. Invalid on mainnet until the hard fork activates; routed to the preview report via `min_plutus_version = 1.60.0.0`." + } +} diff --git a/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metrics.json b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metrics.json new file mode 100644 index 00000000..3bd73c98 --- /dev/null +++ b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/metrics.json @@ -0,0 +1,214 @@ +{ + "evaluations": [ + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 0 instead of constructor 0(preimage)", + "execution_result": "success", + "memory_units": 132, + "name": "redeemer_integer_0" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is raw integer 1 instead of constructor 1()", + "execution_result": "success", + "memory_units": 132, + "name": "redeemer_integer_1" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is bytestring instead of constructor", + "execution_result": "success", + "memory_units": 132, + "name": "redeemer_bytestring" + }, + { + "cpu_units": 24688, + "description": "Validator fails when redeemer is list [1 2 3] instead of constructor", + "execution_result": "success", + "memory_units": 132, + "name": "redeemer_list" + }, + { + "cpu_units": 2457846, + "description": "Validator fails when Claim is constructor 0() with no preimage field", + "execution_result": "success", + "memory_units": 936, + "name": "redeemer_claim_without_preimage" + }, + { + "cpu_units": 21503790, + "description": "Claim at time=50 with correct preimage and recipient signature should succeed", + "execution_result": "success", + "memory_units": 60216, + "name": "claim_well_before_timeout" + }, + { + "cpu_units": 21503790, + "description": "Claim at time=99 (just before timeout=100) with correct preimage should succeed", + "execution_result": "success", + "memory_units": 60216, + "name": "claim_just_before_timeout" + }, + { + "cpu_units": 20084373, + "description": "Refund at time=101 (just after timeout=100) with payer signature should succeed", + "execution_result": "success", + "memory_units": 57083, + "name": "refund_just_after_timeout" + }, + { + "cpu_units": 20084373, + "description": "Refund at time=200 with payer signature should succeed", + "execution_result": "success", + "memory_units": 57083, + "name": "refund_well_after_timeout" + }, + { + "cpu_units": 7470221, + "description": "Claim without recipient signature should fail", + "execution_result": "success", + "memory_units": 21525, + "name": "claim_missing_signature" + }, + { + "cpu_units": 8586601, + "description": "Claim with only payer signature (not recipient) should fail", + "execution_result": "success", + "memory_units": 21526, + "name": "claim_wrong_signature_payer" + }, + { + "cpu_units": 8586601, + "description": "Claim with only impostor signature (not recipient) should fail", + "execution_result": "success", + "memory_units": 21526, + "name": "claim_wrong_signature_impostor" + }, + { + "cpu_units": 3024795, + "description": "Claim with preimage #cafebabe (hash does not match) should fail", + "execution_result": "success", + "memory_units": 1041, + "name": "claim_wrong_preimage" + }, + { + "cpu_units": 3024795, + "description": "Claim with empty preimage (hash does not match) should fail", + "execution_result": "success", + "memory_units": 1041, + "name": "claim_empty_preimage" + }, + { + "cpu_units": 10491228, + "description": "Claim at time=100 (boundary, must be strictly before timeout) should fail", + "execution_result": "success", + "memory_units": 22207, + "name": "claim_at_timeout" + }, + { + "cpu_units": 10491228, + "description": "Claim at time=150 (after timeout) should fail even with correct preimage", + "execution_result": "success", + "memory_units": 22207, + "name": "claim_after_timeout" + }, + { + "cpu_units": 9642280, + "description": "Claim with from_time=50 and no upper bound (+inf) should fail; the upper bound must be finite", + "execution_result": "success", + "memory_units": 21914, + "name": "claim_infinite_upper_bound" + }, + { + "cpu_units": 23473463, + "description": "Claim with two script inputs should fail (double satisfaction attack)", + "execution_result": "success", + "memory_units": 64263, + "name": "claim_double_satisfaction" + }, + { + "cpu_units": 6596467, + "description": "Refund without payer signature should fail", + "execution_result": "success", + "memory_units": 21324, + "name": "refund_missing_signature" + }, + { + "cpu_units": 7712847, + "description": "Refund with only recipient signature (not payer) should fail", + "execution_result": "success", + "memory_units": 21325, + "name": "refund_wrong_signature_recipient" + }, + { + "cpu_units": 7712847, + "description": "Refund with only impostor signature (not payer) should fail", + "execution_result": "success", + "memory_units": 21325, + "name": "refund_wrong_signature_impostor" + }, + { + "cpu_units": 9535811, + "description": "Refund at time=50 (before timeout) should fail", + "execution_result": "success", + "memory_units": 21974, + "name": "refund_before_timeout" + }, + { + "cpu_units": 9535811, + "description": "Refund at time=100 (boundary, must be strictly after timeout) should fail", + "execution_result": "success", + "memory_units": 21974, + "name": "refund_at_timeout" + }, + { + "cpu_units": 8913339, + "description": "Refund with no lower bound (-inf) should fail; the lower bound must be finite", + "execution_result": "success", + "memory_units": 21749, + "name": "refund_infinite_lower_bound" + }, + { + "cpu_units": 22518046, + "description": "Refund with two script inputs should fail (double satisfaction attack)", + "execution_result": "success", + "memory_units": 64030, + "name": "refund_double_satisfaction" + } + ], + "execution_environment": { + "evaluator": "PlutusTx.Eval-1.52.0.0" + }, + "measurements": { + "block_cpu_budget_pct": 0.05868365749999999, + "block_memory_budget_pct": 0.10365, + "cpu_units": { + "maximum": 23473463, + "median": 8586601, + "minimum": 24688, + "sum": 243049304, + "sum_negative": 0, + "sum_positive": 243049304 + }, + "execution_fee_lovelace": 53703, + "memory_units": { + "maximum": 64263, + "median": 21526, + "minimum": 132, + "sum": 627013, + "sum_negative": 0, + "sum_positive": 627013 + }, + "reference_script_fee_lovelace": 10635, + "script_size_bytes": 709, + "scripts_per_block": 964, + "scripts_per_tx": 217, + "term_size": 720, + "total_fee_lovelace": 64338, + "tx_cpu_budget_pct": 0.23473462999999997, + "tx_memory_budget_pct": 0.4590214285714286 + }, + "scenario": "htlc", + "timestamp": "2026-05-06T13:50:27Z", + "version": "1.0.0" +} diff --git a/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/source/README.md b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/source/README.md new file mode 100644 index 00000000..d289a2e9 --- /dev/null +++ b/submissions/htlc/Scalus_0.17.0_Unisay_vanrossem/source/README.md @@ -0,0 +1,38 @@ +# Scalus HTLC Implementation (vanRossem preview) + +**Source Code**: [HTLC.scala](https://github.com/Unisay/scalus-cape-submissions/blob/becb41d62cb2832001de1541ff2dcde0d3ac92c6/src/htlc/HTLC.scala) + +**Repository**: + +**Commit**: `becb41d62cb2832001de1541ff2dcde0d3ac92c6` + +**Path**: `src/htlc/HTLC.scala` + +The validator source is identical to the current-track `Scalus_0.17.0_Unisay/` submission (production-safe validity-range convention from #170: claim reads upper bound, refund reads lower bound — both finite, strict). The difference is in the compile command: this preview artifact is produced with `Options.release.copy(targetProtocolVersion = MajorProtocolVersion.vanRossemPV)`, which enables `case-on-builtins` and batch-6 builtins (e.g. `dropList`). The same `@main htlc.compileHtlc` writes both the current-track and the vanRossem artifact in one run. + +CPU/MEM measurements come from the minimal `ScriptContext` harness in [`src/htlc/HtlcHarness.scala`](https://github.com/Unisay/scalus-cape-submissions/blob/becb41d62cb2832001de1541ff2dcde0d3ac92c6/src/htlc/HtlcHarness.scala), which evaluates both `Claim` and `Refund` redeemers on `PlutusVM.makePlutusV3VM(MajorProtocolVersion.vanRossemPV)`. + +The output is invalid on mainnet until the van Rossem hard fork (Cardano protocol version 11) activates — projected late-June 2026. + +## Reproducing the Compilation + +1. Clone the repository: + + ```bash + git clone https://github.com/Unisay/scalus-cape-submissions + cd scalus-cape-submissions + ``` + +2. Check out the specific commit: + + ```bash + git checkout becb41d62cb2832001de1541ff2dcde0d3ac92c6 + ``` + +3. Run the @main object: + + ```bash + sbt 'runMain htlc.compileHtlc' + ``` + +4. The compiled UPLC output should match `htlc.uplc` in this submission (it is written to `src/htlc/htlc-vanrossem.uplc` upstream).