From 0642b2eb5bbc281a2c13b2432f9715b33c2732df Mon Sep 17 00:00:00 2001 From: esraa Date: Thu, 19 Dec 2024 13:19:15 +0200 Subject: [PATCH 1/3] Wait for `NewTemplate` message to arrive instead of failing if it is not there yet when we first check --- roles/tests-integration/tests/pool_integration.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/tests-integration/tests/pool_integration.rs b/roles/tests-integration/tests/pool_integration.rs index 6230d43249..039a0d599d 100644 --- a/roles/tests-integration/tests/pool_integration.rs +++ b/roles/tests-integration/tests/pool_integration.rs @@ -3,7 +3,9 @@ mod common; use std::convert::TryInto; use common::{InterceptMessage, MessageDirection}; -use const_sv2::MESSAGE_TYPE_SETUP_CONNECTION_ERROR; +use const_sv2::{ + MESSAGE_TYPE_NEW_TEMPLATE, MESSAGE_TYPE_SETUP_CONNECTION_ERROR, MESSAGE_TYPE_SET_NEW_PREV_HASH, +}; use roles_logic_sv2::{ common_messages_sv2::{Protocol, SetupConnection, SetupConnectionError}, parsers::{CommonMessages, PoolMessages, TemplateDistribution}, @@ -55,6 +57,9 @@ async fn success_pool_template_provider_connection() { &sniffer.next_message_from_downstream(), CoinbaseOutputDataSize ); + sniffer + .wait_for_message_type(MessageDirection::ToDownstream, MESSAGE_TYPE_NEW_TEMPLATE) + .await; assert_tp_message!(&sniffer.next_message_from_upstream(), NewTemplate); assert_tp_message!(sniffer.next_message_from_upstream(), SetNewPrevHash); } From 6cb3f7d0fc71bdfb52dba3c54b1eee89ef5ada5c Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 19 Dec 2024 17:04:25 +0700 Subject: [PATCH 2/3] ci: bump TP to 0.1.13 --- roles/tests-integration/tests/common/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/tests-integration/tests/common/mod.rs b/roles/tests-integration/tests/common/mod.rs index bb716aa532..5dabffd845 100644 --- a/roles/tests-integration/tests/common/mod.rs +++ b/roles/tests-integration/tests/common/mod.rs @@ -24,7 +24,7 @@ use tar::Archive; // prevents get_available_port from ever returning the same port twice static UNIQUE_PORTS: Lazy>> = Lazy::new(|| Mutex::new(HashSet::new())); -const VERSION_TP: &str = "0.1.9"; +const VERSION_TP: &str = "0.1.13"; fn download_bitcoind_tarball(download_url: &str) -> Vec { let response = minreq::get(download_url) From c4bd2bba9c0eafff194f2bc11fef462c248013f0 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 19 Dec 2024 18:29:41 +0700 Subject: [PATCH 3/3] test: increase TP log timestamp precision Also log rpc calls. --- roles/tests-integration/tests/common/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/tests-integration/tests/common/mod.rs b/roles/tests-integration/tests/common/mod.rs index 5dabffd845..7992e395ee 100644 --- a/roles/tests-integration/tests/common/mod.rs +++ b/roles/tests-integration/tests/common/mod.rs @@ -91,10 +91,12 @@ impl TemplateProvider { "-txindex=1", "-sv2", &port, + "-debug=rpc", "-debug=sv2", "-sv2interval=20", "-sv2feedelta=1000", "-loglevel=sv2:trace", + "-logtimemicros=1", ]); let os = env::consts::OS;