Skip to content

Commit a16c858

Browse files
authored
Fix incremental commit/decommit state events (#1894)
These have not been carrying and updating the 'chainState' in our 'HeadState' aggregate. This would result in the chain layer not restarting from these last known chain points and we saw the hydra-node re-observing deposits, incrementas and (likely) decrements. --- * [x] CHANGELOG updated * [x] Documentation update not needed * [x] Haddocks update not needed * [x] No new TODOs introduced
2 parents 887c1da + 0c56bb6 commit a16c858

File tree

8 files changed

+398
-303
lines changed

8 files changed

+398
-303
lines changed

CHANGELOG.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ changes.
1919
- Change `PeerConnected` and `PeerDisconnected` to indicate connectivity to `--peer` items and not the remote `node-id`.
2020
- Log outputs related to the network components changed significantly.
2121
- Persisted state (write ahead logs) of the network components changed significantly. The `<persistence-dir>/etcd` directory must not be lost or manual action to recover the L2 network (etcd cluster) with counter-parties needs to be taken.
22+
- To configure the `etcd` instance used internally, you may use `ETCD_` environment variables. For example, to switch auto-compaction to periodic retention of 7 days:
23+
```
24+
ETCD_AUTO_COMPACTION_MODE=periodic
25+
ETCD_AUTO_COMPACTION_RETENTION=168h
26+
```
27+
28+
- Fix a bug where incremental commits / decommits were not correctly observed after restart of `hydra-node`. This was due to incorrect handling of internal chain state [#1894](https://github.com/cardano-scaling/hydra/pull/1894)
2229
2330
- Fix a bug where decoding `Party` information from chain would crash the node or chain observer.
2431
- A problematic transaction will now be ignored and not deemed a valid head protocol transaction.
@@ -40,21 +47,6 @@ changes.
4047
- We now store the `time` in `StateEvent` which is a breaking change to our
4148
persistence loading
4249
43-
- New environment variable handling for the `etcd` service allows for control
44-
of (most) etcd parameters.
45-
46-
For example, you may like to use this to control auto-compaction by switching
47-
to periodic retention for 7 days:
48-
49-
```
50-
ETCD_AUTO_COMPACTION_MODE=periodic
51-
ETCD_AUTO_COMPACTION_RETENTION=168h
52-
```
53-
54-
> [!NOTE]
55-
> Only variables prefixed with `ETCD_` are passed on to the `etcd` process.
56-
57-
5850
- Add a list of [clients](https://hydra.family/head-protocol/unstable/docs/clients) to the docs
5951
6052
## [0.20.0] - 2025-02-04
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
11
{
22
"samples": [
33
{
4-
"depositTxId": "0001010000010101000000000001000101000100000101010000010101010000",
5-
"headId": "01010100010001010101000101000001",
6-
"newVersion": 1,
4+
"chainState": {
5+
"recordedAt": {
6+
"blockHash": "0100000000010001010100010000000100000101010101000100010101000100",
7+
"slot": 1,
8+
"tag": "ChainPoint"
9+
},
10+
"spendableUTxO": {
11+
"0000010001000000000001000101010100000000010000000100000001000001#33": {
12+
"address": "2RhQhCGqYPDn9TWRPDVY9kcHEZpLDwnJka72YWCwDfxGA35wPizRdA9GyvhuD9qcqxKMaGPJZSjD2tBdXHee8wGiTFMAcxgxVLjs6fjkLan6mu",
13+
"datum": null,
14+
"datumhash": null,
15+
"inlineDatum": null,
16+
"inlineDatumRaw": null,
17+
"referenceScript": {
18+
"script": {
19+
"cborHex": "820501",
20+
"description": "",
21+
"type": "SimpleScript"
22+
},
23+
"scriptLanguage": "SimpleScriptLanguage"
24+
},
25+
"value": {
26+
"b0c53e2bf180858da4b64eb5598c5615bba7d723d2b604a83b7f9165": {
27+
"1927e29b34ffa554fc50ccc8bf9b41e5ea17cbdfe6ae6e5a879765": 1094243968039730176
28+
},
29+
"lovelace": 1904754014670228328
30+
}
31+
}
32+
}
33+
},
34+
"depositTxId": "0001010000000000010001000000010001000000000000010100010101000001",
35+
"headId": "01010001000101000101010100010100",
36+
"newVersion": 0,
737
"tag": "CommitFinalized"
838
}
939
],
10-
"seed": -763406104
40+
"seed": -1458698575
1141
}
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,36 @@
11
{
22
"samples": [
33
{
4-
"deadline": "1864-05-09T06:20:33.933700399873Z",
5-
"headId": "00000000010100010101000001010100",
6-
"newLocalUTxO": {},
7-
"pendingDeposit": "0001000100010101000101000001010100000000000001010101000000000101",
8-
"pendingDeposits": {
9-
"0001000101000100010101010000010101000101000101010101010100010000": {
10-
"0100000100010001000100000001010000000101010100000001000000010100#20": {
11-
"address": "addr_test1zpqj8j637n2usgayxmdvx3x7qgvhv0yftnntnk9hj0n72w45j8q427df3l45d2k08auxhlel9c7x244t5xv3uuv9ledq64uz4u",
12-
"datum": null,
13-
"inlineDatum": {
14-
"int": 4
15-
},
16-
"inlineDatumRaw": "04",
17-
"inlineDatumhash": "642206314f534b29ad297d82440a5f9f210e30ca5ced805a587ca402de927342",
18-
"referenceScript": {
19-
"script": {
20-
"cborHex": "4746010000220011",
21-
"description": "",
22-
"type": "PlutusScriptV2"
23-
},
24-
"scriptLanguage": "PlutusScriptLanguage PlutusScriptV2"
25-
},
26-
"value": {
27-
"245d5a7a06fe18358242e81281cd5ba9e6abe4efc54e7b659f25abae": {
28-
"a20c3107ed64ce5b715f": 1
29-
}
30-
}
31-
}
32-
}
4+
"chainState": {
5+
"recordedAt": {
6+
"tag": "ChainPointAtGenesis"
7+
},
8+
"spendableUTxO": {}
339
},
34-
"tag": "CommitRecorded",
35-
"utxoToCommit": {
36-
"0101010101010000010101000101000000000100010000010101000001000100#71": {
37-
"address": "addr1zyjya69cls6mv9gh0h7y7g7svjgfthyacuvv4ezlgyvc0s03fjs34slfuuls5xl7sm5e8yrkvvqn834pn99ermvfvscs0xkwy5",
10+
"deadline": "1864-05-09T00:56:38.983698539086Z",
11+
"headId": "01000100010101010100000100000001",
12+
"newLocalUTxO": {
13+
"0001000001010101000100000100010100010101010001010101000100010001#94": {
14+
"address": "addr1x9qn667sq6qap3j0yvp6khlzgzw57yc04dc6ha5rs8g0nrjpd2em6zxaucfcfht5gdmejvn24fke69qhu6u7kwh4r85qwa9902",
3815
"datum": null,
39-
"datumhash": null,
16+
"datumhash": "6825d60ec81f041ebf7dcdf1076312142d0a36432936e598dbe0694acc984692",
4017
"inlineDatum": null,
4118
"inlineDatumRaw": null,
42-
"referenceScript": {
43-
"script": {
44-
"cborHex": "8202818201818200581cb1075ce9c25485e1f9547f8c9c9177e47239599a4cb96eea6e1ef1c5",
45-
"description": "",
46-
"type": "SimpleScript"
47-
},
48-
"scriptLanguage": "SimpleScriptLanguage"
49-
},
19+
"referenceScript": null,
5020
"value": {
51-
"467f58932b54910584a0e8ea25a225e06a14530b2e96e938c53a3f22": {
52-
"1709a19f55300ab14c212db363c5": 1
21+
"8f461954fe2f18fee1dca233f358907e643ff839ed1f995e4bf325e3": {
22+
"30": 2
5323
}
5424
}
5525
}
56-
}
26+
},
27+
"pendingDeposit": "0100000101010100010001000000000100010001000100010001000101010100",
28+
"pendingDeposits": {
29+
"0000010101010000000001000100000100010101010001000100010100000000": {}
30+
},
31+
"tag": "CommitRecorded",
32+
"utxoToCommit": {}
5733
}
5834
],
59-
"seed": 284889560
35+
"seed": 735071337
6036
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
{
22
"samples": [
33
{
4-
"headId": "01010001010101000101010101010001",
5-
"newLocalUTxO": {},
6-
"recoveredTxId": "0100000001000001000000000101010001000000000000000001010100010101",
4+
"chainState": {
5+
"recordedAt": null,
6+
"spendableUTxO": {}
7+
},
8+
"headId": "00010000010101000000000000000001",
9+
"newLocalUTxO": {
10+
"0001000101010100010101010001000100010100010000010101010000000100#69": {
11+
"address": "addr_test1xru4r822mv0hsqjks0pg57r679eshp4wq55rkuqgkvjkuntqe42x85cw82wz3d86h423py4a8saq8kqhghws85hln5nqv39fdf",
12+
"datum": null,
13+
"datumhash": "325018121e9cac56dc21e64b14ed0a8bc3e3b62ba83b048f44c9ce0366345e06",
14+
"inlineDatum": null,
15+
"inlineDatumRaw": null,
16+
"referenceScript": null,
17+
"value": {
18+
"b0c53e2bf180858da4b64eb5598c5615bba7d723d2b604a83b7f9165": {
19+
"03b18655f635784d096d": 1
20+
}
21+
}
22+
}
23+
},
24+
"recoveredTxId": "0001010001000001010100010100010100010000000101000000010101000001",
725
"recoveredUTxO": {},
826
"tag": "CommitRecovered"
927
}
1028
],
11-
"seed": -1010695085
29+
"seed": 1182547604
1230
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,40 @@
11
{
22
"samples": [
33
{
4-
"decommitTxId": "0001000000000000000000000001000000000000010001010000010000010100",
5-
"headId": "00000001010101000001000101000000",
4+
"chainState": {
5+
"recordedAt": {
6+
"blockHash": "0100010101010101010100000100010001000100000000010000010000010001",
7+
"slot": 1,
8+
"tag": "ChainPoint"
9+
},
10+
"spendableUTxO": {
11+
"0000000000010100010101000001010100010100010100010100000001010100#19": {
12+
"address": "addr_test1zpscm90puxtm785w02th7qws0w0v0vphzyh88g2w90e50387lg66ceyc8n04addy7qhqfwgpem2qkkhe3gafa47ltdls8pjj0t",
13+
"datum": null,
14+
"datumhash": null,
15+
"inlineDatum": null,
16+
"inlineDatumRaw": null,
17+
"referenceScript": {
18+
"script": {
19+
"cborHex": "83030081820180",
20+
"description": "",
21+
"type": "SimpleScript"
22+
},
23+
"scriptLanguage": "SimpleScriptLanguage"
24+
},
25+
"value": {
26+
"b0c53e2bf180858da4b64eb5598c5615bba7d723d2b604a83b7f9165": {
27+
"eb0211177e54": 1
28+
}
29+
}
30+
}
31+
}
32+
},
33+
"decommitTxId": "0101000101010000000101000001000000000101010001000100010100000101",
34+
"headId": "00000101010100010001000000000100",
635
"newVersion": 0,
736
"tag": "DecommitFinalized"
837
}
938
],
10-
"seed": -2022187077
39+
"seed": -277076702
1140
}

0 commit comments

Comments
 (0)