Skip to content

Commit f8393ec

Browse files
committed
Define events to be re-submitted on startup
Also incorporate minor reviewer comments
1 parent 976922f commit f8393ec

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

docs/adr/2023-11-07_029-event-source-sink.md

+21-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: 29
33
title: |
44
29. EventSource & EventSink abstractions
55
authors: [@cardenaso11, @quantumplation, @ch1bo]
6-
tags: []
6+
tags: [Draft]
77
---
88

99
## Status
@@ -47,25 +47,36 @@ data HydraNode tx m = HydraNode
4747
}
4848
```
4949

50-
* The `stepHydraNode` main loop does call `putEvent` on all `eventSinks` in sequence.
51-
52-
- TBD: transaction semantics? what happens if one fails?
50+
* The `hydra-node` will load events and __hydra_te its `HeadState` using `getEvents` of the single `eventSource`.
5351

54-
* The default `hydra-node` main loop does use the file-based `EventSource` and a single file-based `EventSink` (using the same file).
52+
* The `stepHydraNode` main loop does call `putEvent` on all `eventSinks` in sequence. Any failure will make the `hydra-node` process terminate and require a restart.
53+
54+
* When loading events from `eventSource` on `hydra-node` startup, it will also re-submit events via `putEvent` to all `eventSinks`.
5555

56-
* TBD: As the node starts up, when loading events from the `EventSource`, it will also ensure "at least once" semantics for each `EventSink`.
56+
* The default `hydra-node` main loop does use the file-based `EventSource` and a single file-based `EventSink` (using the same file).
5757

5858
* We realize that the `EventSource` and `EventSink` handles, as well as their aggregation in `HydraNode` are used as an API by forks of the `hydra-node` and try to minimize changes to it.
5959

6060
## Consequences
6161

6262
* The default operation of the `hyda-node` remains unchanged.
63+
6364
* There are other things called `Event` and `EventQueue(putEvent)` right now in the `hydra-node`. This is getting confusing and when we implement this, we should also rename several things first (tidying).
65+
66+
* Interface first: Implementations of `EventSink` should specify their format in a non-ambiguous and versioned way, especially when a corresponding `EventSource` exists.
67+
6468
* The API `Server` can be modelled and refactored as an `EventSink`.
65-
- TBD: Do `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still?
66-
* Projects forking the hydra node have a natively extensions points for producing and consuming events.
67-
* TBD: These extensions can preserve robust "at least once" semantics for each hydra event.
69+
70+
* Projects forking the hydra node have dedicated extension points for producing and consuming events.
71+
6872
* Sundae Labs can build a "Save transaction batches to S3" proof of concept `EventSink`.
6973
* Sundae Labs can build a "Scrolls source" `EventSink`.
7074
* Sundae Labs can build a "Amazon Kinesis" `EventSource` and `EventSink`.
71-
* Extension points like `EventSource` and `EventSink` could be dynamically loaded as plugins without having to fork `hydra-node` (maybe in a future ADR).
75+
76+
## Out of scope / future work
77+
78+
* Available implementations for `EventSource` and `EventSink` could be
79+
- configured upon `hydra-node` startup using for example URIs: `--event-source file://state` or `--event-sink s3://some-bucket`
80+
- dynamically loaded as plugins without having to fork `hydra-node`.
81+
82+
* The `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still?

0 commit comments

Comments
 (0)