Skip to content

Benchmark: Linear Vesting #7166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Jun 25, 2025

Closes https://github.com/IntersectMBO/plutus-private/issues/1617

Evaluation was SUCCESSFUL, result is:
  ()

Execution budget spent:
  CPU 101,442,633
  MEM 474,786

Evaluation traces:
  1. Parsing ScriptContext...
  2. Parsed ScriptContext
  3. Parsed Redeemer
  4. Full unlock requested
  5. Validation completed

After switching to the Data-backed ScriptContext:

Execution budget spent:
  CPU 39,768,848
  MEM 155,049  

Copy link
Contributor

github-actions bot commented Jun 25, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/pr-7166/

Built to branch gh-pages at 2025-06-26 10:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@Unisay Unisay force-pushed the yura/benchmark-linear-vesting branch from 8c04d25 to cd09aca Compare June 25, 2025 15:04
@Unisay Unisay force-pushed the yura/benchmark-linear-vesting branch from cd09aca to 407e11a Compare June 25, 2025 15:44
@Unisay Unisay force-pushed the yura/benchmark-linear-vesting branch from 407e11a to 705b58c Compare June 26, 2025 10:01
@Unisay Unisay force-pushed the yura/benchmark-linear-vesting branch from 705b58c to 7e83383 Compare June 26, 2025 10:06
@Unisay Unisay requested review from SeungheonOh June 26, 2025 10:22
@Unisay Unisay self-assigned this Jun 26, 2025
@Unisay Unisay marked this pull request as ready for review June 26, 2025 10:22
@Unisay Unisay added No Changelog Required Add this to skip the Changelog Check labels Jun 26, 2025
@Unisay Unisay requested a review from zeme-wana June 26, 2025 13:04
@SeungheonOh
Copy link
Collaborator

Copy link
Collaborator

@SeungheonOh SeungheonOh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script looks good.

About running tests, do we want to pursue some unified format? For me, I made it so that script will be exported and save to validation/data so that it can be run by the existing "test runner".

validatorCodeFullyApplied =
validatorCode `unsafeApplyCode` liftCodeDef (toBuiltinData testScriptContext)

testScriptContext :: ScriptContext
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have this as an another file.

traceError "Unlock not permitted until firstUnlockPossibleAfter time"
| newRemainingQty <= 0 ->
traceError "Zero remaining assets not allowed"
| newRemainingQty > oldRemainingQty ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressCredential (beneficiary vestingDatum)
in
if
| not (txSignedBy txInfo beneficiaryHash) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, using not is not preferable. I'm not sure our optimizer or GHC deal with this like

if not predicate then A else B

to

if predicate then B then A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants