-
Notifications
You must be signed in to change notification settings - Fork 17
(WIP) Adding confirmation streaming in Event Stream #144
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Chengxuan Xing <[email protected]>
Signed-off-by: Chengxuan Xing <[email protected]>
Signed-off-by: Chengxuan Xing <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few worries about API spelling of those functions, they seem to similar but do different things - @peterbroadhurst will have some opinions here
Sad that we just released 1.4.0 and this will break consumers
Thanks for fixing the typos!
StartConfirmedBlockListener(ctx context.Context, id *fftypes.UUID, fromBlock string, checkpoint *ffcapi.BlockListenerCheckpoint, eventStream chan<- *ffcapi.ListenerEvent) error | ||
StartBlockConfirmationsListener(ctx context.Context, id *fftypes.UUID, fromBlock string, checkpoint *ffcapi.BlockListenerCheckpoint, eventStream chan<- *apitypes.ConfirmationsForListenerEvent) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth a comment to explain the difference, I'm still torn and think the confirmations context should be included in the ListenerEvent?
// ListenerEvent is an event+checkpoint for a particular listener, and is the object delivered over the event stream channel when | ||
// a new event is detected for delivery to the confirmation manager. | ||
type ConfirmationsForListenerEvent struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment needs updating
Signed-off-by: Enrique Lacal <[email protected]>
Okay there is a bug here I'm fixing
It's dispatching the same block |
…xception Signed-off-by: Enrique Lacal <[email protected]>
Signed-off-by: Enrique Lacal <[email protected]>
Okay I think I managed to fix the above, was just returning instead of breaking when we don't dispatch anything else so wasn't clearing from the blocksSinceCheckpoint the ones dispatched |
Adding support to stream confirmation events (the confirmation notification with a block event) for block listener only.
Unlike the built-in confirmation manager that's already used by the existing transaction handler, the confirmation events returned by the event stream ALWAYS return a full set of confirmations so that the consumer doesn't need to rebuild the full picture by accumulating them. This increases the size of the confirmation event, but hugely reduce the complexity of the client logic.