Skip to content

Commit

Permalink
L1-222: Establish notification streams again (#1742)
Browse files Browse the repository at this point in the history
# Description

This should actually fix the problem with other protocols not connecting
completely.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

# Checklist:

- I have made corresponding changes to the existing documentation
- I have created new documentation
  • Loading branch information
timorleph authored May 22, 2024
1 parent a0faac5 commit 066cee2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions finality-aleph/src/network/base_protocol/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const DUMMY_SET_CONFIG: SetConfig = SetConfig {
reserved_nodes: Vec::new(),
non_reserved_mode: NonReservedPeerMode::Deny,
};
// Setting the message size too low makes it impossible to establish notification streams,
// which is expected by the base protocol to inform other protocols about peers.
// Other than that we send no messages.
// This value provides a wide margin, I tested it works with just 1024, but 4KB is not a problem.
const MAX_MESSAGE_SIZE: u64 = 4 * 1024;

/// Generate a config for the base protocol and the notification service that should be passed to its service.
pub fn setup<B>(genesis_hash: B::Hash) -> (NonDefaultSetConfig, Box<dyn NotificationService>)
Expand All @@ -34,10 +39,7 @@ where
NonDefaultSetConfig::new(
base_protocol_name.into(),
iter::once(legacy_block_announces_protocol.into()).collect(),
// This is the maximum message size. We don't need messages at all,
// but we want to avoid tripping some magic value,
// which 0 might suddenly become, so 1.
1,
MAX_MESSAGE_SIZE,
Some(NotificationHandshake::new(
BlockAnnouncesHandshake::<B>::build(
// All nodes are full nodes.
Expand Down

0 comments on commit 066cee2

Please sign in to comment.