Skip to content

feat(submissions): add Scalus 0.16.0 HTLC submission by Unisay#173

Merged
Unisay merged 2 commits intomainfrom
yura/htlc-scalus-submission
Apr 24, 2026
Merged

feat(submissions): add Scalus 0.16.0 HTLC submission by Unisay#173
Unisay merged 2 commits intomainfrom
yura/htlc-scalus-submission

Conversation

@Unisay
Copy link
Copy Markdown
Collaborator

@Unisay Unisay commented Apr 24, 2026

Summary

Parser compatibility

The artifact uses toUplcOptimized() (CaseConstrApply + builtin-packing) with an AST-level alpha-rename pass that rewrites all generated identifiers to short purely-alphabetic names (a, b, …, z, aa, …) before serialisation. This ensures compatibility with the plutus-core 1.45.0.0 textual parser without sacrificing optimised code size.

Metrics

test cpu mem
claim_well_before_timeout 29 068 491 88 755
refund_well_after_timeout 27 304 661 84 629
script size 1 497 bytes

Closes #161

25/25 cape tests pass. Script size: 1648 bytes.
claim_well_before_timeout: cpu=34380491 mem=121955
refund_well_after_timeout: cpu=32424661 mem=116629

Two parser-compatibility workarounds vs plutus-core 1.45:
- toUplc() instead of toUplcOptimized() to avoid case/constr syntax
  (upstream: IntersectMBO/plutus#7742)
- post-processing renames NAME-NNNNrMMMM identifiers (Scalus refresh
  counter suffix) to NAME_NNNNrMMMM so Lex.decimal after hyphen
  doesn't split the name

Closes #161
@Unisay Unisay self-assigned this Apr 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

🚀 PR Preview Deployed

Preview URL: https://intersectmbo.github.io/UPLC-CAPE/pr-173/

The preview site is automatically updated on every push to this PR and will be removed when the PR is closed.

Use toUplcOptimized() (CaseConstrApply + builtin-packing) with an
AST-level alpha-rename pass that rewrites all generated names to short
purely-alphabetic identifiers. Principled fix vs the toUplc()+regex
approach: no hyphens or digit-letter patterns, guaranteed parser-safe.

script_size: 1648 -> 1497 bytes (-9%)
claim cpu:   34380491 -> 29068491 (-15%), mem: 121955 -> 88755 (-27%)
refund cpu:  32424661 -> 27304661 (-16%), mem: 116629 -> 84629 (-27%)

Source: Unisay/scalus-cape-submissions@07350ed
@Unisay Unisay enabled auto-merge (squash) April 24, 2026 17:30
@Unisay Unisay disabled auto-merge April 24, 2026 17:30
@Unisay Unisay merged commit 61530cd into main Apr 24, 2026
5 checks passed
@Unisay Unisay deleted the yura/htlc-scalus-submission branch April 24, 2026 17:31
github-actions Bot added a commit that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HTLC submission with Scalus v0.16.0

1 participant