From 5f2ff7e06eb31a1d26674793e096a36e355ef7ec Mon Sep 17 00:00:00 2001
From: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date: Wed, 22 Feb 2023 10:08:50 +0300
Subject: [PATCH] Wrap confirmation and finality transactions into batch_all in
 Millau -> RialtoParachain bridge (#1898)

* wrap confirmation and finality transactions into batch_all in RialtoParachain<>Millau

* review comments
---
 .../chains/millau_messages_to_rialto_parachain.rs   |  7 ++++---
 bridges/relays/messages/src/message_race_loop.rs    | 13 +++++--------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/bridges/relays/bin-substrate/src/chains/millau_messages_to_rialto_parachain.rs b/bridges/relays/bin-substrate/src/chains/millau_messages_to_rialto_parachain.rs
index 5dbe1d69d13..8fedd22a40a 100644
--- a/bridges/relays/bin-substrate/src/chains/millau_messages_to_rialto_parachain.rs
+++ b/bridges/relays/bin-substrate/src/chains/millau_messages_to_rialto_parachain.rs
@@ -18,8 +18,9 @@
 
 use relay_millau_client::Millau;
 use relay_rialto_parachain_client::RialtoParachain;
-use substrate_relay_helper::messages_lane::{
-	DirectReceiveMessagesDeliveryProofCallBuilder, SubstrateMessageLane,
+use substrate_relay_helper::{
+	messages_lane::{DirectReceiveMessagesDeliveryProofCallBuilder, SubstrateMessageLane},
+	UtilityPalletBatchCallBuilder,
 };
 
 substrate_relay_helper::generate_receive_message_proof_call_builder!(
@@ -45,6 +46,6 @@ impl SubstrateMessageLane for MillauMessagesToRialtoParachain {
 		millau_runtime::WithRialtoParachainMessagesInstance,
 	>;
 
-	type SourceBatchCallBuilder = ();
+	type SourceBatchCallBuilder = UtilityPalletBatchCallBuilder<Millau>;
 	type TargetBatchCallBuilder = ();
 }
diff --git a/bridges/relays/messages/src/message_race_loop.rs b/bridges/relays/messages/src/message_race_loop.rs
index 2988ab231d9..3d995a0a362 100644
--- a/bridges/relays/messages/src/message_race_loop.rs
+++ b/bridges/relays/messages/src/message_race_loop.rs
@@ -573,17 +573,14 @@ pub async fn run<P: MessageRace, SC: SourceClient<P>, TC: TargetClient<P>>(
 			if let Some((at_block, nonces_range, proof)) = race_state.nonces_to_submit.as_ref() {
 				log::debug!(
 					target: "bridge",
-					"Going to submit proof of messages in range {:?} to {} node",
+					"Going to submit proof of messages in range {:?} to {} node{}",
 					nonces_range,
 					P::target_name(),
+					target_batch_transaction.as_ref().map(|tx| format!(
+						". This transaction is batched with sending the proof for header {:?}.",
+						tx.required_header_id())
+					).unwrap_or_default(),
 				);
-				if let Some(ref target_batch_transaction) = target_batch_transaction {
-					log::debug!(
-						target: "bridge",
-						"This transaction is batched with sending the proof for header {:?}.",
-						target_batch_transaction.required_header_id(),
-					);
-				}
 
 				target_submit_proof.set(
 					race_target
-- 
GitLab