mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Bump dependencies (#1180)
* substrate: d0f6c1c60da22e04dd25c2eca46ebfe6f1571af0
polkadot: dd4b2e6a34a08a01b876d14641e99e7011be3463
cumulus: 9379cd6c18
* fmt
* fixed lost refs
* spelling
* benckhmarks
* fmt
This commit is contained in:
committed by
Bastian Köcher
parent
6396239e18
commit
e23266c7e6
@@ -14,6 +14,7 @@ futures = "0.3"
|
||||
jsonrpc-core = "18.0"
|
||||
kvdb = "0.10"
|
||||
kvdb-rocksdb = "0.12"
|
||||
lru = "0.7"
|
||||
structopt = "0.3.21"
|
||||
serde_json = "1.0.59"
|
||||
thiserror = "1.0"
|
||||
|
||||
@@ -264,7 +264,6 @@ fn testnet_genesis(
|
||||
ump_service_total_weight: 4 * 1_000_000_000,
|
||||
max_upward_message_size: 1024 * 1024,
|
||||
max_upward_message_num_per_candidate: 5,
|
||||
_hrmp_open_request_ttl: 5,
|
||||
hrmp_sender_deposit: 0,
|
||||
hrmp_recipient_deposit: 0,
|
||||
hrmp_channel_max_capacity: 8,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
use crate::service::{AuthorityDiscoveryApi, Error};
|
||||
use rialto_runtime::{opaque::Block, Hash};
|
||||
|
||||
use lru::LruCache;
|
||||
use polkadot_availability_distribution::IncomingRequestReceivers;
|
||||
use polkadot_node_core_approval_voting::Config as ApprovalVotingConfig;
|
||||
use polkadot_node_core_av_store::Config as AvailabilityConfig;
|
||||
@@ -30,7 +31,10 @@ use polkadot_node_core_candidate_validation::Config as CandidateValidationConfig
|
||||
use polkadot_node_core_chain_selection::Config as ChainSelectionConfig;
|
||||
use polkadot_node_core_dispute_coordinator::Config as DisputeCoordinatorConfig;
|
||||
use polkadot_node_network_protocol::request_response::{v1 as request_v1, IncomingRequestReceiver};
|
||||
use polkadot_overseer::{AllSubsystems, BlockInfo, Overseer, OverseerHandle};
|
||||
use polkadot_overseer::{
|
||||
metrics::Metrics as OverseerMetrics, BlockInfo, MetricsTrait, Overseer, OverseerBuilder,
|
||||
OverseerConnector, OverseerHandle,
|
||||
};
|
||||
use polkadot_primitives::v1::ParachainHost;
|
||||
use sc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
use sc_client_api::AuxStore;
|
||||
@@ -107,12 +111,11 @@ where
|
||||
pub dispute_coordinator_config: DisputeCoordinatorConfig,
|
||||
}
|
||||
|
||||
/// Create a default, unaltered set of subsystems.
|
||||
///
|
||||
/// A convenience for usage with malus, to avoid
|
||||
/// repetitive code across multiple behavior strain implementations.
|
||||
pub fn create_default_subsystems<Spawner, RuntimeClient>(
|
||||
/// Obtain a prepared `OverseerBuilder`, that is initialized
|
||||
/// with all default values.
|
||||
pub fn prepared_overseer_builder<'a, Spawner, RuntimeClient>(
|
||||
OverseerGenArgs {
|
||||
leaves,
|
||||
keystore,
|
||||
runtime_client,
|
||||
parachains_db,
|
||||
@@ -120,6 +123,7 @@ pub fn create_default_subsystems<Spawner, RuntimeClient>(
|
||||
authority_discovery_service,
|
||||
pov_req_receiver,
|
||||
chunk_req_receiver,
|
||||
collation_req_receiver: _,
|
||||
available_data_req_receiver,
|
||||
statement_req_receiver,
|
||||
dispute_req_receiver,
|
||||
@@ -130,10 +134,11 @@ pub fn create_default_subsystems<Spawner, RuntimeClient>(
|
||||
candidate_validation_config,
|
||||
chain_selection_config,
|
||||
dispute_coordinator_config,
|
||||
..
|
||||
}: OverseerGenArgs<'_, Spawner, RuntimeClient>,
|
||||
}: OverseerGenArgs<'a, Spawner, RuntimeClient>,
|
||||
) -> Result<
|
||||
AllSubsystems<
|
||||
OverseerBuilder<
|
||||
Spawner,
|
||||
Arc<RuntimeClient>,
|
||||
CandidateValidationSubsystem,
|
||||
CandidateBackingSubsystem<Spawner>,
|
||||
StatementDistributionSubsystem,
|
||||
@@ -153,7 +158,7 @@ pub fn create_default_subsystems<Spawner, RuntimeClient>(
|
||||
CollatorProtocolSubsystem,
|
||||
ApprovalDistributionSubsystem,
|
||||
ApprovalVotingSubsystem,
|
||||
GossipSupportSubsystem,
|
||||
GossipSupportSubsystem<AuthorityDiscoveryService>,
|
||||
DisputeCoordinatorSubsystem,
|
||||
DisputeParticipationSubsystem,
|
||||
DisputeDistributionSubsystem<AuthorityDiscoveryService>,
|
||||
@@ -167,86 +172,104 @@ where
|
||||
Spawner: 'static + SpawnNamed + Clone + Unpin,
|
||||
{
|
||||
use polkadot_node_subsystem_util::metrics::Metrics;
|
||||
use std::iter::FromIterator;
|
||||
|
||||
let all_subsystems = AllSubsystems {
|
||||
availability_distribution: AvailabilityDistributionSubsystem::new(
|
||||
let metrics = <OverseerMetrics as MetricsTrait>::register(registry)?;
|
||||
|
||||
let builder = Overseer::builder()
|
||||
.availability_distribution(AvailabilityDistributionSubsystem::new(
|
||||
keystore.clone(),
|
||||
IncomingRequestReceivers { pov_req_receiver, chunk_req_receiver },
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
availability_recovery: AvailabilityRecoverySubsystem::with_chunks_only(
|
||||
))
|
||||
.availability_recovery(AvailabilityRecoverySubsystem::with_chunks_only(
|
||||
available_data_req_receiver,
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
availability_store: AvailabilityStoreSubsystem::new(
|
||||
))
|
||||
.availability_store(AvailabilityStoreSubsystem::new(
|
||||
parachains_db.clone(),
|
||||
availability_config,
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
bitfield_distribution: BitfieldDistributionSubsystem::new(Metrics::register(registry)?),
|
||||
bitfield_signing: BitfieldSigningSubsystem::new(
|
||||
))
|
||||
.bitfield_distribution(BitfieldDistributionSubsystem::new(Metrics::register(registry)?))
|
||||
.bitfield_signing(BitfieldSigningSubsystem::new(
|
||||
spawner.clone(),
|
||||
keystore.clone(),
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
candidate_backing: CandidateBackingSubsystem::new(
|
||||
))
|
||||
.candidate_backing(CandidateBackingSubsystem::new(
|
||||
spawner.clone(),
|
||||
keystore.clone(),
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
candidate_validation: CandidateValidationSubsystem::with_config(
|
||||
))
|
||||
.candidate_validation(CandidateValidationSubsystem::with_config(
|
||||
candidate_validation_config,
|
||||
Metrics::register(registry)?, // candidate-validation metrics
|
||||
Metrics::register(registry)?, // validation host metrics
|
||||
),
|
||||
chain_api: ChainApiSubsystem::new(runtime_client.clone(), Metrics::register(registry)?),
|
||||
collation_generation: CollationGenerationSubsystem::new(Metrics::register(registry)?),
|
||||
collator_protocol: CollatorProtocolSubsystem::new(ProtocolSide::Validator {
|
||||
))
|
||||
.chain_api(ChainApiSubsystem::new(runtime_client.clone(), Metrics::register(registry)?))
|
||||
.collation_generation(CollationGenerationSubsystem::new(Metrics::register(registry)?))
|
||||
.collator_protocol(CollatorProtocolSubsystem::new(ProtocolSide::Validator {
|
||||
keystore: keystore.clone(),
|
||||
eviction_policy: Default::default(),
|
||||
metrics: Metrics::register(registry)?,
|
||||
}),
|
||||
network_bridge: NetworkBridgeSubsystem::new(
|
||||
}))
|
||||
.network_bridge(NetworkBridgeSubsystem::new(
|
||||
network_service.clone(),
|
||||
authority_discovery_service.clone(),
|
||||
Box::new(network_service.clone()),
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
provisioner: ProvisionerSubsystem::new(spawner.clone(), (), Metrics::register(registry)?),
|
||||
runtime_api: RuntimeApiSubsystem::new(
|
||||
runtime_client,
|
||||
))
|
||||
.provisioner(ProvisionerSubsystem::new(spawner.clone(), (), Metrics::register(registry)?))
|
||||
.runtime_api(RuntimeApiSubsystem::new(
|
||||
runtime_client.clone(),
|
||||
Metrics::register(registry)?,
|
||||
spawner,
|
||||
),
|
||||
statement_distribution: StatementDistributionSubsystem::new(
|
||||
spawner.clone(),
|
||||
))
|
||||
.statement_distribution(StatementDistributionSubsystem::new(
|
||||
keystore.clone(),
|
||||
statement_req_receiver,
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
approval_distribution: ApprovalDistributionSubsystem::new(Metrics::register(registry)?),
|
||||
approval_voting: ApprovalVotingSubsystem::with_config(
|
||||
))
|
||||
.approval_distribution(ApprovalDistributionSubsystem::new(Metrics::register(registry)?))
|
||||
.approval_voting(ApprovalVotingSubsystem::with_config(
|
||||
approval_voting_config,
|
||||
parachains_db.clone(),
|
||||
keystore.clone(),
|
||||
Box::new(network_service),
|
||||
Box::new(network_service.clone()),
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
gossip_support: GossipSupportSubsystem::new(keystore.clone()),
|
||||
dispute_coordinator: DisputeCoordinatorSubsystem::new(
|
||||
))
|
||||
.gossip_support(GossipSupportSubsystem::new(
|
||||
keystore.clone(),
|
||||
authority_discovery_service.clone(),
|
||||
))
|
||||
.dispute_coordinator(DisputeCoordinatorSubsystem::new(
|
||||
parachains_db.clone(),
|
||||
dispute_coordinator_config,
|
||||
keystore.clone(),
|
||||
),
|
||||
dispute_participation: DisputeParticipationSubsystem::new(),
|
||||
dispute_distribution: DisputeDistributionSubsystem::new(
|
||||
keystore,
|
||||
dispute_req_receiver,
|
||||
authority_discovery_service,
|
||||
Metrics::register(registry)?,
|
||||
),
|
||||
chain_selection: ChainSelectionSubsystem::new(chain_selection_config, parachains_db),
|
||||
};
|
||||
Ok(all_subsystems)
|
||||
))
|
||||
.dispute_participation(DisputeParticipationSubsystem::new())
|
||||
.dispute_distribution(DisputeDistributionSubsystem::new(
|
||||
keystore.clone(),
|
||||
dispute_req_receiver,
|
||||
authority_discovery_service.clone(),
|
||||
Metrics::register(registry)?,
|
||||
))
|
||||
.chain_selection(ChainSelectionSubsystem::new(chain_selection_config, parachains_db))
|
||||
.leaves(Vec::from_iter(
|
||||
leaves
|
||||
.into_iter()
|
||||
.map(|BlockInfo { hash, parent_hash: _, number }| (hash, number)),
|
||||
))
|
||||
.activation_external_listeners(Default::default())
|
||||
.span_per_active_leaf(Default::default())
|
||||
.active_leaves(Default::default())
|
||||
.supports_parachains(runtime_client)
|
||||
.known_leaves(LruCache::new(KNOWN_LEAVES_CACHE_SIZE))
|
||||
.metrics(metrics)
|
||||
.spawner(spawner);
|
||||
Ok(builder)
|
||||
}
|
||||
|
||||
/// Trait for the `fn` generating the overseer.
|
||||
@@ -255,9 +278,10 @@ where
|
||||
/// would do.
|
||||
pub trait OverseerGen {
|
||||
/// Overwrite the full generation of the overseer, including the subsystems.
|
||||
fn generate<Spawner, RuntimeClient>(
|
||||
fn generate<'a, Spawner, RuntimeClient>(
|
||||
&self,
|
||||
args: OverseerGenArgs<'_, Spawner, RuntimeClient>,
|
||||
connector: OverseerConnector,
|
||||
args: OverseerGenArgs<'a, Spawner, RuntimeClient>,
|
||||
) -> Result<(Overseer<Spawner, Arc<RuntimeClient>>, OverseerHandle), Error>
|
||||
where
|
||||
RuntimeClient: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block> + AuxStore,
|
||||
@@ -265,34 +289,31 @@ pub trait OverseerGen {
|
||||
Spawner: 'static + SpawnNamed + Clone + Unpin,
|
||||
{
|
||||
let gen = RealOverseerGen;
|
||||
RealOverseerGen::generate::<Spawner, RuntimeClient>(&gen, args)
|
||||
RealOverseerGen::generate::<Spawner, RuntimeClient>(&gen, connector, args)
|
||||
}
|
||||
// It would be nice to make `create_subsystems` part of this trait,
|
||||
// but the amount of generic arguments that would be required as
|
||||
// as consequence make this rather annoying to implement and use.
|
||||
}
|
||||
|
||||
use polkadot_overseer::KNOWN_LEAVES_CACHE_SIZE;
|
||||
|
||||
/// The regular set of subsystems.
|
||||
pub struct RealOverseerGen;
|
||||
|
||||
impl OverseerGen for RealOverseerGen {
|
||||
fn generate<Spawner, RuntimeClient>(
|
||||
fn generate<'a, Spawner, RuntimeClient>(
|
||||
&self,
|
||||
args: OverseerGenArgs<'_, Spawner, RuntimeClient>,
|
||||
connector: OverseerConnector,
|
||||
args: OverseerGenArgs<'a, Spawner, RuntimeClient>,
|
||||
) -> Result<(Overseer<Spawner, Arc<RuntimeClient>>, OverseerHandle), Error>
|
||||
where
|
||||
RuntimeClient: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block> + AuxStore,
|
||||
RuntimeClient::Api: ParachainHost<Block> + BabeApi<Block> + AuthorityDiscoveryApi<Block>,
|
||||
Spawner: 'static + SpawnNamed + Clone + Unpin,
|
||||
{
|
||||
let spawner = args.spawner.clone();
|
||||
let leaves = args.leaves.clone();
|
||||
let runtime_client = args.runtime_client.clone();
|
||||
let registry = args.registry;
|
||||
|
||||
let all_subsystems = create_default_subsystems::<Spawner, RuntimeClient>(args)?;
|
||||
|
||||
Overseer::new(leaves, all_subsystems, registry, runtime_client, spawner)
|
||||
prepared_overseer_builder(args)?
|
||||
.build_with_connector(connector)
|
||||
.map_err(|e| e.into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ use polkadot_node_core_candidate_validation::Config as CandidateValidationConfig
|
||||
use polkadot_node_core_chain_selection::Config as ChainSelectionConfig;
|
||||
use polkadot_node_core_dispute_coordinator::Config as DisputeCoordinatorConfig;
|
||||
use polkadot_node_network_protocol::request_response::IncomingRequest;
|
||||
use polkadot_overseer::BlockInfo;
|
||||
use polkadot_overseer::{BlockInfo, OverseerConnector};
|
||||
use polkadot_primitives::v1::BlockId;
|
||||
use rialto_runtime::{self, opaque::Block, RuntimeApi};
|
||||
use sc_client_api::ExecutorProvider;
|
||||
@@ -47,7 +47,7 @@ use sp_runtime::traits::{BlakeTwo256, Block as BlockT};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
|
||||
pub use polkadot_overseer::{Handle, Overseer, OverseerHandle};
|
||||
pub use polkadot_overseer::Handle;
|
||||
pub use polkadot_primitives::v1::ParachainHost;
|
||||
pub use sc_client_api::AuxStore;
|
||||
pub use sp_authority_discovery::AuthorityDiscoveryApi;
|
||||
@@ -432,6 +432,8 @@ where
|
||||
|
||||
let prometheus_registry = config.prometheus_registry().cloned();
|
||||
|
||||
let overseer_connector = OverseerConnector::default();
|
||||
|
||||
let shared_voter_state = rpc_setup;
|
||||
let auth_disc_publish_non_global_ips = config.network.allow_non_globals_in_dht;
|
||||
|
||||
@@ -462,6 +464,7 @@ where
|
||||
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
|
||||
backend.clone(),
|
||||
import_setup.1.shared_authority_set().clone(),
|
||||
vec![],
|
||||
));
|
||||
|
||||
let (network, system_rpc_tx, network_starter) =
|
||||
@@ -586,50 +589,55 @@ where
|
||||
|
||||
let overseer_handle = if let Some((authority_discovery_service, keystore)) = maybe_params {
|
||||
let (overseer, overseer_handle) = overseer_gen
|
||||
.generate::<sc_service::SpawnTaskHandle, FullClient>(OverseerGenArgs {
|
||||
leaves: active_leaves,
|
||||
keystore,
|
||||
runtime_client: overseer_client.clone(),
|
||||
parachains_db,
|
||||
availability_config,
|
||||
approval_voting_config,
|
||||
network_service: network.clone(),
|
||||
authority_discovery_service,
|
||||
registry: prometheus_registry.as_ref(),
|
||||
spawner,
|
||||
candidate_validation_config,
|
||||
available_data_req_receiver,
|
||||
chain_selection_config,
|
||||
chunk_req_receiver,
|
||||
collation_req_receiver,
|
||||
dispute_coordinator_config,
|
||||
dispute_req_receiver,
|
||||
pov_req_receiver,
|
||||
statement_req_receiver,
|
||||
})?;
|
||||
let handle = Handle::Connected(overseer_handle);
|
||||
let handle_clone = handle.clone();
|
||||
.generate::<sc_service::SpawnTaskHandle, FullClient>(
|
||||
overseer_connector,
|
||||
OverseerGenArgs {
|
||||
leaves: active_leaves,
|
||||
keystore,
|
||||
runtime_client: overseer_client.clone(),
|
||||
parachains_db,
|
||||
availability_config,
|
||||
approval_voting_config,
|
||||
network_service: network.clone(),
|
||||
authority_discovery_service,
|
||||
registry: prometheus_registry.as_ref(),
|
||||
spawner,
|
||||
candidate_validation_config,
|
||||
available_data_req_receiver,
|
||||
chain_selection_config,
|
||||
chunk_req_receiver,
|
||||
collation_req_receiver,
|
||||
dispute_coordinator_config,
|
||||
dispute_req_receiver,
|
||||
pov_req_receiver,
|
||||
statement_req_receiver,
|
||||
},
|
||||
)?;
|
||||
let handle = Handle::new(overseer_handle.clone());
|
||||
|
||||
task_manager.spawn_essential_handle().spawn_blocking(
|
||||
"overseer",
|
||||
Box::pin(async move {
|
||||
use futures::{pin_mut, select, FutureExt};
|
||||
{
|
||||
let handle = handle.clone();
|
||||
task_manager.spawn_essential_handle().spawn_blocking(
|
||||
"overseer",
|
||||
Box::pin(async move {
|
||||
use futures::{pin_mut, select, FutureExt};
|
||||
|
||||
let forward = polkadot_overseer::forward_events(overseer_client, handle_clone);
|
||||
let forward = polkadot_overseer::forward_events(overseer_client, handle);
|
||||
|
||||
let forward = forward.fuse();
|
||||
let overseer_fut = overseer.run().fuse();
|
||||
let forward = forward.fuse();
|
||||
let overseer_fut = overseer.run().fuse();
|
||||
|
||||
pin_mut!(overseer_fut);
|
||||
pin_mut!(forward);
|
||||
pin_mut!(overseer_fut);
|
||||
pin_mut!(forward);
|
||||
|
||||
select! {
|
||||
_ = forward => (),
|
||||
_ = overseer_fut => (),
|
||||
complete => (),
|
||||
}
|
||||
}),
|
||||
);
|
||||
select! {
|
||||
_ = forward => (),
|
||||
_ = overseer_fut => (),
|
||||
complete => (),
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Some(handle)
|
||||
} else {
|
||||
|
||||
@@ -12,6 +12,7 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features =
|
||||
hex-literal = "0.3"
|
||||
libsecp256k1 = { version = "0.7", optional = true, default-features = false, features = ["hmac"] }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
@@ -112,6 +113,7 @@ std = [
|
||||
"polkadot-primitives/std",
|
||||
"polkadot-runtime-common/std",
|
||||
"polkadot-runtime-parachains/std",
|
||||
"scale-info/std",
|
||||
"serde",
|
||||
"sp-api/std",
|
||||
"sp-authority-discovery/std",
|
||||
|
||||
@@ -35,13 +35,14 @@ use bp_eth_poa::{transaction_decode_rlp, RawTransaction, RawTransactionReceipt};
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::RuntimeDebug;
|
||||
use hex_literal::hex;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// Ethereum address where locked PoA funds must be sent to.
|
||||
pub const LOCK_FUNDS_ADDRESS: [u8; 20] = hex!("DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF");
|
||||
|
||||
/// Ethereum transaction inclusion proof.
|
||||
#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)]
|
||||
#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub struct EthereumTransactionInclusionProof {
|
||||
/// Hash of the block with transaction.
|
||||
pub block: sp_core::H256,
|
||||
@@ -58,7 +59,7 @@ pub struct EthereumTransactionInclusionProof {
|
||||
/// transactions included into finalized blocks. This is obviously true
|
||||
/// for any existing eth-like chain (that keep current TX format), because
|
||||
/// otherwise transaction can be replayed over and over.
|
||||
#[derive(Encode, Decode, PartialEq, RuntimeDebug)]
|
||||
#[derive(Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub struct EthereumTransactionTag {
|
||||
/// Account that has locked funds.
|
||||
pub account: [u8; 20],
|
||||
|
||||
@@ -226,11 +226,13 @@ pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration =
|
||||
parameter_types! {
|
||||
pub const EpochDuration: u64 = bp_rialto::EPOCH_DURATION_IN_SLOTS as u64;
|
||||
pub const ExpectedBlockTime: bp_rialto::Moment = bp_rialto::time_units::MILLISECS_PER_BLOCK;
|
||||
pub const MaxAuthorities: u32 = 10;
|
||||
}
|
||||
|
||||
impl pallet_babe::Config for Runtime {
|
||||
type EpochDuration = EpochDuration;
|
||||
type ExpectedBlockTime = ExpectedBlockTime;
|
||||
type MaxAuthorities = MaxAuthorities;
|
||||
|
||||
// session module is the trigger
|
||||
type EpochChangeTrigger = pallet_babe::ExternalTrigger;
|
||||
@@ -370,6 +372,7 @@ impl bp_currency_exchange::DepositInto for DepositInto {
|
||||
impl pallet_grandpa::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type MaxAuthorities = MaxAuthorities;
|
||||
type KeyOwnerProofSystem = ();
|
||||
type KeyOwnerProof =
|
||||
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
|
||||
@@ -421,6 +424,7 @@ impl pallet_balances::Config for Runtime {
|
||||
parameter_types! {
|
||||
pub const TransactionBaseFee: Balance = 0;
|
||||
pub const TransactionByteFee: Balance = 1;
|
||||
pub const OperationalFeeMultiplier: u8 = 5;
|
||||
// values for following parameters are copied from polkadot repo, but it is fine
|
||||
// not to sync them - we're not going to make Rialto a full copy of one of Polkadot-like chains
|
||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||
@@ -431,6 +435,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
type WeightToFee = bp_rialto::WeightToFee;
|
||||
type FeeMultiplierUpdate = pallet_transaction_payment::TargetedFeeAdjustment<
|
||||
Runtime,
|
||||
@@ -454,15 +459,10 @@ impl pallet_session::Config for Runtime {
|
||||
type SessionManager = pallet_shift_session_manager::Pallet<Runtime>;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
type DisabledValidatorsThreshold = ();
|
||||
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const MaxAuthorities: u32 = 10;
|
||||
}
|
||||
|
||||
impl pallet_authority_discovery::Config for Runtime {
|
||||
type MaxAuthorities = MaxAuthorities;
|
||||
}
|
||||
@@ -662,7 +662,7 @@ impl_runtime_apis! {
|
||||
|
||||
impl sp_api::Metadata<Block> for Runtime {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
Runtime::metadata().into()
|
||||
OpaqueMetadata::new(Runtime::metadata().into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ impl_runtime_apis! {
|
||||
slot_duration: Babe::slot_duration(),
|
||||
epoch_length: EpochDuration::get(),
|
||||
c: BABE_GENESIS_EPOCH_CONFIG.c,
|
||||
genesis_authorities: Babe::authorities(),
|
||||
genesis_authorities: Babe::authorities().to_vec(),
|
||||
randomness: Babe::randomness(),
|
||||
allowed_slots: BABE_GENESIS_EPOCH_CONFIG.allowed_slots,
|
||||
}
|
||||
@@ -902,6 +902,10 @@ impl_runtime_apis! {
|
||||
) -> Option<polkadot_primitives::v1::ValidationCode> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v1::validation_code_by_hash::<Runtime>(hash)
|
||||
}
|
||||
|
||||
fn on_chain_votes() -> Option<polkadot_primitives::v1::ScrapedOnChainVotes<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v1::on_chain_votes::<Runtime>()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_authority_discovery::AuthorityDiscoveryApi<Block> for Runtime {
|
||||
@@ -1172,7 +1176,7 @@ impl_runtime_apis! {
|
||||
MessagesProofSize::Minimal(ref size) => vec![0u8; *size as _],
|
||||
_ => vec![],
|
||||
};
|
||||
let call = Call::System(SystemCall::remark(remark));
|
||||
let call = Call::System(SystemCall::remark { remark });
|
||||
let call_weight = call.get_dispatch_info().weight;
|
||||
|
||||
let millau_account_id: bp_millau::AccountId = Default::default();
|
||||
|
||||
@@ -31,6 +31,7 @@ use frame_support::{
|
||||
weights::{DispatchClass, Weight},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{traits::Saturating, FixedPointNumber, FixedU128};
|
||||
use sp_std::{convert::TryFrom, ops::RangeInclusive};
|
||||
|
||||
@@ -272,7 +273,7 @@ impl SourceHeaderChain<bp_millau::Balance> for Millau {
|
||||
}
|
||||
|
||||
/// Rialto -> Millau message lane pallet parameters.
|
||||
#[derive(RuntimeDebug, Clone, Encode, Decode, PartialEq, Eq)]
|
||||
#[derive(RuntimeDebug, Clone, Encode, Decode, PartialEq, Eq, TypeInfo)]
|
||||
pub enum RialtoToMillauMessagesParameter {
|
||||
/// The conversion formula we use is: `RialtoTokens = MillauTokens * conversion_rate`.
|
||||
MillauToRialtoConversionRate(FixedU128),
|
||||
@@ -315,7 +316,7 @@ mod tests {
|
||||
SystemConfig::default().build_storage::<Runtime>().unwrap().into();
|
||||
ext.execute_with(|| {
|
||||
let bridge = MILLAU_CHAIN_ID;
|
||||
let call: Call = SystemCall::remark(vec![]).into();
|
||||
let call: Call = SystemCall::remark { remark: vec![] }.into();
|
||||
let dispatch_weight = call.get_dispatch_info().weight;
|
||||
let dispatch_fee = <Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(
|
||||
&dispatch_weight,
|
||||
|
||||
@@ -39,7 +39,9 @@ impl polkadot_runtime_parachains::inclusion::RewardValidators for RewardValidato
|
||||
|
||||
// all required parachain modules from `polkadot-runtime-parachains` crate
|
||||
|
||||
impl parachains_configuration::Config for Runtime {}
|
||||
impl parachains_configuration::Config for Runtime {
|
||||
type WeightInfo = parachains_configuration::TestWeightInfo;
|
||||
}
|
||||
|
||||
impl parachains_dmp::Config for Runtime {}
|
||||
|
||||
@@ -58,6 +60,7 @@ impl parachains_inclusion::Config for Runtime {
|
||||
impl parachains_initializer::Config for Runtime {
|
||||
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
|
||||
type ForceOrigin = EnsureRoot<AccountId>;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl parachains_origin::Config for Runtime {}
|
||||
@@ -65,6 +68,7 @@ impl parachains_origin::Config for Runtime {}
|
||||
impl parachains_paras::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Event = Event;
|
||||
type WeightInfo = parachains_paras::TestWeightInfo;
|
||||
}
|
||||
|
||||
impl parachains_paras_inherent::Config for Runtime {}
|
||||
@@ -83,6 +87,7 @@ impl parachains_ump::Config for Runtime {
|
||||
type Event = Event;
|
||||
type UmpSink = ();
|
||||
type FirstMessageFactorPercent = FirstMessageFactorPercent;
|
||||
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
// required onboarding pallets. We're not going to use auctions or crowdloans, so they're missing
|
||||
@@ -112,6 +117,7 @@ impl slots::Config for Runtime {
|
||||
type Registrar = Registrar;
|
||||
type LeasePeriod = LeasePeriod;
|
||||
type WeightInfo = slots::TestWeightInfo;
|
||||
type LeaseOffset = ();
|
||||
}
|
||||
|
||||
impl paras_sudo_wrapper::Config for Runtime {}
|
||||
|
||||
Reference in New Issue
Block a user