Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Commit blueprint tx #1380

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Commit blueprint tx #1380

merged 4 commits into from
Apr 24, 2024

Conversation

v0d1ch
Copy link
Contributor

@v0d1ch v0d1ch commented Apr 2, 2024

fix #1350

As discussed with out users in #1337 we want to unlock more usecases and allow additional transaction context specified by providing a blueprint transaction.

  • It is important to note that only the inputs spent by the blueprint transaction will be committed to a head.

  • Any outputs as well as minting or burning will be igored by the hydra-node

  • The old way of committing still works with a caveat that only the pub key UTxO can be committed this way. In order to commit a script UTxO we need a draft/blueprint transaction that proves these outputs can be spent and provides necessary data (i.e. redeemers).

  • Now it is possible to also commit reference inputs since we lifted this restriction.


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

@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch from c6deea1 to aa16136 Compare April 3, 2024 13:38
@ch1bo ch1bo linked an issue Apr 4, 2024 that may be closed by this pull request
@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch 13 times, most recently from 2857ae4 to cf0cae1 Compare April 9, 2024 13:24
Copy link

github-actions bot commented Apr 9, 2024

Test Results

423 tests  +2   414 ✅ +2   14m 41s ⏱️ -54s
138 suites +2     9 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit 62371ed. ± Comparison against base commit 120ff1b.

This pull request removes 8 and adds 10 tests. Note that renamed tests count towards both.
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized DraftCommitTxRequest) ‑ allows to encode values with aeson and read them back
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized DraftCommitTxRequest) ‑ produces the same JSON as is found in golden/ReasonablySized DraftCommitTxRequest.json
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized DraftCommitTxResponse) ‑ allows to encode values with aeson and read them back
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized DraftCommitTxResponse) ‑ produces the same JSON as is found in golden/ReasonablySized DraftCommitTxResponse.json
Hydra.Chain.Direct.State/commit ‑ reject committing outputs with reference scripts
Test.EndToEnd/End-to-end on Cardano devnet/single party hydra head ‑ can't commit externally with internal wallet utxo
Test.EndToEnd/End-to-end on Cardano devnet/single party hydra head ‑ commit external wallet utxo with inline datum in the script
Test.EndToEnd/End-to-end on Cardano devnet/single party hydra head ‑ commits from external with script utxo
Hydra.API.HTTPServer/API should respond correctly/POST /commit ‑ handles PostTxErrors accordingly
Hydra.API.HTTPServer/API should respond correctly/POST /commit ‑ responds on valid requests
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized (DraftCommitTxRequest (Tx BabbageEra))) ‑ allows to encode values with aeson and read them back
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized (DraftCommitTxRequest (Tx BabbageEra))) ‑ produces the same JSON as is found in golden/ReasonablySized (DraftCommitTxRequest (Tx BabbageEra)).json
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized (DraftCommitTxResponse (Tx BabbageEra))) ‑ allows to encode values with aeson and read them back
Hydra.API.HTTPServer/JSON encoding of (ReasonablySized (DraftCommitTxResponse (Tx BabbageEra))) ‑ produces the same JSON as is found in golden/ReasonablySized (DraftCommitTxResponse (Tx BabbageEra)).json
Hydra.Chain.Direct.Tx/commitTx ‑ Validate blueprint and commit transactions
Hydra.Chain.Direct.Tx/commitTx ‑ genBlueprintTx generates interesting txs
Test.EndToEnd/End-to-end on Cardano devnet/single party hydra head ‑ commits from external with tx blueprint
Test.EndToEnd/End-to-end on Cardano devnet/single party hydra head ‑ commits from external with utxo

♻️ This comment has been updated with latest results.

@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch 2 times, most recently from beaed87 to a756ce7 Compare April 9, 2024 14:07
@v0d1ch v0d1ch self-assigned this Apr 9, 2024
@v0d1ch v0d1ch marked this pull request as ready for review April 9, 2024 14:11
CHANGELOG.md Outdated Show resolved Hide resolved
@ffakenz ffakenz force-pushed the commit-blueprint-tx branch 2 times, most recently from 679efde to 934703e Compare April 16, 2024 08:04
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.

This looks correct! Only some dead code / specifications to be taken care of.

I do expect we go through this diff and my suggestions in an ensemble session today.

hydra-cluster/src/Hydra/Cluster/Scenarios.hs Outdated Show resolved Hide resolved
hydra-cluster/src/HydraNode.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/Contract/Mutation.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/Contract/Check.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/API/ServerSpec.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/API/HTTPServer.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Chain/Direct/Tx.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/TxSpec.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/Chain/Direct/TxSpec.hs Outdated Show resolved Hide resolved
hydra-tui/src/Hydra/Client.hs Show resolved Hide resolved
@ffakenz ffakenz force-pushed the commit-blueprint-tx branch from 4f57516 to 2e29b3d Compare April 17, 2024 10:54
@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch 4 times, most recently from 20b99e5 to 987e9bc Compare April 18, 2024 12:04
@ch1bo ch1bo force-pushed the commit-blueprint-tx branch 2 times, most recently from 8c17fba to a363e08 Compare April 18, 2024 13:34
@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch 11 times, most recently from 1c868a2 to 252bbf0 Compare April 21, 2024 13:16
@v0d1ch v0d1ch force-pushed the commit-blueprint-tx branch from 252bbf0 to 5550b7a Compare April 21, 2024 13:34
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.

This should be correct now. Only minor things pointed out, although some inconsistencies are ideally cleaned up before merging this.

docs/docs/blueprint_transaction.md Outdated Show resolved Hide resolved
docs/docs/blueprint_transaction.md Outdated Show resolved Hide resolved
hydra-cardano-api/src/Hydra/Cardano/Api/Tx.hs Outdated Show resolved Hide resolved
hydra-cluster/src/Hydra/Cluster/Scenarios.hs Outdated Show resolved Hide resolved
hydra-cluster/src/Hydra/Cluster/Scenarios.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Ledger/Cardano.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/API/HTTPServer.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/API/HTTPServer.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/API/HTTPServer.hs Outdated Show resolved Hide resolved
hydra-node/json-schemas/api.yaml Outdated Show resolved Hide resolved
@v0d1ch v0d1ch enabled auto-merge April 24, 2024 10:50
@v0d1ch v0d1ch merged commit 4bbbe28 into master Apr 24, 2024
24 checks passed
@v0d1ch v0d1ch deleted the commit-blueprint-tx branch April 24, 2024 11:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revise POST /commit endpoint interface
4 participants