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

Reliable persistence #1101

Merged
merged 22 commits into from Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0bbedb3
Pass in persistence handle and append on broadcast
v0d1ch Oct 4, 2023
ff39092
Make everything compile using mockPersistence
v0d1ch Oct 5, 2023
ecd37ac
Add a test to assert we append messages in reliability layer
v0d1ch Oct 5, 2023
6cf725b
Check for the existence of the persistence file as well
v0d1ch Oct 5, 2023
e51af8e
Save vector clock messages too
v0d1ch Oct 5, 2023
2c07200
Use own mock persistence for messages
v0d1ch Oct 6, 2023
086cca2
Minor formatting changes to network reliability persistence spec
ffakenz Oct 7, 2023
eb93944
Remove sent messages from memory
v0d1ch Oct 9, 2023
e7235d6
Rename mock message handles in ReliabilitySpec
v0d1ch Oct 9, 2023
cc3e9ae
Introduce MessagePersistence handle
v0d1ch Oct 9, 2023
1573863
Store messages in right order with mock persistence
abailly-iohk Oct 9, 2023
e563af7
Finalize MessagePersistence handle
v0d1ch Oct 9, 2023
47db45b
Remove unneeded TVars in favor of persistence handle
v0d1ch Oct 9, 2023
64f5fdf
Improve log message in case of missing local message to resend
v0d1ch Oct 9, 2023
5eb6954
Create persistence handle inside of network code
v0d1ch Oct 9, 2023
51b70bc
Fix concurrent update of vector clocks
abailly-iohk Oct 10, 2023
706d4f2
Simplify creation of Message persistence handle
abailly-iohk Oct 10, 2023
c150fc5
Go back to using me + others interface
v0d1ch Oct 10, 2023
7299a3c
Add ReceivedMalformedAcks trace
v0d1ch Oct 10, 2023
9a1cebc
Go back to using me + others interface
v0d1ch Oct 10, 2023
aeae7f9
Update module documentation
abailly-iohk Oct 10, 2023
e9a6ebd
Save vector clock also on Pings
abailly-iohk Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,8 @@ changes.
layer to improve reliability in the face of transient connection
issues

- Persist network messages on disk in order to gracefully handle crashes

## [0.13.0] - 2023-10-03

- **BREAKING** Update to plutus 1.9. This changes the script hashes.
Expand Down
3 changes: 2 additions & 1 deletion hydra-node/exe/hydra-node/Main.hs
Expand Up @@ -101,8 +101,9 @@ main = do
RunOptions{apiHost, apiPort} = opts
apiPersistence <- createPersistenceIncremental $ persistenceDir <> "/server-output"
withAPIServer apiHost apiPort party apiPersistence (contramap APIServer tracer) chain pparams (putEvent . ClientEvent) $ \server -> do

-- Network
withNetwork tracer (connectionMessages server) signingKey otherParties host port peers nodeId putNetworkEvent $ \hn -> do
withNetwork tracer persistenceDir (connectionMessages server) signingKey otherParties host port peers nodeId putNetworkEvent $ \hn -> do
-- Main loop
runHydraNode (contramap Node tracer) $
HydraNode
Expand Down
37 changes: 34 additions & 3 deletions hydra-node/json-schemas/logs.yaml
Expand Up @@ -587,13 +587,22 @@ definitions:
additionalProperties: false
required:
- tag
- failedToFindMessage
- missingMsgIndex
- sentMessagesLength
- knownAckForUs
- messageAckForUs
properties:
tag:
type: string
enum: ["ReliabilityFailedToFindMsg"]
failedToFindMessage:
type: string
missingMsgIndex:
type: number
sentMessagesLength:
type: number
knownAckForUs:
type: number
messageAckForUs:
type: number
- title: ReliabilityMissingPartyIndex
description: >-
Logged when party index could not be found. NOTE: This should never happen.
Expand All @@ -608,6 +617,28 @@ definitions:
enum: ["ReliabilityMissingPartyIndex"]
missingParty:
$ref: "api.yaml#/components/schemas/Party"
- title: ReceivedMalformedAcks
description: >-
Logged when we receive a message from a party but its vector clock is malformed (not having the same length as the number of parties in a Head)
type: object
additionalProperties: false
required:
- tag
- fromParty
- partyAcks
- numberOfParties
properties:
tag:
type: string
enum: ["ReceivedMalformedAcks"]
fromParty:
$ref: "api.yaml#/components/schemas/Party"
partyAcks:
type: array
items:
type: number
numberOfParties:
type: number


# NOTE: We cannot simply describe 'ServerOutput' and re-use it in api.yaml, so
Expand Down