Skip to content

Commit f5b1e4f

Browse files
authored
Merge pull request #1222 from input-output-hk/ch1bo/refactor-offline-mode
Refactor offline-mode
2 parents b0c94e7 + 00427a5 commit f5b1e4f

File tree

41 files changed

+1773
-2501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1773
-2501
lines changed

CHANGELOG.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@ changes.
2424
- Renamed `HasInlineDatums` type class to `IsBabbageEraOnwards`. Use
2525
`babbageEraOnwards` to produce witnesses for features from babbage onwards.
2626

27-
- New top-level offline mode command, `offline`
28-
- Initializes ledger via `--initial-utxo` parameter, and does not connect to a
29-
cardano-node.
30-
- Hydra.Options split into Hydra.Options.Common, Hydra.Options.Offline,
31-
Hydra.Options.Online, re-exported from Hydra.Options.
32-
3327
- Report error on unsupported era.
3428

29+
- New `offline` sub-command for `hydra-node`:
30+
- Initializes a head with given `--initial-utxo` parameter, and does not
31+
connect to the Cardano network.
32+
- Transactions submitted on the L2 are validated as usual, where the offline
33+
chain simulates time passing in slots.
34+
- The `--ledger-genesis` option allows to give a shelley genesis file to
35+
configure start time and slot length of the simulated chain time.
36+
37+
- The `hydra-node` now also has a default `--node-id` (`"hydra-node-1"`) to
38+
simplify configuration.
39+
40+
- **BREAKING** Changes the `NodeOptions` log output because of internal
41+
restructuring of chain layer configuration.
42+
3543
## [0.14.0] - 2023-12-04
3644

3745
- **BREAKING** Multiple changes to the Hydra Head protocol on-chain:

hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs

+18
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ findTxOutByScript utxo script =
104104
_ ->
105105
False
106106

107+
-- | Predicate to find or filter 'TxOut' owned by a key. This
108+
-- is better than comparing the full address as it does not require a network
109+
-- discriminator.
110+
isVkTxOut ::
111+
forall ctx era.
112+
VerificationKey PaymentKey ->
113+
TxOut ctx era ->
114+
Bool
115+
isVkTxOut vk txOut =
116+
case address of
117+
(AddressInEra (ShelleyAddressInEra _) (ShelleyAddress _ (Ledger.KeyHashObj kh) _)) ->
118+
keyHash == kh
119+
_ -> False
120+
where
121+
(PaymentKeyHash keyHash) = verificationKeyHash vk
122+
123+
(TxOut address _ _ _) = txOut
124+
107125
-- | Predicate to find or filter 'TxOut' which are governed by some script. This
108126
-- is better than comparing the full address as it does not require a network
109127
-- discriminator.

hydra-cluster/golden/RunOptions.json

-286
This file was deleted.

hydra-cluster/hydra-cluster.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ test-suite tests
157157
Test.Hydra.Cluster.FaucetSpec
158158
Test.Ledger.Cardano.ConfigurationSpec
159159
Test.LogFilterSpec
160+
Test.OfflineChainSpec
160161

161162
build-depends:
162163
, aeson

0 commit comments

Comments
 (0)