Skip to content

Commit 3d4e009

Browse files
authored
Merge pull request #4159 from ProvableHQ/fix/4.5.1-hotfixes
[Fix] 4.5.1 mainnet backports
2 parents e75dfb6 + 634f643 commit 3d4e009

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ default-features = false
4747

4848
[workspace.dependencies.snarkvm]
4949
#path = "../snarkVM"
50-
#git = "https://github.com/ProvableHQ/snarkVM.git"
51-
#rev = "ba7bf28"
52-
version = "=4.5.0"
50+
git = "https://github.com/ProvableHQ/snarkVM.git"
51+
rev = "eb6d42f"
52+
# version = "=4.5.0"
5353
default-features = false
5454

5555
[workspace.dependencies.anyhow]

node/bft/src/gateway.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,7 @@ impl<N: Network> OnConnect for Gateway<N> {
13031303
if let Some(listener_addr) = self.resolve_to_listener(&peer_addr) {
13041304
if let Some(peer) = self.get_connected_peer(listener_addr) {
13051305
if peer.node_type == NodeType::BootstrapClient {
1306+
self.cache.increment_outbound_validators_requests(listener_addr);
13061307
let _ =
13071308
<Self as Transport<N>>::send(self, listener_addr, Event::ValidatorsRequest(ValidatorsRequest))
13081309
.await;

node/bft/tests/gateway_e2e.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use snarkos_account::Account;
2626
use snarkos_node_bft::{Gateway, helpers::init_primary_channels};
2727
use snarkos_node_bft_events::{ChallengeRequest, ChallengeResponse, Event};
2828
use snarkos_node_network::PeerPoolHandling;
29-
use snarkos_node_tcp::P2P;
29+
use snarkos_node_tcp::{P2P, protocols::Handshake};
3030
use snarkvm::{ledger::narwhal::Data, prelude::TestRng};
3131

3232
use std::time::Duration;
@@ -79,7 +79,10 @@ async fn handshake_responder_side_timeout() {
7979
// Check the tcp stack's connection counts, wait longer than the gateway's timeout to ensure
8080
// connecting peers are cleared.
8181
let gateway_clone = gateway.clone();
82-
deadline!(Duration::from_secs(5), move || gateway_clone.tcp().num_connecting() == 0);
82+
deadline!(Duration::from_millis(<Gateway<CurrentNetwork> as Handshake>::TIMEOUT_MS + 2_000), move || gateway_clone
83+
.tcp()
84+
.num_connecting()
85+
== 0);
8386

8487
// Check the test peer hasn't been added to the gateway's connected peers.
8588
assert!(gateway.connected_peers().is_empty());

node/tcp/src/helpers/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Default for Config {
8484
allow_random_port: true,
8585
fatal_io_errors: vec![ConnectionReset, ConnectionAborted, BrokenPipe, InvalidData, UnexpectedEof],
8686
max_connections: 100,
87-
connection_timeout_ms: 1_000,
87+
connection_timeout_ms: 3_000,
8888
}
8989
}
9090
}

node/tcp/src/protocols/handshake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ where
3939
{
4040
/// The maximum time allowed for a connection to perform a handshake before it is rejected.
4141
///
42-
/// The default value is 3000ms.
43-
const TIMEOUT_MS: u64 = 3_000;
42+
/// The default value is 5s.
43+
const TIMEOUT_MS: u64 = 5_000;
4444

4545
/// Prepares the node to perform specified network handshakes.
4646
async fn enable_handshake(&self) {

0 commit comments

Comments
 (0)