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

Remove minting policy script from ChainState #928

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

ch1bo
Copy link
Member

@ch1bo ch1bo commented Jun 14, 2023

The actual script is easily computd from the linked hydra-plutus script code using the seedTxIn and this will substantially reduce persisted and logged size.

Rough estimate: By watching the state directory of e2e test "two heads on the same network do not conflict" I could see ~11MB use on master and around ~6.2MB use with this branch.


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

@ch1bo ch1bo requested review from v0d1ch, pgrange, ffakenz and abailly-iohk and removed request for v0d1ch and pgrange June 14, 2023 10:47
@github-actions
Copy link

github-actions bot commented Jun 14, 2023

Transactions 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 2023-06-15 13:22:24.983821298 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2212a4ee618434b9b2f366d7c330dbdfb5c7072e793a850fd0de6ddd 4294
νCommit 69e1ccf9ad73dc6d37a5bc8de5aec86f3c4c1710fe5fd334e0e16b18 2124
νHead 8ae095dca4d14a1b8edffb37faa6c84ec60340fbf389a62f027e0b76 9355
μHead 33642a45c7fbb955ce1704ef09229bb211bf9af9980530db28c6aafe* 4148
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per Head.

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4739 12.92 5.06 0.50
2 4944 16.39 6.41 0.55
3 5155 19.59 7.64 0.59
5 5561 23.87 9.24 0.65
10 6584 36.07 13.85 0.83
38 12328 99.94 37.86 1.77

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 14.98 5.74 0.34
2 787 19.57 7.70 0.40
3 975 24.66 9.84 0.46
5 1345 36.15 14.59 0.61
10 2287 71.73 28.85 1.04
13 2846 98.11 39.18 1.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 815 27.93 10.85 0.49
2 114 1136 43.63 17.08 0.68
3 171 1457 61.33 24.16 0.88
4 227 1777 82.31 32.58 1.13

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 672 19.33 8.77 0.40
2 804 20.27 9.68 0.42
3 969 21.37 10.82 0.44
5 1299 24.16 13.33 0.50
10 2120 31.12 19.62 0.64
50 8725 87.17 69.99 1.74

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 676 24.34 10.47 0.45
2 842 26.49 12.01 0.49
3 1013 28.20 13.38 0.52
5 1336 31.20 15.95 0.58
10 2160 40.20 22.97 0.74
44 7779 98.46 69.53 1.79

Cost of Abort Transaction

Some variation because of random mixture of still initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 4856 22.40 9.38 0.61
2 5176 36.59 15.53 0.79
3 5500 53.61 22.94 0.99
4 5676 68.21 29.12 1.16
5 6000 90.40 38.81 1.42

Cost of FanOut Transaction

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 4764 8.66 3.57 0.46
5 1 56 4795 10.06 4.39 0.47
5 5 284 4944 15.64 7.69 0.55
5 10 570 5124 22.61 11.82 0.64
5 20 1138 5483 36.56 20.07 0.83
5 30 1707 5844 50.52 28.33 1.02
5 40 2274 6204 64.49 36.60 1.21
5 50 2848 6569 78.46 44.87 1.40
5 65 3698 7095 99.42 57.28 1.68

@github-actions
Copy link

github-actions bot commented Jun 14, 2023

Test Results

322 tests  ±0   316 ✔️ ±0   22m 41s ⏱️ - 2m 51s
110 suites ±0       6 💤 ±0 
    6 files   ±0       0 ±0 

Results for commit 2b8ec49. ± Comparison against base commit 60a73e0.

♻️ This comment has been updated with latest results.

@pgrange
Copy link
Contributor

pgrange commented Jun 14, 2023

That should definitely help with our logs. Awesome 🎉

, openUtxoHash = utxoHash
}
pure (event, st')
where
InitialState
{ headId = headId
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure where those came from 🤔 ?

@@ -1014,6 +1014,11 @@ update env ledger st ev = case (st, ev) of
-- General
(currentState, OnChainEvent Rollback{rolledBackChainState}) ->
NewState (setChainState rolledBackChainState currentState) []
-- FIXME: We do not write the chain state unless we do a head state change.
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: move to a github issue? Stuff in code comments have a natural tendency to get lost in the sands of time and trumped by other priorities

Copy link
Member Author

Choose a reason for hiding this comment

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

Was not intending to commit this and I have written a bug report yesterday about this: #931

@pgrange pgrange force-pushed the ch1bo/no-scripts-in-chain-state branch from 1f1aade to 41fa9cb Compare June 15, 2023 13:07
The actual script is easily computd from the linked hydra-plutus script
code using the `seedTxIn` and this will substantially reduce persisted
and logged size.
@ch1bo ch1bo force-pushed the ch1bo/no-scripts-in-chain-state branch from 41fa9cb to 2b8ec49 Compare June 15, 2023 13:11
@pgrange pgrange merged commit 035c40a into master Jun 15, 2023
28 checks passed
@pgrange pgrange deleted the ch1bo/no-scripts-in-chain-state branch June 15, 2023 13:36
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

5 participants