-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A0-3584: Create NetworkEventStream earlier (#1519)
# Description There was a race condition, making our e2e test fail randomly because one node was not finalizing. Namely: ``` task_manager.spawn_essential_handle().spawn_blocking( "aleph", None, run_validator_node(aleph_config), // registers notification channel from substrate network ); network_starter.start_network(); // start substrate network ``` And the registration could have executed after starting the network, causing missing some notifications. This PR moves registering `NetworkEventStream` rx so that now it is always created before starting the network, and we get all notifications about `StreamOpened`. In `run_validator_node` we create also other notification channels from other network components, but I think the only event that cannot be missed is the mentioned `StreamOpened` event. Since my proposed solution exposes our facade for `SubstrateNetwork` and creates that component in `bin/`, I also simplified `AlephConfig` a bit. ## Type of change Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) # Checklist: # Notes: After changes, the finalization likely goes smooth (at least my local ~11~ quite a few runs were all healthy). However, validators still cannot be boot nodes at the same time - in such cases we still get random stalls. ![image](https://github.com/Cardinal-Cryptography/aleph-node/assets/31205678/5d37b285-7024-4b62-a2c2-ae14491d35de)
- Loading branch information
Showing
9 changed files
with
73 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters