-
Notifications
You must be signed in to change notification settings - Fork 2
Progress report
Opened following issues:
- We currently have an issue when issuing fanout, the node reports an L1 failure. https://github.com/input-output-hk/hydra-poc/issues/388
- Validator errors inside the head are encoded, and its not easy to debug issues with txs. https://github.com/input-output-hk/hydra-poc/issues/389
- How do we e.g. resolve datum hashes, we need tools like chain-index to be able to work on the head. First steps to support that outlined in https://github.com/input-output-hk/hydra-poc/issues/379
- Clarification about hydra-node params https://github.com/input-output-hk/hydra-poc/issues/390
Detailed plan of state tracking implementation:
- decode UTxO from HeadIsOpen and SnapshotConfirmed events
- add UTxO tracking
- use UTxO data to fill in "bet" and "claim" command parameters
- automatically generate salt for "bet" and remember it for later potential claim
- watch for "bet" tx from another player
- modify "claim" to just accept the salt and the gesture from another player and combine it with all of the previously collected data
- (possibly) after observing "bet" from another player:
- automatically reveal our salt and gesture through the metadata of a dummy tx,
- watch for a similar dummy tx from another player
- issue claim automatically
Raw versions of claim and bet commands.
Validator execution in the Head fails with a very terse error message:
CekError An error has occurred: User error:
The provided Plutus code called 'error'.
Is there a way to obtain output from traceXxx in on-chain code?
Add support for Abort, Commit, Close, and the new Fanout command.
Close (and Fanout after hydra-node update) started failing with
["fannedOutUtxoHash /= closedUtxoHash","PT5"]
It may have something to do with our privnet set-up - needs further investigation.
Anyway we can now fully manage the Head's life-cycle from the CLI.
One point to consider for the future: it may be useful to have an event (node output) to clearly demarcate historical events from what is happening in the head now.
Pair programming session to sketch the CLI to communicating with the Node WS API. At present it just dumps all the output from the Node and can issue the Init command.
Pair programming session to build tx with cardano-api
- Some issues with our docker setup
- Ended up with solution similar to hydra-poc
- We want to keep a copy of all the files in a separate folder in repo
- This is because those files need to be periodically updated with new startDate time, otherwise cardano-node will start throwing LedgerNoView errors
- actually only 2 files need updates, but we want to keep config together
- we need to delete db when starting up node to restore clean state
- keep sources fixed, add devnet folder to .gitignore add startDate modification to reset script
- This prevents git from marking those as dirty every time we clear db
- explored some solutions that would instruct git to keep those out of tracked files, but none really works (https://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree#)
- Building tx that locks ada at validator address with correct datum
- Currently relying on known (fixed) tx ids to fetch inputs
- Manually need to add collateral/change addr
- Addresses are also hard-coded for now
- We should be able to derive everything we need from greeting messages (vkey)
- We are currently exporting tx to file, then signing through CLI and pasting the output into the node WS
- Redeem tx
- more involved
- to we need to have access to both datums to consume both utxos?
- build a tx that consumes only 1 of the utxos
- This actually highlighted a bug (?) in the RPS code, a user can take back the utxo they posted by building a tx that uses their pk/salt as both myInfo and theirInfo, maybe a feature?
- managed to consume utxo with this on-head
- Started working on haskell program that will manage head sending WS commands
- currently CLI, will adapt to something different at some point
- goal is to have something that can drive the opening of a head from haskell so we can submit and sign a tx entirely through haskell
- Initial uncertainty on how to write transactions. Coming from Plutus-tx the experience creating a valid tx is much harder (we don't get access to the Contract monad).
- Setting up the environment.
- Since this includes many pieces we decided to create a compose file that allows you to easily spin up all the components required to play (cardano-node, hydra-node, app)
- [!] Write down some notes on how to build Txs with cardano-api
- Lack of fees makes it interesting from POV of on-chain code. We don't have to worry about those when checking the validity of UTxOs in trasaction.
- Simple Example: When player needs to redeem RPS win, we check that the tx is sending their bet + other player bet to their address, but we have to subtract fees (we don't really HAVE to, but the off-chain code you would naturally write for this would not account for fees. Maybe this is an issue with the tx building in the contract monad?) We have no way of testing inside the head (initially) so we write some emulator trace tests to be confident our on-chain code is correct Does this translate to correctness inside the head?