Skip to content
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

DONTMERGE: Import schnorrkel plutus #1742

Closed
wants to merge 7 commits into from
Closed

Conversation

locallycompact
Copy link
Contributor


  • CHANGELOG updated or not needed
  • Documentation updated or not needed
  • Haddocks updated or not needed
  • No new TODOs introduced or explained herafter

@locallycompact locallycompact force-pushed the lc/schnorrkel branch 6 times, most recently from 1cb11a3 to eb5071d Compare November 19, 2024 16:40
Copy link

github-actions bot commented Nov 19, 2024

Transaction cost differences

Script summary

Name Size (Bytes)
νInitial -
νCommit -
νHead -
μHead -
νDeposit -

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
44 - - - -

Commit transaction costs

UTxO Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
54 - - - -

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 - - - - -
2 - - - - -
3 - - - - -
4 - - - - -
5 - - - - -
6 - - - - -
7 - - - - -
8 - - - - -
9 - - - - -
10 - - - - -

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - +0.39 +0.09 -
2 - - - -
3 - $${\color{green}-0.38}$$ $${\color{green}-0.09}$$ -
5 - - - -
10 - - - -
43 - - - -

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
45 - - - -

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
41 - - - -

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 - - - -
2 - - - -
3 - - - -
5 - - - -
10 - - - -
33 - - - -

FanOut transaction costs

UTxO, Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
(0, 10) - - - - -
(1, 10) - - - - -
(5, 10) - - - - -
(10, 10) - - - - -
(20, 10) - - - - -
(40, 10) - - - - -
(41, 10) - - - - -

Copy link

github-actions bot commented Nov 19, 2024

Transaction costs

Sizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using arbitrary values and results are not fully deterministic and comparable to previous runs.

Metadata
Generated at 2025-01-21 14:24:18.413298498 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial c8a101a5c8ac4816b0dceb59ce31fc2258e387de828f02961d2f2045 2652
νCommit 61458bc2f297fff3cc5df6ac7ab57cefd87763b0b7bd722146a1035c 685
νHead 5350e9d521552ebfd9e846fd70c3b801f716fc14296134ec0fb71e97 14492
μHead 6b49dc4e571207d615dba01996548cb610b0caa85c30423d169d0091* 5612
νDeposit ae01dade3a9c346d5c93ae3ce339412b90a0b8f83f94ec6baa24e30c 1102
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per head.

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 6165 10.48 3.36 0.53
2 6365 12.81 4.11 0.56
3 6564 14.24 4.52 0.59
5 6966 18.36 5.81 0.65
10 7972 28.57 9.02 0.80
44 14810 98.11 30.88 1.82

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 561 2.44 1.16 0.20
2 739 3.38 1.73 0.22
3 921 4.36 2.33 0.24
5 1280 6.41 3.60 0.28
10 2181 12.13 7.25 0.40
54 10056 98.61 68.52 1.88

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 529 25.00 7.26 0.43
2 114 636 32.98 9.56 0.51
3 170 747 40.65 11.77 0.60
4 228 858 53.43 15.22 0.73
5 283 974 55.83 16.25 0.76
6 339 1085 69.15 19.83 0.90
7 394 1192 85.63 24.17 1.07
8 449 1303 98.41 27.59 1.20
9 505 1414 97.01 27.70 1.20

Cost of Increment Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 1806 24.05 8.01 0.48
2 1931 25.09 9.04 0.50
3 2105 27.53 10.54 0.54
5 2380 30.56 12.83 0.59
10 3345 43.05 20.46 0.79
43 8056 99.78 61.04 1.75

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 598 22.40 7.25 0.41
2 817 25.39 8.74 0.45
3 882 24.96 9.27 0.46
5 1339 30.83 12.25 0.55
10 2062 41.59 18.60 0.71
42 6863 99.40 56.17 1.66

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 673 26.95 8.71 0.46
2 829 30.88 10.64 0.51
3 937 32.39 11.71 0.54
5 1266 34.17 13.74 0.58
10 2018 43.36 20.18 0.73
39 6144 99.36 57.56 1.64

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 629 32.74 10.13 0.52
2 764 34.73 11.40 0.55
3 998 37.94 13.26 0.60
5 1278 41.77 15.78 0.66
10 2124 53.02 22.91 0.84
32 5302 99.90 52.55 1.57

Abort transaction costs

There is some variation due to the random mixture of initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 6069 26.21 8.86 0.69
2 6201 34.73 11.75 0.79
3 6274 39.95 13.46 0.85
4 6417 49.34 16.68 0.95
5 6542 60.72 20.53 1.08
6 6695 70.59 23.89 1.19
7 6703 75.24 25.34 1.24
8 7097 91.05 30.88 1.42
9 7054 91.55 31.01 1.42

