-
Notifications
You must be signed in to change notification settings - Fork 88
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
Non-mandatory fuel #924
Non-mandatory fuel #924
Conversation
d6f48d2
to
578e0ef
Compare
b656071
to
38d4836
Compare
38d4836
to
ce2d2bf
Compare
Test Results314 tests +2 308 ✔️ +2 21m 47s ⏱️ + 2m 11s Results for commit 93201bf. ± Comparison against base commit 6ce7cf1. This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
ce2d2bf
to
fcbc8de
Compare
fcbc8de
to
d8ccdc2
Compare
90e0518
to
069d3cb
Compare
ce7e061
to
d55016f
Compare
Transactions CostsSizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using
Script summary
Cost of Init Transaction
Cost of Commit TransactionThis is using ada-only outputs for better comparability.
Cost of CollectCom Transaction
Cost of Close Transaction
Cost of Contest Transaction
Cost of Abort TransactionSome variation because of random mixture of still initial and already committed outputs.
Cost of FanOut TransactionInvolves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.
|
be12bdb
to
427c953
Compare
d64b022
to
1989cd9
Compare
sortingCriteria (_, Babbage.BabbageTxOut _ v _ _) = fst' (gettriples' v) | ||
sortedByValue = sortOn sortingCriteria utxosWithDatum | ||
in case sortedByValue of | ||
findFuelOrLargestUTxO :: Map TxIn TxOut -> Maybe (TxIn, TxOut) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should add a note for when deprecating the Fuel?
75dacb3
to
17bcbc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good, but partial functions in a library is something should avoid strongly. Also there are several "should-do's".
|
||
Hydra node allows the users to commit utxo using their own wallet. This removes the need to mark some specific utxo as _fuel_ to drive L1 transactions. Now it is the users obligation to provide enough funds for a key specified with the `--cardano-signing-key` hydra-node flag since this key is used to pay for all L1 transactions. | ||
|
||
The node provides the http endpoint at the `/commit` path of the internal api server which can accept multiple user utxos (belonging to public key or script address) to commit to a Head after the `Initialization` phase. Hydra-node sends back a draft transaction which is expected to be submitted to a network by the user. Please take a look at the [api documentation](https://hydra.family/head-protocol/api-reference) and specifically `DraftCommitTxRequest/Response` to get more insights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The information here is correct, but don't feel afraid in changing/incorporating this more with the Fuel
section below!
For example, the explanation for fuel per se is still good to have, only difference is that now it does not need to be marked if we use external commits.
Also, there is a an :::info About commits
banner below which feels odd to have if we have this section.
Should: update the Fuel
section, and maybe move this after it, only adding additional info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 241389a
@@ -69,6 +69,10 @@ cardano-cli query utxo --address $(cat ./test-head/Alice/AliceCardano.addr) --te | |||
cardano-cli query utxo --address $(cat ./test-head/Bob/BobCardano.addr) --testnet-magic 2 | |||
``` | |||
|
|||
:::warning Fuel is deprecated and will be removed in future Hydra versions. | |||
Please take a look at [external-commits](/head-protocol/docs/getting-started/quickstart#external-commits) | |||
::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a perfect world we would have updated the tutorial already with external commits. But it may be outdated for other reasons now.
Let's keep this part in mind when we write the follow-up of "actually removing fuel"
7a4048a
to
ccbab33
Compare
This is enough as the benchmark does fund the internal signing keys of each hydra-node at the beginning of the scenario.
Also: - Improve changelog. - Enhance fuel warnings in docs.
Also move the function to inner where clause where is needed. This is also updating the property on finding the largest UTxO and surprisingly it does not pass (even on the previous version) .
Make a comment a haddock
This keeps the same errors as they were originally. We still call the funds on the internal wallet fuel, but we just don't require marking them anymore.
2cda4ff
to
2e276a3
Compare
As we are using req now, we can try to get rid of the retrying on connection failures. Also drops the dependency to http-conduit as currently unused.
Also remove details about fuel marking from demo instructions
It's easier to not talk about details in all these tutorials, but just refer to "fueling the hydra node".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated my change requests. Can approve now.
hydra-cluster/src/HydraNode.hs
Outdated
(HttpExceptionRequest _ (ConnectionFailure _)) -> threadDelay 100_000 >> cont | ||
e -> throwIO e | ||
(Req.VanillaHttpException _) -> threadDelay 100_000 >> cont | ||
(Req.JsonHttpException _) -> threadDelay 100_000 >> cont |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hydra-cluster/src/HydraNode.hs
Outdated
response <- failAfter 3 $ queryNode hydraNodeId | ||
let respBody = Req.responseBody response | ||
when (Req.responseStatusCode response /= 200) $ | ||
failure ("Request for Hydra-node metrics failed :" <> show respBody) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
Hydra node allows the users to commit utxo using their own wallet. This removes the need to mark some specific utxo as _fuel_ to drive L1 transactions. Now it is the users obligation to provide enough funds for a key specified with the `--cardano-signing-key` hydra-node flag since this key is used to pay for all L1 transactions. | ||
|
||
The node provides the http endpoint at the `/commit` path of the internal api server which can accept multiple user utxos (belonging to public key or script address) to commit to a Head after the `Initialization` phase. Hydra-node sends back a draft transaction which is expected to be submitted to a network by the user. Please take a look at the [api documentation](https://hydra.family/head-protocol/api-reference) and specifically `DraftCommitTxRequest/Response` to get more insights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 241389a
- Rename to . - Fix witness parsing for to be really optional. This also fixes the golden file for DraftCommitTxRequest. - Define arbitrary instance for ScriptData. - Complete arbitrary instance for HashableScriptData. - Remove singlePartyCommitsFromExternal scenario as it was redundant. In #924 we have made most tests use external commit of Normal outputs. - use Cannot in a scenario name as it's easier to read and tell apart from Can. Cant is easily misread. - Remove unused data constructor SubmitCommitTx.
- Rename DraftUTxO to TxOutWithWitness. - Fix witness parsing for TxOutWithWitness to be really optional. This also fixes the golden file for DraftCommitTxRequest. - Define arbitrary instance for ScriptData. - Complete arbitrary instance for HashableScriptData. - Remove singlePartyCommitsFromExternal scenario as it was redundant. In #924 we have made most tests use external commit of Normal outputs. - use Cannot in a scenario name as it's easier to read and tell apart from Can. Cant is easily misread. - Remove unused data constructor SubmitCommitTx. - use $ref: "#/components/schemas/Cbor" for Script datum and redemer in api.yaml
- Rename DraftUTxO to TxOutWithWitness. - Fix witness parsing for TxOutWithWitness to be really optional. This also fixes the golden file for DraftCommitTxRequest. - Define arbitrary instance for ScriptData. - Complete arbitrary instance for HashableScriptData. - Remove singlePartyCommitsFromExternal scenario as it was redundant. In #924 we have made most tests use external commit of Normal outputs. - use Cannot in a scenario name as it's easier to read and tell apart from Can. Cant is easily misread. - Remove unused data constructor SubmitCommitTx. - use $ref: "#/components/schemas/Cbor" for Script datum and redemer in api.yaml
- Rename DraftUTxO to TxOutWithWitness. - Fix witness parsing for TxOutWithWitness to be really optional. This also fixes the golden file for DraftCommitTxRequest. - Define arbitrary instance for ScriptData. - Complete arbitrary instance for HashableScriptData. - Remove singlePartyCommitsFromExternal scenario as it was redundant. In #924 we have made most tests use external commit of Normal outputs. - use Cannot in a scenario name as it's easier to read and tell apart from Can. Cant is easily misread. - Remove unused data constructor SubmitCommitTx. - use $ref: "#/components/schemas/Cbor" for Script datum and redemer in api.yaml
- Rename DraftUTxO to TxOutWithWitness. - Fix witness parsing for TxOutWithWitness to be really optional. This also fixes the golden file for DraftCommitTxRequest. - Define arbitrary instance for ScriptData. - Complete arbitrary instance for HashableScriptData. - Remove singlePartyCommitsFromExternal scenario as it was redundant. In #924 we have made most tests use external commit of Normal outputs. - use Cannot in a scenario name as it's easier to read and tell apart from Can. Cant is easily misread. - Remove unused data constructor SubmitCommitTx. - use $ref: "#/components/schemas/Cbor" for Script datum and redemer in api.yaml
--cardano-signing-key
if no marked fuel can be found.