Fix on-different-forks metrics during initialization (#1468)

* fix on-different-forks metrics during initialization

* "initialize" parachain finality pallet in on-demand parachains relay

* decrease converstion rate requests count

* more error logging

* fix compilation

* clippy
This commit is contained in:
Svyatoslav Nikolsky
2022-06-21 14:52:07 +03:00
committed by Bastian Köcher
parent 418942826d
commit 31a2be845c
25 changed files with 173 additions and 105 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ sp_api::decl_runtime_apis! {
/// Kusama runtime itself.
pub trait KusamaFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Kusama chain.
+1 -1
View File
@@ -314,7 +314,7 @@ sp_api::decl_runtime_apis! {
/// Millau runtime itself.
pub trait MillauFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Millau chain.
+1 -1
View File
@@ -118,7 +118,7 @@ sp_api::decl_runtime_apis! {
/// Polkadot runtime itself.
pub trait PolkadotFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Polkadot chain.
@@ -241,7 +241,7 @@ sp_api::decl_runtime_apis! {
/// RialtoParachain runtime itself.
pub trait RialtoParachainFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to RialtoParachain chain.
+1 -1
View File
@@ -262,7 +262,7 @@ sp_api::decl_runtime_apis! {
/// Rialto runtime itself.
pub trait RialtoFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Rialto chain.
+1 -1
View File
@@ -113,7 +113,7 @@ sp_api::decl_runtime_apis! {
/// Rococo runtime itself.
pub trait RococoFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Rococo chain.
+1 -1
View File
@@ -106,6 +106,6 @@ sp_api::decl_runtime_apis! {
/// Westend runtime itself.
pub trait WestendFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
}
+1 -1
View File
@@ -70,7 +70,7 @@ sp_api::decl_runtime_apis! {
/// Wococo runtime itself.
pub trait WococoFinalityApi {
/// Returns number and hash of the best finalized header known to the bridge module.
fn best_finalized() -> (BlockNumber, Hash);
fn best_finalized() -> Option<(BlockNumber, Hash)>;
}
/// Outbound message lane API for messages that are sent to Wococo chain.
+3 -3
View File
@@ -88,7 +88,7 @@ pub trait InclusionProofVerifier {
/// A trait for pallets which want to keep track of finalized headers from a bridged chain.
pub trait HeaderChain<H, E> {
/// Get the best finalized header known to the header chain.
fn best_finalized() -> H;
fn best_finalized() -> Option<H>;
/// Get the best authority set known to the header chain.
fn authority_set() -> AuthoritySet;
@@ -98,8 +98,8 @@ pub trait HeaderChain<H, E> {
}
impl<H: Default, E> HeaderChain<H, E> for () {
fn best_finalized() -> H {
H::default()
fn best_finalized() -> Option<H> {
None
}
fn authority_set() -> AuthoritySet {