FanOut transaction costs

Involves spending head output and burning head tokens. Uses ada-only UTXO for better comparability.

Parties UTxO UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
10 0 0 6162 17.30 5.88 0.60
10 1 56 6195 19.99 6.94 0.63
10 10 570 6502 37.98 14.16 0.85
10 20 1140 6842 57.35 21.96 1.07
10 30 1707 7181 76.42 29.65 1.30
10 40 2279 7523 96.75 37.80 1.54
10 40 2277 7522 96.39 37.66 1.53

End-to-end benchmark results

This page is intended to collect the latest end-to-end benchmark results produced by Hydra's continuous integration (CI) system from the latest master code.

Please note that these results are approximate as they are currently produced from limited cloud VMs and not controlled hardware. Rather than focusing on the absolute results, the emphasis should be on relative results, such as how the timings for a scenario evolve as the code changes.

Generated at 2025-01-21 14:27:27.146723235 UTC

Baseline Scenario

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 4.754978410
P99 13.594007429999985ms
P95 6.125480250000001ms
P50 4.3067845ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 23.742813564
P99 121.16206944ms
P95 31.026088099999996ms
P50 20.7528625ms
Number of Invalid txs 0

Copy link

github-actions bot commented Nov 19, 2024

Test Results

  5 files  ±0  165 suites  ±0   31m 6s ⏱️ +46s
562 tests +1  560 ✅ +1  2 💤 ±0  0 ❌ ±0 
564 runs  +1  562 ✅ +1  2 💤 ±0  0 ❌ ±0 

Results for commit 4c04841. ± Comparison against base commit af5c305.

♻️ This comment has been updated with latest results.


let tx' = txSpendingUTxO scriptUTxO

send n1 $ input "NewTx" ["transaction" .= tx']
Copy link
Contributor

Choose a reason for hiding this comment

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

This is looking lovely.

I think the main thing we need here is to close the Head and make sure the UTxO can be fanned out back to L1.

@locallycompact locallycompact force-pushed the lc/schnorrkel branch 4 times, most recently from 7d8d530 to d6ff585 Compare December 2, 2024 15:04
@v0d1ch v0d1ch force-pushed the lc/schnorrkel branch 3 times, most recently from 23a82ef to d180493 Compare December 12, 2024 09:58
@v0d1ch v0d1ch force-pushed the lc/schnorrkel branch 2 times, most recently from 7f70541 to 4042cc4 Compare December 24, 2024 18:08
@locallycompact locallycompact force-pushed the lc/schnorrkel branch 6 times, most recently from 1cce7d3 to 8bef572 Compare January 8, 2025 16:39
@noonio noonio force-pushed the lc/schnorrkel branch 2 times, most recently from 7d42c2b to 366f7cf Compare January 13, 2025 11:31
locallycompact and others added 3 commits January 14, 2025 06:43
add singlePartyUsesSchnorrkelScriptOnL2 scenario test

Finalize schnorkel test case

There is some refactoring in order but the test itself is fine.

Update plutus source-repository-package

treefmt

fixup

Have some ada for the min UTxO

Almost there; insufficient collateral now

Trying to be more clear about the UTxOs to pay for things

WIP on schnorrkel; just missing script as input
@ch1bo ch1bo changed the title Import schnorrkel plutus DONTMERGE: Import schnorrkel plutus Jan 21, 2025
@ch1bo ch1bo marked this pull request as draft January 21, 2025 10:36
@noonio
Copy link
Contributor

noonio commented Jan 21, 2025

This branch now demonstrates that Hydra with a custom ledger work fine; and you can infact spend from a script that uses a custom ledger operation that isn't present in the L1.

You can run the test like so:

cabal test hydra-cluster --test-options '--match "schnorrkel"'  

@noonio
Copy link
Contributor

noonio commented Jan 21, 2025

I'm going to close; as the investigation is now complete.

@noonio noonio closed this Jan 21, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 22, 2025
This brings in the bulk of the work from #1742 ; it demonstrates that
one can spend from a script on L2. This is useful infrastructure to,
say, test a custom ledger operation and check that the Hydra can deal
with that on it's own ledger, but still close and go back to L1
successfully.

This is a useful test in any case.

Note that it contains a `TODO` around a bug we saw with autobalancing,
that will hopefully be fixed in subsequent versions of `cardano-api`.

We make two further additions:

- We attempt to zero-out a few more fee fields in the protocol params
- We provide `buildTransactionWithPParams` to explicitly set the pparams
instead of using the **L1 pparams**. This is an important observation!
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.

Spike: Custom ledger containing a new primitive operation - can we still decommit/close?
2 participants