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

PlutusV2 -> PlutusV3 #1523

Closed
wants to merge 18 commits into from
Closed

PlutusV2 -> PlutusV3 #1523

wants to merge 18 commits into from

Conversation

locallycompact
Copy link
Contributor

@locallycompact locallycompact commented Jul 22, 2024

Updating the Hydra protocol transactions to use Plutus V3 validators.


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

@locallycompact locallycompact marked this pull request as draft July 22, 2024 09:33
@locallycompact locallycompact force-pushed the lc/plutusV3 branch 2 times, most recently from bc0a5c3 to 96d72a8 Compare July 22, 2024 12:59
@locallycompact locallycompact force-pushed the lc/plutusV3 branch 2 times, most recently from f88a249 to ab166f4 Compare July 23, 2024 17:26
@ch1bo ch1bo changed the base branch from master to lc/conway-support July 24, 2024 08:14
@locallycompact locallycompact force-pushed the lc/plutusV3 branch 3 times, most recently from a436819 to fe35d8b Compare July 24, 2024 14:07
@noonio noonio added this to the 1.0.0 milestone Aug 5, 2024
@locallycompact
Copy link
Contributor Author

@@ -448,184 +439,260 @@ genPointInTimeAfter deadline = do
-- ** Plutus cost model fixtures

-- | Current (2023-08-04) mainnet PlutusV2 cost model.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
-- | Current (2023-08-04) mainnet PlutusV2 cost model.
-- | Current (2024-08-13) preview PlutusV3 cost model.

ch1bo and others added 5 commits August 13, 2024 12:14
This should not be kept like this and is only incresased to progress
with V3 update
The decoding of script context got lost when updating from PlutusV2 to
PlutusV3 seemingly.
Copy link

github-actions bot commented Aug 15, 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 2024-08-15 15:13:16.025090756 UTC
Max. memory units 20000000
Max. CPU units 10000000000
Max. tx size (kB) 32768

Script summary

Name Hash Size (Bytes)
νInitial e0bfb5453cd8cfe82daa5486be9d80165a5ee66eab35be85bfd63d06 5662
νCommit aab2a193b4e0f739871dd53b3b9b21b704f39df61b11609209cfd889 3663
νHead d17644e09f152b82773866e960e13ddc8aa0eb74950ee3015be26e61 11795
μHead 6448791cf3c43393c3cda2927e8a0805f3b348448e59c26bb96034be* 8615
  • 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 9201 4.51 2.02 0.62
2 9401 5.18 2.29 0.64
3 9599 6.19 2.74 0.66
5 10003 7.88 3.47 0.71
10 11007 12.49 5.50 0.82
100 29103 91.83 40.04 2.78

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 561 10.10 4.37 0.32
2 737 12.61 5.53 0.37
3 923 15.21 6.71 0.41
5 1284 20.68 9.16 0.51
10 2179 35.94 15.84 0.78
26 5026 99.88 42.41 1.83

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 560 21.44 9.53 0.49
2 114 671 34.21 15.57 0.69
3 170 786 49.86 22.99 0.93
4 225 893 66.10 30.97 1.18
5 282 1004 90.10 42.02 1.54

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 628 14.87 6.96 0.40
2 790 16.09 8.08 0.43
3 1003 18.75 9.77 0.48
5 1193 18.62 10.99 0.50
10 1965 26.74 17.44 0.67
50 7772 75.62 62.59 1.82

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 657 16.92 8.02 0.43
2 788 17.98 9.14 0.46
3 914 19.05 10.27 0.48
5 1139 20.82 12.25 0.53
10 2209 29.41 20.15 0.73
50 7807 76.24 67.64 1.86

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 681 21.25 9.70 0.50
2 879 23.00 11.22 0.54
3 905 23.42 11.83 0.55
5 1300 27.29 15.12 0.63
10 2239 35.80 22.61 0.82
50 7908 90.20 73.14 2.07

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 9078 20.80 10.26 0.86
2 9184 32.31 16.04 1.04
3 9274 51.91 25.92 1.34
4 9403 70.13 35.20 1.63

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 ₳
5 0 0 9042 8.00 3.90 0.67
5 1 57 9075 9.02 4.52 0.69
5 5 285 9211 12.87 6.89 0.75
5 10 569 9380 17.74 9.89 0.84
5 20 1137 9718 28.46 16.40 1.02
5 30 1705 10058 38.49 22.54 1.20
5 40 2277 10401 48.43 28.64 1.37
5 50 2846 10739 58.88 35.00 1.55
5 90 5128 12101 98.90 59.51 2.25

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 2024-08-15 15:16:10.579701711 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 5.068532208
P99 12.520937759999983ms
P95 6.8085105499999985ms
P50 4.749407ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 24.056060167
P99 102.34151458000028ms
P95 33.347558699999986ms
P50 21.662947000000003ms
Number of Invalid txs 0

@locallycompact
Copy link
Contributor Author

Upgrading to PlutusV3 works functionally in terms of logic but exceed Tx size constraints and memory units, especially using off-the-shelf ScriptContext. Restoring custom ScriptContext or using techniques like https://github.com/cardanoapi/hardfork-testing/blob/main/migration.md will be needed to optimize performance.

@ch1bo
Copy link
Collaborator

ch1bo commented Aug 19, 2024

@locallycompact Okay. Let's summarize the findings in the monthly report and park this effort for now.

@ch1bo ch1bo closed this Aug 19, 2024
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.

None yet

3 participants