,
}
impl {
const SOURCE_NAME: &'static str = P::SourceChain::NAME;
const TARGET_NAME: &'static str = P::TargetChain::NAME;
type MessagesProof = SubstrateMessagesProof ) -> anyhow::Result<()>
where
AccountIdOf (
source_client.clone(),
target_client.clone(),
)
})?;
log::info!(
target: "bridge",
"Starting {} -> {} messages relay.\n\t\
{} relayer account id: {:?}\n\t\
Max messages in single transaction: {}\n\t\
Max messages size in single transaction: {}\n\t\
Max messages weight in single transaction: {}\n\t\
Tx mortality: {:?}/{:?}\n\t\
Stall timeout: {:?}",
P::SourceChain::NAME,
P::TargetChain::NAME,
P::SourceChain::NAME,
relayer_id_at_source,
max_messages_in_single_batch,
max_messages_size_in_single_batch,
max_messages_weight_in_single_batch,
params.source_transaction_params.mortality,
params.target_transaction_params.mortality,
stall_timeout,
);
messages_relay::message_lane_loop::run(
messages_relay::message_lane_loop::Params {
lane: params.lane_id,
source_tick: P::SourceChain::AVERAGE_BLOCK_INTERVAL,
target_tick: P::TargetChain::AVERAGE_BLOCK_INTERVAL,
reconnect_delay: relay_utils::relay_loop::RECONNECT_DELAY,
stall_timeout,
delivery_params: messages_relay::message_lane_loop::MessageDeliveryParams {
max_unrewarded_relayer_entries_at_target:
P::SourceChain::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_nonces_at_target:
P::SourceChain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
max_messages_in_single_batch,
max_messages_weight_in_single_batch,
max_messages_size_in_single_batch,
relay_strategy: params.relay_strategy,
},
},
SubstrateMessagesSource:: ::new(
source_client,
params.lane_id,
params.source_transaction_params,
params.target_to_source_headers_relay,
),
SubstrateMessagesTarget:: ::new(
target_client,
params.lane_id,
relayer_id_at_source,
params.target_transaction_params,
standalone_metrics.clone(),
params.source_to_target_headers_relay,
),
standalone_metrics.register_and_spawn(params.metrics_params)?,
futures::future::pending(),
)
.await
.map_err(Into::into)
}
/// Different ways of building `receive_messages_proof` calls.
pub trait ReceiveMessagesProofCallBuilder {
_phantom: PhantomData<(P, R, I)>,
}
impl ReceiveMessagesProofCallBuilder for DirectReceiveMessagesProofCallBuilder
where
P: SubstrateMessageLane,
R: BridgeMessagesConfig>,
I: 'static,
R::SourceHeaderChain: bp_messages::target_chain::SourceHeaderChain<
R::InboundMessageFee,
MessagesProof = FromBridgedChainMessagesProof {
_phantom: PhantomData<(P, R, I)>,
}
impl ReceiveMessagesDeliveryProofCallBuilder
for DirectReceiveMessagesDeliveryProofCallBuilder
where
P: SubstrateMessageLane,
R: BridgeMessagesConfig,
I: 'static,
R::TargetHeaderChain: bp_messages::source_chain::TargetHeaderChain<
R::OutboundPayload,
R::AccountId,
MessagesDeliveryProof = FromBridgedChainMessagesDeliveryProof