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

Fix fanout after contest #1313

Merged
merged 12 commits into from
Feb 21, 2024
Merged

Fix fanout after contest #1313

merged 12 commits into from
Feb 21, 2024

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Feb 20, 2024

Fixes #1260

🐛🔨 Add CloseWithInitialSnapshot action to the model based tests to simulate the scenario outlined in #1260 where we see a close with the initial snapshot and consequently a contest transaction.

🐛 🔨 Fix HeadLogic and Chain.Direct.Tx to correctly observe and update the contestationDeadline in HeadState.

🐛 🔨 Add contestationDeadline to HeadIsContested server output to also communicate the observed deadline to clients.


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

v0d1ch and others added 6 commits February 20, 2024 11:15
We are able to simulate closing with initial snapshot while we had a
snapshot with one tx already. This reveals the bug where we previously
saw H25 error related to contest deadline not being pushed.
This also adds HeadContested state changed event to update the
contestation deadline in the HeadState. By updating it on contest
observations, the fanout transaction creation will use the right correct
deadline and passes tests.
@ch1bo ch1bo force-pushed the contest-bug-repro branch from c9f0e72 to 76d10e1 Compare February 20, 2024 10:15
Copy link

github-actions bot commented Feb 20, 2024

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 2024-02-21 16:03:25.129106058 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 985245919fcc6c0c5cd116023cd2c947c43e80dcbb5075fe12433fbb 4072
νCommit 7cb20fa71eb4c563ca283566ebe0aa65859d96c3f8cba35c52c181fd 2043
νHead 7a36661f5c15e9f1783aeaab890812c59b7286cbbc6de762d3110772 8816
μHead 8b111ac12274e46314769295a1c5dcab1d260096fc469fd698065463* 3851
  • 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 4433 10.25 3.95 0.46
2 4634 12.68 4.88 0.49
3 4834 14.68 5.63 0.52
5 5241 19.22 7.35 0.59
10 6242 30.24 11.53 0.75
41 12475 99.00 37.59 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 591 11.37 4.44 0.30
2 784 15.04 6.07 0.35
3 972 18.85 7.75 0.40
5 1345 26.90 11.27 0.51
10 2281 49.55 20.97 0.80
19 3975 99.43 41.75 1.43

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 544 21.12 8.27 0.40
2 114 654 32.35 12.79 0.53
3 169 764 48.11 19.08 0.71
4 227 878 61.96 24.78 0.87
5 282 984 81.96 32.84 1.09

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 528 15.16 6.43 0.34
2 740 18.00 8.96 0.39
3 878 19.45 10.29 0.42
5 1087 21.68 12.49 0.46
10 2030 30.57 20.68 0.64
50 7957 90.14 77.06 1.78

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 651 20.27 8.99 0.41
2 773 21.85 10.36 0.44
3 952 23.74 12.02 0.47
5 1105 25.91 14.01 0.51
10 2021 35.57 22.37 0.69
47 7451 97.40 76.39 1.82

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 4304 19.03 8.18 0.55
2 4469 32.02 13.94 0.71
3 4582 46.30 20.25 0.87
4 4676 62.46 27.29 1.06
5 4769 80.90 35.46 1.27

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 4266 7.63 3.19 0.42
5 1 57 4299 8.86 3.96 0.44
5 5 285 4436 14.40 7.27 0.51
5 10 567 4602 19.71 10.73 0.59
5 20 1139 4944 32.43 18.53 0.76
5 30 1707 5285 44.31 25.98 0.93
5 40 2279 5626 57.33 33.92 1.11
5 50 2848 5966 68.72 41.16 1.26
5 75 4268 6810 99.74 60.37 1.69

End-To-End Benchmark Results

This page is intended to collect the latest end-to-end benchmarks results produced by Hydra's Continuous Integration system from the latest master code.

Please take those results with a grain of salt as they are currently produced from very limited cloud VMs and not controlled hardware. Instead of focusing on the absolute results, the emphasis should be on relative results, eg. how the timings for a scenario evolve as the code changes.

Generated at 2024-02-21 16:05:46.035740292 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 21.936947036
P99 113.32157721000004ms
P95 31.937253000000002ms
P50 19.417457ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 3.974077748
P99 7.228311549999999ms
P95 4.782722599999996ms
P50 3.8327635ms
Number of Invalid txs 0

Copy link

github-actions bot commented Feb 20, 2024

Test Results

417 tests  +1   410 ✅ +1   13m 9s ⏱️ -36s
139 suites ±0     7 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit e974f06. ± Comparison against base commit 4463d6f.

♻️ This comment has been updated with latest results.

@v0d1ch v0d1ch requested a review from a team February 20, 2024 13:02
This adds the observed contestation deadline to also inform users when
the deadline will be (for informational purposes). The ReadyToFanout
output should still be the authorative source for when fanout is
possible.
@locallycompact locallycompact merged commit 477fb4d into master Feb 21, 2024
21 checks passed
@locallycompact locallycompact deleted the contest-bug-repro branch February 21, 2024 17:47
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.

Cannot Fanout a head after contestation
3 participants