chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent ee6e42c461
commit 193f6b9294
1358 changed files with 9464 additions and 7656 deletions
@@ -19,14 +19,16 @@
//! checks.
use bp_relayers::ExplicitOrAccountParams;
use pezbp_runtime::Teyrchain;
use bp_teyrchains::SubmitTeyrchainHeadsInfo;
use pezbp_runtime::Teyrchain;
use pezpallet_bridge_grandpa::{
BridgedBlockNumber, CallSubType as GrandpaCallSubType, SubmitFinalityProofHelper,
};
use pezpallet_bridge_messages::CallSubType as MessagesCallSubType;
use pezpallet_bridge_relayers::Pezpallet as RelayersPallet;
use pezpallet_bridge_teyrchains::{CallSubType as TeyrchainsCallSubtype, SubmitTeyrchainHeadsHelper};
use pezpallet_bridge_teyrchains::{
CallSubType as TeyrchainsCallSubtype, SubmitTeyrchainHeadsHelper,
};
use pezsp_runtime::{
traits::{Get, UniqueSaturatedInto},
transaction_validity::{TransactionPriority, TransactionValidity, ValidTransactionBuilder},
@@ -220,7 +222,8 @@ where
}
impl<T: pezpallet_bridge_messages::Config<I>, I: 'static>
BridgeRuntimeFilterCall<T::AccountId, T::RuntimeCall> for pezpallet_bridge_messages::Pezpallet<T, I>
BridgeRuntimeFilterCall<T::AccountId, T::RuntimeCall>
for pezpallet_bridge_messages::Pezpallet<T, I>
where
T::RuntimeCall: MessagesCallSubType<T, I>,
{
@@ -378,14 +381,13 @@ mod tests {
use bp_messages::{InboundLaneData, MessageNonce, OutboundLaneData};
use bp_pezkuwi_core::teyrchains::{ParaHeadsProof, ParaId};
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
use pezbp_runtime::HeaderId;
use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID};
use bp_teyrchains::{BestParaHeadHash, ParaInfo};
use codec::{Decode, Encode, MaxEncodedLen};
use pezbp_runtime::HeaderId;
use pezframe_support::{assert_err, assert_ok, traits::fungible::Mutate};
use pezpallet_bridge_grandpa::{Call as GrandpaCall, StoredAuthoritySet};
use pezpallet_bridge_teyrchains::Call as TeyrchainsCall;
use scale_info::TypeInfo;
use pezsp_runtime::{
traits::{
parameter_types, AsSystemOriginSigner, AsTransactionAuthorizedOrigin, ConstU64,
@@ -396,6 +398,7 @@ mod tests {
},
DispatchError,
};
use scale_info::TypeInfo;
parameter_types! {
pub MsgProofsRewardsAccount: RewardsAccountParams<TestLaneIdType> = RewardsAccountParams::new(
+20 -16
View File
@@ -21,8 +21,8 @@
use bp_header_pez_chain::ChainWithGrandpa;
use bp_messages::{ChainWithMessages, InboundLaneData, MessageNonce};
use pezbp_runtime::{AccountIdOf, Chain};
use codec::Encode;
use pezbp_runtime::{AccountIdOf, Chain};
use pezframe_support::{storage::generator::StorageValue, traits::Get, weights::Weight};
use pezframe_system::limits;
use pezpallet_bridge_messages::{ThisChainOf, WeightInfoExt as _};
@@ -56,8 +56,8 @@ macro_rules! assert_chain_types(
}
);
/// Macro that ensures that the bridge messages pezpallet is configured properly to bridge using given
/// configuration.
/// Macro that ensures that the bridge messages pezpallet is configured properly to bridge using
/// given configuration.
#[macro_export]
macro_rules! assert_bridge_messages_pallet_types(
(
@@ -193,8 +193,8 @@ struct AssertBridgeGrandpaPalletNames<'a> {
pub with_bridged_chain_grandpa_pallet_name: &'a str,
}
/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching constants
/// from chain primitives crates.
/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching
/// constants from chain primitives crates.
fn assert_bridge_grandpa_pallet_names<R, GI>(params: AssertBridgeGrandpaPalletNames)
where
R: pezpallet_bridge_grandpa::Config<GI>,
@@ -202,13 +202,13 @@ where
{
// check that the bridge GRANDPA pezpallet has required name
assert_eq!(
pezpallet_bridge_grandpa::PalletOwner::<R, GI>::storage_value_final_key().to_vec(),
pezbp_runtime::storage_value_key(
params.with_bridged_chain_grandpa_pallet_name,
"PalletOwner",
)
.0,
);
pezpallet_bridge_grandpa::PalletOwner::<R, GI>::storage_value_final_key().to_vec(),
pezbp_runtime::storage_value_key(
params.with_bridged_chain_grandpa_pallet_name,
"PalletOwner",
)
.0,
);
assert_eq!(
pezpallet_bridge_grandpa::PalletOperatingMode::<R, GI>::storage_value_final_key().to_vec(),
pezbp_runtime::storage_value_key(
@@ -227,8 +227,8 @@ struct AssertBridgeMessagesPalletNames<'a> {
pub with_bridged_chain_messages_pallet_name: &'a str,
}
/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching constants
/// from chain primitives crates.
/// Tests that bridge pezpallet names used in `construct_runtime!()` macro call are matching
/// constants from chain primitives crates.
fn assert_bridge_messages_pallet_names<R, MI>(params: AssertBridgeMessagesPalletNames)
where
R: pezpallet_bridge_messages::Config<MI>,
@@ -292,7 +292,9 @@ pub fn assert_complete_with_teyrchain_bridge_constants<R, PI, MI>(
R: pezframe_system::Config
+ pezpallet_bridge_teyrchains::Config<PI>
+ pezpallet_bridge_messages::Config<MI>,
<R as pezpallet_bridge_teyrchains::BoundedBridgeGrandpaConfig<R::BridgesGrandpaPalletInstance>>::BridgedRelayChain: ChainWithGrandpa,
<R as pezpallet_bridge_teyrchains::BoundedBridgeGrandpaConfig<
R::BridgesGrandpaPalletInstance,
>>::BridgedRelayChain: ChainWithGrandpa,
PI: 'static,
MI: 'static,
{
@@ -370,7 +372,9 @@ pub fn check_message_lane_weights<
>::encoded_size_hint_u32(
this_chain_max_unrewarded_relayers as _
);
pezpallet_bridge_messages::ensure_able_to_receive_confirmation::<Weights<T, MessagesPalletInstance>>(
pezpallet_bridge_messages::ensure_able_to_receive_confirmation::<
Weights<T, MessagesPalletInstance>,
>(
C::max_extrinsic_size(),
C::max_extrinsic_weight(),
max_incoming_inbound_lane_data_proof_size,
@@ -31,12 +31,14 @@ where
{
(begin..=end)
.filter_map(|nonce| {
let message_data =
pezpallet_bridge_messages::Pezpallet::<Runtime, MessagesPalletInstance>::outbound_message_data(lane, nonce)?;
let message_data = pezpallet_bridge_messages::Pezpallet::<
Runtime,
MessagesPalletInstance,
>::outbound_message_data(lane, nonce)?;
Some(OutboundMessageDetails {
nonce,
// dispatch message weight is always zero at the source chain, since we're paying for
// dispatch at the target chain
// dispatch message weight is always zero at the source chain, since we're paying
// for dispatch at the target chain
dispatch_weight: pezframe_support::weights::Weight::zero(),
size: message_data.len() as _,
})
@@ -24,8 +24,8 @@ use bp_messages::{
target_chain::FromBridgedChainMessagesProof, MessagePayload,
};
use bp_pezkuwi_core::teyrchains::ParaHash;
use pezbp_runtime::{AccountIdOf, Chain, HashOf, Teyrchain};
use codec::Encode;
use pezbp_runtime::{AccountIdOf, Chain, HashOf, Teyrchain};
use pezframe_support::weights::Weight;
use pezpallet_bridge_messages::{
benchmarking::{MessageDeliveryProofParams, MessageProofParams},
+8 -7
View File
@@ -24,9 +24,9 @@ use bp_messages::{
ChainWithMessages, HashedLaneId, LaneIdType, MessageNonce,
};
use bp_relayers::{PayRewardFromAccount, RewardsAccountParams};
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
use bp_teyrchains::SingleParaStoredHeaderDataBuilder;
use codec::Encode;
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
use pezframe_support::{
derive_impl, parameter_types,
weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight},
@@ -197,12 +197,13 @@ impl pezpallet_bridge_messages::Config for TestRuntime {
type LaneId = TestLaneIdType;
type DeliveryPayments = ();
type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
TestRuntime,
(),
(),
ConstU32<100_000>,
>;
type DeliveryConfirmationPayments =
pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
TestRuntime,
(),
(),
ConstU32<100_000>,
>;
type OnMessagesDelivered = ();
type MessageDispatch = DummyMessageDispatch;
@@ -21,11 +21,13 @@
use crate::messages_benchmarking::insert_header_to_grandpa_pallet;
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId};
use pezbp_runtime::{grow_storage_value, record_all_trie_keys, Chain, UnverifiedStorageProofParams};
use bp_teyrchains::{
teyrchain_head_storage_key_at_source, RelayBlockHash, RelayBlockHasher, RelayBlockNumber,
};
use codec::Encode;
use pezbp_runtime::{
grow_storage_value, record_all_trie_keys, Chain, UnverifiedStorageProofParams,
};
use pezframe_support::traits::Get;
use pezsp_std::prelude::*;
use pezsp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut};
@@ -124,9 +124,9 @@ pub type Address = MultiAddress<AccountId, ()>;
// `75% * WEIGHT_REF_TIME_PER_SECOND * 1 / 2 * 50% = 0.75 * 1_000_000_000_000 / 2 * 0.5 =
// 187_500_000_000`
//
// According to (preliminary) weights of messages pezpallet, cost of additional message is zero and the
// cost of additional relayer is `8_000_000 + db read + db write`. Let's say we want no more than
// 4096 unconfirmed messages (no any scientific justification for that - it just looks large
// According to (preliminary) weights of messages pezpallet, cost of additional message is zero and
// the cost of additional relayer is `8_000_000 + db read + db write`. Let's say we want no more
// than 4096 unconfirmed messages (no any scientific justification for that - it just looks large
// enough). And then we can't have more than 4096 relayers. E.g. for 1024 relayers is (using
// `RocksDbWeight`):
//
@@ -21,6 +21,7 @@
use bp_header_pez_chain::ChainWithGrandpa;
use bp_messages::{ChainWithMessages, MessageNonce};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezbp_runtime::{
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis,
extensions::{
@@ -29,18 +30,17 @@ use pezbp_runtime::{
},
Chain, ChainId, TransactionEra,
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::{
dispatch::DispatchClass,
parameter_types,
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use pezframe_system::limits;
use scale_info::TypeInfo;
use pezsp_runtime::{
impl_tx_ext_default, traits::Dispatchable, transaction_validity::TransactionValidityError,
Perbill, StateVersion,
};
use scale_info::TypeInfo;
// This chain reuses most of Pezkuwi primitives.
pub use bp_pezkuwi_core::{
+4 -4
View File
@@ -277,8 +277,8 @@ pub mod pezpallet {
/// The current number of requests which have written to storage.
///
/// If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pezpallet until
/// the request capacity is increased.
/// If the `RequestCount` hits `MaxRequests`, no more calls will be allowed to the pezpallet
/// until the request capacity is increased.
///
/// The `RequestCount` is decreased by one at the beginning of every block. This is to ensure
/// that the pezpallet can always make progress.
@@ -415,11 +415,11 @@ pub mod pezpallet {
#[cfg(test)]
mod tests {
use super::*;
use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModuleError};
use bp_test_utils::generate_owned_bridge_module_tests;
use pezframe_support::{assert_noop, assert_ok, traits::Get};
use mock::*;
use mock_chain::*;
use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModuleError};
use pezframe_support::{assert_noop, assert_ok, traits::Get};
use pezsp_consensus_beefy::mmr::BeefyAuthoritySet;
use pezsp_runtime::DispatchError;
+1 -1
View File
@@ -22,8 +22,8 @@ use crate::{
};
use bp_beefy::{BeefyValidatorSignatureOf, ChainWithBeefy, Commitment, MmrDataOrHash};
use pezbp_runtime::{BasicOperatingMode, Chain, ChainId};
use codec::Encode;
use pezbp_runtime::{BasicOperatingMode, Chain, ChainId};
use pezframe_support::{construct_runtime, derive_impl, weights::Weight};
use pezsp_core::{sr25519::Signature, Pair};
use pezsp_runtime::{
+1 -1
View File
@@ -29,10 +29,10 @@ use crate::{
use bp_beefy::{BeefyPayload, Commitment, ValidatorSetId, MMR_ROOT_PAYLOAD_ID};
use codec::Encode;
use pezpallet_mmr::NodeIndex;
use rand::Rng;
use pezsp_consensus_beefy::mmr::{BeefyNextAuthoritySet, MmrLeafVersion};
use pezsp_core::Pair;
use pezsp_runtime::traits::{Hash, Header as HeaderT};
use rand::Rng;
use std::collections::HashMap;
#[derive(Debug, Clone)]
@@ -43,11 +43,11 @@
use crate::*;
use bp_header_pez_chain::justification::required_justification_precommits;
use pezbp_runtime::BasicOperatingMode;
use bp_test_utils::{
accounts, make_justification_for_header, JustificationGeneratorParams, TEST_GRANDPA_ROUND,
TEST_GRANDPA_SET_ID,
};
use pezbp_runtime::BasicOperatingMode;
use pezframe_benchmarking::{benchmarks_instance_pallet, whitelisted_caller};
use pezframe_system::RawOrigin;
use pezsp_consensus_grandpa::AuthorityId;
+11 -9
View File
@@ -308,12 +308,12 @@ mod tests {
StoredAuthoritySet, WeightInfo,
};
use bp_header_pez_chain::{ChainWithGrandpa, SubmitFinalityProofInfo};
use pezbp_runtime::{BasicOperatingMode, HeaderId};
use bp_test_utils::{
make_default_justification, make_justification_for_header, JustificationGeneratorParams,
TEST_GRANDPA_SET_ID,
};
use codec::Encode;
use pezbp_runtime::{BasicOperatingMode, HeaderId};
use pezframe_support::weights::Weight;
use pezsp_runtime::{testing::DigestItem, traits::Header as _, SaturatedConversion};
@@ -518,12 +518,13 @@ mod tests {
// when `improved_by` is less than the free interval BUT it is a mandatory header
let mut mandatory_header = test_header(100);
let consensus_log = pezsp_consensus_grandpa::ConsensusLog::<TestNumber>::ScheduledChange(
pezsp_consensus_grandpa::ScheduledChange {
next_authorities: bp_test_utils::authority_list(),
delay: 0,
},
);
let consensus_log =
pezsp_consensus_grandpa::ConsensusLog::<TestNumber>::ScheduledChange(
pezsp_consensus_grandpa::ScheduledChange {
next_authorities: bp_test_utils::authority_list(),
delay: 0,
},
);
mandatory_header.digest = pezsp_runtime::Digest {
logs: vec![DigestItem::Consensus(
pezsp_consensus_grandpa::GRANDPA_ENGINE_ID,
@@ -711,8 +712,9 @@ mod tests {
#[test]
fn check_obsolete_submit_finality_proof_ignores_other_calls() {
run_test(|| {
let call =
RuntimeCall::System(pezframe_system::Call::<TestRuntime>::remark { remark: vec![42] });
let call = RuntimeCall::System(pezframe_system::Call::<TestRuntime>::remark {
remark: vec![42],
});
assert_eq!(RuntimeCall::check_obsolete_submit_finality_proof(&call), Ok(None));
})
+13 -8
View File
@@ -22,9 +22,10 @@
//! verified, finalized headers are stored in the pezpallet, thereby creating a sparse header chain.
//! This sparse header chain can be used as a source of truth for other higher-level applications.
//!
//! The pezpallet is responsible for tracking GRANDPA validator set hand-offs. We only import headers
//! with justifications signed by the current validator set we know of. The header is inspected for
//! a `ScheduledChanges` digest item, which is then used to update to next validator set.
//! The pezpallet is responsible for tracking GRANDPA validator set hand-offs. We only import
//! headers with justifications signed by the current validator set we know of. The header is
//! inspected for a `ScheduledChanges` digest item, which is then used to update to next validator
//! set.
//!
//! Since this pezpallet only tracks finalized headers it does not deal with forks. Forks can only
//! occur if the GRANDPA validator set on the bridged chain is either colluding or there is a severe
@@ -198,7 +199,8 @@ pub mod pezpallet {
)
}
/// Bootstrap the bridge pezpallet with an initial header and authority set from which to sync.
/// Bootstrap the bridge pezpallet with an initial header and authority set from which to
/// sync.
///
/// The initial configuration provided does not need to be the genesis header of the bridged
/// chain, it can be any arbitrary header. You can also provide the next scheduled set
@@ -517,7 +519,8 @@ pub mod pezpallet {
InvalidJustification,
/// The authority set from the underlying header chain is invalid.
InvalidAuthoritySet,
/// The header being imported is older than the best finalized header known to the pezpallet.
/// The header being imported is older than the best finalized header known to the
/// pezpallet.
OldHeader,
/// The scheduled authority set change found in the header is unsupported by the pezpallet.
///
@@ -814,7 +817,7 @@ pub fn initialize_for_benchmarks<T: Config<I>, I: 'static>(header: BridgedHeader
initialize_bridge::<T, I>(InitializationData {
header: Box::new(header),
authority_list: pezsp_std::vec::Vec::new(), /* we don't verify any proofs in external
* benchmarks */
* benchmarks */
set_id: 0,
operating_mode: pezbp_runtime::BasicOperatingMode::Normal,
})
@@ -836,13 +839,13 @@ mod tests {
System, TestBridgedChain, TestHeader, TestNumber, TestRuntime, MAX_BRIDGED_AUTHORITIES,
};
use bp_header_pez_chain::BridgeGrandpaCall;
use pezbp_runtime::BasicOperatingMode;
use bp_test_utils::{
authority_list, generate_owned_bridge_module_tests, make_default_justification,
make_justification_for_header, JustificationGeneratorParams, ALICE, BOB,
TEST_GRANDPA_SET_ID,
};
use codec::Encode;
use pezbp_runtime::BasicOperatingMode;
use pezframe_support::{
assert_err, assert_noop, assert_ok,
dispatch::{Pays, PostDispatchInfo},
@@ -1470,7 +1473,9 @@ mod tests {
<BestFinalized<TestRuntime>>::put(HeaderId(2, hash));
<ImportedHeaders<TestRuntime>>::insert(hash, header.build());
assert_ok!(Pezpallet::<TestRuntime>::verify_storage_proof(hash, storage_proof).map(|_| ()));
assert_ok!(
Pezpallet::<TestRuntime>::verify_storage_proof(hash, storage_proof).map(|_| ())
);
});
}
@@ -21,9 +21,9 @@ use crate::{Config, Error};
use bp_header_pez_chain::{AuthoritySet, ChainWithGrandpa};
use codec::{Decode, Encode, MaxEncodedLen};
use pezframe_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound};
use scale_info::TypeInfo;
use pezsp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId};
use pezsp_std::marker::PhantomData;
use scale_info::TypeInfo;
/// A bounded list of Grandpa authorities with associated weights.
pub type StoredAuthorityList<MaxBridgedAuthorities> =
@@ -29,8 +29,8 @@ use bp_messages::{
InboundLaneData, LaneState, MessageNonce, OutboundLaneData, UnrewardedRelayer,
UnrewardedRelayersState,
};
use pezbp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams};
use codec::Decode;
use pezbp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams};
use pezframe_benchmarking::{account, v2::*};
use pezframe_support::weights::Weight;
use pezframe_system::RawOrigin;
@@ -23,11 +23,11 @@ use bp_messages::{
ChainWithMessages, DeliveredMessages, InboundLaneData, LaneState, MessageKey, MessageNonce,
OutboundLaneData, ReceptionResult, UnrewardedRelayer,
};
use pezbp_runtime::AccountIdOf;
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
use scale_info::{Type, TypeInfo};
use pezbp_runtime::AccountIdOf;
use pezsp_runtime::RuntimeDebug;
use pezsp_std::prelude::PartialEq;
use scale_info::{Type, TypeInfo};
/// Inbound lane storage.
pub trait InboundLaneStorage {
@@ -24,11 +24,11 @@ use bp_messages::{
target_chain::MessageDispatch, ChainWithMessages, InboundLaneData, LaneState, MessageKey,
MessageNonce, OutboundLaneData,
};
use pezbp_runtime::AccountIdOf;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use pezbp_runtime::AccountIdOf;
use pezframe_support::{ensure, pezsp_runtime::RuntimeDebug, PalletError};
use scale_info::TypeInfo;
use pezsp_std::marker::PhantomData;
use scale_info::TypeInfo;
/// Lanes manager errors.
#[derive(
@@ -183,9 +183,9 @@ impl<T: Config<I>, I: 'static> RuntimeInboundLaneStorage<T, I> {
/// maximal configured.
///
/// Maximal inbound lane state set size is configured by the
/// `MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX` constant from the pezpallet configuration. The PoV
/// of the call includes the maximal size of inbound lane state. If the actual size is smaller,
/// we may subtract extra bytes from this component.
/// `MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX` constant from the pezpallet configuration. The
/// PoV of the call includes the maximal size of inbound lane state. If the actual size is
/// smaller, we may subtract extra bytes from this component.
pub fn extra_proof_size_bytes(&self) -> u64 {
let max_encoded_len = StoredInboundLaneData::<T, I>::max_encoded_len();
let relayers_count = self.data().relayers.len();
+3 -2
View File
@@ -64,11 +64,11 @@ use bp_messages::{
MessageNonce, MessagePayload, MessagesOperatingMode, OutboundLaneData, OutboundMessageDetails,
UnrewardedRelayersState, VerificationError,
};
use codec::{Decode, Encode};
use pezbp_runtime::{
AccountIdOf, BasicOperatingMode, HashOf, OwnedBridgeModule, PreComputedSize, RangeInclusiveExt,
Size,
};
use codec::{Decode, Encode};
use pezframe_support::{dispatch::PostDispatchInfo, ensure, fail, traits::Get, DefaultNoBound};
use pezsp_std::{marker::PhantomData, prelude::*};
@@ -677,7 +677,8 @@ pub struct SendMessageArgs<T: Config<I>, I: 'static> {
payload: StoredMessagePayload<T, I>,
}
impl<T, I> bp_messages::source_chain::MessagesBridge<T::OutboundPayload, T::LaneId> for Pezpallet<T, I>
impl<T, I> bp_messages::source_chain::MessagesBridge<T::OutboundPayload, T::LaneId>
for Pezpallet<T, I>
where
T: Config<I>,
I: 'static,
+4 -2
View File
@@ -31,8 +31,8 @@ pub mod v0 {
use super::Config;
use crate::BridgedChainOf;
use bp_messages::{MessageNonce, UnrewardedRelayer};
use pezbp_runtime::AccountIdOf;
use codec::{Decode, Encode};
use pezbp_runtime::AccountIdOf;
use pezsp_std::collections::vec_deque::VecDeque;
#[derive(Encode, Decode, Clone, PartialEq, Eq)]
@@ -107,7 +107,9 @@ pub mod v1 {
}
#[cfg(feature = "try-runtime")]
fn post_upgrade(state: pezsp_std::vec::Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
fn post_upgrade(
state: pezsp_std::vec::Vec<u8>,
) -> Result<(), pezsp_runtime::DispatchError> {
use codec::Decode;
const LOG_TARGET: &str = "runtime::bridge-messages-migration";
@@ -24,9 +24,9 @@ use bp_messages::{
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::{traits::Get, BoundedVec, PalletError};
use scale_info::TypeInfo;
use pezsp_runtime::RuntimeDebug;
use pezsp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive};
use scale_info::TypeInfo;
/// Outbound lane storage.
pub trait OutboundLaneStorage {
+2 -2
View File
@@ -25,10 +25,10 @@ use bp_messages::{
ChainWithMessages, InboundLaneData, Message, MessageKey, MessageNonce, MessagePayload,
OutboundLaneData, VerificationError,
};
use codec::Decode;
use pezbp_runtime::{
HashOf, HasherOf, RangeInclusiveExt, RawStorageProof, StorageProofChecker, StorageProofError,
};
use codec::Decode;
use pezsp_std::vec::Vec;
/// 'Parsed' message delivery proof - inbound lane id and its state.
@@ -218,8 +218,8 @@ mod tests {
use bp_header_pez_chain::{HeaderChainError, StoredHeaderDataBuilder};
use bp_messages::LaneState;
use pezbp_runtime::{HeaderId, StorageProofError};
use codec::Encode;
use pezbp_runtime::{HeaderId, StorageProofError};
use pezsp_runtime::traits::Header;
fn using_messages_proof<R>(
@@ -20,11 +20,11 @@ use bp_messages::{
storage_keys, ChainWithMessages, InboundLaneData, MessageKey, MessageNonce, MessagePayload,
OutboundLaneData,
};
use codec::Encode;
use pezbp_runtime::{
grow_storage_value, record_all_trie_keys, AccountIdOf, Chain, HashOf, HasherOf,
RawStorageProof, UnverifiedStorageProofParams,
};
use codec::Encode;
use pezsp_std::{ops::RangeInclusive, prelude::*};
use pezsp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut};
@@ -39,21 +39,21 @@ use bp_messages::{
Message, MessageKey, MessageNonce, OutboundLaneData, UnrewardedRelayer,
UnrewardedRelayersState,
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezbp_runtime::{
messages::MessageDispatchResult, Chain, ChainId, Size, UnverifiedStorageProofParams,
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::{
derive_impl,
weights::{constants::RocksDbWeight, Weight},
};
use scale_info::TypeInfo;
use pezsp_core::H256;
use pezsp_runtime::{
testing::Header as BizinikiwiHeader,
traits::{BlakeTwo256, ConstU32},
BuildStorage, StateVersion,
};
use scale_info::TypeInfo;
use std::{collections::VecDeque, ops::RangeInclusive};
pub type AccountId = u64;
@@ -354,7 +354,8 @@ impl TestMessageDispatch {
pub fn emulate_enqueued_message(lane: TestLaneIdType) {
let key = (b"dispatched", lane).encode();
let dispatched = pezframe_support::storage::unhashed::get_or_default::<MessageNonce>(&key[..]);
let dispatched =
pezframe_support::storage::unhashed::get_or_default::<MessageNonce>(&key[..]);
pezframe_support::storage::unhashed::put(&key[..], &(dispatched + 1));
}
}
@@ -460,7 +461,9 @@ pub fn inbound_unrewarded_relayers_state(lane: TestLaneIdType) -> UnrewardedRela
/// Return test externalities to use in tests.
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let mut t = pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
let mut t = pezframe_system::GenesisConfig::<TestRuntime>::default()
.build_storage()
.unwrap();
pezpallet_balances::GenesisConfig::<TestRuntime> {
balances: vec![(ENDOWED_ACCOUNT, 1_000_000)],
..Default::default()
@@ -23,7 +23,7 @@ use crate::{
tests::mock::{RuntimeEvent as TestEvent, *},
weights_ext::WeightInfoExt,
Call, Config, Error, Event, InboundLanes, LanesManagerError, OutboundLanes, OutboundMessages,
Pezpallet, PalletOperatingMode, PalletOwner, StoredInboundLaneData,
PalletOperatingMode, PalletOwner, Pezpallet, StoredInboundLaneData,
};
use bp_messages::{
@@ -34,9 +34,9 @@ use bp_messages::{
OutboundLaneData, OutboundMessageDetails, UnrewardedRelayer, UnrewardedRelayersState,
VerificationError,
};
use pezbp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size};
use bp_test_utils::generate_owned_bridge_module_tests;
use codec::Encode;
use pezbp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size};
use pezframe_support::{
assert_err, assert_noop, assert_ok,
dispatch::Pays,
@@ -248,7 +248,10 @@ fn send_message_rejects_too_large_message() {
.extra
.extend_from_slice(&vec![0u8; max_outbound_payload_size as usize]);
assert_noop!(
Pezpallet::<TestRuntime, ()>::validate_message(test_lane_id(), &message_payload.clone(),),
Pezpallet::<TestRuntime, ()>::validate_message(
test_lane_id(),
&message_payload.clone(),
),
Error::<TestRuntime, ()>::MessageRejectedByPallet(VerificationError::MessageTooLarge),
);
@@ -284,8 +284,8 @@ pub trait WeightInfoExt: WeightInfo {
// storage values that are read during the call. So we may ignore the weight of this check.
//
// However, during (2) we read and update storage values of other pallets
// (`pezpallet-bridge-relayers` and balances/assets pezpallet). So we need to add this weight to the
// weight of our call. Hence two following methods.
// (`pezpallet-bridge-relayers` and balances/assets pezpallet). So we need to add this weight to
// the weight of our call. Hence two following methods.
/// Extra weight that is added to the `receive_messages_proof` call weight by signed extensions
/// that are declared at runtime level.
@@ -22,8 +22,8 @@ use crate::{
};
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
use pezbp_runtime::{Chain, StaticStrProvider};
use core::marker::PhantomData;
use pezbp_runtime::{Chain, StaticStrProvider};
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
use pezframe_system::Config as SystemConfig;
use pezpallet_bridge_grandpa::{
@@ -20,8 +20,8 @@
use crate::{extension::verify_messages_call_succeeded, Config as BridgeRelayersConfig};
use bp_relayers::{ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
use pezbp_runtime::StaticStrProvider;
use core::marker::PhantomData;
use pezbp_runtime::StaticStrProvider;
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
use pezpallet_bridge_messages::{
CallSubType as BridgeMessagesCallSubType, Config as BridgeMessagesConfig, LaneIdOf,
@@ -29,9 +29,9 @@ use bp_relayers::{
ExplicitOrAccountParams, ExtensionCallData, ExtensionCallInfo, ExtensionConfig,
RewardsAccountOwner, RewardsAccountParams,
};
use pezbp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider};
use codec::{Decode, DecodeWithMemTracking, Encode};
use core::{fmt::Debug, marker::PhantomData};
use pezbp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider};
use pezframe_support::{
dispatch::{DispatchInfo, PostDispatchInfo},
pezpallet_prelude::TransactionSource,
@@ -45,7 +45,6 @@ use pezpallet_bridge_messages::{
use pezpallet_transaction_payment::{
Config as TransactionPaymentConfig, OnChargeTransaction, Pezpallet as TransactionPaymentPallet,
};
use scale_info::TypeInfo;
use pezsp_runtime::{
traits::{
AsSystemOriginSigner, DispatchInfoOf, Dispatchable, PostDispatchInfoOf,
@@ -54,6 +53,7 @@ use pezsp_runtime::{
transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransactionBuilder},
DispatchResult, RuntimeDebug,
};
use scale_info::TypeInfo;
pub use grandpa_adapter::WithGrandpaChainExtensionConfig;
pub use messages_adapter::WithMessagesExtensionConfig;
@@ -464,16 +464,18 @@ mod tests {
};
use bp_pezkuwi_core::teyrchains::{ParaHeadsProof, ParaId};
use bp_relayers::RuntimeWithUtilityPallet;
use pezbp_runtime::{BasicOperatingMode, HeaderId, Teyrchain};
use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID};
use bp_teyrchains::{BestParaHeadHash, ParaInfo, SubmitTeyrchainHeadsInfo};
use pezbp_runtime::{BasicOperatingMode, HeaderId, Teyrchain};
use pezframe_support::{
__private::pezsp_tracing,
assert_storage_noop, parameter_types,
traits::{fungible::Mutate, ReservableCurrency},
weights::Weight,
};
use pezpallet_bridge_grandpa::{Call as GrandpaCall, Pezpallet as GrandpaPallet, StoredAuthoritySet};
use pezpallet_bridge_grandpa::{
Call as GrandpaCall, Pezpallet as GrandpaPallet, StoredAuthoritySet,
};
use pezpallet_bridge_messages::{Call as MessagesCall, Pezpallet as MessagesPallet};
use pezpallet_bridge_teyrchains::{Call as TeyrchainsCall, Pezpallet as TeyrchainsPallet};
use pezpallet_utility::Call as UtilityCall;
@@ -157,8 +157,8 @@ mod integrity_tests {
pub fn ensure_priority_boost_is_sane<Runtime, GrandpaInstance, PriorityBoostPerHeader>(
tip_boost_per_header: BalanceOf<Runtime>,
) where
Runtime:
pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config<GrandpaInstance>,
Runtime: pezpallet_transaction_payment::Config
+ pezpallet_bridge_grandpa::Config<GrandpaInstance>,
GrandpaInstance: 'static,
PriorityBoostPerHeader: Get<TransactionPriority>,
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
@@ -189,8 +189,8 @@ mod integrity_tests {
tip: BalanceOf<Runtime>,
) -> TransactionPriority
where
Runtime:
pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config<GrandpaInstance>,
Runtime: pezpallet_transaction_payment::Config
+ pezpallet_bridge_grandpa::Config<GrandpaInstance>,
GrandpaInstance: 'static,
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
BalanceOf<Runtime>: Send + Sync + FixedPointOperand,
@@ -25,8 +25,8 @@ use crate::{
};
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
use pezbp_runtime::{StaticStrProvider, Teyrchain};
use core::marker::PhantomData;
use pezbp_runtime::{StaticStrProvider, Teyrchain};
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
use pezframe_system::Config as SystemConfig;
use pezpallet_bridge_grandpa::{
+5 -3
View File
@@ -23,8 +23,8 @@ extern crate alloc;
pub use bp_relayers::RewardLedger;
use bp_relayers::{PaymentProcedure, Registration, RelayerRewardsKeyProvider, StakeAndSlash};
use pezbp_runtime::StorageDoubleMapKeyProvider;
use core::marker::PhantomData;
use pezbp_runtime::StorageDoubleMapKeyProvider;
use pezframe_support::{fail, traits::tokens::Balance};
use pezsp_arithmetic::traits::{AtLeast32BitUnsigned, Zero};
use pezsp_runtime::{
@@ -32,8 +32,8 @@ use pezsp_runtime::{
Saturating,
};
pub use pezpallet::*;
pub use payment_adapter::{DeliveryConfirmationPaymentsAdapter, PayRewardFromAccount};
pub use pezpallet::*;
pub use stake_adapter::StakeAndSlashNamed;
pub use weights::WeightInfo;
pub use weights_ext::WeightInfoExt;
@@ -1000,7 +1000,9 @@ mod tests {
let reserved_balance = Balances::reserved_balance(REGISTER_RELAYER);
let free_balance = Balances::free_balance(REGISTER_RELAYER);
assert_ok!(Pezpallet::<TestRuntime>::deregister(RuntimeOrigin::signed(REGISTER_RELAYER)));
assert_ok!(Pezpallet::<TestRuntime>::deregister(RuntimeOrigin::signed(
REGISTER_RELAYER
)));
assert_eq!(
Balances::reserved_balance(REGISTER_RELAYER),
reserved_balance - Stake::get()
+5 -4
View File
@@ -30,12 +30,12 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
pub mod v0 {
use crate::{Config, Pezpallet};
use bp_relayers::RewardsAccountOwner;
use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider};
use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen};
use core::marker::PhantomData;
use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider};
use pezframe_support::{pezpallet_prelude::OptionQuery, Blake2_128Concat, Identity};
use scale_info::TypeInfo;
use pezsp_runtime::traits::AccountIdConversion;
use scale_info::TypeInfo;
/// Structure used to identify the account that pays a reward to the relayer.
#[derive(Copy, Clone, Debug, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen)]
@@ -122,11 +122,12 @@ pub mod v1 {
use crate::{Config, Pezpallet};
use bp_messages::LaneIdType;
use bp_relayers::RewardsAccountParams;
use pezbp_runtime::StorageDoubleMapKeyProvider;
use codec::{Codec, EncodeLike};
use core::marker::PhantomData;
use pezbp_runtime::StorageDoubleMapKeyProvider;
use pezframe_support::{
pezpallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat, Identity,
pezpallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat,
Identity,
};
use pezsp_arithmetic::traits::Zero;
+11 -8
View File
@@ -26,9 +26,9 @@ use bp_messages::{
use bp_relayers::{
PayRewardFromAccount, PaymentProcedure, RewardsAccountOwner, RewardsAccountParams,
};
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
use bp_teyrchains::SingleParaStoredHeaderDataBuilder;
use codec::Encode;
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
use pezframe_support::{
derive_impl, parameter_types,
traits::fungible::Mutate,
@@ -267,12 +267,13 @@ impl pezpallet_bridge_messages::Config for TestRuntime {
type LaneId = TestLaneIdType;
type DeliveryPayments = ();
type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
TestRuntime,
(),
(),
ConstU64<100_000>,
>;
type DeliveryConfirmationPayments =
pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
TestRuntime,
(),
(),
ConstU64<100_000>,
>;
type OnMessagesDelivered = ();
type MessageDispatch = DummyMessageDispatch;
@@ -408,7 +409,9 @@ pub fn test_reward_account_param() -> RewardsAccountParams<TestLaneIdType> {
/// Return test externalities to use in tests.
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let t = pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
let t = pezframe_system::GenesisConfig::<TestRuntime>::default()
.build_storage()
.unwrap();
pezsp_io::TestExternalities::new(t)
}
@@ -26,8 +26,8 @@ use bp_messages::{
};
pub use bp_relayers::PayRewardFromAccount;
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
use pezbp_runtime::Chain;
use core::{marker::PhantomData, ops::RangeInclusive};
use pezbp_runtime::Chain;
use pezframe_support::{pezsp_runtime::SaturatedConversion, traits::Get};
use pezpallet_bridge_messages::LaneIdOf;
use pezsp_arithmetic::traits::{Saturating, Zero};
@@ -55,8 +55,10 @@ where
confirmation_relayer: &T::AccountId,
received_range: &RangeInclusive<bp_messages::MessageNonce>,
) -> MessageNonce {
let relayers_rewards =
bp_messages::calc_relayers_rewards::<T::AccountId>(pez_messages_relayers, received_range);
let relayers_rewards = bp_messages::calc_relayers_rewards::<T::AccountId>(
pez_messages_relayers,
received_range,
);
let rewarded_relayers = relayers_rewards.len();
register_relayers_rewards::<T, RI, MI>(
@@ -16,8 +16,8 @@
use crate::{Config, GrandpaPalletOf, Pezpallet, RelayBlockNumber};
use bp_header_pez_chain::HeaderChain;
use pezbp_runtime::{HeaderId, OwnedBridgeModule};
use bp_teyrchains::{BestParaHeadHash, SubmitTeyrchainHeadsInfo};
use pezbp_runtime::{HeaderId, OwnedBridgeModule};
use pezframe_support::{
dispatch::CallableCallFor,
traits::{Get, IsSubType},
@@ -260,8 +260,8 @@ mod tests {
};
use bp_header_pez_chain::StoredHeaderData;
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHeadsProof, ParaId};
use pezbp_runtime::BasicOperatingMode;
use bp_teyrchains::BestParaHeadHash;
use pezbp_runtime::BasicOperatingMode;
fn validate_submit_teyrchain_heads(
num: RelayBlockNumber,
+32 -22
View File
@@ -29,22 +29,22 @@ pub use weights_ext::WeightInfoExt;
use bp_header_pez_chain::{HeaderChain, HeaderChainError};
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId};
use pezbp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain};
use bp_teyrchains::{
ParaInfo, ParaStoredHeaderData, RelayBlockHash, RelayBlockHasher, RelayBlockNumber,
SubmitTeyrchainHeadsInfo,
};
use pezbp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain};
use pezframe_support::{dispatch::PostDispatchInfo, DefaultNoBound};
use pezpallet_bridge_grandpa::SubmitFinalityProofHelper;
use proofs::{StorageProofAdapter, TeyrchainsStorageProofAdapter};
use pezsp_std::{marker::PhantomData, vec::Vec};
use proofs::{StorageProofAdapter, TeyrchainsStorageProofAdapter};
#[cfg(feature = "runtime-benchmarks")]
use pezbp_runtime::HeaderOf;
#[cfg(feature = "runtime-benchmarks")]
use bp_teyrchains::ParaStoredHeaderDataBuilder;
#[cfg(feature = "runtime-benchmarks")]
use codec::Encode;
#[cfg(feature = "runtime-benchmarks")]
use pezbp_runtime::HeaderOf;
// Re-export in crate namespace for `construct_runtime!`.
pub use call_ext::*;
@@ -75,14 +75,14 @@ struct UpdateTeyrchainHeadArtifacts {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezbp_runtime::{
BasicOperatingMode, BoundedStorageValue, OwnedBridgeModule, StorageDoubleMapKeyProvider,
StorageMapKeyProvider,
};
use bp_teyrchains::{
BestParaHeadHash, ImportedParaHeadsKeyProvider, OnNewHead, ParaStoredHeaderDataBuilder,
ParasInfoKeyProvider,
};
use pezbp_runtime::{
BasicOperatingMode, BoundedStorageValue, OwnedBridgeModule, StorageDoubleMapKeyProvider,
StorageMapKeyProvider,
};
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
@@ -98,7 +98,8 @@ pub mod pezpallet {
#[pezpallet::event]
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// The caller has provided head of teyrchain that the pezpallet is not configured to track.
/// The caller has provided head of teyrchain that the pezpallet is not configured to
/// track.
UntrackedTeyrchainRejected {
/// Identifier of the teyrchain that is not tracked by the pezpallet.
teyrchain: ParaId,
@@ -119,7 +120,8 @@ pub mod pezpallet {
/// Actual teyrchain head hash.
actual_teyrchain_head_hash: ParaHash,
},
/// The caller has provided obsolete teyrchain head, which is already known to the pezpallet.
/// The caller has provided obsolete teyrchain head, which is already known to the
/// pezpallet.
RejectedObsoleteTeyrchainHead {
/// Identifier of the teyrchain with obsolete head.
teyrchain: ParaId,
@@ -189,7 +191,8 @@ pub mod pezpallet {
/// Benchmarks results from runtime we're plugged into.
type WeightInfo: WeightInfoExt;
/// Instance of bridges GRANDPA pezpallet (within this runtime) that this pezpallet is linked to.
/// Instance of bridges GRANDPA pezpallet (within this runtime) that this pezpallet is
/// linked to.
///
/// The GRANDPA pezpallet instance must be configured to import headers of relay chain that
/// we're interested in.
@@ -583,8 +586,10 @@ pub mod pezpallet {
&& SubmitFinalityProofHelper::<T, T::BridgesGrandpaPalletInstance>::has_free_header_slots();
let pays_fee = if is_free {
tracing::trace!(target: LOG_TARGET, "Teyrchain heads update transaction is free");
pezpallet_bridge_grandpa::on_free_header_imported::<T, T::BridgesGrandpaPalletInstance>(
);
pezpallet_bridge_grandpa::on_free_header_imported::<
T,
T::BridgesGrandpaPalletInstance,
>();
Pays::No
} else {
tracing::trace!(target: LOG_TARGET, "Teyrchain heads update transaction is paid");
@@ -791,7 +796,8 @@ impl<T: Config<I>, I: 'static, C: Teyrchain<Hash = ParaHash>> HeaderChain<C>
}
}
/// (Re)initialize pezpallet with given header for using it in `pezpallet-bridge-messages` benchmarks.
/// (Re)initialize pezpallet with given header for using it in `pezpallet-bridge-messages`
/// benchmarks.
#[cfg(feature = "runtime-benchmarks")]
pub fn initialize_for_benchmarks<T: Config<I>, I: 'static, PC: Teyrchain<Hash = ParaHash>>(
header: HeaderOf<PC>,
@@ -839,10 +845,6 @@ pub(crate) mod tests {
use bp_header_pez_chain::{justification::GrandpaJustification, StoredHeaderGrandpaInfo};
use bp_pezkuwi_core::teyrchains::ParaHead;
use pezbp_runtime::{
BasicOperatingMode, OwnedBridgeModuleError, StorageDoubleMapKeyProvider,
StorageMapKeyProvider, StorageProofError,
};
use bp_test_utils::{
authority_list, generate_owned_bridge_module_tests, make_default_justification,
TEST_GRANDPA_SET_ID,
@@ -850,6 +852,10 @@ pub(crate) mod tests {
use bp_teyrchains::{
BestParaHeadHash, BridgeTeyrchainCall, ImportedParaHeadsKeyProvider, ParasInfoKeyProvider,
};
use pezbp_runtime::{
BasicOperatingMode, OwnedBridgeModuleError, StorageDoubleMapKeyProvider,
StorageMapKeyProvider, StorageProofError,
};
use pezframe_support::{
assert_noop, assert_ok,
dispatch::DispatchResultWithPostInfo,
@@ -1842,9 +1848,10 @@ pub(crate) mod tests {
initialize(Default::default());
// set free headers limit to `4`
let mut free_headers_remaining = 4;
pezpallet_bridge_grandpa::FreeHeadersRemaining::<TestRuntime, BridgesGrandpaPalletInstance>::set(
Some(free_headers_remaining),
);
pezpallet_bridge_grandpa::FreeHeadersRemaining::<
TestRuntime,
BridgesGrandpaPalletInstance,
>::set(Some(free_headers_remaining));
// import free GRANDPA and teyrchain headers
let mut relay_block_number = 0;
for i in 0..2 {
@@ -1882,7 +1889,10 @@ pub(crate) mod tests {
let (state_root, proof, teyrchains) =
prepare_teyrchain_heads_proof::<RegularTeyrchainHeader>(vec![(2, head_data(2, 7))]);
relay_block_number = relay_block_number + FreeHeadersInterval::get();
let result = pezpallet_bridge_grandpa::Pezpallet::<TestRuntime, BridgesGrandpaPalletInstance>::submit_finality_proof_ex(
let result = pezpallet_bridge_grandpa::Pezpallet::<
TestRuntime,
BridgesGrandpaPalletInstance,
>::submit_finality_proof_ex(
RuntimeOrigin::signed(1),
Box::new(test_relay_header(relay_block_number, state_root)),
make_default_justification(&test_relay_header(relay_block_number, state_root)),
+1 -1
View File
@@ -19,9 +19,9 @@
use crate::{Config, GrandpaPalletOf, RelayBlockHash, RelayBlockHasher};
use bp_header_pez_chain::{HeaderChain, HeaderChainError};
use bp_pezkuwi_core::teyrchains::{ParaHead, ParaId};
use pezbp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError};
use bp_teyrchains::teyrchain_head_storage_key_at_source;
use codec::Decode;
use pezbp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError};
use pezframe_support::traits::Get;
/// Abstraction over storage proof manipulation, hiding implementation details of actual storage
@@ -445,8 +445,8 @@ impl<T: Config<I>, I: 'static> FeeTracker for Pezpallet<T, I> {
#[cfg(test)]
mod tests {
use super::*;
use pezframe_support::assert_ok;
use mock::*;
use pezframe_support::assert_ok;
use pezframe_support::traits::Hooks;
use pezframe_system::{EventRecord, Phase};
@@ -88,7 +88,9 @@ impl pezpallet_xcm_bridge_hub_router::Config<()> for TestRuntime {
type FeeAsset = BridgeFeeAsset;
}
pub struct LatestOrNoneForLocationVersionChecker<Location>(pezsp_std::marker::PhantomData<Location>);
pub struct LatestOrNoneForLocationVersionChecker<Location>(
pezsp_std::marker::PhantomData<Location>,
);
impl<LocationValue: Contains<Location>> GetVersion
for LatestOrNoneForLocationVersionChecker<LocationValue>
{
@@ -172,7 +174,9 @@ impl XcmChannelStatusProvider for TestLocalXcmChannelManager {
/// Return test externalities to use in tests.
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let t = pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
let t = pezframe_system::GenesisConfig::<TestRuntime>::default()
.build_storage()
.unwrap();
pezsp_io::TestExternalities::new(t)
}
@@ -55,7 +55,8 @@ pub trait WeightInfo {
fn report_bridge_status() -> Weight;
}
/// Weights for `pezpallet_xcm_bridge_hub_router` that are generated using one of the Bridge testnets.
/// Weights for `pezpallet_xcm_bridge_hub_router` that are generated using one of the Bridge
/// testnets.
///
/// Those weights are test only and must never be used in production.
pub struct BridgeWeight<T>(PhantomData<T>);
@@ -24,13 +24,13 @@
use crate::{Config, Pezpallet, LOG_TARGET};
use bp_messages::target_chain::{DispatchMessage, MessageDispatch};
use pezbp_runtime::messages::MessageDispatchResult;
use bp_xcm_bridge_hub::{LocalXcmChannelManager, XcmAsPlainPayload};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezbp_runtime::messages::MessageDispatchResult;
use pezframe_support::{weights::Weight, CloneNoBound, EqNoBound, PartialEqNoBound};
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, WeightInfoExt};
use scale_info::TypeInfo;
use pezsp_runtime::SaturatedConversion;
use scale_info::TypeInfo;
use xcm::prelude::*;
use xcm_builder::{DispatchBlob, DispatchBlobError};
@@ -355,9 +355,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
///
/// We are using `HaulBlobExporter`, which requires `HaulBlob` implementation. It assumes that
/// there's a single channel between two bridge hubs - `HaulBlob` only accepts the blob and nothing
/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of bridged
/// chains. So we are using our own `ExportXcm` implementation, but to utilize `HaulBlobExporter` we
/// still need this `DummyHaulBlob`.
/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of
/// bridged chains. So we are using our own `ExportXcm` implementation, but to utilize
/// `HaulBlobExporter` we still need this `DummyHaulBlob`.
pub struct DummyHaulBlob;
impl HaulBlob for DummyHaulBlob {
@@ -371,8 +371,8 @@ mod tests {
use super::*;
use crate::{mock::*, Bridges, LaneToBridge, LanesManagerOf};
use pezbp_runtime::RangeInclusiveExt;
use bp_xcm_bridge_hub::{Bridge, BridgeLocations, BridgeState};
use pezbp_runtime::RangeInclusiveExt;
use pezframe_support::{assert_ok, traits::EnsureOrigin};
use pezpallet_bridge_messages::InboundLaneStorage;
use xcm_builder::{NetworkExportTable, UnpaidRemoteExporter};
+25 -14
View File
@@ -18,9 +18,9 @@
//! open and close bridges between local (to this pezpallet location) and remote XCM
//! destinations.
//!
//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains from
//! different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are introduced.
//! Other chains can manage channels with different bridged global consensuses.
//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains
//! from different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are
//! introduced. Other chains can manage channels with different bridged global consensuses.
//!
//! # Concept of `lane` and `LaneId`
//!
@@ -48,8 +48,8 @@
//!
//! # Concept of `bridge` and `BridgeId`
//!
//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The bridge
//! (or bridge metadata) is stored under the `BridgeId` key.
//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The
//! bridge (or bridge metadata) is stored under the `BridgeId` key.
//!
//! `BridgeId` is generated from `bridge_origin_relative_location` and
//! `bridge_origin_universal_location` using the `latest` XCM structs. `BridgeId` is not transferred
@@ -62,8 +62,8 @@
//!
//! # Migrations and State
//!
//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know if
//! any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is
//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know
//! if any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is
//! recalculated on runtime upgrade. Upgrading to a new XCM version should not break anything,
//! except removing older XCM versions. In such cases, we need to add migration for `BridgeId` and
//! stored `Versioned*` structs and update `LaneToBridge` mapping, but this won't affect `LaneId`
@@ -144,11 +144,11 @@
#![cfg_attr(not(feature = "std"), no_std)]
use bp_messages::{LaneState, MessageNonce};
use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
use bp_xcm_bridge_hub::BridgeLocationsError;
pub use bp_xcm_bridge_hub::{
Bridge, BridgeId, BridgeLocations, BridgeState, LocalXcmChannelManager,
};
use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
use pezframe_support::{traits::fungible::MutateHold, DefaultNoBound};
use pezframe_system::Config as SystemConfig;
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LanesManagerError};
@@ -215,8 +215,8 @@ pub mod pezpallet {
/// Checks the XCM version for the destination.
type DestinationVersion: GetVersion;
/// The origin that is allowed to call privileged operations on the pezpallet, e.g. open/close
/// bridge for locations.
/// The origin that is allowed to call privileged operations on the pezpallet, e.g.
/// open/close bridge for locations.
type ForceOrigin: EnsureOrigin<<Self as SystemConfig>::RuntimeOrigin>;
/// A set of XCM locations within local consensus system that are allowed to open
/// bridges with remote destinations.
@@ -691,10 +691,15 @@ pub mod pezpallet {
Ok(bridge.lane_id)
}
/// Ensure the correctness of the state of the connected `pezpallet_bridge_messages` instance.
/// Ensure the correctness of the state of the connected `pezpallet_bridge_messages`
/// instance.
pub fn do_try_state_for_messages() -> Result<(), pezsp_runtime::TryRuntimeError> {
// check that all `InboundLanes` laneIds have mapping to some bridge.
for lane_id in pezpallet_bridge_messages::InboundLanes::<T, T::BridgeMessagesPalletInstance>::iter_keys() {
for lane_id in pezpallet_bridge_messages::InboundLanes::<
T,
T::BridgeMessagesPalletInstance,
>::iter_keys()
{
tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `InboundLanes`...");
ensure!(
LaneToBridge::<T, I>::get(lane_id).is_some(),
@@ -703,7 +708,11 @@ pub mod pezpallet {
}
// check that all `OutboundLanes` laneIds have mapping to some bridge.
for lane_id in pezpallet_bridge_messages::OutboundLanes::<T, T::BridgeMessagesPalletInstance>::iter_keys() {
for lane_id in pezpallet_bridge_messages::OutboundLanes::<
T,
T::BridgeMessagesPalletInstance,
>::iter_keys()
{
tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `OutboundLanes`");
ensure!(
LaneToBridge::<T, I>::get(lane_id).is_some(),
@@ -839,7 +848,9 @@ mod tests {
use bp_messages::LaneIdType;
use mock::*;
use pezframe_support::{assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec};
use pezframe_support::{
assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec,
};
use pezframe_system::{EventRecord, Phase};
use pezsp_runtime::TryRuntimeError;
@@ -22,9 +22,9 @@ use bp_messages::{
target_chain::{DispatchMessage, MessageDispatch},
ChainWithMessages, HashedLaneId, MessageNonce,
};
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
use bp_xcm_bridge_hub::{BridgeId, LocalXcmChannelManager};
use codec::{Decode, Encode};
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
use pezframe_support::{
assert_ok, derive_impl, parameter_types,
traits::{EnsureOrigin, Equals, Everything, Get, OriginTrait},
@@ -276,8 +276,8 @@ thread_local! {
/// The `SendXcm` implementation directly executes XCM using `XcmExecutor`.
///
/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible with
/// the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`.
/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible
/// with the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`.
///
/// Note: The crucial part is that `ExportMessage` is processed by `XcmExecutor`, which calls the
/// `ExportXcm` implementation of `pezpallet_xcm_bridge_hub` as `MessageExporter`.
@@ -663,7 +663,9 @@ impl MessageDispatch for TestMessageDispatch {
/// Run pezpallet test.
pub fn run_test<T>(test: impl FnOnce() -> T) -> T {
pezsp_io::TestExternalities::new(
pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap(),
pezframe_system::GenesisConfig::<TestRuntime>::default()
.build_storage()
.unwrap(),
)
.execute_with(test)
}
+3 -3
View File
@@ -35,16 +35,16 @@ pub use pezsp_consensus_beefy::{
ValidatorSetId, BEEFY_ENGINE_ID,
};
use pezbp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
use codec::{Decode, Encode};
use pezbp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
use pezframe_support::Parameter;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use pezsp_runtime::{
traits::{Convert, MaybeSerializeDeserialize},
RuntimeAppPublic, RuntimeDebug,
};
use pezsp_std::prelude::*;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
/// Bizinikiwi-based chain with BEEFY && MMR pallets deployed.
///
@@ -18,13 +18,13 @@
use crate::{justification, InitializationData};
use pezbp_runtime::HeaderOf;
use codec::{Decode, Encode};
use pezbp_runtime::HeaderOf;
use pezframe_support::{weights::Weight, RuntimeDebugNoBound};
use scale_info::TypeInfo;
use pezsp_consensus_grandpa::SetId;
use pezsp_runtime::traits::{Header as HeaderT, Zero};
use pezsp_std::{boxed::Box, fmt::Debug};
use scale_info::TypeInfo;
/// A minimized version of `pezpallet-bridge-grandpa::Call` that can be used without a runtime.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
@@ -30,12 +30,12 @@ pub use verification::{
PrecommitError,
};
use pezbp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId};
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use pezbp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId};
use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature};
use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug, SaturatedConversion};
use pezsp_std::prelude::*;
use scale_info::TypeInfo;
/// A GRANDPA Justification is a proof that a given header was finalized
/// at a certain height and with a certain set of authorities.
@@ -22,8 +22,8 @@ pub mod strict;
use crate::{justification::GrandpaJustification, AuthoritySet};
use pezbp_runtime::HeaderId;
use finality_grandpa::voter_set::VoterSet;
use pezbp_runtime::HeaderId;
use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId};
use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug};
use pezsp_std::{
@@ -23,20 +23,20 @@
use crate::justification::{
GrandpaJustification, JustificationVerificationContext, JustificationVerificationError,
};
use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen};
use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug};
use pezbp_runtime::{
BasicOperatingMode, BlockNumberOf, Chain, HashOf, HasherOf, HeaderOf, RawStorageProof,
StorageProofChecker, StorageProofError, UnderlyingChainProvider,
};
use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen};
use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug};
use pezframe_support::PalletError;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use pezsp_consensus_grandpa::{
AuthorityList, ConsensusLog, ScheduledChange, SetId, GRANDPA_ENGINE_ID,
};
use pezsp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug, SaturatedConversion};
use pezsp_std::{boxed::Box, vec::Vec};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
pub use call_info::{BridgeGrandpaCall, BridgeGrandpaCallOf, SubmitFinalityProofInfo};
@@ -251,8 +251,8 @@ pub trait FindEquivocations<FinalityProof, FinalityVerificationContext, Equivoca
/// Keep in mind that teyrchains are relying on relay chain GRANDPA, so they should not implement
/// this trait.
pub trait ChainWithGrandpa: Chain {
/// Name of the bridge GRANDPA pezpallet (used in `construct_runtime` macro call) that is deployed
/// at some other chain to bridge with this `ChainWithGrandpa`.
/// Name of the bridge GRANDPA pezpallet (used in `construct_runtime` macro call) that is
/// deployed at some other chain to bridge with this `ChainWithGrandpa`.
///
/// We assume that all chains that are bridging with this `ChainWithGrandpa` are using
/// the same name.
@@ -20,9 +20,9 @@ use crate::{MessageNonce, UnrewardedRelayersState};
use codec::{Decode, Encode};
use pezframe_support::weights::Weight;
use scale_info::TypeInfo;
use pezsp_core::RuntimeDebug;
use pezsp_std::ops::RangeInclusive;
use scale_info::TypeInfo;
/// A minimized version of `pezpallet-bridge-messages::Call` that can be used without a runtime.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
+2 -2
View File
@@ -17,11 +17,11 @@
//! Primitives of messages module, that represents lane id.
use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use pezsp_core::{RuntimeDebug, TypeId, H256};
use pezsp_io::hashing::blake2_256;
use pezsp_std::fmt::Debug;
use scale_info::TypeInfo;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
/// Trait representing a generic `LaneId` type.
pub trait LaneIdType:
+3 -3
View File
@@ -20,19 +20,19 @@
#![cfg_attr(not(feature = "std"), no_std)]
use bp_header_pez_chain::HeaderChainError;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use pezbp_runtime::{
messages::MessageDispatchResult, BasicOperatingMode, Chain, OperatingMode, RangeInclusiveExt,
StorageProofError, UnderlyingChainOf, UnderlyingChainProvider,
};
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use pezframe_support::PalletError;
// Weight is reexported to avoid additional pezframe-support dependencies in related crates.
pub use pezframe_support::weights::Weight;
use pezsp_core::RuntimeDebug;
use pezsp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use source_chain::RelayersRewards;
use pezsp_core::RuntimeDebug;
use pezsp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*};
pub use call_info::{
BaseMessagesProofInfo, BridgeMessagesCall, MessagesCallInfo, ReceiveMessagesDeliveryProofInfo,
@@ -18,15 +18,15 @@
use crate::{MessageNonce, UnrewardedRelayer};
use pezbp_runtime::{raw_storage_proof_size, RawStorageProof, Size};
use codec::{Decode, DecodeWithMemTracking, Encode};
use scale_info::TypeInfo;
use pezbp_runtime::{raw_storage_proof_size, RawStorageProof, Size};
use pezsp_core::RuntimeDebug;
use pezsp_std::{
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
fmt::Debug,
ops::RangeInclusive,
};
use scale_info::TypeInfo;
/// Messages delivery proof from the bridged chain.
///
@@ -18,12 +18,14 @@
use crate::{Message, MessageKey, MessageNonce, MessagePayload, OutboundLaneData};
use pezbp_runtime::{messages::MessageDispatchResult, raw_storage_proof_size, RawStorageProof, Size};
use codec::{Decode, DecodeWithMemTracking, Encode, Error as CodecError};
use pezbp_runtime::{
messages::MessageDispatchResult, raw_storage_proof_size, RawStorageProof, Size,
};
use pezframe_support::weights::Weight;
use scale_info::TypeInfo;
use pezsp_core::RuntimeDebug;
use pezsp_std::{fmt::Debug, marker::PhantomData, prelude::*};
use scale_info::TypeInfo;
/// Messages proof from bridged chain.
///
@@ -22,12 +22,12 @@
//! teyrchains. Having pallets that are referencing pezkuwi, would mean that there may
//! be two versions of pezkuwi crates included in the runtime. Which is bad.
use pezbp_runtime::{raw_storage_proof_size, RawStorageProof, Size};
use codec::{CompactAs, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use pezbp_runtime::{raw_storage_proof_size, RawStorageProof, Size};
use pezsp_core::Hasher;
use pezsp_runtime::RuntimeDebug;
use pezsp_std::vec::Vec;
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
@@ -19,9 +19,9 @@
use bp_header_pez_chain::SubmitFinalityProofInfo;
use bp_messages::MessagesCallInfo;
use pezbp_runtime::StaticStrProvider;
use bp_teyrchains::SubmitTeyrchainHeadsInfo;
use codec::{Decode, Encode};
use pezbp_runtime::StaticStrProvider;
use pezframe_support::{
dispatch::CallableCallFor, traits::IsSubType, weights::Weight, RuntimeDebugNoBound,
};
+1 -1
View File
@@ -27,13 +27,13 @@ pub use registration::{ExplicitOrAccountParams, Registration, StakeAndSlash};
use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider};
use pezframe_support::{traits::tokens::Preservation, Blake2_128Concat, Identity};
use scale_info::TypeInfo;
use pezsp_runtime::{
codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen},
traits::AccountIdConversion,
TypeId,
};
use pezsp_std::{fmt::Debug, marker::PhantomData};
use scale_info::TypeInfo;
mod extension;
mod registration;
@@ -40,11 +40,11 @@
use crate::{PayRewardFromAccount, RewardsAccountParams};
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use pezsp_runtime::{
traits::{Get, IdentifyAccount, Zero},
DispatchError, DispatchResult,
};
use scale_info::TypeInfo;
/// Either explicit account reference or `RewardsAccountParams`.
#[derive(Clone, Debug)]
+1 -1
View File
@@ -17,8 +17,8 @@
use crate::{ChainId, HeaderIdProvider};
use codec::{Codec, Decode, Encode, MaxEncodedLen};
use pezframe_support::{weights::Weight, Parameter};
use num_traits::{AsPrimitive, Bounded, CheckedSub, Saturating, SaturatingAdd, Zero};
use pezframe_support::{weights::Weight, Parameter};
use pezsp_runtime::{
traits::{
AtLeast32Bit, AtLeast32BitUnsigned, Hash as HashT, Header as HeaderT, MaybeDisplay,
@@ -18,13 +18,13 @@
use codec::{Compact, Decode, DecodeWithMemTracking, Encode};
use impl_trait_for_tuples::impl_for_tuples;
use scale_info::{StaticTypeInfo, TypeInfo};
use pezsp_runtime::{
impl_tx_ext_default,
traits::{Dispatchable, TransactionExtension},
transaction_validity::TransactionValidityError,
};
use pezsp_std::{fmt::Debug, marker::PhantomData};
use scale_info::{StaticTypeInfo, TypeInfo};
/// Trait that describes some properties of a `TransactionExtension` that are needed in order to
/// send a transaction to the chain.
+11 -9
View File
@@ -24,22 +24,22 @@ use pezframe_support::{
pezpallet_prelude::DispatchResult, weights::Weight, PalletError, StorageHasher, StorageValue,
};
use pezframe_system::RawOrigin;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use pezsp_core::storage::StorageKey;
use pezsp_runtime::{
traits::{BadOrigin, Header as HeaderT, UniqueSaturatedInto},
RuntimeDebug,
};
use pezsp_std::{fmt::Debug, ops::RangeInclusive, vec, vec::Vec};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
pub use chain::{
AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain, EncodedOrDecodedCall, HashOf,
HasherOf, HeaderOf, NonceOf, SignatureOf, Teyrchain, TeyrchainIdOf, TransactionEraOf,
UnderlyingChainOf, UnderlyingChainProvider, __private,
};
pub use pezframe_support::storage::storage_prefix as storage_value_final_key;
use num_traits::{CheckedAdd, CheckedSub, One, SaturatingAdd, Zero};
pub use pezframe_support::storage::storage_prefix as storage_value_final_key;
#[cfg(feature = "std")]
pub use storage_proof::craft_valid_storage_proof;
#[cfg(feature = "test-helpers")]
@@ -205,8 +205,10 @@ impl<BlockNumber: Copy + UniqueSaturatedInto<u64>, BlockHash: Copy>
TransactionEra::Immortal => pezsp_runtime::generic::Era::immortal(),
// `unique_saturated_into` is fine here - mortality `u64::MAX` is not something we
// expect to see on any chain
TransactionEra::Mortal(header_id, period) =>
pezsp_runtime::generic::Era::mortal(period as _, header_id.0.unique_saturated_into()),
TransactionEra::Mortal(header_id, period) => pezsp_runtime::generic::Era::mortal(
period as _,
header_id.0.unique_saturated_into(),
),
}
}
@@ -437,10 +439,10 @@ pub trait OwnedBridgeModule<T: pezframe_system::Config> {
Ok(())
}
/// Pezpallet owner has a right to halt all module operations and then resume it. If it is `None`,
/// then there are no direct ways to halt/resume module operations, but other runtime methods
/// may still be used to do that (i.e. democracy::referendum to update halt flag directly
/// or call the `set_operating_mode`).
/// Pezpallet owner has a right to halt all module operations and then resume it. If it is
/// `None`, then there are no direct ways to halt/resume module operations, but other runtime
/// methods may still be used to do that (i.e. democracy::referendum to update halt flag
/// directly or call the `set_operating_mode`).
fn module_owner() -> Option<T::AccountId> {
Self::OwnerStorage::get()
}
@@ -18,8 +18,8 @@
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::weights::Weight;
use scale_info::TypeInfo;
use pezsp_runtime::RuntimeDebug;
use scale_info::TypeInfo;
/// Message dispatch result.
#[derive(Encode, Decode, DecodeWithMemTracking, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
@@ -25,9 +25,9 @@ use pezsp_trie::{
use codec::{Decode, DecodeWithMemTracking, Encode};
use hash_db::{HashDB, Hasher, EMPTY_PREFIX};
use scale_info::TypeInfo;
#[cfg(feature = "test-helpers")]
use pezsp_trie::{recorder_ext::RecorderExt, Recorder, TrieDBBuilder, TrieError, TrieHash};
use scale_info::TypeInfo;
#[cfg(feature = "test-helpers")]
use trie_db::{Trie, TrieConfiguration, TrieDBMut};
@@ -336,7 +336,8 @@ pub mod tests_for_storage_proof_checker {
// checking proof against invalid commitment fails
assert_eq!(
<StorageProofChecker<pezsp_core::Blake2Hasher>>::new(pezsp_core::H256::random(), proof).err(),
<StorageProofChecker<pezsp_core::Blake2Hasher>>::new(pezsp_core::H256::random(), proof)
.err(),
Some(StorageProofError::StorageRootMismatch)
);
}
@@ -19,9 +19,9 @@
use codec::{Decode, Encode, MaxEncodedLen};
use pezframe_support::traits::Get;
use scale_info::{Type, TypeInfo};
use pezsp_runtime::RuntimeDebug;
use pezsp_std::{marker::PhantomData, ops::Deref};
use scale_info::{Type, TypeInfo};
/// Error that is returned when the value size exceeds maximal configured size.
#[derive(RuntimeDebug)]
+5 -2
View File
@@ -21,9 +21,9 @@
use bp_header_pez_chain::justification::{required_justification_precommits, GrandpaJustification};
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId};
use pezbp_runtime::record_all_trie_keys;
use bp_teyrchains::teyrchain_head_storage_key_at_source;
use codec::Encode;
use pezbp_runtime::record_all_trie_keys;
use pezsp_consensus_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
use pezsp_runtime::traits::{Header as HeaderT, One, Zero};
use pezsp_std::prelude::*;
@@ -162,7 +162,10 @@ fn generate_chain<H: HeaderT>(fork_id: u32, depth: u32, ancestor: &H) -> Vec<H>
// Modifying the digest so headers at the same height but in different forks have different
// hashes
header.digest_mut().logs.push(pezsp_runtime::DigestItem::Other(fork_id.encode()));
header
.digest_mut()
.logs
.push(pezsp_runtime::DigestItem::Other(fork_id.encode()));
headers.push(header);
}
@@ -19,11 +19,11 @@
use crate::{ParaHash, ParaId, RelayBlockHash, RelayBlockNumber};
use bp_pezkuwi_core::teyrchains::ParaHeadsProof;
use pezbp_runtime::HeaderId;
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use pezbp_runtime::HeaderId;
use pezsp_runtime::RuntimeDebug;
use pezsp_std::vec::Vec;
use scale_info::TypeInfo;
/// A minimized version of `pezpallet-bridge-teyrchains::Call` that can be used without a runtime.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
+11 -5
View File
@@ -23,16 +23,16 @@ pub use bp_header_pez_chain::StoredHeaderData;
pub use call_info::{BridgeTeyrchainCall, SubmitTeyrchainHeadsInfo};
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaId};
use codec::{Decode, Encode, MaxEncodedLen};
use pezbp_runtime::{
BlockNumberOf, Chain, HashOf, HeaderOf, StorageDoubleMapKeyProvider, StorageMapKeyProvider,
Teyrchain,
};
use codec::{Decode, Encode, MaxEncodedLen};
use pezframe_support::{weights::Weight, Blake2_128Concat, Twox64Concat};
use scale_info::TypeInfo;
use pezsp_core::storage::StorageKey;
use pezsp_runtime::{traits::Header as HeaderT, RuntimeDebug};
use pezsp_std::{marker::PhantomData, prelude::*};
use scale_info::TypeInfo;
/// Block hash of the bridged relay chain.
pub type RelayBlockHash = bp_pezkuwi_core::Hash;
@@ -75,7 +75,11 @@ pub fn teyrchain_head_storage_key_at_source(
paras_pallet_name: &str,
para_id: ParaId,
) -> StorageKey {
pezbp_runtime::storage_map_final_key::<Twox64Concat>(paras_pallet_name, "Heads", &para_id.encode())
pezbp_runtime::storage_map_final_key::<Twox64Concat>(
paras_pallet_name,
"Heads",
&para_id.encode(),
)
}
/// Can be use to access the runtime storage key of the teyrchains info at the target chain.
@@ -92,7 +96,8 @@ impl StorageMapKeyProvider for ParasInfoKeyProvider {
/// Can be use to access the runtime storage key of the teyrchain head at the target chain.
///
/// The head is stored by the `pezpallet-bridge-teyrchains` pezpallet in the `ImportedParaHeads` map.
/// The head is stored by the `pezpallet-bridge-teyrchains` pezpallet in the `ImportedParaHeads`
/// map.
pub struct ImportedParaHeadsKeyProvider;
impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider {
const MAP_NAME: &'static str = "ImportedParaHeads";
@@ -108,7 +113,8 @@ impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider {
/// `pezbp_runtime::StoredHeaderData` structure.
///
/// We do not know exact structure of the teyrchain head, so we always store encoded version
/// of the `pezbp_runtime::StoredHeaderData`. It is only decoded when we talk about specific teyrchain.
/// of the `pezbp_runtime::StoredHeaderData`. It is only decoded when we talk about specific
/// teyrchain.
#[derive(Clone, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)]
pub struct ParaStoredHeaderData(pub Vec<u8>);
@@ -19,9 +19,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use pezsp_core::H256;
use pezsp_runtime::{FixedU128, RuntimeDebug};
use scale_info::TypeInfo;
use xcm::latest::prelude::Location;
/// Minimal delivery fee factor.
@@ -57,7 +57,8 @@ impl Default for BridgeState {
}
}
/// A minimized version of `pezpallet-xcm-bridge-hub-router::Call` that can be used without a runtime.
/// A minimized version of `pezpallet-xcm-bridge-hub-router::Call` that can be used without a
/// runtime.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
#[allow(non_camel_case_types)]
pub enum XcmBridgeHubRouterCall {
@@ -18,8 +18,8 @@
use bp_messages::MessageNonce;
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use pezsp_std::boxed::Box;
use scale_info::TypeInfo;
use xcm::prelude::VersionedInteriorLocation;
/// A minimized version of `pezpallet_xcm_bridge_hub::Call` that can be used without a runtime.
@@ -20,18 +20,18 @@
#![cfg_attr(not(feature = "std"), no_std)]
use bp_messages::LaneIdType;
use pezbp_runtime::{AccountIdOf, BalanceOf, Chain};
pub use call_info::XcmBridgeHubCall;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use pezbp_runtime::{AccountIdOf, BalanceOf, Chain};
use pezframe_support::{
ensure, pezsp_runtime::RuntimeDebug, CloneNoBound, PalletError, PartialEqNoBound,
RuntimeDebugNoBound,
};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use pezsp_core::H256;
use pezsp_io::hashing::blake2_256;
use pezsp_std::boxed::Box;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use xcm::{
latest::prelude::*, prelude::XcmVersion, IntoVersion, VersionedInteriorLocation,
VersionedLocation,
@@ -17,8 +17,8 @@
//! Basic runtime calls.
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use pezsp_std::{boxed::Box, vec::Vec};
use scale_info::TypeInfo;
use xcm::{VersionedLocation, VersionedXcm};
@@ -19,22 +19,22 @@ use crate::calls::UtilityCall;
use crate::SimpleRuntimeVersion;
use bp_header_pez_chain::ChainWithGrandpa as ChainWithGrandpaBase;
use bp_messages::ChainWithMessages as ChainWithMessagesBase;
use codec::{Codec, Decode, Encode, MaxEncodedLen};
use jsonrpsee::core::{DeserializeOwned, Serialize};
use num_traits::Zero;
use pezbp_runtime::{
Chain as ChainBase, EncodedOrDecodedCall, HashOf, Teyrchain as TeyrchainBase, TransactionEra,
TransactionEraOf, UnderlyingChainProvider,
};
use codec::{Codec, Decode, Encode, MaxEncodedLen};
use pezframe_support::Parameter;
use jsonrpsee::core::{DeserializeOwned, Serialize};
use num_traits::Zero;
use pezsc_transaction_pool_api::TransactionStatus;
use scale_info::TypeInfo;
use pezsp_core::{storage::StorageKey, Pair};
use pezsp_runtime::{
generic::SignedBlock,
traits::{AtLeast32BitUnsigned, Block as BlockT, Member},
ConsensusEngineId, EncodedJustification,
};
use scale_info::TypeInfo;
use std::{fmt::Debug, time::Duration};
/// Signed block type of given chain.
@@ -128,8 +128,8 @@ pub type CallOf<C> = <C as Chain>::Call;
/// Transaction status of the chain.
pub type TransactionStatusOf<C> = TransactionStatus<HashOf<C>, HashOf<C>>;
/// Bizinikiwi-based chain with `AccountData` generic argument of `pezframe_system::AccountInfo` set to
/// the `pezpallet_balances::AccountData<Balance>`.
/// Bizinikiwi-based chain with `AccountData` generic argument of `pezframe_system::AccountInfo` set
/// to the `pezpallet_balances::AccountData<Balance>`.
pub trait ChainWithBalances: Chain {
/// Return runtime storage key for getting `pezframe_system::AccountInfo` of given account.
fn account_info_storage_key(account_id: &Self::AccountId) -> StorageKey;
@@ -32,9 +32,8 @@ use async_std::{
};
use async_trait::async_trait;
use codec::Encode;
use pezframe_support::weights::Weight;
use futures::{FutureExt, StreamExt};
use quick_cache::unsync::Cache;
use pezframe_support::weights::Weight;
use pezsp_consensus_grandpa::{AuthorityId, OpaqueKeyOwnershipProof, SetId};
use pezsp_core::{
storage::{StorageData, StorageKey},
@@ -43,6 +42,7 @@ use pezsp_core::{
use pezsp_runtime::{traits::Header as _, transaction_validity::TransactionValidity};
use pezsp_trie::StorageProof;
use pezsp_version::RuntimeVersion;
use quick_cache::unsync::Cache;
/// `quick_cache::unsync::Cache` wrapped in async-aware synchronization primitives.
type SyncCache<K, V> = Arc<RwLock<Cache<K, V>>>;
@@ -20,8 +20,8 @@ use crate::{Chain, ConnectionParams};
use caching::CachingClient;
use num_traits::Saturating;
use rpc::RpcClient;
use pezsp_version::RuntimeVersion;
use rpc::RpcClient;
pub mod caching;
pub mod rpc;
@@ -37,17 +37,16 @@ use crate::{
use async_std::sync::{Arc, Mutex, RwLock};
use async_trait::async_trait;
use pezbp_runtime::HeaderIdProvider;
use codec::Encode;
use pezframe_support::weights::Weight;
use futures::TryFutureExt;
use jsonrpsee::{
core::{client::Subscription as RpcSubscription, ClientError},
ws_client::{WsClient, WsClientBuilder},
};
use num_traits::Zero;
use pezbp_runtime::HeaderIdProvider;
use pezframe_support::weights::Weight;
use pezpallet_transaction_payment::RuntimeDispatchInfo;
use relay_utils::{relay_loop::RECONNECT_DELAY, STALL_TIMEOUT};
use pezsp_core::{
storage::{StorageData, StorageKey},
Bytes, Hasher, Pair,
@@ -58,6 +57,7 @@ use pezsp_runtime::{
};
use pezsp_trie::StorageProof;
use pezsp_version::RuntimeVersion;
use relay_utils::{relay_loop::RECONNECT_DELAY, STALL_TIMEOUT};
use std::{cmp::Ordering, future::Future, marker::PhantomData};
const MAX_SUBSCRIPTION_CAPACITY: usize = 4096;
@@ -132,8 +132,8 @@ impl<C: Chain> RpcClient<C> {
}
}
/// Try to connect to Bizinikiwi node over websocket. Returns Bizinikiwi RPC client if connection
/// has been established or error otherwise.
/// Try to connect to Bizinikiwi node over websocket. Returns Bizinikiwi RPC client if
/// connection has been established or error otherwise.
async fn try_connect(params: Arc<ConnectionParams>) -> Result<Self> {
let (tokio, client) = Self::build_client(&params).await?;
@@ -22,8 +22,8 @@ use crate::{
};
use async_trait::async_trait;
use pezbp_runtime::{StorageDoubleMapKeyProvider, StorageMapKeyProvider};
use codec::{Decode, Encode};
use pezbp_runtime::{StorageDoubleMapKeyProvider, StorageMapKeyProvider};
use pezframe_support::weights::Weight;
use pezsp_core::{
storage::{StorageData, StorageKey},
@@ -20,10 +20,10 @@ use crate::{BlockNumberOf, Chain, HashOf, SimpleRuntimeVersion};
use bp_header_pez_chain::SubmitFinalityProofCallExtras;
use bp_pezkuwi_core::teyrchains::ParaId;
use jsonrpsee::core::ClientError as RpcError;
use relay_utils::MaybeConnectionError;
use pezsc_rpc_api::system::Health;
use pezsp_core::{storage::StorageKey, Bytes};
use pezsp_runtime::transaction_validity::TransactionValidityError;
use relay_utils::MaybeConnectionError;
use thiserror::Error;
/// Result type used by Bizinikiwi client.
@@ -20,12 +20,12 @@ use async_std::sync::{Arc, RwLock};
use async_trait::async_trait;
use codec::Decode;
use num_traits::One;
use pezsp_core::storage::{StorageData, StorageKey};
use pezsp_runtime::{traits::UniqueSaturatedInto, FixedPointNumber, FixedU128};
use relay_utils::metrics::{
metric_name, register, F64SharedRef, Gauge, Metric, PrometheusError, Registry,
StandaloneMetric, F64,
};
use pezsp_core::storage::{StorageData, StorageKey};
use pezsp_runtime::{traits::UniqueSaturatedInto, FixedPointNumber, FixedU128};
use std::{marker::PhantomData, time::Duration};
/// Storage value update interval (in blocks).
@@ -26,8 +26,8 @@ use crate::{
Error as BizinikiwiError, SignParam, UnsignedTransaction,
};
use bp_messages::{ChainWithMessages as ChainWithMessagesBase, MessageNonce};
use pezbp_runtime::ChainId;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use pezbp_runtime::ChainId;
use pezframe_support::{pezsp_runtime::StateVersion, weights::Weight};
use scale_info::TypeInfo;
use std::time::Duration;
@@ -20,8 +20,8 @@ use crate::{Chain, Error, HashOf, HeaderIdOf, Subscription, TransactionStatusOf}
use async_trait::async_trait;
use futures::{future::Either, Future, FutureExt, Stream, StreamExt};
use relay_utils::{HeaderId, TrackedTransactionStatus};
use pezsp_runtime::traits::Header as _;
use relay_utils::{HeaderId, TrackedTransactionStatus};
use std::time::Duration;
/// Transaction tracker environment.
@@ -20,9 +20,9 @@ use crate::{
};
use bp_header_pez_chain::{FinalityProof, FindEquivocations as FindEquivocationsT};
use pez_finality_relay::FinalityProofsBuf;
use futures::future::{BoxFuture, FutureExt};
use num_traits::Saturating;
use pez_finality_relay::FinalityProofsBuf;
/// First step in the block checking state machine.
///
@@ -20,9 +20,9 @@ use crate::{
};
use crate::block_checker::BlockChecker;
use pez_finality_relay::{FinalityProofsBuf, FinalityProofsStream};
use futures::{select_biased, FutureExt};
use num_traits::Saturating;
use pez_finality_relay::{FinalityProofsBuf, FinalityProofsStream};
use relay_utils::{metrics::MetricsParams, FailedClient};
use std::{future::Future, time::Duration};
+1 -1
View File
@@ -19,8 +19,8 @@
use crate::{EquivocationDetectionPipeline, HeaderFinalityInfo, SourceClient, TargetClient};
use async_trait::async_trait;
use bp_header_pez_chain::{FinalityProof, FindEquivocations};
use pez_finality_relay::{FinalityPipeline, SourceClientBase};
use futures::{Stream, StreamExt};
use pez_finality_relay::{FinalityPipeline, SourceClientBase};
use relay_utils::{
relay_loop::Client as RelayClient, HeaderId, MaybeConnectionError, TrackedTransactionStatus,
TransactionTracker,
@@ -19,7 +19,7 @@
use crate::{
equivocation::BizinikiwiEquivocationDetectionPipeline,
finality::BizinikiwiFinalitySyncPipeline,
messages::{MessagesRelayLimits, BizinikiwiMessageLane},
messages::{BizinikiwiMessageLane, MessagesRelayLimits},
teyrchains::BizinikiwiTeyrchainsPipeline,
};
use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber};
@@ -23,10 +23,10 @@ use crate::{
cli::{bridge::CliBridgeBase, chain_schema::*},
finality_base::engine::Engine,
};
use pezbp_runtime::Chain as ChainBase;
use clap::Parser;
use relay_bizinikiwi_client::{AccountKeyPairOf, Chain, UnsignedTransaction};
use pezbp_runtime::Chain as ChainBase;
use pezsp_core::Pair;
use relay_bizinikiwi_client::{AccountKeyPairOf, Chain, UnsignedTransaction};
/// Bridge initialization params.
#[derive(Parser)]
@@ -17,8 +17,8 @@
//! Deal with CLI args of bizinikiwi-to-bizinikiwi relay.
use clap::Parser;
use rbtag::BuildInfo;
use pezsp_runtime::traits::TryConvert;
use rbtag::BuildInfo;
use std::str::FromStr;
pub mod bridge;
@@ -46,13 +46,13 @@ use crate::{
HeadersToRelay, TaggedAccount, TransactionParams,
};
use pezbp_runtime::BalanceOf;
use pezsp_core::Pair;
use pezsp_runtime::traits::TryConvert;
use relay_bizinikiwi_client::{
AccountIdOf, AccountKeyPairOf, Chain, ChainWithBalances, ChainWithMessages,
ChainWithRuntimeVersion, ChainWithTransactions,
};
use relay_utils::metrics::MetricsParams;
use pezsp_core::Pair;
use pezsp_runtime::traits::TryConvert;
/// Parameters that have the same names across all bridges.
#[derive(Debug, PartialEq, Parser)]
@@ -31,10 +31,10 @@ use crate::{
finality::BizinikiwiFinalitySyncPipeline,
on_demand::{headers::OnDemandHeadersRelay, OnDemandRelay},
};
use pezsp_core::Pair;
use relay_bizinikiwi_client::{
AccountIdOf, AccountKeyPairOf, ChainWithRuntimeVersion, ChainWithTransactions, Client,
};
use pezsp_core::Pair;
/// A base relay between two standalone (relay) chains.
///
@@ -35,11 +35,11 @@ use crate::{
};
use bp_pezkuwi_core::teyrchains::ParaHash;
use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber};
use pezsp_core::Pair;
use relay_bizinikiwi_client::{
AccountIdOf, AccountKeyPairOf, Chain, ChainWithRuntimeVersion, ChainWithTransactions, Client,
Teyrchain,
};
use pezsp_core::Pair;
/// A base relay between standalone (relay) chain and a teyrchain from another consensus system.
///
@@ -32,11 +32,11 @@ use crate::{
};
use bp_pezkuwi_core::teyrchains::ParaHash;
use bp_teyrchains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber};
use pezsp_core::Pair;
use relay_bizinikiwi_client::{
AccountIdOf, AccountKeyPairOf, Chain, ChainWithRuntimeVersion, ChainWithTransactions, Client,
Teyrchain,
};
use pezsp_core::Pair;
/// A base relay between two teyrchain from different consensus systems.
///
@@ -28,12 +28,12 @@ use pezsp_core::Pair;
use bp_messages::MessageNonce;
use pezbp_runtime::HeaderIdProvider;
use pezsp_runtime::traits::TryConvert;
use relay_bizinikiwi_client::{
AccountIdOf, AccountKeyPairOf, BalanceOf, Chain, ChainWithRuntimeVersion,
ChainWithTransactions, Client,
};
use relay_utils::UniqueSaturatedInto;
use pezsp_runtime::traits::TryConvert;
/// Messages relaying params.
#[derive(Parser)]
@@ -19,8 +19,8 @@
use async_std::sync::Mutex;
use async_trait::async_trait;
use bp_pezkuwi_core::BlockNumber as RelayBlockNumber;
use pezbp_runtime::HeaderIdProvider;
use clap::Parser;
use pezbp_runtime::HeaderIdProvider;
use relay_bizinikiwi_client::{Client, Teyrchain};
use relay_utils::metrics::{GlobalMetrics, StandaloneMetric};
use std::sync::Arc;
@@ -27,14 +27,14 @@ use crate::{
};
use async_trait::async_trait;
use pezbp_runtime::{AccountIdOf, BlockNumberOf, HashOf};
use pez_equivocation_detector::EquivocationDetectionPipeline;
use pez_finality_relay::FinalityPipeline;
use pezbp_runtime::{AccountIdOf, BlockNumberOf, HashOf};
use pezpallet_grandpa::{Call as GrandpaCall, Config as GrandpaConfig};
use relay_bizinikiwi_client::{AccountKeyPairOf, CallOf, Chain, ChainWithTransactions, Client};
use relay_utils::metrics::MetricsParams;
use pezsp_core::Pair;
use pezsp_runtime::traits::{Block, Header};
use relay_bizinikiwi_client::{AccountKeyPairOf, CallOf, Chain, ChainWithTransactions, Client};
use relay_utils::metrics::MetricsParams;
use std::marker::PhantomData;
/// Convenience trait that adds bounds to `BizinikiwiEquivocationDetectionPipeline`.
@@ -18,17 +18,17 @@
use crate::{
equivocation::{
EquivocationDetectionPipelineAdapter, EquivocationProofOf, ReportEquivocationCallBuilder,
BizinikiwiEquivocationDetectionPipeline,
BizinikiwiEquivocationDetectionPipeline, EquivocationDetectionPipelineAdapter,
EquivocationProofOf, ReportEquivocationCallBuilder,
},
finality_base::{engine::Engine, finality_proofs, BizinikiwiFinalityProofsStream},
TransactionParams,
};
use async_trait::async_trait;
use pezbp_runtime::{HashOf, TransactionEra};
use pez_equivocation_detector::SourceClient;
use pez_finality_relay::SourceClientBase;
use pezbp_runtime::{HashOf, TransactionEra};
use relay_bizinikiwi_client::{
AccountKeyPairOf, Client, Error, TransactionTracker, UnsignedTransaction,
};
@@ -18,19 +18,19 @@
use crate::{
equivocation::{
EquivocationDetectionPipelineAdapter, FinalityProoffOf, FinalityVerificationContextfOf,
BizinikiwiEquivocationDetectionPipeline,
BizinikiwiEquivocationDetectionPipeline, EquivocationDetectionPipelineAdapter,
FinalityProoffOf, FinalityVerificationContextfOf,
},
finality_base::{best_synced_header_id, engine::Engine},
};
use async_trait::async_trait;
use bp_header_pez_chain::HeaderFinalityInfo;
use pezbp_runtime::{BlockNumberOf, HashOf};
use pez_equivocation_detector::TargetClient;
use pezbp_runtime::{BlockNumberOf, HashOf};
use pezsp_runtime::traits::Header;
use relay_bizinikiwi_client::{Client, Error};
use relay_utils::relay_loop::Client as RelayClient;
use pezsp_runtime::traits::Header;
use std::marker::PhantomData;
/// Bizinikiwi node as equivocation source.
@@ -16,9 +16,9 @@
//! Relay errors.
use relay_bizinikiwi_client as client;
use pezsp_consensus_grandpa::AuthorityList;
use pezsp_runtime::traits::MaybeDisplay;
use relay_bizinikiwi_client as client;
use std::fmt::Debug;
use thiserror::Error;
@@ -25,12 +25,12 @@ use crate::{error::Error, finality_base::engine::Engine};
use pezsp_core::Pair;
use pezbp_runtime::HeaderIdOf;
use pezsp_runtime::traits::Header as HeaderT;
use relay_bizinikiwi_client::{
AccountKeyPairOf, Chain, ChainWithTransactions, Client, Error as BizinikiwiError,
UnsignedTransaction,
};
use relay_utils::{TrackedTransactionStatus, TransactionTracker};
use pezsp_runtime::traits::Header as HeaderT;
/// Submit headers-bridge initialization transaction.
pub async fn initialize<
@@ -29,12 +29,12 @@ use pez_finality_relay::{
FinalityPipeline, FinalitySyncPipeline, HeadersToRelay, SourceClient, TargetClient,
};
use pezpallet_bridge_grandpa::{Call as BridgeGrandpaCall, Config as BridgeGrandpaConfig};
use pezsp_core::Pair;
use relay_bizinikiwi_client::{
transaction_stall_timeout, AccountIdOf, AccountKeyPairOf, BlockNumberOf, CallOf, Chain,
ChainWithTransactions, Client, HashOf, HeaderOf, SyncHeader,
};
use relay_utils::{metrics::MetricsParams, TrackedTransactionStatus, TransactionTracker};
use pezsp_core::Pair;
use std::{fmt::Debug, marker::PhantomData};
pub mod initialize;
@@ -17,7 +17,7 @@
//! Default generic implementation of finality source for basic Bizinikiwi client.
use crate::{
finality::{FinalitySyncPipelineAdapter, BizinikiwiFinalitySyncPipeline},
finality::{BizinikiwiFinalitySyncPipeline, FinalitySyncPipelineAdapter},
finality_base::{
engine::Engine, finality_proofs, BizinikiwiFinalityProof, BizinikiwiFinalityProofsStream,
},
@@ -27,12 +27,12 @@ use async_std::sync::{Arc, Mutex};
use async_trait::async_trait;
use bp_header_pez_chain::FinalityProof;
use codec::Decode;
use pez_finality_relay::{SourceClient, SourceClientBase};
use futures::{
select,
stream::{try_unfold, Stream, StreamExt, TryStreamExt},
};
use num_traits::One;
use pez_finality_relay::{SourceClient, SourceClientBase};
use relay_bizinikiwi_client::{BlockNumberOf, BlockWithJustification, Client, Error, HeaderOf};
use relay_utils::{relay_loop::Client as RelayClient, UniqueSaturatedInto};

Some files were not shown because too many files have changed in this diff Show More