Millau -> Rialto messages relay (#399)

* Millau messages -> Rialto relay

* prepare for custom race strategy of delivery race

* custom strategy for delivery race

* update TODOs

* add reference to issue 457

* impl reconnect

* clippy

* fix check in test

* fmt

* removed obsolete TODO

* fixed another TODOs

* fmt

* use MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE const from primitives

* Update relays/messages-relay/src/message_lane_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* added SubstrateMessagesProof typedef

* fix test

* removed comment

* additional_proof_required -> ProofParameters

* typo

* multiline literal

* clippy

* fix typo

* and_then -> await

* update_source_latest_confirmed_nonce

* Update relays/messages-relay/src/message_race_delivery.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent 804ef55146
commit d4fc7bebdc
27 files changed
+1506 -451

No files matched your search

@@ -23,6 +23,9 @@
use crate::chain::Chain;
use bp_message_lane::{LaneId, MessageNonce};
use bp_runtime::InstanceId;
use frame_support::weights::Weight;
use sp_core::{
storage::{StorageData, StorageKey},
Bytes,
@@ -33,6 +36,8 @@ jsonrpsee::rpc_api! {
pub(crate) Substrate<C: Chain> {
#[rpc(method = "chain_getHeader", positional_params)]
fn chain_get_header(block_hash: Option<C::Hash>) -> C::Header;
#[rpc(method = "chain_getFinalizedHead", positional_params)]
fn chain_get_finalized_head() -> C::Hash;
#[rpc(method = "chain_getBlock", positional_params)]
fn chain_get_block(block_hash: Option<C::Hash>) -> C::SignedBlock;
#[rpc(method = "chain_getBlockHash", positional_params)]
@@ -48,4 +53,23 @@ jsonrpsee::rpc_api! {
#[rpc(method = "state_getRuntimeVersion", positional_params)]
fn runtime_version() -> RuntimeVersion;
}
pub(crate) SubstrateMessageLane<C: Chain> {
#[rpc(method = "messageLane_proveMessages", positional_params)]
fn prove_messages(
instance: InstanceId,
lane: LaneId,
begin: MessageNonce,
end: MessageNonce,
include_outbound_lane_state: bool,
block: Option<C::Hash>,
) -> (Weight, Bytes);
#[rpc(method = "messageLane_proveMessagesDelivery", positional_params)]
fn prove_messages_delivery(
instance: InstanceId,
lane: LaneId,
block: Option<C::Hash>,
) -> Bytes;
}
}