Add another condition to the reject-obsolete-parachain-heads extension (#1505)

* add another condition to the reject-obsolete-parachain-heads extension

* add tracing to obsolete-tx-extensions

* fix tests

* extension_rejects_header_from_new_relay_block_with_same_hash

* fmt

* fix benchmarks
This commit is contained in:
Svyatoslav Nikolsky
2022-07-14 15:18:15 +03:00
committed by Bastian Köcher
parent e9d7adf8fd
commit ea1f46ff45
13 changed files with 225 additions and 92 deletions
+7
View File
@@ -75,6 +75,13 @@ macro_rules! declare_bridge_reject_obsolete_grandpa_header {
if best_finalized_number < bundled_block_number {
Ok(sp_runtime::transaction_validity::ValidTransaction::default())
} else {
log::trace!(
target: $crate::LOG_TARGET,
"Rejecting obsolete bridged header: bundled {:?}, best {:?}",
bundled_block_number,
best_finalized_number,
);
sp_runtime::transaction_validity::InvalidTransaction::Stale.into()
}
},
+1 -1
View File
@@ -60,7 +60,7 @@ pub use pallet::*;
pub use weights::WeightInfo;
/// The target that will be used when publishing logs related to this pallet.
const LOG_TARGET: &str = "runtime::bridge-grandpa";
pub const LOG_TARGET: &str = "runtime::bridge-grandpa";
/// Block number of the bridged chain.
pub type BridgedBlockNumber<T, I> = BlockNumberOf<<T as Config<I>>::BridgedChain>;