Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

NotificationReceived received before NotificationsStreamOpen #5516

Closed
tomaka opened this issue Apr 3, 2020 · 0 comments · Fixed by #5560
Closed

NotificationReceived received before NotificationsStreamOpen #5516

tomaka opened this issue Apr 3, 2020 · 0 comments · Fixed by #5560
Labels
I3-bug The node fails to follow expected behavior.

Comments

@tomaka
Copy link
Contributor

tomaka commented Apr 3, 2020

It is possible at the moment from the network events stream to receive a notification for a protocol with a peer that hasn't been reported as open.

For backwards-compatibility reasons, we report on the API level as open only nodes for which we have a fully-handshaked legacy substream open. We also discard notifications received from nodes for which we don't have a fully-handshaked legacy substream open.

There exists a bug right now where we are only discarding messages from nodes for which we don't have a substream with, but not from nodes for which we do have a substream but it hasn't finished its handshake.

Before fixing this bug, however, we have to figure out why notifications get sent at all in this condition. Remember that the remote also only sees the notifications substream as open once the legacy substream has been handshaked, and thus it is not supposed to send any message that we would then discard.

@tomaka tomaka added the I3-bug The node fails to follow expected behavior. label Apr 3, 2020
@tomaka tomaka mentioned this issue Apr 7, 2020
tomaka added a commit that referenced this issue Apr 8, 2020
* Add a failing test

* Make test not freeze

* Fix the bug

* Fix spaces

* Fix tests

* Apply suggestions from code review

Co-Authored-By: Toralf Wittner <tw@dtex.org>

* Make sure test doesn't succeed if nothing happened

* Fix build

* Do the events change

Co-authored-by: Toralf Wittner <tw@dtex.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant