-
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
Propose an ADR on reference scripts #438
Conversation
Transactions CostsSizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using
Cost of Init Transaction
Cost of Commit TransactionCurrently only one UTxO per commit allowed (this is about to change soon)
Cost of CollectCom Transaction
Cost of Close Transaction
Cost of Contest Transaction
Cost of Abort Transaction
Cost of FanOut TransactionInvolves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.
|
* Publish outputs holding Hydra scripts out-of-band (option 2), because | ||
+ All scripts would not fit into the `init` transaction directly, we would need to post multiple. | ||
+ Costs (deposits) would need to be payed for each head instance. | ||
+ Although, heads using option 1 would not be exposed to DoS |
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 way this is presented is a bit weird because, both option (1) and option (2) are about publishing Hydra scripts on-chain; the only question is whether or not to mix that with the init transaction.
And the conclusion being that no, we'd rather not for reason X & Y.
- Although, heads using option 1 would not be exposed to DoS
I disagree, it would be exposed to it all-the-same. The DoS problem stems from what locks the outputs where the script is posted to. If it's spendable, then it's deniable. So these are kind of orthogonal.
One extra reason why doing it as part of the init isn't a good idea is the complexity it adds to the system. When the publishing transaction is assumed to exist, it is known on application start, provided as configuration. However, doing it part of the init means that there needs to be code that (a) realize the event and (b) monitor the outcome of the event. That's extra complexity for the Hydra node which we may want to prevent.
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.
Good points. You are right in that the DoS stuff is about spendability of the outputs. In option 1 we could make it spendable by head instance itself and only when terminating it, i.e. by ensuring the ST is also burned. So it can be made DoS-safe and non-littering. Which is not possible in option 2.
* We will publish scripts on release of the `hydra-node`, or more specifically of the `hydra-plutus` package. | ||
|
||
* The scripts are stored at outputs addressed to some **unspendable** `v_publish` validator. | ||
+ This is to avoid DoS risk and unnecessariy centralization with option 2 |
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.
I was thinking that, we could imagine a v_genesis_delegate
which can only be spent with a quorum of 5 signatures from the genesis delegates 😅 ... As a "standard", this would allow to create scripts that can be later garbage-collected by the genesis delegates to reduce littering of the chain. They can already DoS the entire chain if they wanted to, so letting them also get rid of the UTxO if needs be sounds fair enough 😅
I guess it's okay anyway to have a const False
script because we'll be talking about few scripts a year 🤷 ... still, somehow it bothers me to "leave my trash around".
## Consequences | ||
|
||
* We need a process and/or tool to publish `hydra-plutus` scripts and need to pay the deposits. | ||
+ Any other party could to the same, this does not lead to centralization. |
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.
I've got a proof of concept in mind, little web app connecting to a CIP-0030's wallet and using the Github API to fetch release artifacts 👌
* We need a process and/or tool to publish `hydra-plutus` scripts and need to pay the deposits. | ||
+ Any other party could to the same, this does not lead to centralization. | ||
|
||
* The `hydra-node` would be need to know the `TxIn`s of the "right" published scripts. In the simplest case we would just make this configurable. |
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.
I'd park that as an "implementation details" (the TxIn
bit). As we discussed, we need to provide the Hydra node with the output reference corresponding to each scripts needed as reference. This can be inferred from a TxIn
+ state query (as we currently do), or could be specified as a configuration file / command-line options fully.
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.
Are you saying that it's okay to leave it like this and how the TxIn
gets inferred is an implementation detail? i.e. not enumerating all but doing what we do right now is an optimization on convenience == implementation detail not covered by the adr
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.
I mean that mentioning TxIn
is an implementation detail. The ADR should simply say that a reference to the published scripts must be communicated to the Hydra node. An address, a TxId, a TxIn ... doesn't matter much.
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.
Perhaps I am just neat picking.
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.
Ah well. Ultimately the reference needs to be available as a TxIn
eventually, so I think that formulation is the common denominator all specific implementations need to fulfill. 🚲 🏠
|
||
* The `hydra-node` would be need to know the `TxIn`s of the "right" published scripts. In the simplest case we would just make this configurable. | ||
|
||
* If we parameterize the `v_publish` validator by a "type + version" indicator, this yield a unique address per Head script version. |
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.
We'd likely want to also include some kind of project identifier in there. Because we could imagine this approach to be "normalized" and reused. Alternatively, we could also use a static address and use inline-datum as a way to attach metadata. Then it's possible to discover all scripts published in that way and tell them apart from the metadata.
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.
Yeah maybe better to store the tags in datums. In this specific case the examples should highlight that any tag should be okay and we use a script name + version in HydraHeadV1
, HydraInitialV1
etc.
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: Franco Testagrossa <[email protected]>
c65b51a
to
985df77
Compare
We somehow covered this while grooming #397, but I thought we should persist the design as an ADR.
It's not just a dump of the ticket, but tries to give a bit more rationale.
Rendered (github): https://github.com/input-output-hk/hydra-poc/blob/4f723b771ca8f538766154437750e8ec1de2c137/docs/adr/2022-07-22_019-reference-scripts.md