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 FaucetFailedToBuildTx in smoke test #1384

Merged
merged 5 commits into from
Apr 8, 2024

Conversation

ffakenz
Copy link
Member

@ffakenz ffakenz commented Apr 5, 2024

Our smoke test requires funds from the faucet to run. Once completed, it constructs a transaction to return the provided funds back to the faucet. To determine the amount of value to be returned, it subtracts a fee calculation from the remaining balance.

However, there is an issue with our fee calculation, causing the smoke test to fail with FaucetFailedToBuildTx {reason = TxBodyErrorAdaBalanceNegative (Coin (-176))}.

This PR aims to resolve the issue by removing the incorrect fee calculation and allowing the transaction to automatically balance itself during construction.


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

@ffakenz ffakenz self-assigned this Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 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-04-08 09:45:33.631303205 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial bccf2a430c016bc960fbf31b02694011cd399d20da8882aac9d33611 4110
νCommit 56b0f0b597150e619c76bed60683f3b1e42d7bc0685ed951b882bfc5 1975
νHead 86bff95ba20e9d1d1b34899a56d86bbacc9fed999260b27dcc92d128 9351
μHead 88f533cf67cd0fc93d7d9ccf0a8b1d69ffd1208a825efbebbc1d36ba* 4213
  • 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 4792 8.68 3.31 0.46
2 5000 10.72 4.10 0.49
3 5196 12.93 4.96 0.52
5 5597 16.66 6.39 0.58
10 6604 26.16 10.02 0.72
47 14044 97.83 37.53 1.83

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 594 10.24 4.04 0.29
2 784 13.88 5.64 0.34
3 969 17.66 7.29 0.39
5 1348 25.66 10.74 0.49
10 2276 48.19 20.30 0.79
19 3968 97.83 40.79 1.41

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 544 16.52 6.53 0.35
2 114 654 26.89 10.72 0.47
3 170 768 39.31 15.79 0.62
4 226 874 51.49 20.85 0.76
5 283 984 69.05 28.01 0.95
6 337 1099 87.37 35.57 1.16

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 588 8.29 4.59 0.28
2 693 8.55 5.31 0.29
3 953 10.07 7.07 0.32
5 1158 11.15 8.88 0.36
10 2120 16.91 16.12 0.50
50 7959 49.33 62.17 1.35

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 624 8.65 4.73 0.28
2 859 9.83 6.20 0.31
3 910 10.03 6.85 0.32
5 1269 12.29 9.66 0.38
10 2052 16.87 15.75 0.49
50 7981 50.12 62.57 1.36

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 4669 16.96 7.33 0.55
2 4789 27.80 12.11 0.67
3 4955 42.24 18.55 0.84
4 5016 56.58 24.80 1.01
5 5222 73.18 32.10 1.20
6 5337 98.56 43.38 1.49

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 4628 7.85 3.28 0.44
5 1 57 4661 9.00 3.99 0.46
5 5 284 4796 13.70 6.88 0.52
5 10 569 4967 19.16 10.31 0.60
5 20 1138 5306 31.11 17.62 0.76
5 30 1709 5649 42.85 24.84 0.92
5 40 2278 5987 53.96 31.81 1.08
5 50 2845 6325 65.92 39.13 1.24
5 79 4492 7305 99.00 59.68 1.70

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-04-08 09:49:19.141682899 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 21.950689805
P99 106.40876387000053ms
P95 31.958029499999988ms
P50 19.349335ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.172414273
P99 8.662175449999998ms
P95 5.4069274499999995ms
P50 3.961664ms
Number of Invalid txs 0

Copy link

github-actions bot commented Apr 5, 2024

Test Results

427 tests  ±0   419 ✅ ±0   15m 17s ⏱️ +44s
139 suites ±0     8 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit ec430b2. ± Comparison against base commit 0fbcffe.

♻️ This comment has been updated with latest results.

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.

The change is fine, the test assertions are / were confusing and I left some comments to maybe improve them (as we touch this code now).

hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/src/Hydra/Cluster/Faucet.hs Show resolved Hide resolved
@ffakenz ffakenz force-pushed the ffakenz/fix-sanchonet-smoke-test branch from d3eeeee to 4183ce6 Compare April 8, 2024 07:17
- Generate the arbitrary actor within the forAll expression.
- Added an explanatory comment regarding why we do not set outputs while building the transaction.
- Make use of selectLovelace helper instead.
@ffakenz ffakenz force-pushed the ffakenz/fix-sanchonet-smoke-test branch from 9efc488 to ec430b2 Compare April 8, 2024 09:42
@ffakenz ffakenz merged commit dfa41e8 into master Apr 8, 2024
21 checks passed
@ffakenz ffakenz deleted the ffakenz/fix-sanchonet-smoke-test branch April 8, 2024 12:09
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

2 participants