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

Upper tx validity could be very big on close/contest #615

Merged
merged 113 commits into from
Dec 19, 2022

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Nov 15, 2022

Why

If the tx has too high upper validity bound it can cause large wait times since we are using this upper validity when checking the expected deadline.

What

Take a look at the ADR21 for context

Screenshot 2022-12-08 14:25:58

To check before merging:

  • CHANGELOG is up to date
  • Up to date with master

@v0d1ch v0d1ch requested a review from ch1bo November 15, 2022 12:55
@v0d1ch v0d1ch marked this pull request as draft November 15, 2022 13:39
@v0d1ch v0d1ch marked this pull request as ready for review November 15, 2022 15:33
@github-actions
Copy link

github-actions bot commented Nov 15, 2022

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 2022-12-19 16:31:13.871894775 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4833 11.04 4.38 0.48
2 5038 11.13 4.37 0.49
3 5242 13.50 5.29 0.53
5 5653 18.58 7.28 0.60
10 6681 27.35 10.63 0.74
46 14059 98.73 38.13 1.84

Cost of Commit Transaction

Currently only one UTxO per commit allowed (this is about to change soon)

UTxO Tx size % max Mem % max CPU Min fee ₳
1 576 20.53 8.33 0.40

Cost of CollectCom Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 13375 21.36 8.56 0.97
2 13627 36.34 14.72 1.15
3 13958 55.04 22.46 1.37
4 14523 80.98 33.23 1.68

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9581 8.36 3.42 0.66
2 9748 9.14 3.88 0.68
3 9911 9.92 4.33 0.70
5 10271 11.92 5.40 0.74
10 11138 16.58 7.95 0.83
30 14433 31.99 16.91 1.17
69 16357 41.20 15.60 1.32

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9611 8.61 3.51 0.67
2 9741 8.94 3.79 0.68
3 9908 9.72 4.25 0.70
5 10269 11.68 5.30 0.73
10 11098 15.62 7.58 0.82
30 14463 32.05 16.93 1.17
41 16249 40.37 21.79 1.35

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 13742 22.51 9.35 1.00
2 14065 38.25 16.27 1.20
3 14174 52.67 22.49 1.36
4 14498 75.99 33.11 1.64

Cost of FanOut Transaction

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

UTxO Tx size % max Mem % max CPU Min fee ₳
1 13732 10.26 4.46 0.87
2 13834 12.16 5.49 0.90
3 13806 13.60 6.34 0.91
5 13876 16.64 8.10 0.95
10 14122 24.59 12.63 1.06
50 15497 85.18 47.72 1.86
59 15878 99.23 55.78 2.05

@ch1bo ch1bo linked an issue Nov 16, 2022 that may be closed by this pull request
hydra-node/src/Hydra/Chain/Direct/State.hs Show resolved Hide resolved
hydra-node/src/Hydra/Snapshot.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/Contract/Close.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/Contract/Close.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Chain/Direct/Handlers.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch force-pushed the ensemble/592-tx-validity-mutation branch 4 times, most recently from bd27a57 to 8bcd180 Compare November 17, 2022 16:04
@v0d1ch v0d1ch force-pushed the ensemble/592-tx-validity-mutation branch from 61fcaa7 to d0ca777 Compare November 24, 2022 11:26
@ch1bo ch1bo force-pushed the ensemble/592-tx-validity-mutation branch from d0ca777 to aa549f4 Compare November 29, 2022 09:38
@v0d1ch v0d1ch force-pushed the ensemble/592-tx-validity-mutation branch from 7e532bd to 97421f5 Compare December 5, 2022 13:10
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Test Results

269 tests  +3   263 ✔️ +3   15m 46s ⏱️ + 2m 27s
  92 suites ±0       6 💤 ±0 
    4 files   ±0       0 ±0 

Results for commit 50df255. ± Comparison against base commit 536c68a.

♻️ This comment has been updated with latest results.

@v0d1ch v0d1ch force-pushed the ensemble/592-tx-validity-mutation branch 2 times, most recently from ce1d292 to d91550e Compare December 8, 2022 13:29
@v0d1ch v0d1ch requested a review from ch1bo December 8, 2022 13:32
docs/adr/authors.yml Outdated Show resolved Hide resolved
hydra-plutus/hydra-plutus.cabal Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Head.hs Outdated Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Head.hs Show resolved Hide resolved
hydra-plutus/src/Hydra/Contract/Head.hs Show resolved Hide resolved
hydra-cluster/src/Hydra/Cluster/Scenarios.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Show resolved Hide resolved
hydra-node/test/Hydra/Model.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Model.hs Show resolved Hide resolved
@ch1bo ch1bo force-pushed the ensemble/592-tx-validity-mutation branch from bae846a to 8f45cda Compare December 16, 2022 17:28
@v0d1ch v0d1ch force-pushed the ensemble/592-tx-validity-mutation branch from 1f32cae to 3030a69 Compare December 19, 2022 11:22
Copy link
Member

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

I think this is good to go! Minor comments and some documentation would be perfect, but also fine if you want to get it merged now.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/Contract/Close.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/TxSpec.hs Outdated Show resolved Hide resolved
nix/hydra/shell.nix Outdated Show resolved Hide resolved
hydra-node/src/Hydra/ContestationPeriod.hs Outdated Show resolved Hide resolved
@v0d1ch v0d1ch merged commit 03f64a7 into master Dec 19, 2022
@v0d1ch v0d1ch deleted the ensemble/592-tx-validity-mutation branch December 19, 2022 16:52
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.

Upper tx validity could be very big on close/contest
4 participants