diff --git a/zilliqa/tests/it/consensus.rs b/zilliqa/tests/it/consensus.rs index 9e2c6099a..9764f665b 100644 --- a/zilliqa/tests/it/consensus.rs +++ b/zilliqa/tests/it/consensus.rs @@ -99,7 +99,7 @@ async fn block_production(mut network: Network) { .map_or(0, |b| b.number()) >= 5 }, - 50, + 100, ) .await .unwrap(); diff --git a/zilliqa/tests/it/eth.rs b/zilliqa/tests/it/eth.rs index 54d55ed00..73750d05b 100644 --- a/zilliqa/tests/it/eth.rs +++ b/zilliqa/tests/it/eth.rs @@ -1427,7 +1427,7 @@ async fn test_eth_syncing(mut network: Network) { network .run_until_async( || async { wallet.get_block_number().await.unwrap().as_u64() > 4 }, - 50, + 100, ) .await .unwrap(); diff --git a/zilliqa/tests/it/main.rs b/zilliqa/tests/it/main.rs index f107f2a0b..0f4ad42c2 100644 --- a/zilliqa/tests/it/main.rs +++ b/zilliqa/tests/it/main.rs @@ -1004,9 +1004,20 @@ impl Network { let mut inner = node.inner.lock().unwrap(); // Send to nodes only in the same shard (having same chain_id) if inner.config.eth_chain_id == sender_chain_id { - inner - .handle_broadcast(source, external_message.clone()) - .unwrap(); + match external_message { + // Re-route Proposals from Broadcast to Requests, which is the behaviour in Production. + ExternalMessage::Proposal(p) => inner + .handle_request( + source, + &p.hash().to_string(), + external_message.clone(), + ResponseChannel::Local, + ) + .unwrap(), + _ => inner + .handle_broadcast(source, external_message.clone()) + .unwrap(), + } } }); } @@ -1015,22 +1026,24 @@ impl Network { } AnyMessage::Response { channel, message } => { info!(%message, ?channel, "response"); - let destination = self.pending_responses.remove(channel).unwrap(); - let (index, node) = self - .nodes - .iter() - .enumerate() - .find(|(_, n)| n.peer_id == destination) - .unwrap(); - if !self.disconnected.contains(&index) { - let span = tracing::span!(tracing::Level::INFO, "handle_message", index); - span.in_scope(|| { - let mut inner = node.inner.lock().unwrap(); - // Send to nodes only in the same shard (having same chain_id) - if inner.config.eth_chain_id == sender_chain_id { - inner.handle_response(source, message.clone()).unwrap(); - } - }); + // skip on faux response + if let Some(destination) = self.pending_responses.remove(channel) { + let (index, node) = self + .nodes + .iter() + .enumerate() + .find(|(_, n)| n.peer_id == destination) + .unwrap(); + if !self.disconnected.contains(&index) { + let span = tracing::span!(tracing::Level::INFO, "handle_message", index); + span.in_scope(|| { + let mut inner = node.inner.lock().unwrap(); + // Send to nodes only in the same shard (having same chain_id) + if inner.config.eth_chain_id == sender_chain_id { + inner.handle_response(source, message.clone()).unwrap(); + } + }); + } } } }