Problem Statement
UPLC-CAPE currently includes both the measurement infrastructure (CEK machine for UPLC evaluation) and the Plinth submission generation code (PlutusTx compilation). This creates an unnecessary coupling between two concerns that have different versioning requirements:
- CEK Machine (Evaluation): Must match the Plutus version used by the latest cardano-node release (currently 1.45.0)
- PlutusTx Plugin (Compilation): Can use any Plutus version that targets a compatible Plutus Core version (1.1.0)
The Problem: Both currently depend on Plutus 1.45.0, preventing us from demonstrating newer PlutusTx compiler optimizations that were released after 1.45.0.
Why CEK version must match cardano-node: The measurement tool must evaluate UPLC with the same semantics and cost model as the actual Cardano blockchain to ensure benchmark results are accurate and representative.
Why PlutusTx compilation version can be independent: As long as the compiler targets Plutus Core 1.1.0 (which the CEK machine can evaluate), the compilation can use any PlutusTx version. Newer compiler versions may include optimizations that produce more efficient UPLC code while maintaining the same semantics.
Proposed Solution
Move Plinth submission generation to an external repository Unisay/plinth-cape-submissions, following the existing pattern used by Scalus and Plutarch submissions.
Benefits:
- ✅ PlutusTx compiler can be upgraded independently from CEK evaluator
- ✅ Demonstrate newer compiler optimizations (post-1.45.0) in Plinth submissions
- ✅ Cleaner separation of concerns (evaluation vs compilation)
- ✅ Reduced dependencies in UPLC-CAPE core repository
- ✅ Faster build times (no Agda compilation needed for UPLC-CAPE)
- ✅ Consistent pattern across all compiler submissions (all external)
Architecture:
- UPLC-CAPE (this repo): Contains only evaluation infrastructure (
measure tool with CEK machine) and submission artifacts (.uplc files, metadata)
- plinth-cape-submissions (new external repo): Contains Plinth source code, compilation logic, and build system with independent Plutus version
Affected Submissions
5 existing Plinth submissions will be migrated:
submissions/ecd/Plinth_1.45.0.0_Unisay/
submissions/factorial_naive_recursion/Plinth_1.45.0.0_Unisay/
submissions/two_party_escrow/Plinth_1.45.0.0_Unisay/
submissions/fibonacci/Plinth_1.45.0.0_Unisay_tailrec/
submissions/fibonacci_naive_recursion/Plinth_1.45.0.0_Unisay/
Implementation Tasks
Phase 1: External Repository Setup
Phase 2: UPLC-CAPE Migration
Phase 3: Build System Cleanup
Phase 4: Documentation Updates
Migration Path for Existing Submissions
Each Plinth submission will:
- Keep in UPLC-CAPE:
.uplc file, metadata.json, metrics.json, README.md
- Create:
source/README.md pointing to external repository with:
- Repository URL
- Specific commit hash
- File path within repository
- Reproduction steps
This follows the existing pattern used by Scalus and Plutarch submissions.
References
Existing external submission examples:
- Scalus pattern:
submissions/factorial/Scalus_0.12.1_Unisay/source/README.md
- Plutarch pattern:
submissions/factorial/Plutarch_1.11.0_SeungheonOh_exbudget/source/README.md
Current Plinth (before migration):
submissions/factorial_naive_recursion/Plinth_1.45.0.0_Unisay/source/README.md
Critical files in UPLC-CAPE:
cape.cabal:16-30 - Common Plutus dependencies
cape.cabal:129-145 - Plinth-submissions executable definition
plinth-submissions-app/Main.hs - Current compilation logic
lib/Fibonacci.hs, lib/Factorial.hs, lib/Ecd.hs, lib/TwoPartyEscrow.hs - Validator source code
flake.nix:24-30 - Plutus input pinning
Success Criteria
Problem Statement
UPLC-CAPE currently includes both the measurement infrastructure (CEK machine for UPLC evaluation) and the Plinth submission generation code (PlutusTx compilation). This creates an unnecessary coupling between two concerns that have different versioning requirements:
The Problem: Both currently depend on Plutus 1.45.0, preventing us from demonstrating newer PlutusTx compiler optimizations that were released after 1.45.0.
Why CEK version must match cardano-node: The measurement tool must evaluate UPLC with the same semantics and cost model as the actual Cardano blockchain to ensure benchmark results are accurate and representative.
Why PlutusTx compilation version can be independent: As long as the compiler targets Plutus Core 1.1.0 (which the CEK machine can evaluate), the compilation can use any PlutusTx version. Newer compiler versions may include optimizations that produce more efficient UPLC code while maintaining the same semantics.
Proposed Solution
Move Plinth submission generation to an external repository
Unisay/plinth-cape-submissions, following the existing pattern used by Scalus and Plutarch submissions.Benefits:
Architecture:
measuretool with CEK machine) and submission artifacts (.uplcfiles, metadata)Affected Submissions
5 existing Plinth submissions will be migrated:
submissions/ecd/Plinth_1.45.0.0_Unisay/submissions/factorial_naive_recursion/Plinth_1.45.0.0_Unisay/submissions/two_party_escrow/Plinth_1.45.0.0_Unisay/submissions/fibonacci/Plinth_1.45.0.0_Unisay_tailrec/submissions/fibonacci_naive_recursion/Plinth_1.45.0.0_Unisay/Implementation Tasks
Phase 1: External Repository Setup
Unisay/plinth-cape-submissionslib/modules (Fibonacci, Factorial, Ecd, TwoPartyEscrow, etc.)Phase 2: UPLC-CAPE Migration
plinth-submissions-app/directory and cabal componentlib/(Fibonacci, Factorial, Ecd, TwoPartyEscrow, FibonacciIterative, Cape.Fixture)source/README.mdwith external repo references (repo URL, commit hash, file path, reproduction steps)Phase 3: Build System Cleanup
plinth-submissionsexecutable fromflake.nixmeasuretool still works correctly with all submissionsPhase 4: Documentation Updates
Migration Path for Existing Submissions
Each Plinth submission will:
.uplcfile,metadata.json,metrics.json,README.mdsource/README.mdpointing to external repository with:This follows the existing pattern used by Scalus and Plutarch submissions.
References
Existing external submission examples:
submissions/factorial/Scalus_0.12.1_Unisay/source/README.mdsubmissions/factorial/Plutarch_1.11.0_SeungheonOh_exbudget/source/README.mdCurrent Plinth (before migration):
submissions/factorial_naive_recursion/Plinth_1.45.0.0_Unisay/source/README.mdCritical files in UPLC-CAPE:
cape.cabal:16-30- Common Plutus dependenciescape.cabal:129-145- Plinth-submissions executable definitionplinth-submissions-app/Main.hs- Current compilation logiclib/Fibonacci.hs,lib/Factorial.hs,lib/Ecd.hs,lib/TwoPartyEscrow.hs- Validator source codeflake.nix:24-30- Plutus input pinningSuccess Criteria
cape submission verify