Skip to content

Commit

Permalink
Implemeted review comments, fixed flaky unit test & cucumber test
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Aug 23, 2021
1 parent dada8d9 commit 797d17f
Show file tree
Hide file tree
Showing 3 changed files with 4,622 additions and 22 deletions.
9 changes: 5 additions & 4 deletions comms/src/connection_manager/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ where
}
},
Ok(WireMode::Comms(byte)) => {
// TODO: This call is expensive and only added for the benefit of improved logging and may lead to
// TODO: DoS attacks. Remove later when not needed anymore or make it optional with a config file
// TODO: setting.
let public_key = Self::remote_public_key_from_socket(socket, noise_config).await;
warn!(
target: LOG_TARGET,
Expand Down Expand Up @@ -317,13 +320,11 @@ where
}
},
Err(err) => {
let public_key = Self::remote_public_key_from_socket(socket, noise_config).await;
warn!(
target: LOG_TARGET,
"Peer at address '{}' ({}) failed to send its wire format . Expected network byte {:x?} or \
liveness byte {:x?} not received. Error: {}",
"Peer at address '{}' failed to send its wire format. Expected network byte {:x?} or liveness \
byte {:x?} not received. Error: {}",
peer_addr,
public_key,
config.network_info.network_byte,
LIVENESS_WIRE_MODE,
err
Expand Down
7 changes: 5 additions & 2 deletions integration_tests/features/Sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ Feature: Block Sync
Then node PNODE2 is at height 40
When I start base node NODE1
# We need for node to boot up and supply node 2 with blocks
And I connect node NODE2 to node NODE1 and wait 60 seconds
Then all nodes are at height 40
And I connect node NODE2 to node NODE1 and wait 5 seconds
# NODE2 may initially try to sync from PNODE1 and PNODE2, then eventually try to sync from NODE1; mining blocks
# on NODE1 will make this test less flaky and force NODE2 to sync from NODE1 much quicker
When I mine 10 blocks on NODE1
Then all nodes are at height 50

Scenario Outline: Syncing node while also mining before tip sync
Given I have a seed node SEED
Expand Down
Loading

0 comments on commit 797d17f

Please sign in to comment.