cardano-scaling / hydra

Implementation of the Hydra Head protocol
https://hydra.family/head-protocol/
Apache License 2.0
281 stars 86 forks source link

Fix demo by using latest docker image to publish scripts #1539

Closed ch1bo closed 3 months ago

ch1bo commented 3 months ago

We recently updated hydra to use the latest cardano-api that works with cardano-node 9.1 and consequently also updated the cardano-node binary used to version 9.1.

Previous version of the ledger/api seem to have problems communicating with this node version, which manifests itself in this error where we used hydra-node:0.17.0 still to post the scripts transaction (maybe incompatible deserialization of protocol params or so):

[ch1bo][~/code/iog/hydra/demo][⌥ master][󰁫821ms] λ ./seed-devnet.sh 
[...]
Publishing reference scripts...
0.17.0: Pulling from cardano-scaling/hydra-node
Digest: sha256:9d3b1aef1e7c07c0b3db2845dbcfd0a500d9b53e566d326e8099bf795a0abd70
Status: Image is up to date for ghcr.io/cardano-scaling/hydra-node:0.17.0
Environment variable stored in '.env'

    HYDRA_SCRIPTS_TX_ID=hydra-node: DecoderFailure (LocalStateQuery HardForkBlock (': * ByronBlock (': * (ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)) ('[] *)))))))) Query (BlockQuery (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)) ('[] *))))))))))) ServerAgency TokQuerying BlockQuery (QueryHardFork GetInterpreter)) (DeserialiseFailure 13 "Size mismatch when decoding EraParams.
Expected 3, but found 4.")

By using the latest master version via the hydra-node:unstable docker image, this is fixed.


github-actions[bot] commented 3 months ago

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-07-31 07:06:42.627517633 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead bd9fad235c871fb7f837c767593018a84be3083ff80f9dab5f1c55f9 10194
μHead c8038945816586c4d38926ee63bba67821eb863794220ebbd0bf79ee* 4607
Parties Tx size % max Mem % max CPU Min fee ₳
1 5188 5.93 2.35 0.44
2 5387 7.36 2.91 0.47
3 5588 8.73 3.46 0.49
5 5993 11.32 4.48 0.54
10 6996 18.16 7.18 0.66
56 16247 81.63 32.29 1.76

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 556 10.52 4.15 0.29
2 748 13.86 5.65 0.34
3 931 17.33 7.20 0.38
5 1310 24.65 10.44 0.48
10 2253 45.22 19.36 0.75
20 4118 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 549 22.14 8.66 0.42
2 113 659 33.89 13.40 0.55
3 170 773 47.27 18.87 0.70
4 227 879 60.23 24.30 0.85
5 284 989 72.33 29.53 0.99
6 339 1100 90.03 36.93 1.19

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 623 17.67 7.77 0.38
2 780 19.33 9.15 0.41
3 895 19.97 10.07 0.42
5 1225 24.46 13.34 0.50
10 1913 30.60 19.33 0.62
50 8036 98.63 74.88 1.84

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 665 20.94 9.40 0.42
2 838 22.86 11.15 0.45
3 996 24.37 12.59 0.48
5 1244 27.20 15.33 0.54
10 1989 35.19 22.95 0.69
49 7919 98.02 82.74 1.89

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 687 27.18 11.69 0.48
2 821 28.97 13.21 0.52
3 1047 31.51 15.37 0.56
5 1331 35.10 18.43 0.63
10 2065 44.43 26.50 0.79
39 6379 99.60 73.36 1.76

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 5076 17.47 7.60 0.57
2 5177 28.42 12.45 0.70
3 5310 38.72 17.00 0.82
4 5522 59.74 26.54 1.07
5 5621 77.30 34.40 1.27
6 5693 86.87 38.49 1.38

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 5023 8.34 3.53 0.46
5 1 57 5056 8.49 3.82 0.47
5 5 284 5192 13.80 7.01 0.54
5 10 570 5362 19.06 10.39 0.62
5 20 1137 5699 30.78 17.68 0.78
5 30 1709 6043 42.10 24.80 0.94
5 40 2275 6379 52.84 31.67 1.09
5 50 2845 6719 64.76 39.06 1.25
5 81 4609 7770 99.53 61.01 1.74

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-07-31 07:09:13.153887851 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.820103857
P99 11.777719319999967ms
P95 6.522500099999998ms
P50 4.4770045ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 23.779652243
P99 61.12229886000029ms
P95 32.56181459999999ms
P50 21.4741725ms
Number of Invalid txs 0
github-actions[bot] commented 3 months ago

Test Results

464 tests  ±0   457 :white_check_mark: ±0   17m 24s :stopwatch: +34s 149 suites ±0     7 :zzz: ±0    5 files   ±0     0 :x: ±0 

Results for commit 2f160a27. ± Comparison against base commit b8f3e861.

ch1bo commented 3 months ago

Looks reasonable; would be helpful to know the exact problem it solved just incase someone searches for it at some point :)

Good point. I'll add it to the PR description.