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

Spike / Not merge: Inception chain component #1603

Closed
wants to merge 27 commits into from
Closed

Spike / Not merge: Inception chain component #1603

wants to merge 27 commits into from

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Sep 5, 2024

This is not meant to be merged as-is as it contains A LOT of hacks to make this work.

  • 🤯 Adds a new chain component that can be used with hydra-node --inception.
  • 🤯 Adds an end-to-end test about this: cabal test hydra-cluster --test-options "-m inception"
  • 🤯 Changes ServerOutput to contain full transactions (easier to handle)
  • 🤯 Make hydra-node publish-scripts use the same inception command line options (hacky)
  • 🤯 Manual address entry in TUI to have fuel/funds separate on L2 conveniently. Backported TUI: Add recipient address entry #1607

See issue #1590 for more details on learnings and a how-to.


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

@ch1bo ch1bo linked an issue Sep 5, 2024 that may be closed by this pull request
@ch1bo ch1bo mentioned this pull request Sep 5, 2024
@ch1bo ch1bo marked this pull request as draft September 5, 2024 16:36
@ch1bo ch1bo force-pushed the inception branch 2 times, most recently from 3a4c50e to d82053c Compare September 6, 2024 16:09
@ch1bo ch1bo requested a review from a team September 6, 2024 16:19
@@ -192,6 +192,14 @@ postDecommit HydraClient{apiHost = Host{hostname, port}} decommitTx = do
<&> setRequestBodyJSON decommitTx
>>= httpLbs

-- | Fetch protocol parameters fro a hydra-node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- | Fetch protocol parameters fro a hydra-node.
-- | Fetch protocol parameters for a hydra-node.

withTracerOutputTo h "Inception" $ \tracer -> do
let l2Dir = tmpDir </> "l2"
withCardanoNodeDevnet (contramap FromCardanoNode tracer) l2Dir $ \node@RunningNode{networkId} -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
-- Publish hydra scripts in L1
hydraScriptsTxId <- publishHydraScriptsAs node Faucet

-- This allows to open heads in other heads leveraging the isomorphic nature of
-- the Hydra Head protocol.
--
-- Basd on a websocket client to the API of one of the underlying head's nodes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- Basd on a websocket client to the API of one of the underlying head's nodes.
-- Based on a websocket client to the API of one of the underlying head's nodes.

hydra-node/src/Hydra/HeadLogic.hs Show resolved Hide resolved
@ch1bo ch1bo mentioned this pull request Sep 10, 2024
12 tasks
@noonio
Copy link
Contributor

noonio commented Sep 16, 2024

Can confirm I can follow the instructions and get it working on the branch!

Nice :)

Note: There are some compile-time errors on the hydra-node tests; but not too important as we aren't merging it; but just FYI if anyone is looking back.

```shell
nix run .#hydra-tui -- -c 0.0.0.0:4003 -k inception-demo/wallet.sk
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: You need to initialise the head here; i.e. press i in the TUI; then continue on with the rest of the steps.

Copy link
Contributor

@noonio noonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't merging this, but I'm formally "approving" to record that I've been able to at least replicate this demo on this branch by following the instructions.

The inception hydra client must only callback with a transaction
observed when it is confirmed. Otherwise, subsequent queries of
confirmed UTxO will not include the just observed transactions outputs.

Changing SnapshotConfirmed to include full txs allows to write the
inception hydra client simply without requiring book-keeping of
transactions seen.

Obviously this breaks many other things.
This is a bit weird in case of --offline as that would not require
publishing scripts in the first place. In fact, this is another hint
that we might have different chain components, but the cardano backends
share more things than the offline one for example.
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.

Spike: Hydra Head in Head
3 participants