mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 15:27:57 +00:00
bump substrate+polkadot refs and fix builds (#1989)
* bump refs and fix build * more fixes * Fix rialto-parachain node * Update dependencies for tools/runtime-codegen * Regenerate rialto-parachain indirect runtime * Fix register_parachain * Fix clippy * Undo clippy allow --------- Co-authored-by: Serban Iorga <serban@parity.io>
This commit is contained in:
committed by
Bastian Köcher
parent
830afff353
commit
e55d4dd6e0
@@ -22,7 +22,6 @@ use sc_client_api::BlockBackend;
|
||||
use sc_consensus_aura::{CompatibilityMode, ImportQueueParams, SlotProportion, StartAuraParams};
|
||||
use sc_consensus_grandpa::SharedVoterState;
|
||||
pub use sc_executor::NativeElseWasmExecutor;
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
|
||||
use sc_telemetry::{Telemetry, TelemetryWorker};
|
||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||
@@ -78,10 +77,6 @@ pub fn new_partial(
|
||||
>,
|
||||
ServiceError,
|
||||
> {
|
||||
if config.keystore_remote.is_some() {
|
||||
return Err(ServiceError::Other("Remote Keystores are not supported.".into()))
|
||||
}
|
||||
|
||||
let telemetry = config
|
||||
.telemetry_endpoints
|
||||
.clone()
|
||||
@@ -175,13 +170,6 @@ pub fn new_partial(
|
||||
})
|
||||
}
|
||||
|
||||
fn remote_keystore(_url: &str) -> Result<Arc<LocalKeystore>, &'static str> {
|
||||
// FIXME: here would the concrete keystore be built,
|
||||
// must return a concrete type (NOT `LocalKeystore`) that
|
||||
// implements `CryptoStore` and `SyncCryptoStore`
|
||||
Err("Remote Keystore not supported.")
|
||||
}
|
||||
|
||||
/// Builds a new service for a full client.
|
||||
pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
use sc_network_common::sync::warp::WarpSyncParams;
|
||||
@@ -191,22 +179,12 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
backend,
|
||||
mut task_manager,
|
||||
import_queue,
|
||||
mut keystore_container,
|
||||
keystore_container,
|
||||
select_chain,
|
||||
transaction_pool,
|
||||
other: (block_import, grandpa_link, beefy_voter_links, beefy_rpc_links, mut telemetry),
|
||||
} = new_partial(&config)?;
|
||||
|
||||
if let Some(url) = &config.keystore_remote {
|
||||
match remote_keystore(url) {
|
||||
Ok(k) => keystore_container.set_remote_keystore(k),
|
||||
Err(e) =>
|
||||
return Err(ServiceError::Other(format!(
|
||||
"Error hooking up remote keystore for {url}: {e}"
|
||||
))),
|
||||
};
|
||||
}
|
||||
|
||||
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
|
||||
|
||||
// Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
|
||||
@@ -332,7 +310,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||
network: network.clone(),
|
||||
client: client.clone(),
|
||||
keystore: keystore_container.sync_keystore(),
|
||||
keystore: keystore_container.keystore(),
|
||||
task_manager: &mut task_manager,
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
sync_service: sync_service.clone(),
|
||||
@@ -375,7 +353,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
},
|
||||
force_authoring,
|
||||
backoff_authoring_blocks,
|
||||
keystore: keystore_container.sync_keystore(),
|
||||
keystore: keystore_container.keystore(),
|
||||
sync_oracle: sync_service.clone(),
|
||||
justification_sync_link: sync_service.clone(),
|
||||
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
|
||||
@@ -394,8 +372,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
|
||||
// if the node isn't actively participating in consensus then it doesn't
|
||||
// need a keystore, regardless of which protocol we use below.
|
||||
let keystore =
|
||||
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
|
||||
let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None };
|
||||
|
||||
let justifications_protocol_name = beefy_on_demand_justifications_handler.protocol_name();
|
||||
let payload_provider = sp_consensus_beefy::mmr::MmrRootProvider::new(client.clone());
|
||||
|
||||
@@ -331,6 +331,10 @@ impl pallet_balances::Config for Runtime {
|
||||
type MaxLocks = ConstU32<50>;
|
||||
type MaxReserves = ConstU32<50>;
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -655,6 +659,14 @@ impl_runtime_apis! {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
OpaqueMetadata::new(Runtime::metadata().into())
|
||||
}
|
||||
|
||||
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
|
||||
Runtime::metadata_at_version(version)
|
||||
}
|
||||
|
||||
fn metadata_versions() -> sp_std::vec::Vec<u32> {
|
||||
Runtime::metadata_versions()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_block_builder::BlockBuilder<Block> for Runtime {
|
||||
|
||||
@@ -28,6 +28,7 @@ use frame_support::{
|
||||
traits::{ConstU32, Everything, Nothing},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, CurrencyAdapter as XcmCurrencyAdapter, IsConcrete, MintLocation,
|
||||
@@ -186,6 +187,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type WeightInfo = pallet_xcm::TestWeightInfo;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type ReachableDest = ReachableDest;
|
||||
type AdminOrigin = EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
pub struct ToRialtoOrRialtoParachainSwitchExporter;
|
||||
|
||||
@@ -286,7 +286,7 @@ pub fn run() -> Result<()> {
|
||||
let id = ParaId::from(cli.parachain_id.or(para_id).expect("Missing ParaId"));
|
||||
|
||||
let parachain_account =
|
||||
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);
|
||||
AccountIdConversion::<polkadot_primitives::v4::AccountId>::into_account_truncating(&id);
|
||||
|
||||
let state_version =
|
||||
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
|
||||
|
||||
@@ -47,7 +47,7 @@ use sc_network_sync::SyncingService;
|
||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
||||
use sp_api::ConstructRuntimeApi;
|
||||
use sp_keystore::SyncCryptoStorePtr;
|
||||
use sp_keystore::KeystorePtr;
|
||||
use sp_runtime::traits::BlakeTwo256;
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
|
||||
@@ -237,7 +237,7 @@ where
|
||||
Arc<dyn RelayChainInterface>,
|
||||
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
||||
Arc<SyncingService<Block>>,
|
||||
SyncCryptoStorePtr,
|
||||
KeystorePtr,
|
||||
bool,
|
||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||
{
|
||||
@@ -294,7 +294,7 @@ where
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
task_manager: &mut task_manager,
|
||||
config: parachain_config,
|
||||
keystore: params.keystore_container.sync_keystore(),
|
||||
keystore: params.keystore_container.keystore(),
|
||||
backend: backend.clone(),
|
||||
network: network.clone(),
|
||||
sync_service: sync_service.clone(),
|
||||
@@ -324,7 +324,7 @@ where
|
||||
relay_chain_interface.clone(),
|
||||
transaction_pool,
|
||||
sync_service,
|
||||
params.keystore_container.sync_keystore(),
|
||||
params.keystore_container.keystore(),
|
||||
force_authoring,
|
||||
)?;
|
||||
|
||||
|
||||
@@ -304,6 +304,10 @@ impl pallet_balances::Config for Runtime {
|
||||
type MaxLocks = ConstU32<50>;
|
||||
type MaxReserves = ConstU32<50>;
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -492,6 +496,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type WeightInfo = pallet_xcm::TestWeightInfo;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type ReachableDest = ReachableDest;
|
||||
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_xcm::Config for Runtime {
|
||||
@@ -637,6 +642,14 @@ impl_runtime_apis! {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
OpaqueMetadata::new(Runtime::metadata().into())
|
||||
}
|
||||
|
||||
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
|
||||
Runtime::metadata_at_version(version)
|
||||
}
|
||||
|
||||
fn metadata_versions() -> sp_std::vec::Vec<u32> {
|
||||
Runtime::metadata_versions()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_block_builder::BlockBuilder<Block> for Runtime {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::weights::Weight;
|
||||
use polkadot_primitives::v2::{AssignmentId, ValidatorId};
|
||||
use polkadot_primitives::v4::{AssignmentId, ValidatorId};
|
||||
use rialto_runtime::{
|
||||
AccountId, BabeConfig, BalancesConfig, BeefyConfig, BridgeMillauMessagesConfig,
|
||||
ConfigurationConfig, GenesisConfig, GrandpaConfig, SessionConfig, SessionKeys, Signature,
|
||||
@@ -244,8 +244,8 @@ fn testnet_genesis(
|
||||
validation_upgrade_cooldown: 2u32,
|
||||
validation_upgrade_delay: 2,
|
||||
code_retention_period: 1200,
|
||||
max_code_size: polkadot_primitives::v2::MAX_CODE_SIZE,
|
||||
max_pov_size: polkadot_primitives::v2::MAX_POV_SIZE,
|
||||
max_code_size: polkadot_primitives::v4::MAX_CODE_SIZE,
|
||||
max_pov_size: polkadot_primitives::v4::MAX_POV_SIZE,
|
||||
max_head_data_size: 32 * 1024,
|
||||
group_rotation_frequency: 20,
|
||||
chain_availability_period: 4,
|
||||
@@ -255,7 +255,7 @@ fn testnet_genesis(
|
||||
max_downward_message_size: 1024 * 1024,
|
||||
ump_service_total_weight: Weight::from_parts(
|
||||
100_000_000_000,
|
||||
polkadot_primitives::v2::MAX_POV_SIZE as u64,
|
||||
polkadot_primitives::v4::MAX_POV_SIZE as u64,
|
||||
),
|
||||
max_upward_message_size: 50 * 1024,
|
||||
max_upward_message_num_per_candidate: 5,
|
||||
|
||||
@@ -330,6 +330,10 @@ impl pallet_balances::Config for Runtime {
|
||||
type MaxLocks = ConstU32<50>;
|
||||
type MaxReserves = ConstU32<50>;
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -579,6 +583,14 @@ impl_runtime_apis! {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
OpaqueMetadata::new(Runtime::metadata().into())
|
||||
}
|
||||
|
||||
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
|
||||
Runtime::metadata_at_version(version)
|
||||
}
|
||||
|
||||
fn metadata_versions() -> sp_std::vec::Vec<u32> {
|
||||
Runtime::metadata_versions()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_block_builder::BlockBuilder<Block> for Runtime {
|
||||
@@ -754,55 +766,55 @@ impl_runtime_apis! {
|
||||
}
|
||||
|
||||
impl polkadot_primitives::runtime_api::ParachainHost<Block, Hash, BlockNumber> for Runtime {
|
||||
fn validators() -> Vec<polkadot_primitives::v2::ValidatorId> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validators::<Runtime>()
|
||||
fn validators() -> Vec<polkadot_primitives::v4::ValidatorId> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::validators::<Runtime>()
|
||||
}
|
||||
|
||||
fn validator_groups() -> (Vec<Vec<polkadot_primitives::v2::ValidatorIndex>>, polkadot_primitives::v2::GroupRotationInfo<BlockNumber>) {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validator_groups::<Runtime>()
|
||||
fn validator_groups() -> (Vec<Vec<polkadot_primitives::v4::ValidatorIndex>>, polkadot_primitives::v4::GroupRotationInfo<BlockNumber>) {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::validator_groups::<Runtime>()
|
||||
}
|
||||
|
||||
fn availability_cores() -> Vec<polkadot_primitives::v2::CoreState<Hash, BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::availability_cores::<Runtime>()
|
||||
fn availability_cores() -> Vec<polkadot_primitives::v4::CoreState<Hash, BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::availability_cores::<Runtime>()
|
||||
}
|
||||
|
||||
fn persisted_validation_data(para_id: polkadot_primitives::v2::Id, assumption: polkadot_primitives::v2::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v2::PersistedValidationData<Hash, BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::persisted_validation_data::<Runtime>(para_id, assumption)
|
||||
fn persisted_validation_data(para_id: polkadot_primitives::v4::Id, assumption: polkadot_primitives::v4::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v4::PersistedValidationData<Hash, BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::persisted_validation_data::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn assumed_validation_data(
|
||||
para_id: polkadot_primitives::v2::Id,
|
||||
para_id: polkadot_primitives::v4::Id,
|
||||
expected_persisted_validation_data_hash: Hash,
|
||||
) -> Option<(polkadot_primitives::v2::PersistedValidationData<Hash, BlockNumber>, polkadot_primitives::v2::ValidationCodeHash)> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::assumed_validation_data::<Runtime>(
|
||||
) -> Option<(polkadot_primitives::v4::PersistedValidationData<Hash, BlockNumber>, polkadot_primitives::v4::ValidationCodeHash)> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::assumed_validation_data::<Runtime>(
|
||||
para_id,
|
||||
expected_persisted_validation_data_hash,
|
||||
)
|
||||
}
|
||||
|
||||
fn check_validation_outputs(
|
||||
para_id: polkadot_primitives::v2::Id,
|
||||
outputs: polkadot_primitives::v2::CandidateCommitments,
|
||||
para_id: polkadot_primitives::v4::Id,
|
||||
outputs: polkadot_primitives::v4::CandidateCommitments,
|
||||
) -> bool {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::check_validation_outputs::<Runtime>(para_id, outputs)
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::check_validation_outputs::<Runtime>(para_id, outputs)
|
||||
}
|
||||
|
||||
fn session_index_for_child() -> polkadot_primitives::v2::SessionIndex {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::session_index_for_child::<Runtime>()
|
||||
fn session_index_for_child() -> polkadot_primitives::v4::SessionIndex {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::session_index_for_child::<Runtime>()
|
||||
}
|
||||
|
||||
fn validation_code(para_id: polkadot_primitives::v2::Id, assumption: polkadot_primitives::v2::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v2::ValidationCode> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validation_code::<Runtime>(para_id, assumption)
|
||||
fn validation_code(para_id: polkadot_primitives::v4::Id, assumption: polkadot_primitives::v4::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v4::ValidationCode> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::validation_code::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn candidate_pending_availability(para_id: polkadot_primitives::v2::Id) -> Option<polkadot_primitives::v2::CommittedCandidateReceipt<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::candidate_pending_availability::<Runtime>(para_id)
|
||||
fn candidate_pending_availability(para_id: polkadot_primitives::v4::Id) -> Option<polkadot_primitives::v4::CommittedCandidateReceipt<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::candidate_pending_availability::<Runtime>(para_id)
|
||||
}
|
||||
|
||||
fn candidate_events() -> Vec<polkadot_primitives::v2::CandidateEvent<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::candidate_events::<Runtime, _>(|ev| {
|
||||
fn candidate_events() -> Vec<polkadot_primitives::v4::CandidateEvent<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::candidate_events::<Runtime, _>(|ev| {
|
||||
match ev {
|
||||
RuntimeEvent::Inclusion(ev) => {
|
||||
Some(ev)
|
||||
@@ -812,46 +824,54 @@ impl_runtime_apis! {
|
||||
})
|
||||
}
|
||||
|
||||
fn session_info(index: polkadot_primitives::v2::SessionIndex) -> Option<polkadot_primitives::v2::SessionInfo> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::session_info::<Runtime>(index)
|
||||
fn session_info(index: polkadot_primitives::v4::SessionIndex) -> Option<polkadot_primitives::v4::SessionInfo> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::session_info::<Runtime>(index)
|
||||
}
|
||||
|
||||
fn dmq_contents(recipient: polkadot_primitives::v2::Id) -> Vec<polkadot_primitives::v2::InboundDownwardMessage<BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::dmq_contents::<Runtime>(recipient)
|
||||
fn dmq_contents(recipient: polkadot_primitives::v4::Id) -> Vec<polkadot_primitives::v4::InboundDownwardMessage<BlockNumber>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::dmq_contents::<Runtime>(recipient)
|
||||
}
|
||||
|
||||
fn inbound_hrmp_channels_contents(
|
||||
recipient: polkadot_primitives::v2::Id
|
||||
) -> BTreeMap<polkadot_primitives::v2::Id, Vec<polkadot_primitives::v2::InboundHrmpMessage<BlockNumber>>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::inbound_hrmp_channels_contents::<Runtime>(recipient)
|
||||
recipient: polkadot_primitives::v4::Id
|
||||
) -> BTreeMap<polkadot_primitives::v4::Id, Vec<polkadot_primitives::v4::InboundHrmpMessage<BlockNumber>>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::inbound_hrmp_channels_contents::<Runtime>(recipient)
|
||||
}
|
||||
|
||||
fn validation_code_by_hash(hash: polkadot_primitives::v2::ValidationCodeHash) -> Option<polkadot_primitives::v2::ValidationCode> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validation_code_by_hash::<Runtime>(hash)
|
||||
fn validation_code_by_hash(hash: polkadot_primitives::v4::ValidationCodeHash) -> Option<polkadot_primitives::v4::ValidationCode> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::validation_code_by_hash::<Runtime>(hash)
|
||||
}
|
||||
|
||||
fn on_chain_votes() -> Option<polkadot_primitives::v2::ScrapedOnChainVotes<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::on_chain_votes::<Runtime>()
|
||||
fn on_chain_votes() -> Option<polkadot_primitives::v4::ScrapedOnChainVotes<Hash>> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::on_chain_votes::<Runtime>()
|
||||
}
|
||||
|
||||
fn submit_pvf_check_statement(stmt: polkadot_primitives::v2::PvfCheckStatement, signature: polkadot_primitives::v2::ValidatorSignature) {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::submit_pvf_check_statement::<Runtime>(stmt, signature)
|
||||
fn submit_pvf_check_statement(stmt: polkadot_primitives::v4::PvfCheckStatement, signature: polkadot_primitives::v4::ValidatorSignature) {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::submit_pvf_check_statement::<Runtime>(stmt, signature)
|
||||
}
|
||||
|
||||
fn pvfs_require_precheck() -> Vec<polkadot_primitives::v2::ValidationCodeHash> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::pvfs_require_precheck::<Runtime>()
|
||||
fn pvfs_require_precheck() -> Vec<polkadot_primitives::v4::ValidationCodeHash> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::pvfs_require_precheck::<Runtime>()
|
||||
}
|
||||
|
||||
fn validation_code_hash(para_id: polkadot_primitives::v2::Id, assumption: polkadot_primitives::v2::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v2::ValidationCodeHash>
|
||||
fn validation_code_hash(para_id: polkadot_primitives::v4::Id, assumption: polkadot_primitives::v4::OccupiedCoreAssumption)
|
||||
-> Option<polkadot_primitives::v4::ValidationCodeHash>
|
||||
{
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validation_code_hash::<Runtime>(para_id, assumption)
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::validation_code_hash::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn disputes() -> Vec<(polkadot_primitives::v4::SessionIndex, polkadot_primitives::v4::CandidateHash, polkadot_primitives::v4::DisputeState<BlockNumber>)> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::get_session_disputes::<Runtime>()
|
||||
}
|
||||
|
||||
fn session_executor_params(session_index: polkadot_primitives::v4::SessionIndex) -> Option<polkadot_primitives::v4::ExecutorParams> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::session_executor_params::<Runtime>(session_index)
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_authority_discovery::AuthorityDiscoveryApi<Block> for Runtime {
|
||||
fn authorities() -> Vec<AuthorityDiscoveryId> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::relevant_authority_ids::<Runtime>()
|
||||
polkadot_runtime_parachains::runtime_api_impl::v4::relevant_authority_ids::<Runtime>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
|
||||
use frame_support::{parameter_types, traits::KeyOwnerProofSystem};
|
||||
use frame_system::EnsureRoot;
|
||||
use polkadot_primitives::v2::{ValidatorId, ValidatorIndex};
|
||||
use polkadot_primitives::v4::{ValidatorId, ValidatorIndex};
|
||||
use polkadot_runtime_common::{paras_registrar, paras_sudo_wrapper, slots};
|
||||
use polkadot_runtime_parachains::{
|
||||
configuration as parachains_configuration, disputes as parachains_disputes,
|
||||
|
||||
@@ -27,6 +27,7 @@ use frame_support::{
|
||||
traits::{ConstU32, Everything, Nothing},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, CurrencyAdapter as XcmCurrencyAdapter, IsConcrete, MintLocation,
|
||||
@@ -182,6 +183,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type WeightInfo = pallet_xcm::TestWeightInfo;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type ReachableDest = ReachableDest;
|
||||
type AdminOrigin = EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
hash-db = { version = "0.16.0", default-features = false }
|
||||
log = { version = "0.4.17", default-features = false }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
static_assertions = { version = "1.1", optional = true }
|
||||
|
||||
@@ -172,6 +172,10 @@ impl pallet_balances::Config for TestRuntime {
|
||||
type MaxLocks = ConstU32<50>;
|
||||
type MaxReserves = ConstU32<50>;
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for TestRuntime {
|
||||
|
||||
@@ -40,7 +40,7 @@ use scale_info::TypeInfo;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::Header as SubstrateHeader,
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
traits::{BlakeTwo256, ConstU32, IdentityLookup},
|
||||
Perbill,
|
||||
};
|
||||
use std::{
|
||||
@@ -133,6 +133,10 @@ impl pallet_balances::Config for TestRuntime {
|
||||
type WeightInfo = ();
|
||||
type MaxReserves = ();
|
||||
type ReserveIdentifier = ();
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -24,7 +24,7 @@ use frame_support::{parameter_types, weights::RuntimeDbWeight};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::Header as SubstrateHeader,
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
traits::{BlakeTwo256, ConstU32, IdentityLookup},
|
||||
};
|
||||
|
||||
pub type AccountId = u64;
|
||||
@@ -86,6 +86,10 @@ impl pallet_balances::Config for TestRuntime {
|
||||
type WeightInfo = ();
|
||||
type MaxReserves = ();
|
||||
type ReserveIdentifier = ();
|
||||
type HoldIdentifier = ();
|
||||
type FreezeIdentifier = ();
|
||||
type MaxHolds = ConstU32<0>;
|
||||
type MaxFreezes = ConstU32<0>;
|
||||
}
|
||||
|
||||
impl pallet_bridge_relayers::Config for TestRuntime {
|
||||
|
||||
@@ -53,7 +53,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
|
||||
/// This is a copy-paste from the cumulus repo's `parachains-common` crate.
|
||||
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TIME_PER_SECOND, 0)
|
||||
.saturating_div(2)
|
||||
.set_proof_size(polkadot_primitives::v2::MAX_POV_SIZE as u64);
|
||||
.set_proof_size(polkadot_primitives::v4::MAX_POV_SIZE as u64);
|
||||
|
||||
/// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by
|
||||
/// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
use bp_messages::LaneId;
|
||||
use bp_runtime::{ChainId, StorageDoubleMapKeyProvider};
|
||||
use frame_support::{Blake2_128Concat, Identity};
|
||||
use frame_support::{traits::tokens::Preservation, Blake2_128Concat, Identity};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen},
|
||||
@@ -110,7 +110,7 @@ where
|
||||
|
||||
impl<T, Relayer> PaymentProcedure<Relayer, T::Balance> for PayRewardFromAccount<T, Relayer>
|
||||
where
|
||||
T: frame_support::traits::fungible::Transfer<Relayer>,
|
||||
T: frame_support::traits::fungible::Mutate<Relayer>,
|
||||
Relayer: Decode + Encode,
|
||||
{
|
||||
type Error = sp_runtime::DispatchError;
|
||||
@@ -120,8 +120,13 @@ where
|
||||
rewards_account_params: RewardsAccountParams,
|
||||
reward: T::Balance,
|
||||
) -> Result<(), Self::Error> {
|
||||
T::transfer(&Self::rewards_account(rewards_account_params), relayer, reward, false)
|
||||
.map(drop)
|
||||
T::transfer(
|
||||
&Self::rewards_account(rewards_account_params),
|
||||
relayer,
|
||||
reward,
|
||||
Preservation::Expendable,
|
||||
)
|
||||
.map(drop)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
hash-db = { version = "0.16.0", default-features = false }
|
||||
impl-trait-for-tuples = "0.2.2"
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -103,8 +103,8 @@ impl RegisterParachain {
|
||||
let para_id: ParaId = relay_client
|
||||
.storage_value(StorageKey(para_id_key.to_vec()), None)
|
||||
.await?
|
||||
.unwrap_or(polkadot_primitives::v2::LOWEST_PUBLIC_ID)
|
||||
.max(polkadot_primitives::v2::LOWEST_PUBLIC_ID);
|
||||
.unwrap_or(polkadot_primitives::v4::LOWEST_PUBLIC_ID)
|
||||
.max(polkadot_primitives::v4::LOWEST_PUBLIC_ID);
|
||||
log::info!(target: "bridge", "Going to reserve parachain id: {:?}", para_id);
|
||||
|
||||
// step 1: reserve a parachain id
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5" }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
subxt = { git = "https://github.com/paritytech/subxt", branch = "master", default-features = false, features = [] }
|
||||
subxt = { version = "0.27.1", default-features = false, features = [] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -739,12 +739,12 @@ impl<C: Chain> Client<C> {
|
||||
async fn jsonrpsee_execute<MF, F, T>(&self, make_jsonrpsee_future: MF) -> Result<T>
|
||||
where
|
||||
MF: FnOnce(Arc<RpcClient>) -> F + Send + 'static,
|
||||
F: Future<Output = Result<T>> + Send,
|
||||
F: Future<Output = Result<T>> + Send + 'static,
|
||||
T: Send + 'static,
|
||||
{
|
||||
let data = self.data.read().await;
|
||||
let client = data.client.clone();
|
||||
data.tokio.spawn(async move { make_jsonrpsee_future(client).await }).await?
|
||||
data.tokio.spawn(make_jsonrpsee_future(client)).await?
|
||||
}
|
||||
|
||||
/// Returns `true` if version guard can be started.
|
||||
|
||||
Reference in New Issue
Block a user