diff --git a/Cargo.lock b/Cargo.lock index e4789167a..51ada918d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18027,6 +18027,7 @@ version = "0.1.0" dependencies = [ "cumulus-primitives-core", "dp-chain-state-snapshot", + "dp-container-chain-genesis-data", "frame-support", "impl-trait-for-tuples", "macro_rules_attribute", diff --git a/pallets/registrar/src/benchmarks.rs b/pallets/registrar/src/benchmarks.rs index a047db874..6b504811b 100644 --- a/pallets/registrar/src/benchmarks.rs +++ b/pallets/registrar/src/benchmarks.rs @@ -119,7 +119,7 @@ mod benchmarks { create_funded_user::("caller", 0, T::DepositAmount::get()); #[extrinsic_call] - Pallet::::register(RawOrigin::Signed(caller), Default::default(), storage); + Pallet::::register(RawOrigin::Signed(caller), Default::default(), storage, None); // verification code assert_eq!(pending_verification_len::(), 1usize); @@ -165,6 +165,7 @@ mod benchmarks { proof, signature, storage, + None, ); // verification code @@ -188,6 +189,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); // Do not call mark_valid_for_collating, to ensure that the deregister call also executes the cleanup hooks @@ -224,6 +226,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); // Call mark_valid_for_collating to ensure that the deregister call @@ -273,6 +276,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); // Do not call mark_valid_for_collating, to ensure that the deregister call also executes the cleanup hooks @@ -326,6 +330,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); // Call mark_valid_for_collating to ensure that the deregister call @@ -393,6 +398,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); } @@ -406,6 +412,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), k.into(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(k.into()); @@ -445,6 +452,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), k.into(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(k.into()); @@ -461,6 +469,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(i.into()); @@ -509,6 +518,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), k.into(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(k.into()); @@ -525,6 +535,7 @@ mod benchmarks { RawOrigin::Signed(caller.clone()).into(), i.into(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(i.into()); @@ -568,6 +579,7 @@ mod benchmarks { Default::default(), slot_frequency, storage, + None, ); // verification code @@ -596,6 +608,7 @@ mod benchmarks { i.into(), slot_frequency.clone(), storage.clone(), + None, ) .unwrap(); T::RegistrarHooks::benchmarks_ensure_valid_for_collating(i.into()); diff --git a/pallets/registrar/src/lib.rs b/pallets/registrar/src/lib.rs index de3a086bc..0775831d5 100644 --- a/pallets/registrar/src/lib.rs +++ b/pallets/registrar/src/lib.rs @@ -43,6 +43,7 @@ pub use weights::WeightInfo; pub use pallet::*; use { + cumulus_primitives_core::relay_chain::HeadData, dp_chain_state_snapshot::GenericStateProof, dp_container_chain_genesis_data::ContainerChainGenesisData, frame_support::{ @@ -64,8 +65,8 @@ use { sp_std::{collections::btree_set::BTreeSet, prelude::*}, tp_traits::{ GetCurrentContainerChains, GetSessionContainerChains, GetSessionIndex, ParaId, - ParathreadParams as ParathreadParamsTy, RelayStorageRootProvider, SessionContainerChains, - SlotFrequency, + ParathreadParams as ParathreadParamsTy, RegistrarHandler, RelayStorageRootProvider, + SessionContainerChains, SlotFrequency, }, }; @@ -175,6 +176,14 @@ pub mod pallet { type RegistrarHooks: RegistrarHooks; + /// External manager that takes care of executing specific operations + /// when register-like functions of this pallet are called. + /// + /// Mostly used when we are in a relay-chain configuration context (Starlight) + /// to also register, deregister and upgrading paraIds in polkadot's + /// paras_registrar pallet. + type InnerRegistrar: RegistrarHandler; + type WeightInfo: WeightInfo; } @@ -235,6 +244,27 @@ pub mod pallet { ValueQuery, >; + /// This storage aims to act as a 'buffer' for paraIds that must be deregistered at the + /// end of the block execution by calling 'T::InnerRegistrar::deregister()' implementation. + /// + /// We need this buffer because when we are using this pallet on a relay-chain environment + /// like Starlight (where 'T::InnerRegistrar' implementation is usually the + /// 'paras_registrar' pallet) we need to deregister (via 'paras_registrar::deregister') + /// the same paraIds we have in 'PendingToRemove', and we need to do this deregistration + /// process inside 'on_finalize' hook. + /// + /// It can be the case that some paraIds need to be downgraded to a parathread before + /// deregistering on 'paras_registrar'. This process usually takes 2 sessions, + /// and the actual downgrade happens when the block finalizes. + /// + /// Therefore, if we tried to perform this relay deregistration process at the beginning + /// of the session/block inside ('on_initialize') initializer_on_new_session() as we do + /// for this pallet, it would fail due to the downgrade process could have not taken + /// place yet. + #[pallet::storage] + pub type BufferedParasToDeregister = + StorageValue<_, BoundedVec, ValueQuery>; + pub type DepositBalanceOf = <::Currency as Inspect<::AccountId>>::Balance; @@ -311,6 +341,10 @@ pub mod pallet { InvalidRelayManagerSignature, /// Tried to deregister a parachain that was not deregistered from the relay chain ParaStillExistsInRelay, + /// Tried to register a paraId in a relay context without specifying a proper HeadData. + HeadDataNecessary, + /// Tried to register a paraId in a relay context without specifying a wasm chain code. + WasmCodeNecessary, } #[pallet::composite_enum] @@ -320,6 +354,17 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { + fn on_initialize(_n: BlockNumberFor) -> Weight { + // Account for on_finalize weight + let mut weight = Weight::zero().saturating_add(T::DbWeight::get().reads(1)); + + let buffered_paras = BufferedParasToDeregister::::get(); + for _ in 0..buffered_paras.len() { + weight += T::InnerRegistrar::deregister_weight(); + } + weight + } + #[cfg(feature = "try-runtime")] fn try_state(_n: BlockNumberFor) -> Result<(), sp_runtime::TryRuntimeError> { use {scale_info::prelude::format, sp_std::collections::btree_set::BTreeSet}; @@ -421,6 +466,14 @@ pub mod pallet { Ok(()) } + + fn on_finalize(_: BlockNumberFor) { + let buffered_paras = BufferedParasToDeregister::::take(); + for para_id in buffered_paras { + // Deregister (in the relay context) each paraId present inside the buffer. + T::InnerRegistrar::deregister(para_id); + } + } } #[pallet::call] @@ -432,9 +485,10 @@ pub mod pallet { origin: OriginFor, para_id: ParaId, genesis_data: ContainerChainGenesisData, + head_data: Option, ) -> DispatchResult { let account = ensure_signed(origin)?; - Self::do_register(account, para_id, genesis_data)?; + Self::do_register(account, para_id, genesis_data, head_data)?; Self::deposit_event(Event::ParaIdRegistered { para_id }); Ok(()) @@ -538,9 +592,10 @@ pub mod pallet { para_id: ParaId, slot_frequency: SlotFrequency, genesis_data: ContainerChainGenesisData, + head_data: Option, ) -> DispatchResult { let account = ensure_signed(origin)?; - Self::do_register(account, para_id, genesis_data)?; + Self::do_register(account, para_id, genesis_data, head_data)?; // Insert parathread params let params = ParathreadParamsTy { slot_frequency }; ParathreadParams::::insert(para_id, params); @@ -605,6 +660,7 @@ pub mod pallet { relay_storage_proof: sp_trie::StorageProof, manager_signature: cumulus_primitives_core::relay_chain::Signature, genesis_data: ContainerChainGenesisData, + head_data: Option, ) -> DispatchResult { let account = T::RegisterWithRelayProofOrigin::ensure_origin(origin)?; let relay_storage_root = @@ -633,7 +689,7 @@ pub mod pallet { return Err(Error::::InvalidRelayManagerSignature.into()); } - Self::do_register(account, para_id, genesis_data)?; + Self::do_register(account, para_id, genesis_data, head_data)?; // Insert parathread params if let Some(parathread_params) = parathread_params { ParathreadParams::::insert(para_id, parathread_params); @@ -750,7 +806,12 @@ pub mod pallet { (T::Currency::minimum_balance() + T::DepositAmount::get()) * 2u32.into(); let account = create_funded_user::("caller", 1000, new_balance).0; let origin = RawOrigin::Signed(account); - assert_ok!(Self::register(origin.into(), *para_id, Default::default())); + assert_ok!(Self::register( + origin.into(), + *para_id, + Default::default(), + None + )); } let deposit_info = RegistrarDeposit::::get(para_id).expect("Cannot return signed origin for a container chain that was registered by root. Try using a different para id"); @@ -767,6 +828,7 @@ pub mod pallet { account: T::AccountId, para_id: ParaId, genesis_data: ContainerChainGenesisData, + head_data: Option, ) -> DispatchResult { let deposit = T::DepositAmount::get(); // Verify we can hold @@ -805,6 +867,14 @@ pub mod pallet { // Hold the deposit, we verified we can do this T::Currency::hold(&HoldReason::RegistrarDeposit.into(), &account, deposit)?; + // Register the paraId also in the relay context (if any). + T::InnerRegistrar::register( + account.clone(), + para_id, + &genesis_data.storage, + head_data, + )?; + // Update DepositInfo RegistrarDeposit::::insert( para_id, @@ -828,6 +898,13 @@ pub mod pallet { Self::deposit_event(Event::ParaIdDeregistered { para_id }); // Cleanup immediately Self::cleanup_deregistered_para_id(para_id); + BufferedParasToDeregister::::try_mutate(|v| v.try_push(para_id)).map_err( + |_e| { + DispatchError::Other( + "Failed to add paraId to deregistration list: buffer is full", + ) + }, + )?; } else { Self::schedule_paused_parachain_change(|para_ids, paused| { // We have to find out where, in the sorted vec the para id is, if anywhere. @@ -853,6 +930,18 @@ pub mod pallet { })?; // Mark this para id for cleanup later Self::schedule_parachain_cleanup(para_id)?; + + // If we have InnerRegistrar set to a relay context (like Starlight), + // we first need to downgrade the paraId (if it was a parachain before) + // and convert it to a parathread before deregistering it. Otherwise + // the deregistration process will fail in the scheduled session. + // + // We only downgrade if the paraId is a parachain in the context of + // this pallet. + if let None = ParathreadParams::::get(para_id) { + T::InnerRegistrar::schedule_para_downgrade(para_id)?; + } + Self::deposit_event(Event::ParaIdDeregistered { para_id }); } @@ -889,6 +978,15 @@ pub mod pallet { T::RegistrarHooks::para_marked_valid_for_collating(para_id); + // If we execute mark_valid_for_collating, we automatically upgrade + // the paraId to a parachain (in the relay context) at the end of the execution. + // + // We only upgrade if the paraId is a parachain in the context of + // this pallet. + if let None = ParathreadParams::::get(para_id) { + T::InnerRegistrar::schedule_para_upgrade(para_id)?; + } + Ok(()) } @@ -1168,6 +1266,15 @@ pub mod pallet { for para_id in new_paras { Self::cleanup_deregistered_para_id(*para_id); removed_para_ids.insert(*para_id); + if let Err(id) = + BufferedParasToDeregister::::try_mutate(|v| v.try_push(*para_id)) + { + log::error!( + target: LOG_TARGET, + "Failed to add paraId {:?} to deregistration list", + id + ); + } } } diff --git a/pallets/registrar/src/mock.rs b/pallets/registrar/src/mock.rs index 0b58df6ab..51ca7fd37 100644 --- a/pallets/registrar/src/mock.rs +++ b/pallets/registrar/src/mock.rs @@ -18,7 +18,7 @@ use { crate::{self as pallet_registrar, ParathreadParamsTy, RegistrarHooks}, dp_container_chain_genesis_data::ContainerChainGenesisData, frame_support::{ - traits::{ConstU16, ConstU64}, + traits::{ConstU16, ConstU64, OnFinalize, OnInitialize}, weights::Weight, }, parity_scale_codec::{Decode, Encode}, @@ -29,7 +29,7 @@ use { BuildStorage, }, std::collections::BTreeMap, - tp_traits::{ParaId, RelayStorageRootProvider}, + tp_traits::{ParaId, RegistrarHandler, RelayStorageRootProvider}, }; type Block = frame_system::mocking::MockBlock; @@ -148,6 +148,7 @@ impl pallet_registrar::Config for Test { type DepositAmount = DepositAmount; type RuntimeHoldReason = RuntimeHoldReason; type RegistrarHooks = Mock; + type InnerRegistrar = Mock; type WeightInfo = (); } @@ -195,6 +196,11 @@ pub mod mock_data { pub enum HookCall { MarkedValid(ParaId), Deregistered(ParaId), + InnerRegister(ParaId), + InnerScheduleParaUpgrade(ParaId), + InnerScheduleParaDowngrade(ParaId), + InnerDeregister(ParaId), + InnerDeregisterWeight, } pub enum HookCallType { @@ -230,6 +236,50 @@ impl RegistrarHooks for mock_data::Pallet { fn benchmarks_ensure_valid_for_collating(_para_id: ParaId) {} } +// We also use mock_data pallet to check whether InnerRegistrar methods are called properly. +impl RegistrarHandler for mock_data::Pallet { + fn register( + _who: AccountId, + id: ParaId, + _genesis_storage: &[tp_traits::ContainerChainGenesisDataItem], + _head_data: Option, + ) -> sp_runtime::DispatchResult { + Mock::mutate(|m| { + m.called_hooks.push(HookCall::InnerRegister(id)); + + Ok(()) + }) + } + + fn deregister(id: ParaId) { + Mock::mutate(|m| { + m.called_hooks.push(HookCall::InnerDeregister(id)); + }) + } + + fn schedule_para_upgrade(id: ParaId) -> sp_runtime::DispatchResult { + Mock::mutate(|m| { + m.called_hooks.push(HookCall::InnerScheduleParaUpgrade(id)); + Ok(()) + }) + } + + fn schedule_para_downgrade(id: ParaId) -> sp_runtime::DispatchResult { + Mock::mutate(|m| { + m.called_hooks + .push(HookCall::InnerScheduleParaDowngrade(id)); + Ok(()) + }) + } + + fn deregister_weight() -> Weight { + Mock::mutate(|m| { + m.called_hooks.push(HookCall::InnerDeregisterWeight); + Weight::default() + }) + } +} + impl mock_data::Config for Test {} #[derive( @@ -281,6 +331,7 @@ impl Mocks { } last_call_type.insert(*para_id, HookCallType::Deregistered); } + _ => {} } } } @@ -358,10 +409,15 @@ pub fn run_to_block(n: u64) { if x % SESSION_LEN == 1 { let session_index = (x / SESSION_LEN) as u32; ParaRegistrar::initializer_on_new_session(&session_index); + ParaRegistrar::on_initialize(session_index.into()); } } } +pub fn end_block() { + ParaRegistrar::on_finalize(System::block_number()); +} + pub fn get_ed25519_pairs(num: u32) -> Vec { let seed: u128 = 12345678901234567890123456789012; let mut pairs = Vec::new(); diff --git a/pallets/registrar/src/tests.rs b/pallets/registrar/src/tests.rs index bf4fccecc..0b3fd7515 100644 --- a/pallets/registrar/src/tests.rs +++ b/pallets/registrar/src/tests.rs @@ -35,7 +35,8 @@ fn register_para_id_42() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Assert that the correct event was deposited System::assert_last_event(Event::ParaIdRegistered { para_id: 42.into() }.into()); @@ -54,6 +55,14 @@ fn register_para_id_42() { run_to_session(2); assert_eq!(ParaRegistrar::registered_para_ids(), vec![42.into()]); assert_eq!(ParaRegistrar::pending_registered_para_ids(), vec![]); + + // Check that InnerRegistrar methods were called properly. + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerRegister(42u32.into()))); + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerScheduleParaUpgrade(42u32.into()))); }); } @@ -64,13 +73,15 @@ fn register_para_id_42_twice() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_noop!( ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None ), Error::::ParaIdAlreadyRegistered ); @@ -90,7 +101,7 @@ fn register_para_id_42_genesis_data_size_too_big() { properties: Default::default(), }; assert_noop!( - ParaRegistrar::register(RuntimeOrigin::signed(ALICE), 42.into(), genesis_data,), + ParaRegistrar::register(RuntimeOrigin::signed(ALICE), 42.into(), genesis_data, None), Error::::GenesisDataTooBig, ); }); @@ -114,7 +125,8 @@ fn deregister_para_id_42_after_0_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -150,7 +162,8 @@ fn deregister_para_id_42_after_1_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -189,6 +202,30 @@ fn deregister_para_id_42_after_1_sessions() { assert_eq!(ParaRegistrar::pending_registered_para_ids(), vec![]); assert_eq!(ParaRegistrar::registered_para_ids(), vec![]); assert!(ParaRegistrar::para_genesis_data(ParaId::from(42)).is_none()); + + // Run two more sessions for the paraId to get deregistered + // in the relay context (if any) via InnerRegistrar. + run_to_session(5); + // Run end_block after run_to_session to mock the reality and + // kill BufferedParasToDeregister storage after a session change. + end_block(); + + // Check that InnerRegistrar methods were called properly. + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerRegister(42u32.into()))); + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerScheduleParaUpgrade(42u32.into()))); + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerScheduleParaDowngrade(42u32.into()))); + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerDeregister(42u32.into()))); + assert!(Mock::mock() + .called_hooks + .contains(&HookCall::InnerDeregisterWeight)); }); } @@ -199,7 +236,8 @@ fn deregister_para_id_42_after_2_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -242,7 +280,8 @@ fn deregister_para_id_42_twice() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -280,6 +319,7 @@ fn deregister_para_id_removes_genesis_data() { RuntimeOrigin::signed(ALICE), 42.into(), genesis_data.clone(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -321,7 +361,7 @@ fn register_para_id_bad_origin() { new_test_ext().execute_with(|| { run_to_block(1); assert_noop!( - ParaRegistrar::register(RuntimeOrigin::root(), 42.into(), empty_genesis_data()), + ParaRegistrar::register(RuntimeOrigin::root(), 42.into(), empty_genesis_data(), None), DispatchError::BadOrigin ); }); @@ -356,7 +396,8 @@ fn pause_para_id_42_works() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Enable the container-chain for the first time @@ -397,7 +438,8 @@ fn pause_para_id_42_twice_fails() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Enable the container-chain for collating @@ -457,7 +499,8 @@ fn unpause_para_id_that_is_not_paused_fails() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Enable the container-chain for collating @@ -488,7 +531,8 @@ fn unpause_para_id_42_twice_fails() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Enable the container-chain for collating @@ -607,7 +651,8 @@ fn register_without_mark_valid_for_collating() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Assert that the correct event was deposited System::assert_last_event(Event::ParaIdRegistered { para_id: 42.into() }.into()); @@ -627,7 +672,8 @@ fn mark_valid_for_collating_twice() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -658,7 +704,8 @@ fn mark_valid_for_collating_already_valid_para_id() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Assert that the correct event was deposited System::assert_last_event(Event::ParaIdRegistered { para_id: 42.into() }.into()); @@ -684,16 +731,24 @@ fn mark_valid_for_collating_calls_registered_hook() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); - assert_eq!(Mock::mock().called_hooks, vec![]); + assert_eq!( + Mock::mock().called_hooks, + vec![HookCall::InnerRegister(42.into())] + ); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), 42.into(), )); assert_eq!( Mock::mock().called_hooks, - vec![HookCall::MarkedValid(42.into())] + vec![ + HookCall::InnerRegister(42.into()), + HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()) + ] ); }); } @@ -707,7 +762,8 @@ fn deregister_returns_bond_immediately_if_not_marked_as_valid() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_eq!(Balances::free_balance(ALICE), balance_before - bond); @@ -727,7 +783,8 @@ fn deregister_returns_bond_after_2_sessions_if_marked_as_valid() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -751,7 +808,8 @@ fn can_deregister_before_valid_for_collating() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::deregister(RuntimeOrigin::root(), 42.into(),)); @@ -766,7 +824,8 @@ fn can_deregister_paused_para_id_after_0_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -800,7 +859,8 @@ fn can_deregister_paused_para_id_after_1_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -840,7 +900,8 @@ fn can_deregister_paused_para_id_after_2_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -882,7 +943,8 @@ fn cannot_register_same_para_id_while_deregister_is_pending() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -894,6 +956,7 @@ fn cannot_register_same_para_id_while_deregister_is_pending() { RuntimeOrigin::signed(ALICE), 42.into(), empty_genesis_data(), + None ), Error::::ParaIdAlreadyRegistered, ); @@ -903,6 +966,7 @@ fn cannot_register_same_para_id_while_deregister_is_pending() { RuntimeOrigin::signed(ALICE), 42.into(), empty_genesis_data(), + None ), Error::::ParaIdAlreadyRegistered, ); @@ -910,7 +974,8 @@ fn cannot_register_same_para_id_while_deregister_is_pending() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); }); } @@ -922,7 +987,8 @@ fn register_deregister_register_in_same_block() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_eq!( ParaRegistrar::para_genesis_data(ParaId::from(42)).as_ref(), @@ -945,6 +1011,7 @@ fn register_deregister_register_in_same_block() { RuntimeOrigin::signed(ALICE), 42.into(), new_genesis_data.clone(), + None )); assert_eq!( ParaRegistrar::para_genesis_data(ParaId::from(42)).as_ref(), @@ -965,12 +1032,14 @@ fn deregister_2_container_chains_in_same_block() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 43.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -982,6 +1051,10 @@ fn deregister_2_container_chains_in_same_block() { )); run_to_session(2); + // Run end_block after each run_to_session to mock the reality and + // kill BufferedParasToDeregister storage after a session change. + end_block(); + assert_eq!( ParaRegistrar::registered_para_ids(), vec![42.into(), 43.into()] @@ -999,12 +1072,20 @@ fn deregister_2_container_chains_in_same_block() { assert_eq!( Mock::mock().called_hooks, vec![ + HookCall::InnerRegister(42.into()), + HookCall::InnerRegister(43.into()), HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()), HookCall::MarkedValid(43.into()), + HookCall::InnerScheduleParaUpgrade(43.into()), + HookCall::InnerScheduleParaDowngrade(42.into()), + HookCall::InnerScheduleParaDowngrade(43.into()), ] ); run_to_session(4); + end_block(); + assert_eq!(ParaRegistrar::registered_para_ids(), vec![]); assert_eq!( ParaRegistrar::para_genesis_data(ParaId::from(42)).as_ref(), @@ -1017,10 +1098,20 @@ fn deregister_2_container_chains_in_same_block() { assert_eq!( Mock::mock().called_hooks, vec![ + HookCall::InnerRegister(42.into()), + HookCall::InnerRegister(43.into()), HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()), HookCall::MarkedValid(43.into()), + HookCall::InnerScheduleParaUpgrade(43.into()), + HookCall::InnerScheduleParaDowngrade(42.into()), + HookCall::InnerScheduleParaDowngrade(43.into()), HookCall::Deregistered(42.into()), HookCall::Deregistered(43.into()), + HookCall::InnerDeregisterWeight, + HookCall::InnerDeregisterWeight, + HookCall::InnerDeregister(42.into()), + HookCall::InnerDeregister(43.into()), ] ); }); @@ -1033,12 +1124,14 @@ fn deregister_2_container_chains_in_consecutive_sessions() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 43.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(ParaRegistrar::mark_valid_for_collating( RuntimeOrigin::root(), @@ -1050,6 +1143,10 @@ fn deregister_2_container_chains_in_consecutive_sessions() { )); run_to_session(2); + // Run end_block after each run_to_session to mock the reality and + // kill BufferedParasToDeregister storage after a session change. + end_block(); + assert_eq!( ParaRegistrar::registered_para_ids(), vec![42.into(), 43.into()] @@ -1065,6 +1162,7 @@ fn deregister_2_container_chains_in_consecutive_sessions() { assert_ok!(ParaRegistrar::deregister(RuntimeOrigin::root(), 42.into(),)); run_to_session(3); + end_block(); assert_eq!( ParaRegistrar::registered_para_ids(), vec![42.into(), 43.into()] @@ -1081,12 +1179,19 @@ fn deregister_2_container_chains_in_consecutive_sessions() { assert_eq!( Mock::mock().called_hooks, vec![ + HookCall::InnerRegister(42.into()), + HookCall::InnerRegister(43.into()), HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()), HookCall::MarkedValid(43.into()), + HookCall::InnerScheduleParaUpgrade(43.into()), + HookCall::InnerScheduleParaDowngrade(42.into()), + HookCall::InnerScheduleParaDowngrade(43.into()), ] ); run_to_session(4); + end_block(); assert_eq!(ParaRegistrar::registered_para_ids(), vec![43.into()]); assert_eq!( ParaRegistrar::para_genesis_data(ParaId::from(42)).as_ref(), @@ -1099,13 +1204,22 @@ fn deregister_2_container_chains_in_consecutive_sessions() { assert_eq!( Mock::mock().called_hooks, vec![ + HookCall::InnerRegister(42.into()), + HookCall::InnerRegister(43.into()), HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()), HookCall::MarkedValid(43.into()), + HookCall::InnerScheduleParaUpgrade(43.into()), + HookCall::InnerScheduleParaDowngrade(42.into()), + HookCall::InnerScheduleParaDowngrade(43.into()), HookCall::Deregistered(42.into()), + HookCall::InnerDeregisterWeight, + HookCall::InnerDeregister(42.into()), ] ); run_to_session(5); + end_block(); assert_eq!(ParaRegistrar::registered_para_ids(), vec![]); assert_eq!( ParaRegistrar::para_genesis_data(ParaId::from(42)).as_ref(), @@ -1118,10 +1232,20 @@ fn deregister_2_container_chains_in_consecutive_sessions() { assert_eq!( Mock::mock().called_hooks, vec![ + HookCall::InnerRegister(42.into()), + HookCall::InnerRegister(43.into()), HookCall::MarkedValid(42.into()), + HookCall::InnerScheduleParaUpgrade(42.into()), HookCall::MarkedValid(43.into()), + HookCall::InnerScheduleParaUpgrade(43.into()), + HookCall::InnerScheduleParaDowngrade(42.into()), + HookCall::InnerScheduleParaDowngrade(43.into()), HookCall::Deregistered(42.into()), + HookCall::InnerDeregisterWeight, + HookCall::InnerDeregister(42.into()), HookCall::Deregistered(43.into()), + HookCall::InnerDeregisterWeight, + HookCall::InnerDeregister(43.into()), ] ); }); @@ -1134,7 +1258,8 @@ fn deposit_removed_on_deregister_if_not_marked_as_valid() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert!(ParaRegistrar::para_genesis_data(ParaId::from(42)).is_some()); @@ -1154,7 +1279,8 @@ fn deposit_removed_after_2_sessions_if_marked_as_valid() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1183,7 +1309,8 @@ fn parathread_change_params_after_two_sessions() { RuntimeOrigin::signed(ALICE), 42.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1217,7 +1344,8 @@ fn parathread_params_cannot_be_set_for_parachains() { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1243,7 +1371,8 @@ fn parathread_register_change_params_deregister() { RuntimeOrigin::signed(ALICE), 42.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1279,7 +1408,8 @@ fn parathread_register_deregister_change_params() { RuntimeOrigin::signed(ALICE), 42.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1353,6 +1483,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None )); System::assert_last_event(Event::ParaIdRegistered { para_id: 42.into() }.into()); @@ -1397,6 +1528,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::RelayStorageRootNotFound ); @@ -1447,6 +1579,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::InvalidRelayStorageProof ); @@ -1483,6 +1616,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::InvalidRelayStorageProof ); @@ -1531,6 +1665,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::InvalidRelayManagerSignature ); @@ -1579,6 +1714,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::InvalidRelayStorageProof ); @@ -1629,6 +1765,7 @@ mod register_with_relay_proof { proof, signature, empty_genesis_data(), + None ), Error::::InvalidRelayManagerSignature ); @@ -1647,7 +1784,8 @@ mod deregister_with_relay_proof { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1706,7 +1844,8 @@ mod deregister_with_relay_proof { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_eq!( @@ -1762,7 +1901,8 @@ mod deregister_with_relay_proof { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1795,7 +1935,8 @@ mod deregister_with_relay_proof { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1843,7 +1984,8 @@ mod deregister_with_relay_proof { assert_ok!(ParaRegistrar::register( RuntimeOrigin::signed(ALICE), 42.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert!(ParaRegistrar::registrar_deposit(ParaId::from(42)).is_some()); assert_ok!(ParaRegistrar::mark_valid_for_collating( @@ -1881,7 +2023,8 @@ fn weights_assigned_to_extrinsics_are_correct() { assert_eq!( crate::Call::::register { para_id: 42.into(), - genesis_data: empty_genesis_data() + genesis_data: empty_genesis_data(), + head_data: None } .get_dispatch_info() .weight, diff --git a/primitives/traits/Cargo.toml b/primitives/traits/Cargo.toml index 07f35a68f..55bc6a110 100644 --- a/primitives/traits/Cargo.toml +++ b/primitives/traits/Cargo.toml @@ -11,6 +11,7 @@ workspace = true [dependencies] dp-chain-state-snapshot = { workspace = true } +dp-container-chain-genesis-data = { workspace = true } frame-support = { workspace = true } impl-trait-for-tuples = { workspace = true } macro_rules_attribute = { workspace = true } @@ -29,6 +30,7 @@ default = [ "std" ] std = [ "cumulus-primitives-core/std", "dp-chain-state-snapshot/std", + "dp-container-chain-genesis-data/std", "frame-support/std", "parity-scale-codec/std", "scale-info/std", diff --git a/primitives/traits/src/lib.rs b/primitives/traits/src/lib.rs index 9bb699d15..ace2bc820 100644 --- a/primitives/traits/src/lib.rs +++ b/primitives/traits/src/lib.rs @@ -24,10 +24,11 @@ pub mod alias; pub use { alias::*, cumulus_primitives_core::{ - relay_chain::{BlockNumber, Slot}, + relay_chain::{BlockNumber, HeadData, Slot, ValidationCode}, ParaId, }, dp_chain_state_snapshot::{GenericStateProof, ReadEntryErr}, + dp_container_chain_genesis_data::ContainerChainGenesisDataItem, }; use { core::marker::PhantomData, @@ -41,7 +42,7 @@ use { sp_runtime::{ app_crypto::sp_core, traits::{CheckedAdd, CheckedMul}, - ArithmeticError, Perbill, + ArithmeticError, DispatchResult, Perbill, }, sp_std::{collections::btree_set::BTreeSet, vec::Vec}, }; @@ -385,3 +386,45 @@ impl GenericStorageReader for NativeStorageReader { } } } + +/// Trait to handle registrar-related operations in a relay-chain context. +/// Mostly used to wire Tanssi's and Polkadot's registrars, for them to +/// work together in a solo-chain environment. +pub trait RegistrarHandler { + fn register( + who: AccountId, + id: ParaId, + genesis_storage: &[ContainerChainGenesisDataItem], + head_data: Option, + ) -> DispatchResult; + + fn schedule_para_upgrade(id: ParaId) -> DispatchResult; + fn schedule_para_downgrade(id: ParaId) -> DispatchResult; + fn deregister(id: ParaId); + fn deregister_weight() -> Weight; +} + +impl RegistrarHandler for () { + fn register( + _who: AccountId, + _id: ParaId, + _genesis_storage: &[ContainerChainGenesisDataItem], + _head_data: Option, + ) -> DispatchResult { + Ok(()) + } + + fn schedule_para_upgrade(_id: ParaId) -> DispatchResult { + Ok(()) + } + + fn schedule_para_downgrade(_id: ParaId) -> DispatchResult { + Ok(()) + } + + fn deregister(_id: ParaId) {} + + fn deregister_weight() -> Weight { + Weight::default() + } +} diff --git a/runtime/dancebox/src/lib.rs b/runtime/dancebox/src/lib.rs index 93193e93d..0b76eb621 100644 --- a/runtime/dancebox/src/lib.rs +++ b/runtime/dancebox/src/lib.rs @@ -1260,6 +1260,7 @@ impl pallet_registrar::Config for Runtime { type DepositAmount = DepositAmount; type RegistrarHooks = DanceboxRegistrarHooks; type RuntimeHoldReason = RuntimeHoldReason; + type InnerRegistrar = (); type WeightInfo = weights::pallet_registrar::SubstrateWeight; } diff --git a/runtime/dancebox/src/tests/common/xcm/core_buyer_common.rs b/runtime/dancebox/src/tests/common/xcm/core_buyer_common.rs index 5642ad872..6fece11f9 100644 --- a/runtime/dancebox/src/tests/common/xcm/core_buyer_common.rs +++ b/runtime/dancebox/src/tests/common/xcm/core_buyer_common.rs @@ -224,7 +224,8 @@ pub fn do_test( alice_origin.clone(), PARATHREAD_ID.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(alice_origin, PARATHREAD_ID.into()); let root_origin = ::RuntimeOrigin::root(); diff --git a/runtime/dancebox/src/tests/integration_test.rs b/runtime/dancebox/src/tests/integration_test.rs index c65c64f6d..465c435e1 100644 --- a/runtime/dancebox/src/tests/integration_test.rs +++ b/runtime/dancebox/src/tests/integration_test.rs @@ -240,7 +240,8 @@ fn genesis_para_registrar_container_chain_genesis_data_runtime_api() { Registrar::register( origin_of(ALICE.into()), 1003.into(), - genesis_data_1003.clone() + genesis_data_1003.clone(), + None ), () ); @@ -493,7 +494,8 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -508,7 +510,8 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1002.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -578,7 +581,8 @@ fn test_authors_paras_inserted_a_posteriori_with_collators_already_assigned() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -642,7 +646,8 @@ fn test_paras_registered_but_zero_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -700,7 +705,8 @@ fn test_paras_registered_but_not_enough_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -779,7 +785,8 @@ fn test_paras_registered_but_only_credits_for_1_session() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4153,7 +4160,8 @@ fn test_cannot_mark_valid_para_with_no_bootnodes() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_noop!( Registrar::mark_valid_for_collating(root_origin(), 1001.into()), @@ -4217,7 +4225,8 @@ fn test_can_buy_credits_before_registering_para_and_receive_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4257,7 +4266,8 @@ fn test_deregister_and_register_again_does_not_give_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None ),); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4286,7 +4296,8 @@ fn test_deregister_and_register_again_does_not_give_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None ),); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4478,7 +4489,8 @@ fn test_register_parathread() { origin_of(ALICE.into()), 3001.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 3001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4571,7 +4583,8 @@ fn test_ed_plus_block_credit_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4667,7 +4680,8 @@ fn test_ed_plus_block_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4734,7 +4748,8 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4842,7 +4857,8 @@ fn test_reassignment_ed_plus_two_block_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -4941,7 +4957,8 @@ fn test_block_credits_with_purchase_can_be_combined() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5078,7 +5095,8 @@ fn test_ed_plus_collator_assignment_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5173,7 +5191,8 @@ fn test_ed_plus_collator_assignment_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5240,7 +5259,8 @@ fn test_collator_assignment_credits_with_purchase_can_be_combined() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5311,7 +5331,8 @@ fn test_block_credits_and_collator_assignation_credits_through_tank() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5373,7 +5394,8 @@ fn test_migration_services_collator_assignment_payment() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5384,7 +5406,8 @@ fn test_migration_services_collator_assignment_payment() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1002.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -5961,12 +5984,14 @@ fn test_migration_data_preservers_assignments() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(Registrar::register( origin_of(BOB.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Set bootnodes in old storage @@ -6150,7 +6175,8 @@ fn test_container_deregister_unassign_data_preserver() { assert_ok!(Registrar::register( origin_of(ALICE.into()), para_id, - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(DataPreservers::create_profile( diff --git a/runtime/flashbox/src/lib.rs b/runtime/flashbox/src/lib.rs index 3fe027bf3..5f969bdef 100644 --- a/runtime/flashbox/src/lib.rs +++ b/runtime/flashbox/src/lib.rs @@ -1103,6 +1103,7 @@ impl pallet_registrar::Config for Runtime { type DepositAmount = DepositAmount; type RegistrarHooks = FlashboxRegistrarHooks; type RuntimeHoldReason = RuntimeHoldReason; + type InnerRegistrar = (); type WeightInfo = weights::pallet_registrar::SubstrateWeight; } diff --git a/runtime/flashbox/src/tests/integration_test.rs b/runtime/flashbox/src/tests/integration_test.rs index 57d9f1264..7e3593aea 100644 --- a/runtime/flashbox/src/tests/integration_test.rs +++ b/runtime/flashbox/src/tests/integration_test.rs @@ -252,7 +252,8 @@ fn genesis_para_registrar_container_chain_genesis_data_runtime_api() { Registrar::register( origin_of(ALICE.into()), 1003.into(), - genesis_data_1003.clone() + genesis_data_1003.clone(), + None ), () ); @@ -505,7 +506,8 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -520,7 +522,8 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1002.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -590,7 +593,8 @@ fn test_authors_paras_inserted_a_posteriori_with_collators_already_assigned() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -654,7 +658,8 @@ fn test_paras_registered_but_zero_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -712,7 +717,8 @@ fn test_paras_registered_but_not_enough_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -791,7 +797,8 @@ fn test_paras_registered_but_only_credits_for_1_session() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2368,7 +2375,8 @@ fn test_cannot_mark_valid_para_with_no_bootnodes() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_noop!( Registrar::mark_valid_for_collating(root_origin(), 1001.into()), @@ -2432,7 +2440,8 @@ fn test_can_buy_credits_before_registering_para_and_receive_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2472,7 +2481,8 @@ fn test_deregister_and_register_again_does_not_give_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None ),); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2501,7 +2511,8 @@ fn test_deregister_and_register_again_does_not_give_free_credits() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None ),); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2541,7 +2552,8 @@ fn test_register_parathread() { origin_of(ALICE.into()), 3001.into(), SlotFrequency { min: 1, max: 1 }, - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 3001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2634,7 +2646,8 @@ fn test_ed_plus_block_credit_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2730,7 +2743,8 @@ fn test_ed_plus_block_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2797,7 +2811,8 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -2905,7 +2920,8 @@ fn test_reassignment_ed_plus_two_block_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3004,7 +3020,8 @@ fn test_credits_with_purchase_can_be_combined() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3141,7 +3158,8 @@ fn test_ed_plus_collator_assignment_session_purchase_works() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3236,7 +3254,8 @@ fn test_ed_plus_collator_assignment_credit_session_minus_1_purchase_fails() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3303,7 +3322,8 @@ fn test_collator_assignment_credits_with_purchase_can_be_combined() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3374,7 +3394,8 @@ fn test_block_credits_and_collator_assignation_credits_through_tank() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3436,7 +3457,8 @@ fn test_migration_services_collator_assignment_payment() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3447,7 +3469,8 @@ fn test_migration_services_collator_assignment_payment() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); set_dummy_boot_node(origin_of(ALICE.into()), 1002.into()); assert_ok!(Registrar::mark_valid_for_collating( @@ -3936,12 +3959,14 @@ fn test_migration_data_preservers_assignments() { assert_ok!(Registrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(Registrar::register( origin_of(BOB.into()), 1002.into(), - empty_genesis_data() + empty_genesis_data(), + None )); // Set bootnodes in old storage @@ -4125,7 +4150,8 @@ fn test_container_deregister_unassign_data_preserver() { assert_ok!(Registrar::register( origin_of(ALICE.into()), para_id, - empty_genesis_data() + empty_genesis_data(), + None )); assert_ok!(DataPreservers::create_profile( diff --git a/solo-chains/runtime/starlight/src/lib.rs b/solo-chains/runtime/starlight/src/lib.rs index 09a31ac7b..e390e3011 100644 --- a/solo-chains/runtime/starlight/src/lib.rs +++ b/solo-chains/runtime/starlight/src/lib.rs @@ -21,7 +21,7 @@ #![recursion_limit = "512"] // Fix compile error in impl_runtime_weights! macro -use runtime_common as polkadot_runtime_common; +use runtime_common::{self as polkadot_runtime_common}; use { authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId, @@ -29,6 +29,8 @@ use { ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, mmr::{BeefyDataProvider, MmrLeafVersion}, }, + cumulus_primitives_core::relay_chain::{HeadData, ValidationCode}, + dp_container_chain_genesis_data::ContainerChainGenesisDataItem, frame_support::{ dispatch::{DispatchErrorWithPostInfo, DispatchResult}, dynamic_params::{dynamic_pallet_params, dynamic_params}, @@ -38,6 +40,7 @@ use { nimbus_primitives::NimbusId, pallet_collator_assignment::{GetRandomnessForNextBlock, RotateCollatorsEveryNSessions}, pallet_initializer as tanssi_initializer, + pallet_registrar::Error as ContainerRegistrarError, pallet_registrar_runtime_api::ContainerChainGenesisData, pallet_services_payment::{ProvideBlockProductionCost, ProvideCollatorAssignmentCost}, pallet_session::ShouldEndSession, @@ -48,7 +51,7 @@ use { CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment, NodeFeatures, Nonce, OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes, - SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, + SessionInfo, Signature, ValidationCodeHash, ValidatorId, ValidatorIndex, PARACHAIN_KEY_TYPE_ID, }, runtime_common::{ @@ -57,7 +60,9 @@ use { ContainsParts, LocatableAssetConverter, ToAuthor, VersionedLocatableAsset, VersionedLocationConverter, }, - paras_registrar, paras_sudo_wrapper, BlockHashCount, BlockLength, SlowAdjustingFeeUpdate, + paras_registrar, paras_sudo_wrapper, + traits::Registrar as RegistrarInterface, + BlockHashCount, BlockLength, SlowAdjustingFeeUpdate, }, runtime_parachains::{ assigner_on_demand as parachains_assigner_on_demand, @@ -75,7 +80,7 @@ use { }, scale_info::TypeInfo, serde::{Deserialize, Serialize}, - sp_core::Get, + sp_core::{storage::well_known_keys as StorageWellKnownKeys, Get}, sp_genesis_builder::PresetId, sp_runtime::traits::BlockNumberProvider, sp_std::{ @@ -85,8 +90,8 @@ use { prelude::*, }, tp_traits::{ - apply, derive_storage_traits, GetSessionContainerChains, RemoveParaIdsWithNoCredits, Slot, - SlotFrequency, + apply, derive_storage_traits, GetSessionContainerChains, RegistrarHandler, + RemoveParaIdsWithNoCredits, Slot, SlotFrequency, }, }; @@ -1606,6 +1611,73 @@ parameter_types! { pub const MaxLengthParaIds: u32 = 100u32; pub const MaxEncodedGenesisDataSize: u32 = 5_000_000u32; // 5MB } + +pub struct InnerStarlightRegistrar( + PhantomData<(Runtime, AccountId, RegistrarManager, RegistrarWeightInfo)>, +); +impl RegistrarHandler + for InnerStarlightRegistrar +where + RegistrarManager: RegistrarInterface, + RegistrarWeightInfo: paras_registrar::WeightInfo, + Runtime: pallet_registrar::Config, +{ + fn register( + who: AccountId, + id: ParaId, + genesis_storage: &[ContainerChainGenesisDataItem], + head_data: Option, + ) -> DispatchResult { + // Return early if head_data is not specified + let genesis_head = match head_data { + Some(data) => data, + None => return Err(ContainerRegistrarError::::HeadDataNecessary.into()), + }; + + // Check if the wasm code is present in storage + let validation_code = match genesis_storage + .into_iter() + .find(|item| item.key == StorageWellKnownKeys::CODE) + { + Some(item) => ValidationCode(item.value.clone()), + None => return Err(ContainerRegistrarError::::WasmCodeNecessary.into()), + }; + + // Try to register the parachain + RegistrarManager::register(who, id, genesis_head, validation_code) + } + + fn schedule_para_upgrade(id: ParaId) -> DispatchResult { + // Return Ok() if the paraId is already a parachain in the relay context + if !RegistrarManager::is_parachain(id) { + return RegistrarManager::make_parachain(id); + } + Ok(()) + } + + fn schedule_para_downgrade(id: ParaId) -> DispatchResult { + // Return Ok() if the paraId is already a parathread in the relay context + if !RegistrarManager::is_parathread(id) { + return RegistrarManager::make_parathread(id); + } + Ok(()) + } + + fn deregister(id: ParaId) { + if let Err(e) = RegistrarManager::deregister(id) { + log::warn!( + "Failed to deregister para id {} in relay chain: {:?}", + u32::from(id), + e, + ); + } + } + + fn deregister_weight() -> Weight { + RegistrarWeightInfo::deregister() + } +} + impl pallet_registrar::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RegistrarOrigin = EnsureRoot; @@ -1621,6 +1693,9 @@ impl pallet_registrar::Config for Runtime { type DepositAmount = DepositAmount; type RegistrarHooks = StarlightRegistrarHooks; type RuntimeHoldReason = RuntimeHoldReason; + // TODO: replace TestWeightInfo when we use proper weights on paras_registrar + type InnerRegistrar = + InnerStarlightRegistrar; type WeightInfo = pallet_registrar::weights::SubstrateWeight; } diff --git a/solo-chains/runtime/starlight/src/tests/collator_assignment_tests.rs b/solo-chains/runtime/starlight/src/tests/collator_assignment_tests.rs index f4f037c81..658a7e98f 100644 --- a/solo-chains/runtime/starlight/src/tests/collator_assignment_tests.rs +++ b/solo-chains/runtime/starlight/src/tests/collator_assignment_tests.rs @@ -19,11 +19,12 @@ use { crate::{ tests::common::*, BabeCurrentBlockRandomnessGetter, Balances, CollatorConfiguration, - ContainerRegistrar, ServicesPayment, TanssiAuthorityMapping, TanssiInvulnerables, + ContainerRegistrar, Paras, ServicesPayment, TanssiAuthorityMapping, TanssiInvulnerables, }, - cumulus_primitives_core::ParaId, - frame_support::assert_ok, + cumulus_primitives_core::{relay_chain::HeadData, ParaId}, + frame_support::{assert_noop, assert_ok}, parity_scale_codec::Encode, + runtime_common::paras_registrar, sp_consensus_aura::AURA_ENGINE_ID, sp_runtime::{traits::BlakeTwo256, DigestItem}, sp_std::vec, @@ -660,9 +661,21 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( root_origin(), @@ -678,9 +691,13 @@ fn test_authors_paras_inserted_a_posteriori() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1002.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + // Assignment should happen after 2 sessions + run_to_session(6); + set_dummy_boot_node(origin_of(ALICE.into()), 1002.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( root_origin(), @@ -693,12 +710,6 @@ fn test_authors_paras_inserted_a_posteriori() { block_credits_to_required_balance(1000, 1002.into()) )); - // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); - // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -733,9 +744,23 @@ fn test_authors_paras_inserted_a_posteriori_with_collators_already_assigned() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -749,10 +774,7 @@ fn test_authors_paras_inserted_a_posteriori_with_collators_already_assigned() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob are now assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); @@ -763,6 +785,62 @@ fn test_authors_paras_inserted_a_posteriori_with_collators_already_assigned() { }); } +#[test] +fn test_collators_not_assigned_if_wasm_code_is_invalid() { + ExtBuilder::default() + .with_balances(vec![ + // Alice gets 10k extra tokens for her mapping deposit + (AccountId::from(ALICE), 210_000 * UNIT), + (AccountId::from(BOB), 100_000 * UNIT), + ]) + .with_collators(vec![ + (AccountId::from(ALICE), 210 * UNIT), + (AccountId::from(BOB), 100 * UNIT), + ]) + .with_config(pallet_configuration::HostConfiguration { + max_collators: 100, + min_orchestrator_collators: 2, + max_orchestrator_collators: 5, + collators_per_container: 2, + full_rotation_period: 24, + ..Default::default() + }) + .build() + .execute_with(|| { + assert_ok!(ContainerRegistrar::register( + origin_of(ALICE.into()), + 1001.into(), + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) + )); + + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // In session 2, we should mark the validation code as trusted in the relay + // for the paraId to be onboarded as a parathread after 2 sessions. + // We won't do it now to see what happens. + run_to_session(4); + + // paraId should not have been onboarded after 2 sessions. + assert!(Paras::lifecycle(1001u32.into()).is_none()); + + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); + + // mark_valid_for_collating() should fail, as the paraId has not been onboarded yet, + // due to its validation code is not trusted. + assert_noop!( + ContainerRegistrar::mark_valid_for_collating(root_origin(), 1001.into()), + paras_registrar::Error::::NotParathread + ); + + // paraId should not have any collators assigned. + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + }); +} + #[test] fn test_paras_registered_but_zero_credits() { ExtBuilder::default() @@ -780,9 +858,23 @@ fn test_paras_registered_but_zero_credits() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -797,10 +889,7 @@ fn test_paras_registered_but_zero_credits() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); @@ -825,8 +914,22 @@ fn test_paras_registered_but_not_enough_credits() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) + )); + + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); @@ -849,10 +952,7 @@ fn test_paras_registered_but_not_enough_credits() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None); @@ -864,7 +964,7 @@ fn test_paras_registered_but_not_enough_credits() { credits_1001 + 1 )); - run_to_session(4u32); + run_to_session(8u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -891,9 +991,23 @@ fn test_paras_registered_but_only_credits_for_1_session() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -915,10 +1029,7 @@ fn test_paras_registered_but_only_credits_for_1_session() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -957,7 +1068,7 @@ fn test_paras_registered_but_only_credits_for_1_session() { .unwrap_or_default(); assert_eq!(credits, credits_1001 - 1); - run_to_session(4u32); + run_to_session(8u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1061,9 +1172,20 @@ fn test_can_buy_credits_before_registering_para_and_receive_free_credits() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) + )); + + run_to_session(2); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() )); + run_to_session(4); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1096,9 +1218,22 @@ fn test_ed_plus_block_credit_session_purchase_works() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + + run_to_session(4); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1122,11 +1257,7 @@ fn test_ed_plus_block_credit_session_purchase_works() { credits_1001 )); - // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1156,7 +1287,7 @@ fn test_ed_plus_block_credit_session_purchase_works() { run_block(); // After this it should not be assigned anymore, since credits are not payable - run_to_session(3u32); + run_to_session(7u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1180,9 +1311,24 @@ fn test_ed_plus_block_credit_session_minus_1_purchase_fails() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1207,11 +1353,7 @@ fn test_ed_plus_block_credit_session_minus_1_purchase_fails() { credits_1001 )); - // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should not be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1235,9 +1377,24 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) + )); + + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1264,11 +1421,7 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1298,7 +1451,7 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { run_block(); // Session 3 should still be assigned - run_to_session(3u32); + run_to_session(7u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1307,7 +1460,7 @@ fn test_reassignment_ed_plus_two_block_credit_session_purchase_works() { ); // After this it should not be assigned anymore, since credits are not payable - run_to_session(4u32); + run_to_session(8u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); @@ -1332,9 +1485,24 @@ fn test_reassignment_ed_plus_two_block_credit_session_minus_1_purchase_fails() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1361,11 +1529,7 @@ fn test_reassignment_ed_plus_two_block_credit_session_minus_1_purchase_fails() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1395,7 +1559,7 @@ fn test_reassignment_ed_plus_two_block_credit_session_minus_1_purchase_fails() { run_block(); // After this it should not be assigned anymore, since credits are not payable - run_to_session(3u32); + run_to_session(7u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1419,9 +1583,23 @@ fn test_credits_with_purchase_can_be_combined() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1446,10 +1624,7 @@ fn test_credits_with_purchase_can_be_combined() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1476,9 +1651,23 @@ fn test_ed_plus_collator_assignment_session_purchase_works() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1502,10 +1691,7 @@ fn test_ed_plus_collator_assignment_session_purchase_works() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1534,7 +1720,7 @@ fn test_ed_plus_collator_assignment_session_purchase_works() { run_block(); // After this it should not be assigned anymore, since credits are not payable - run_to_session(4u32); + run_to_session(8u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1558,9 +1744,23 @@ fn test_ed_plus_collator_assignment_credit_session_minus_1_purchase_fails() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1585,10 +1785,7 @@ fn test_ed_plus_collator_assignment_credit_session_minus_1_purchase_fails() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); - let assignment = TanssiCollatorAssignment::collator_container_chain(); - assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should not be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); @@ -1612,9 +1809,19 @@ fn test_collator_assignment_credits_with_purchase_can_be_combined() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); + run_to_session(2); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1640,10 +1847,10 @@ fn test_collator_assignment_credits_with_purchase_can_be_combined() { )); // Assignment should happen after 2 sessions - run_to_session(1u32); + run_to_session(5u32); let assignment = TanssiCollatorAssignment::collator_container_chain(); assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1670,8 +1877,20 @@ fn test_block_credits_and_collator_assignation_credits_through_tank() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) + )); + + run_to_session(2); + let assignment = TanssiCollatorAssignment::collator_container_chain(); + assert!(assignment.container_chains.is_empty()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() )); + run_to_session(4); set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( @@ -1707,12 +1926,11 @@ fn test_block_credits_and_collator_assignation_credits_through_tank() { + block_production_credits + crate::EXISTENTIAL_DEPOSIT )); - - // Assignment should happen after 2 sessions - run_to_session(1u32); let assignment = TanssiCollatorAssignment::collator_container_chain(); assert!(assignment.container_chains.is_empty()); - run_to_session(2u32); + + // Assignment should happen after 2 sessions + run_to_session(6u32); // Alice and Bob should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!( @@ -1721,7 +1939,7 @@ fn test_block_credits_and_collator_assignation_credits_through_tank() { ); // After this it should not be assigned anymore, since credits are not payable - run_to_session(4u32); + run_to_session(8u32); // Nobody should be assigned to para 1001 let assignment = TanssiCollatorAssignment::collator_container_chain(); assert_eq!(assignment.container_chains.get(&1001u32.into()), None,); diff --git a/solo-chains/runtime/starlight/src/tests/common/mod.rs b/solo-chains/runtime/starlight/src/tests/common/mod.rs index 7f44f0fee..cd21b3707 100644 --- a/solo-chains/runtime/starlight/src/tests/common/mod.rs +++ b/solo-chains/runtime/starlight/src/tests/common/mod.rs @@ -58,8 +58,8 @@ use { pub use crate::{ genesis_config_presets::get_authority_keys_from_seed, AccountId, AuthorNoting, Babe, Balance, - DataPreservers, Grandpa, Initializer, Runtime, RuntimeOrigin, Session, System, - TanssiAuthorityAssignment, TanssiCollatorAssignment, TransactionPayment, + ContainerRegistrar, DataPreservers, Grandpa, Initializer, Runtime, RuntimeOrigin, Session, + System, TanssiAuthorityAssignment, TanssiCollatorAssignment, TransactionPayment, }; pub const UNIT: Balance = 1_000_000_000_000_000_000; @@ -129,6 +129,19 @@ pub fn run_to_block(n: u32) { } } +pub fn get_genesis_data_with_validation_code() -> (ContainerChainGenesisData, Vec) { + let validation_code = mock_validation_code().0; + let genesis_data = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + (genesis_data, validation_code) +} + pub fn insert_authorities_and_slot_digests(slot: u64) { let pre_digest = Digest { logs: vec![DigestItem::PreRuntime( @@ -222,6 +235,7 @@ pub fn end_block() { Grandpa::on_finalize(System::block_number()); TransactionPayment::on_finalize(System::block_number()); Initializer::on_finalize(System::block_number()); + ContainerRegistrar::on_finalize(System::block_number()); TanssiCollatorAssignment::on_finalize(System::block_number()); } @@ -240,6 +254,18 @@ pub struct ParaRegistrationParams { pub parathread_params: Option, } +impl From<(u32, ContainerChainGenesisData, u32, u32)> for ParaRegistrationParams { + fn from(value: (u32, ContainerChainGenesisData, u32, u32)) -> Self { + Self { + para_id: value.0, + genesis_data: value.1, + block_production_credits: value.2, + collator_assignment_credits: value.3, + parathread_params: None, + } + } +} + pub fn default_config() -> pallet_configuration::HostConfiguration { pallet_configuration::HostConfiguration { max_collators: 100, @@ -287,7 +313,12 @@ impl Default for ExtBuilder { sudo: Default::default(), para_ids: Default::default(), config: default_config(), - relay_config: Default::default(), + relay_config: runtime_parachains::configuration::HostConfiguration::< + BlockNumberFor, + > { + max_head_data_size: 20500, + ..Default::default() + }, own_para_id: Default::default(), next_free_para_id: Default::default(), keystore: None, @@ -688,7 +719,7 @@ pub(crate) struct ParasInherentTestBuilder ValidationCode { - ValidationCode(vec![1, 2, 3]) + ValidationCode(vec![1; 10]) } #[allow(dead_code)] diff --git a/solo-chains/runtime/starlight/src/tests/core_scheduling_tests.rs b/solo-chains/runtime/starlight/src/tests/core_scheduling_tests.rs index b01ff490e..a9c5f229b 100644 --- a/solo-chains/runtime/starlight/src/tests/core_scheduling_tests.rs +++ b/solo-chains/runtime/starlight/src/tests/core_scheduling_tests.rs @@ -17,15 +17,13 @@ #![cfg(test)] use { - crate::tests::common::*, - crate::{ContainerRegistrar, OnDemandAssignmentProvider, Paras, ParasSudoWrapper, Session}, + crate::{tests::common::*, ContainerRegistrar, OnDemandAssignmentProvider, Paras, Session}, cumulus_primitives_core::relay_chain::{ - vstaging::SchedulerParams, AsyncBackingParams, CoreIndex, + vstaging::SchedulerParams, AsyncBackingParams, CoreIndex, HeadData, }, frame_support::assert_ok, frame_system::pallet_prelude::BlockNumberFor, primitives::runtime_api::runtime_decl_for_parachain_host::ParachainHostV11, - runtime_parachains::paras::{ParaGenesisArgs, ParaKind}, sp_core::{Decode, Encode}, sp_keystore::testing::MemoryKeystore, sp_std::{collections::btree_map::BTreeMap, vec}, @@ -508,6 +506,7 @@ fn test_parathread_uses_0_and_then_1_after_parachain_onboarded() { // this is, 1000 will go first, then 1001. Since we want 1000 to use core 0, // the only way to achieve this is by assigning the parathread a higher para-id run_to_block(2); + // Now the parathread should be there assert!(Paras::is_parathread(1001u32.into())); let alice_keys = @@ -522,35 +521,42 @@ fn test_parathread_uses_0_and_then_1_after_parachain_onboarded() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1000.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); - set_dummy_boot_node(origin_of(ALICE.into()), 1000.into()); - assert_ok!(ContainerRegistrar::mark_valid_for_collating( - root_origin(), - 1000.into() - )); - assert_ok!(ParasSudoWrapper::sudo_schedule_para_initialize( + run_to_session(2); + + // We call run_block() after each run_to_session() for on_finalize() to + // be properly executed, and thus to coordinate all the necessary storages, + // specially ParasShared and Session CurrentIndex storages. + // + // If we don't do this, ParasShared's CurrentIndex is configured to + // one session before, and we want the to be the same for later checking in + // session 6. + run_block(); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( root_origin(), - 1000.into(), - ParaGenesisArgs { - genesis_head: ParasInherentTestBuilder::::mock_head_data(), - validation_code: mock_validation_code(), - para_kind: ParaKind::Parachain, - }, + get_genesis_data_with_validation_code().1.into() )); - assert_ok!(Paras::add_trusted_validation_code( + run_to_session(4); + run_block(); + + set_dummy_boot_node(origin_of(ALICE.into()), 1000.into()); + assert_ok!(ContainerRegistrar::mark_valid_for_collating( root_origin(), - mock_validation_code() + 1000.into() )); // The parathread now uses core 0 but once the parachain is onboarded (and gets collators) // it should use core 1. - // let's just go to the block right before edge of session 2. + // let's just go to the block right before edge of session 6. let epoch_duration = EpochDurationInBlocks::get(); - run_to_block(2 * epoch_duration - 1); + run_to_block(6 * epoch_duration - 1); // we are not a parachain yet assert!(!Paras::is_parachain(1000u32.into())); // we dont have authorities @@ -594,7 +600,7 @@ fn test_parathread_uses_0_and_then_1_after_parachain_onboarded() { // let's run to right after the edge // We need one more run block to trigger the on_finalize - run_to_session(2); + run_to_session(6); run_block(); // Now the parachain should be there assert!(Paras::is_parachain(1000u32.into())); diff --git a/solo-chains/runtime/starlight/src/tests/integration_test.rs b/solo-chains/runtime/starlight/src/tests/integration_test.rs index 63a23e716..1f9c15683 100644 --- a/solo-chains/runtime/starlight/src/tests/integration_test.rs +++ b/solo-chains/runtime/starlight/src/tests/integration_test.rs @@ -19,7 +19,7 @@ use { crate::tests::common::*, crate::{Balances, CollatorConfiguration, ContainerRegistrar, DataPreservers}, - cumulus_primitives_core::ParaId, + cumulus_primitives_core::{relay_chain::HeadData, ParaId}, frame_support::{assert_noop, assert_ok, BoundedVec}, pallet_registrar_runtime_api::{ runtime_decl_for_registrar_api::RegistrarApi, ContainerChainGenesisData, @@ -190,19 +190,12 @@ fn genesis_para_registrar_container_chain_genesis_data_runtime_api() { assert_eq!(Runtime::genesis_data(1002.into()).as_ref(), Some(&genesis_data_1002), "Deregistered container chain genesis data should not be removed until after 2 sessions"); - let genesis_data_1003 = ContainerChainGenesisData { - storage: vec![(b"key3".to_vec(), b"value3".to_vec()).into()], - name: Default::default(), - id: Default::default(), - fork_id: Default::default(), - extensions: vec![], - properties: Default::default(), - }; assert_ok!( ContainerRegistrar::register( origin_of(ALICE.into()), 1003.into(), - genesis_data_1003.clone() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) ), () ); @@ -210,7 +203,7 @@ fn genesis_para_registrar_container_chain_genesis_data_runtime_api() { // Registered container chains are inserted immediately assert_eq!( Runtime::genesis_data(1003.into()).as_ref(), - Some(&genesis_data_1003) + Some(&get_genesis_data_with_validation_code().0) ); // Deregistered container chain genesis data is removed after 2 sessions @@ -300,7 +293,8 @@ fn test_cannot_mark_valid_para_with_no_bootnodes() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); assert_noop!( ContainerRegistrar::mark_valid_for_collating(root_origin(), 1001.into()), @@ -335,7 +329,8 @@ fn test_container_deregister_unassign_data_preserver() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), para_id, - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 1u8, 1u8])) )); assert_ok!(DataPreservers::create_profile( diff --git a/solo-chains/runtime/starlight/src/tests/relay_registrar.rs b/solo-chains/runtime/starlight/src/tests/relay_registrar.rs index 0c8d01008..e9dc4e45a 100644 --- a/solo-chains/runtime/starlight/src/tests/relay_registrar.rs +++ b/solo-chains/runtime/starlight/src/tests/relay_registrar.rs @@ -17,10 +17,15 @@ #![cfg(test)] use { - crate::tests::common::*, - crate::{Paras, Registrar}, + crate::{tests::common::*, ContainerRegistrar, Paras, Registrar, System}, + cumulus_primitives_core::relay_chain::HeadData, frame_support::{assert_noop, assert_ok}, + pallet_registrar::Event as ContainerRegistrarEvent, + pallet_registrar_runtime_api::{ + runtime_decl_for_registrar_api::RegistrarApi, ContainerChainGenesisData, + }, runtime_common::paras_registrar, + runtime_parachains::configuration as parachains_configuration, sp_std::vec, }; @@ -95,3 +100,468 @@ fn registrar_needs_a_reserved_para_id() { .is_parathread()); }); } + +#[test] +fn register_para_via_container_registrar() { + ExtBuilder::default() + .with_para_ids(vec![ + (1001, empty_genesis_data(), u32::MAX, u32::MAX).into(), + (1002, empty_genesis_data(), u32::MAX, u32::MAX).into(), + ]) + .build() + .execute_with(|| { + // In this test we're gonna register a para via ContainerRegistrar, + // which will internally use the InnerRegistrar type to also register the para + // in the relay Registrar pallet. + + assert_eq!(Runtime::registered_paras(), vec![1001.into(), 1002.into()]); + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + run_to_session(2u32); + assert_eq!( + parachains_configuration::ActiveConfig::::get().max_head_data_size, + 20500 + ); + + let validation_code = + vec![1u8; cumulus_primitives_core::relay_chain::MIN_CODE_SIZE as usize]; + let genesis_data_1003 = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1003.into(), + genesis_data_1003.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Now let's check if the para was preoperly registered in the relay. + // Run to next session. + run_to_session(3); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be onboarding") + .is_onboarding()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + validation_code.into() + )); + run_to_session(5); + + // Now the para should be a parathread. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parathread") + .is_parathread()); + }); +} + +#[test] +fn cannot_register_para_twice_in_relay() { + ExtBuilder::default() + .with_para_ids(vec![ + (1001, empty_genesis_data(), u32::MAX, u32::MAX).into(), + (1002, empty_genesis_data(), u32::MAX, u32::MAX).into(), + ]) + .build() + .execute_with(|| { + // In this test we're gonna confirm that a para cannot be registered in the relay + // after being already registered through ContainerRegistrar. + + assert_eq!(Runtime::registered_paras(), vec![1001.into(), 1002.into()]); + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + run_to_session(2u32); + assert_eq!( + parachains_configuration::ActiveConfig::::get().max_head_data_size, + 20500 + ); + + let validation_code = + vec![1u8; cumulus_primitives_core::relay_chain::MIN_CODE_SIZE as usize]; + let genesis_data_1003 = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1003.into(), + genesis_data_1003.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Now let's check if the para was preoperly registered in the relay. + // Run to next session. + run_to_session(3); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be onboarding") + .is_onboarding()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + validation_code.clone().into() + )); + run_to_session(5); + + // Now the para should be a parathread. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parathread") + .is_parathread()); + + // We shouldn't be able to register the para again + assert_noop!( + Registrar::register( + origin_of(ALICE.into()), + 1003.into(), + vec![].into(), + validation_code.into() + ), + paras_registrar::Error::::AlreadyRegistered + ); + }); +} + +#[test] +fn mark_valid_for_collating_converts_to_parachain() { + ExtBuilder::default() + .with_para_ids(vec![ + (1001, empty_genesis_data(), u32::MAX, u32::MAX).into(), + (1002, empty_genesis_data(), u32::MAX, u32::MAX).into(), + ]) + .build() + .execute_with(|| { + // In this test we're gonna check that inside mark_valid_for_collating(), + // if we are passing a parathread, this one will be upgraded to a parachain + // at the end of the execution. + + assert_eq!(Runtime::registered_paras(), vec![1001.into(), 1002.into()]); + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + run_to_session(2u32); + assert_eq!( + parachains_configuration::ActiveConfig::::get().max_head_data_size, + 20500 + ); + + let validation_code = + vec![1u8; cumulus_primitives_core::relay_chain::MIN_CODE_SIZE as usize]; + let genesis_data_1003 = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1003.into(), + genesis_data_1003.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Now let's check if the para was preoperly registered in the relay. + // Run to next session. + run_to_session(3); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be onboarding") + .is_onboarding()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + validation_code.into() + )); + run_to_session(5); + + // Now the para should be a parathread. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parathread") + .is_parathread()); + + set_dummy_boot_node(origin_of(ALICE.into()), 1003.into()); + + // Call mark_valid_for_collating. + assert_ok!( + ContainerRegistrar::mark_valid_for_collating(root_origin(), 1003.into()), + () + ); + + // The change should be applied after 2 sessions. + run_to_session(7); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parachain") + .is_parachain()); + }); +} + +#[test] +fn deregister_calls_schedule_para_cleanup() { + ExtBuilder::default() + .with_para_ids(vec![ + (1001, empty_genesis_data(), u32::MAX, u32::MAX).into(), + (1002, empty_genesis_data(), u32::MAX, u32::MAX).into(), + ]) + .build() + .execute_with(|| { + // In this test we're gonna check that when calling ContainerRegistrar::deregister(), + // the para is also offboarded from the relay. + + assert_eq!(Runtime::registered_paras(), vec![1001.into(), 1002.into()]); + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + run_to_session(2u32); + assert_eq!( + parachains_configuration::ActiveConfig::::get().max_head_data_size, + 20500 + ); + + let validation_code = + vec![1u8; cumulus_primitives_core::relay_chain::MIN_CODE_SIZE as usize]; + let genesis_data_1003 = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1003.into(), + genesis_data_1003.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Now let's check if the para was preoperly registered in the relay. + // Run to next session. + run_to_session(3); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be onboarding") + .is_onboarding()); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + validation_code.into() + )); + + run_to_session(5); + + // Now the para should be a parathread. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parathread") + .is_parathread()); + + set_dummy_boot_node(origin_of(ALICE.into()), 1003.into()); + + // Call mark_valid_for_collating. + assert_ok!( + ContainerRegistrar::mark_valid_for_collating(root_origin(), 1003.into()), + () + ); + + // The change should be applied after 2 sessions. + run_to_session(7); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parachain") + .is_parachain()); + + assert_eq!( + Runtime::genesis_data(1003.into()).as_ref(), + Some(&genesis_data_1003) + ); + + assert_ok!(ContainerRegistrar::deregister(root_origin(), 1003.into())); + + // Assert that the ParaIdDeregistered event was properly deposited + System::assert_last_event( + ContainerRegistrarEvent::ParaIdDeregistered { + para_id: 1003.into(), + } + .into(), + ); + + run_to_session(9); + end_block(); + + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + + // Para should be offboarding after 2 sessions. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be offboarding") + .is_offboarding()); + }); +} + +#[test] +fn deregister_two_paras_in_the_same_block() { + ExtBuilder::default() + .with_para_ids(vec![ + (1001, empty_genesis_data(), u32::MAX, u32::MAX).into(), + (1002, empty_genesis_data(), u32::MAX, u32::MAX).into(), + ]) + .build() + .execute_with(|| { + // In this test we're gonna check that when calling ContainerRegistrar::deregister(), + // two paraIds are properly offboarded from the relay. + + assert_eq!(Runtime::registered_paras(), vec![1001.into(), 1002.into()]); + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + assert_eq!(Runtime::genesis_data(1004.into()).as_ref(), None); + run_to_session(2u32); + assert_eq!( + parachains_configuration::ActiveConfig::::get().max_head_data_size, + 20500 + ); + + let validation_code = + vec![1u8; cumulus_primitives_core::relay_chain::MIN_CODE_SIZE as usize]; + let genesis_data_1003_and_1004 = ContainerChainGenesisData { + storage: vec![(b":code".to_vec(), validation_code.clone()).into()], + name: Default::default(), + id: Default::default(), + fork_id: Default::default(), + extensions: vec![], + properties: Default::default(), + }; + + // Register paraId 1003 + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1003.into(), + genesis_data_1003_and_1004.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Register paraId 1004 + assert_ok!( + ContainerRegistrar::register( + origin_of(ALICE.into()), + 1004.into(), + genesis_data_1003_and_1004.clone(), + Some(HeadData(vec![1u8, 1u8, 1u8])) + ), + () + ); + + // Now let's check if the paras were preoperly registered in the relay. + // Run to next session. + run_to_session(3); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be onboarding") + .is_onboarding()); + + assert!(Paras::lifecycle(1004.into()) + .expect("para should be onboarding") + .is_onboarding()); + + // We need to accept the validation code, so that paras are onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + validation_code.into() + )); + + run_to_session(5); + + // Now paras should be parathreads. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parathread") + .is_parathread()); + assert!(Paras::lifecycle(1004.into()) + .expect("para should be parathread") + .is_parathread()); + + set_dummy_boot_node(origin_of(ALICE.into()), 1003.into()); + set_dummy_boot_node(origin_of(ALICE.into()), 1004.into()); + + // Call mark_valid_for_collating. + assert_ok!( + ContainerRegistrar::mark_valid_for_collating(root_origin(), 1003.into()), + () + ); + + assert_ok!( + ContainerRegistrar::mark_valid_for_collating(root_origin(), 1004.into()), + () + ); + + // The change should be applied after 2 sessions. + run_to_session(7); + assert!(Paras::lifecycle(1003.into()) + .expect("para should be parachain") + .is_parachain()); + + assert!(Paras::lifecycle(1004.into()) + .expect("para should be parachain") + .is_parachain()); + + assert_eq!( + Runtime::genesis_data(1003.into()).as_ref(), + Some(&genesis_data_1003_and_1004) + ); + + assert_eq!( + Runtime::genesis_data(1004.into()).as_ref(), + Some(&genesis_data_1003_and_1004) + ); + + assert_ok!(ContainerRegistrar::deregister(root_origin(), 1003.into())); + + // Assert that the ParaIdDeregistered event was properly deposited + System::assert_last_event( + ContainerRegistrarEvent::ParaIdDeregistered { + para_id: 1003.into(), + } + .into(), + ); + + assert_ok!(ContainerRegistrar::deregister(root_origin(), 1004.into())); + System::assert_last_event( + ContainerRegistrarEvent::ParaIdDeregistered { + para_id: 1004.into(), + } + .into(), + ); + + run_to_session(9); + end_block(); + + assert_eq!(Runtime::genesis_data(1003.into()).as_ref(), None); + assert_eq!(Runtime::genesis_data(1004.into()).as_ref(), None); + + // Paras should be offboarding after 2 sessions. + assert!(Paras::lifecycle(1003.into()) + .expect("para should be offboarding") + .is_offboarding()); + + assert!(Paras::lifecycle(1004.into()) + .expect("para should be offboarding") + .is_offboarding()); + }); +} diff --git a/solo-chains/runtime/starlight/src/tests/services_payment.rs b/solo-chains/runtime/starlight/src/tests/services_payment.rs index 5eed55c41..3fdc0a3f7 100644 --- a/solo-chains/runtime/starlight/src/tests/services_payment.rs +++ b/solo-chains/runtime/starlight/src/tests/services_payment.rs @@ -18,8 +18,8 @@ use { crate::tests::common::*, - crate::{ContainerRegistrar, ServicesPayment}, - cumulus_primitives_core::ParaId, + crate::{ContainerRegistrar, Paras, ServicesPayment}, + cumulus_primitives_core::{relay_chain::HeadData, ParaId}, frame_support::assert_ok, sp_std::vec, }; @@ -123,9 +123,19 @@ fn test_can_buy_credits_before_registering_para_and_receive_free_credits() { assert_ok!(ContainerRegistrar::register( origin_of(ALICE.into()), 1001.into(), - empty_genesis_data() + get_genesis_data_with_validation_code().0, + Some(HeadData(vec![1u8, 2u8, 3u8])) )); + run_to_session(2); + + // We need to accept the validation code, so that the para is onboarded after 2 sessions. + assert_ok!(Paras::add_trusted_validation_code( + root_origin(), + get_genesis_data_with_validation_code().1.into() + )); + run_to_session(4); + set_dummy_boot_node(origin_of(ALICE.into()), 1001.into()); assert_ok!(ContainerRegistrar::mark_valid_for_collating( diff --git a/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts b/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts index cb72712b6..55a086f3d 100644 --- a/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts +++ b/test/suites/common-tanssi/pallet-data-preservers/test_pallet_data_preservers.ts @@ -293,7 +293,8 @@ describeSuite({ const registerTx = polkadotJs.tx.registrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + null ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -365,7 +366,8 @@ describeSuite({ const registerTx = polkadotJs.tx.registrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + null ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -437,7 +439,8 @@ describeSuite({ const registerTx = polkadotJs.tx.registrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + null ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -512,7 +515,8 @@ describeSuite({ const registerTx = polkadotJs.tx.registrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + null ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -586,7 +590,8 @@ describeSuite({ const registerTx = polkadotJs.tx.registrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + null ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); diff --git a/test/suites/common-tanssi/registrar/test_registrar_para_manager.ts b/test/suites/common-tanssi/registrar/test_registrar_para_manager.ts index 223be2997..dafbcaf24 100644 --- a/test/suites/common-tanssi/registrar/test_registrar_para_manager.ts +++ b/test/suites/common-tanssi/registrar/test_registrar_para_manager.ts @@ -51,7 +51,7 @@ describeSuite({ const containerChainGenesisData = emptyGenesisData(); await context.createBlock([ - await polkadotJs.tx.registrar.register(paraId, containerChainGenesisData).signAsync(alice), + await polkadotJs.tx.registrar.register(paraId, containerChainGenesisData, null).signAsync(alice), ]); // Bob still not a manager, extrinsic requiring ManagerOrigin should fail diff --git a/test/suites/common-tanssi/registrar/test_registrar_proxy.ts b/test/suites/common-tanssi/registrar/test_registrar_proxy.ts index 19a41ea29..f65e94c57 100644 --- a/test/suites/common-tanssi/registrar/test_registrar_proxy.ts +++ b/test/suites/common-tanssi/registrar/test_registrar_proxy.ts @@ -79,7 +79,7 @@ describeSuite({ const tx2 = polkadotJs.tx.proxy.proxy( bob.address, null, - polkadotJs.tx.registrar.register(2002, containerChainGenesisData) + polkadotJs.tx.registrar.register(2002, containerChainGenesisData, null) ); await context.createBlock([await tx2.signAsync(charlie)]); // Check that the on chain genesis data is set correctly @@ -168,7 +168,7 @@ describeSuite({ }; const containerChainGenesisData = emptyGenesisData(); - const tx2 = polkadotJs.tx.registrar.register(2002, containerChainGenesisData); + const tx2 = polkadotJs.tx.registrar.register(2002, containerChainGenesisData, null); const tx3 = polkadotJs.tx.registrar.markValidForCollating(2002); const nonce = await polkadotJs.rpc.system.accountNextIndex(alice.publicKey); await context.createBlock([ diff --git a/test/suites/common-tanssi/registrar/test_registrar_register.ts b/test/suites/common-tanssi/registrar/test_registrar_register.ts index abeee2f81..658ea485e 100644 --- a/test/suites/common-tanssi/registrar/test_registrar_register.ts +++ b/test/suites/common-tanssi/registrar/test_registrar_register.ts @@ -67,7 +67,7 @@ describeSuite({ }; const containerChainGenesisData = emptyGenesisData(); - const tx = polkadotJs.tx.registrar.register(2002, containerChainGenesisData); + const tx = polkadotJs.tx.registrar.register(2002, containerChainGenesisData, null); const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); const profileTx = polkadotJs.tx.dataPreservers.createProfile({ diff --git a/test/suites/common-tanssi/registrar/test_registrar_register_parathread.ts b/test/suites/common-tanssi/registrar/test_registrar_register_parathread.ts index 359b5e467..028211409 100644 --- a/test/suites/common-tanssi/registrar/test_registrar_register_parathread.ts +++ b/test/suites/common-tanssi/registrar/test_registrar_register_parathread.ts @@ -69,7 +69,12 @@ describeSuite({ }; const containerChainGenesisData = emptyGenesisData(); - const tx = polkadotJs.tx.registrar.registerParathread(2002, slotFrequency, containerChainGenesisData); + const tx = polkadotJs.tx.registrar.registerParathread( + 2002, + slotFrequency, + containerChainGenesisData, + null + ); const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); const tx2 = polkadotJs.tx.dataPreservers.createProfile({ diff --git a/test/suites/dev-tanssi-relay/pallet-data-preservers/test_pallet_data_preservers.ts b/test/suites/dev-tanssi-relay/pallet-data-preservers/test_pallet_data_preservers.ts index 93e4c8762..5b9700a7f 100644 --- a/test/suites/dev-tanssi-relay/pallet-data-preservers/test_pallet_data_preservers.ts +++ b/test/suites/dev-tanssi-relay/pallet-data-preservers/test_pallet_data_preservers.ts @@ -268,8 +268,10 @@ describeSuite({ const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { storage: [ { - key: "0x636f6465", - value: "0x010203040506", + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", }, ], name: "0x436f6e7461696e657220436861696e2032303030", @@ -292,7 +294,8 @@ describeSuite({ const registerTx = polkadotJs.tx.containerRegistrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + "0x010203" ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -340,8 +343,10 @@ describeSuite({ const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { storage: [ { - key: "0x636f6465", - value: "0x010203040506", + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", }, ], name: "0x436f6e7461696e657220436861696e2032303030", @@ -364,7 +369,8 @@ describeSuite({ const registerTx = polkadotJs.tx.containerRegistrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + "0x010203" ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -412,8 +418,10 @@ describeSuite({ const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { storage: [ { - key: "0x636f6465", - value: "0x010203040506", + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", }, ], name: "0x436f6e7461696e657220436861696e2032303030", @@ -436,7 +444,8 @@ describeSuite({ const registerTx = polkadotJs.tx.containerRegistrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + "0x010203" ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -486,8 +495,10 @@ describeSuite({ const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { storage: [ { - key: "0x636f6465", - value: "0x010203040506", + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", }, ], name: "0x436f6e7461696e657220436861696e2032303030", @@ -510,7 +521,8 @@ describeSuite({ const registerTx = polkadotJs.tx.containerRegistrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + "0x010203" ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); @@ -560,8 +572,10 @@ describeSuite({ const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { storage: [ { - key: "0x636f6465", - value: "0x010203040506", + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", }, ], name: "0x436f6e7461696e657220436861696e2032303030", @@ -584,7 +598,8 @@ describeSuite({ const registerTx = polkadotJs.tx.containerRegistrar.registerParathread( paraId, slotFrequency, - containerChainGenesisData + containerChainGenesisData, + "0x010203" ); await context.createBlock([await registerTx.signAsync(sudo_alice)]); diff --git a/test/suites/dev-tanssi-relay/registrar/test_registrars.ts b/test/suites/dev-tanssi-relay/registrar/test_registrars.ts new file mode 100644 index 000000000..3d9c7b75b --- /dev/null +++ b/test/suites/dev-tanssi-relay/registrar/test_registrars.ts @@ -0,0 +1,169 @@ +import { describeSuite, expect, beforeAll } from "@moonwall/cli"; +import { ApiPromise } from "@polkadot/api"; +import { KeyringPair } from "@moonwall/util"; +import { jumpSessions } from "../../../util/block"; + +describeSuite({ + id: "DT0102", + title: "ContainerRegistrar <> relay Registrar", + foundationMethods: "dev", + testCases: ({ it, context }) => { + let polkadotJs: ApiPromise; + let alice: KeyringPair; + let charlie: KeyringPair; + let emptyGenesisData: any; + + beforeAll(() => { + alice = context.keyring.alice; + charlie = context.keyring.alice; + polkadotJs = context.pjsApi; + emptyGenesisData = () => { + const g = polkadotJs.createType("DpContainerChainGenesisDataContainerChainGenesisData", { + // Code key: 0x3a636f6465 or [58, 99, 111, 100, 101] + storage: [ + { + // ":code" key + key: "0x3a636f6465", + // code value (must be at least 9 bytes length) + value: "0x0102030405060708091011", + }, + ], + name: "0x436f6e7461696e657220436861696e2032303030", + id: "0x636f6e7461696e65722d636861696e2d32303030", + forkId: null, + extensions: "0x", + properties: { + tokenMetadata: { + tokenSymbol: "0x61626364", + ss58Format: 42, + tokenDecimals: 12, + }, + isEthereum: false, + }, + }); + return g; + }; + }); + + it({ + id: "E01", + title: "should be able to register paraId", + test: async function () { + await context.createBlock(); + const containerChainGenesisData = emptyGenesisData(); + + const tx = await polkadotJs.tx.containerRegistrar + .register(2002, containerChainGenesisData, "0x111") + .signAsync(alice); + + await context.createBlock([tx], { allowFailures: false }); + + await jumpSessions(context, 1); + + // Para should be onboarding now + const isOnboarding = await polkadotJs.query.paras.paraLifecycles(2002); + expect(isOnboarding.toString()).to.eq("Onboarding"); + + // Accept validation code so that para is onboarded after 2 sessions + const tx2 = polkadotJs.tx.paras.addTrustedValidationCode("0x0102030405060708091011"); + await context.createBlock([await polkadotJs.tx.sudo.sudo(tx2).signAsync(alice)], { + allowFailures: false, + }); + + await jumpSessions(context, 2); + + // Para should be a parathread now + const isParathread = await polkadotJs.query.paras.paraLifecycles(2002); + expect(isParathread.toString()).to.eq("Parathread"); + + // Check that the on chain genesis data is set correctly + const onChainGenesisData = await polkadotJs.query.containerRegistrar.paraGenesisData(2002); + expect(emptyGenesisData().toJSON()).to.deep.equal(onChainGenesisData.toJSON()); + + const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); + const profileTx = polkadotJs.tx.dataPreservers.createProfile({ + url: "/ip4/127.0.0.1/tcp/33051/ws/p2p/12D3KooWSDsmAa7iFbHdQW4X8B2KbeRYPDLarK6EbevUSYfGkeQw", + paraIds: "AnyParaId", + mode: "Bootnode", + assignmentRequest: "Free", + }); + + const tx3 = polkadotJs.tx.dataPreservers.startAssignment(profileId, 2002, "Free"); + + // Mark the paraId valid for collating + const tx4 = polkadotJs.tx.containerRegistrar.markValidForCollating(2002); + const nonce = await polkadotJs.rpc.system.accountNextIndex(alice.publicKey); + await context.createBlock( + [ + await profileTx.signAsync(charlie), + await tx3.signAsync(alice, { nonce: nonce.addn(1) }), + await polkadotJs.tx.sudo.sudo(tx4).signAsync(alice, { nonce: nonce.addn(2) }), + ], + { + allowFailures: false, + } + ); + + await jumpSessions(context, 2); + + // Para should be a parachain now + const isParachain = await polkadotJs.query.paras.paraLifecycles(2002); + expect(isParachain.toString()).to.eq("Parachain"); + + // Expect all paraIds to be registered (genesis ones + 2002) + const parasRegistered = await polkadotJs.query.containerRegistrar.registeredParaIds(); + expect(parasRegistered.toJSON()).to.deep.equal([2000, 2001, 2002]); + }, + }); + + it({ + id: "E02", + title: "should not be able to register paraId twice", + test: async function () { + const containerChainGenesisData = emptyGenesisData(); + + // Check we can't register via ContainerRegistrar + const tx = await polkadotJs.tx.containerRegistrar + .register(2002, containerChainGenesisData, "0x111") + .signAsync(alice); + + const { result } = await context.createBlock([tx]); + expect(result[0].successful).to.be.false; + expect(result[0].error.section).to.eq("containerRegistrar"); + expect(result[0].error.name).to.eq("ParaIdAlreadyRegistered"); + + // Check we can't register via relay Registrar + const tx2 = polkadotJs.tx.registrar.register(2002, "0x", "0x0102030405060708091011").signAsync(alice); + const { result: result2 } = await context.createBlock([tx2]); + expect(result2[0].successful).to.be.false; + expect(result2[0].error.section).to.eq("registrar"); + expect(result2[0].error.name).to.eq("AlreadyRegistered"); + }, + }); + + it({ + id: "E03", + title: "ContainerRegistrar::deregister should offboard the paraId", + test: async function () { + // Para should still be a parachain + const isParachain = await polkadotJs.query.paras.paraLifecycles(2002); + expect(isParachain.toString()).to.eq("Parachain"); + + const tx = polkadotJs.tx.containerRegistrar.deregister(2002); + await context.createBlock([await polkadotJs.tx.sudo.sudo(tx).signAsync(alice)], { + allowFailures: false, + }); + + await jumpSessions(context, 2); + + // Check that the on chain genesis data is now empty + const onChainGenesisDataAfter = await polkadotJs.query.containerRegistrar.paraGenesisData(2002); + expect(onChainGenesisDataAfter.toHuman()).to.be.null; + + // Para should be offboarding + const isOffboarding = await polkadotJs.query.paras.paraLifecycles(2002); + expect(isOffboarding.toString()).to.eq("OffboardingParathread"); + }, + }); + }, +}); diff --git a/test/suites/dev-tanssi/register-with-relay-proof/test_deregister_with_relay_proof.ts b/test/suites/dev-tanssi/register-with-relay-proof/test_deregister_with_relay_proof.ts index 24c35dd16..6237eadb1 100644 --- a/test/suites/dev-tanssi/register-with-relay-proof/test_deregister_with_relay_proof.ts +++ b/test/suites/dev-tanssi/register-with-relay-proof/test_deregister_with_relay_proof.ts @@ -54,7 +54,7 @@ describeSuite({ }; const containerChainGenesisData = emptyGenesisData(); - const tx = polkadotJs.tx.registrar.register(2003, containerChainGenesisData); + const tx = polkadotJs.tx.registrar.register(2003, containerChainGenesisData, null); const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); const profileTx = polkadotJs.tx.dataPreservers.createProfile({ diff --git a/test/suites/dev-tanssi/register-with-relay-proof/test_register_with_relay_proof.ts b/test/suites/dev-tanssi/register-with-relay-proof/test_register_with_relay_proof.ts index bd7cf5442..4be39a433 100644 --- a/test/suites/dev-tanssi/register-with-relay-proof/test_register_with_relay_proof.ts +++ b/test/suites/dev-tanssi/register-with-relay-proof/test_register_with_relay_proof.ts @@ -102,7 +102,8 @@ describeSuite({ relayProofBlockNumber, relayStorageProof, managerSignature, - containerChainGenesisData + containerChainGenesisData, + null ); const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); diff --git a/test/suites/dev-tanssi/xcm-core-buyer/test_xcm_core_buyer.ts b/test/suites/dev-tanssi/xcm-core-buyer/test_xcm_core_buyer.ts index 7e1251894..d43c7d777 100644 --- a/test/suites/dev-tanssi/xcm-core-buyer/test_xcm_core_buyer.ts +++ b/test/suites/dev-tanssi/xcm-core-buyer/test_xcm_core_buyer.ts @@ -91,7 +91,12 @@ describeSuite({ // Let's disable all other parachains and set parathread collator to 4 // this will make every collator including the one we are registering being assigned to our parathread - const tx = polkadotJs.tx.registrar.registerParathread(2002, slotFrequency, containerChainGenesisData); + const tx = polkadotJs.tx.registrar.registerParathread( + 2002, + slotFrequency, + containerChainGenesisData, + null + ); const profileId = await polkadotJs.query.dataPreservers.nextProfileId(); const profileTx = polkadotJs.tx.dataPreservers.createProfile({ diff --git a/test/suites/para/test_tanssi_containers.ts b/test/suites/para/test_tanssi_containers.ts index 505eb11f4..184feae22 100644 --- a/test/suites/para/test_tanssi_containers.ts +++ b/test/suites/para/test_tanssi_containers.ts @@ -241,7 +241,7 @@ describeSuite({ const chainSpec2002 = JSON.parse(spec2002); const containerChainGenesisData = chainSpecToContainerChainGenesisData(paraApi, chainSpec2002); - const tx1 = paraApi.tx.registrar.register(2002, containerChainGenesisData); + const tx1 = paraApi.tx.registrar.register(2002, containerChainGenesisData, null); const purchasedCredits = 100000n; const requiredBalance = purchasedCredits * 1_000_000n; const tx2 = paraApi.tx.servicesPayment.purchaseCredits(2002, requiredBalance); diff --git a/test/suites/parathreads/test_tanssi_parathreads.ts b/test/suites/parathreads/test_tanssi_parathreads.ts index bc5b4ea8e..a9a133750 100644 --- a/test/suites/parathreads/test_tanssi_parathreads.ts +++ b/test/suites/parathreads/test_tanssi_parathreads.ts @@ -466,7 +466,7 @@ function createCollatorKeyToNameMap(paraApi, collatorNames: string[]): Record; + /** Tried to register a paraId in a relay context without specifying a proper HeadData. */ + HeadDataNecessary: AugmentedError; /** The provided signature from the parachain manager in the relay is not valid */ InvalidRelayManagerSignature: AugmentedError; /** The provided relay storage proof is not valid */ @@ -451,6 +453,8 @@ declare module "@polkadot/api-base/types/errors" { ParaStillExistsInRelay: AugmentedError; /** The relay storage root for the corresponding block number could not be retrieved */ RelayStorageRootNotFound: AugmentedError; + /** Tried to register a paraId in a relay context without specifying a wasm chain code. */ + WasmCodeNecessary: AugmentedError; /** Generic error */ [key: string]: AugmentedError; }; diff --git a/typescript-api/src/dancebox/interfaces/augment-api-query.ts b/typescript-api/src/dancebox/interfaces/augment-api-query.ts index 90540e4df..8df2ef720 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-query.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-query.ts @@ -988,6 +988,25 @@ declare module "@polkadot/api-base/types/storage" { [key: string]: QueryableStorageEntry; }; registrar: { + /** + * This storage aims to act as a 'buffer' for paraIds that must be deregistered at the end of the block execution + * by calling 'T::InnerRegistrar::deregister()' implementation. + * + * We need this buffer because when we are using this pallet on a relay-chain environment like Starlight (where + * 'T::InnerRegistrar' implementation is usually the 'paras_registrar' pallet) we need to deregister (via + * 'paras_registrar::deregister') the same paraIds we have in 'PendingToRemove', and we need to do this + * deregistration process inside 'on_finalize' hook. + * + * It can be the case that some paraIds need to be downgraded to a parathread before deregistering on + * 'paras_registrar'. This process usually takes 2 sessions, and the actual downgrade happens when the block + * finalizes. + * + * Therefore, if we tried to perform this relay deregistration process at the beginning of the session/block + * inside ('on_initialize') initializer_on_new_session() as we do for this pallet, it would fail due to the + * downgrade process could have not taken place yet. + */ + bufferedParasToDeregister: AugmentedQuery Observable>, []> & + QueryableStorageEntry; paraGenesisData: AugmentedQuery< ApiType, ( diff --git a/typescript-api/src/dancebox/interfaces/augment-api-tx.ts b/typescript-api/src/dancebox/interfaces/augment-api-tx.ts index f4c77a61c..338d4c3ed 100644 --- a/typescript-api/src/dancebox/interfaces/augment-api-tx.ts +++ b/typescript-api/src/dancebox/interfaces/augment-api-tx.ts @@ -2979,9 +2979,10 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, - [u32, DpContainerChainGenesisDataContainerChainGenesisData] + [u32, DpContainerChainGenesisDataContainerChainGenesisData, Option] >; /** Register parathread */ registerParathread: AugmentedSubmittable< @@ -2992,9 +2993,10 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, - [u32, TpTraitsSlotFrequency, DpContainerChainGenesisDataContainerChainGenesisData] + [u32, TpTraitsSlotFrequency, DpContainerChainGenesisDataContainerChainGenesisData, Option] >; /** Register parachain or parathread */ registerWithRelayProof: AugmentedSubmittable< @@ -3020,7 +3022,8 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, [ u32, @@ -3029,6 +3032,7 @@ declare module "@polkadot/api-base/types/submittable" { SpTrieStorageProof, SpRuntimeMultiSignature, DpContainerChainGenesisDataContainerChainGenesisData, + Option, ] >; setParaManager: AugmentedSubmittable< diff --git a/typescript-api/src/dancebox/interfaces/lookup.ts b/typescript-api/src/dancebox/interfaces/lookup.ts index 30b21685a..4ef071b31 100644 --- a/typescript-api/src/dancebox/interfaces/lookup.ts +++ b/typescript-api/src/dancebox/interfaces/lookup.ts @@ -2613,6 +2613,7 @@ export default { register: { paraId: "u32", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, deregister: { paraId: "u32", @@ -2631,6 +2632,7 @@ export default { paraId: "u32", slotFrequency: "TpTraitsSlotFrequency", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, set_parathread_params: { paraId: "u32", @@ -2647,6 +2649,7 @@ export default { relayStorageProof: "SpTrieStorageProof", managerSignature: "SpRuntimeMultiSignature", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, deregister_with_relay_proof: { paraId: "u32", @@ -2680,16 +2683,16 @@ export default { ss58Format: "u32", tokenDecimals: "u32", }, - /** Lookup299: tp_traits::SlotFrequency */ + /** Lookup300: tp_traits::SlotFrequency */ TpTraitsSlotFrequency: { min: "u32", max: "u32", }, - /** Lookup301: tp_traits::ParathreadParams */ + /** Lookup302: tp_traits::ParathreadParams */ TpTraitsParathreadParams: { slotFrequency: "TpTraitsSlotFrequency", }, - /** Lookup302: pallet_configuration::pallet::Call */ + /** Lookup303: pallet_configuration::pallet::Call */ PalletConfigurationCall: { _enum: { set_max_collators: { @@ -2784,9 +2787,9 @@ export default { }, }, }, - /** Lookup304: pallet_collator_assignment::pallet::Call */ + /** Lookup305: pallet_collator_assignment::pallet::Call */ PalletCollatorAssignmentCall: "Null", - /** Lookup305: pallet_author_noting::pallet::Call */ + /** Lookup306: pallet_author_noting::pallet::Call */ PalletAuthorNotingCall: { _enum: { set_latest_author_data: { @@ -2803,13 +2806,13 @@ export default { }, }, }, - /** Lookup306: tp_author_noting_inherent::OwnParachainInherentData */ + /** Lookup307: tp_author_noting_inherent::OwnParachainInherentData */ TpAuthorNotingInherentOwnParachainInherentData: { relayStorageProof: "SpTrieStorageProof", }, - /** Lookup307: pallet_authority_assignment::pallet::Call */ + /** Lookup308: pallet_authority_assignment::pallet::Call */ PalletAuthorityAssignmentCall: "Null", - /** Lookup308: pallet_services_payment::pallet::Call */ + /** Lookup309: pallet_services_payment::pallet::Call */ PalletServicesPaymentCall: { _enum: { purchase_credits: { @@ -2842,7 +2845,7 @@ export default { }, }, }, - /** Lookup309: pallet_data_preservers::pallet::Call */ + /** Lookup310: pallet_data_preservers::pallet::Call */ PalletDataPreserversCall: { _enum: { __Unused0: "Null", @@ -2883,14 +2886,14 @@ export default { }, }, }, - /** Lookup310: pallet_data_preservers::types::Profile */ + /** Lookup311: pallet_data_preservers::types::Profile */ PalletDataPreserversProfile: { url: "Bytes", paraIds: "PalletDataPreserversParaIdsFilter", mode: "PalletDataPreserversProfileMode", assignmentRequest: "DanceboxRuntimePreserversAssignementPaymentRequest", }, - /** Lookup312: pallet_data_preservers::types::ParaIdsFilter */ + /** Lookup313: pallet_data_preservers::types::ParaIdsFilter */ PalletDataPreserversParaIdsFilter: { _enum: { AnyParaId: "Null", @@ -2898,7 +2901,7 @@ export default { Blacklist: "BTreeSet", }, }, - /** Lookup315: pallet_data_preservers::types::ProfileMode */ + /** Lookup316: pallet_data_preservers::types::ProfileMode */ PalletDataPreserversProfileMode: { _enum: { Bootnode: "Null", @@ -2907,19 +2910,19 @@ export default { }, }, }, - /** Lookup316: dancebox_runtime::PreserversAssignementPaymentRequest */ + /** Lookup317: dancebox_runtime::PreserversAssignementPaymentRequest */ DanceboxRuntimePreserversAssignementPaymentRequest: { _enum: ["Free"], }, - /** Lookup317: dancebox_runtime::PreserversAssignementPaymentExtra */ + /** Lookup318: dancebox_runtime::PreserversAssignementPaymentExtra */ DanceboxRuntimePreserversAssignementPaymentExtra: { _enum: ["Free"], }, - /** Lookup318: dancebox_runtime::PreserversAssignementPaymentWitness */ + /** Lookup319: dancebox_runtime::PreserversAssignementPaymentWitness */ DanceboxRuntimePreserversAssignementPaymentWitness: { _enum: ["Free"], }, - /** Lookup319: pallet_invulnerables::pallet::Call */ + /** Lookup320: pallet_invulnerables::pallet::Call */ PalletInvulnerablesCall: { _enum: { __Unused0: "Null", @@ -2931,7 +2934,7 @@ export default { }, }, }, - /** Lookup320: pallet_session::pallet::Call */ + /** Lookup321: pallet_session::pallet::Call */ PalletSessionCall: { _enum: { set_keys: { @@ -2944,17 +2947,17 @@ export default { purge_keys: "Null", }, }, - /** Lookup321: dancebox_runtime::SessionKeys */ + /** Lookup322: dancebox_runtime::SessionKeys */ DanceboxRuntimeSessionKeys: { nimbus: "NimbusPrimitivesNimbusCryptoPublic", }, - /** Lookup322: nimbus_primitives::nimbus_crypto::Public */ + /** Lookup323: nimbus_primitives::nimbus_crypto::Public */ NimbusPrimitivesNimbusCryptoPublic: "[u8;32]", - /** Lookup323: pallet_author_inherent::pallet::Call */ + /** Lookup324: pallet_author_inherent::pallet::Call */ PalletAuthorInherentCall: { _enum: ["kick_off_authorship_validation"], }, - /** Lookup324: pallet_pooled_staking::pallet::Call */ + /** Lookup325: pallet_pooled_staking::pallet::Call */ PalletPooledStakingCall: { _enum: { rebalance_hold: { @@ -2988,16 +2991,16 @@ export default { }, }, }, - /** Lookup325: pallet_pooled_staking::pallet::AllTargetPool */ + /** Lookup326: pallet_pooled_staking::pallet::AllTargetPool */ PalletPooledStakingAllTargetPool: { _enum: ["Joining", "AutoCompounding", "ManualRewards", "Leaving"], }, - /** Lookup327: pallet_pooled_staking::pallet::PendingOperationQuery */ + /** Lookup328: pallet_pooled_staking::pallet::PendingOperationQuery */ PalletPooledStakingPendingOperationQuery: { delegator: "AccountId32", operation: "PalletPooledStakingPendingOperationKey", }, - /** Lookup328: pallet_pooled_staking::pallet::PendingOperationKey */ + /** Lookup329: pallet_pooled_staking::pallet::PendingOperationKey */ PalletPooledStakingPendingOperationKey: { _enum: { JoiningAutoCompounding: { @@ -3014,14 +3017,14 @@ export default { }, }, }, - /** Lookup329: pallet_pooled_staking::pallet::SharesOrStake */ + /** Lookup330: pallet_pooled_staking::pallet::SharesOrStake */ PalletPooledStakingSharesOrStake: { _enum: { Shares: "u128", Stake: "u128", }, }, - /** Lookup332: pallet_treasury::pallet::Call */ + /** Lookup333: pallet_treasury::pallet::Call */ PalletTreasuryCall: { _enum: { __Unused0: "Null", @@ -3051,7 +3054,7 @@ export default { }, }, }, - /** Lookup333: cumulus_pallet_xcmp_queue::pallet::Call */ + /** Lookup334: cumulus_pallet_xcmp_queue::pallet::Call */ CumulusPalletXcmpQueueCall: { _enum: { __Unused0: "Null", @@ -3077,7 +3080,7 @@ export default { }, }, }, - /** Lookup334: pallet_xcm::pallet::Call */ + /** Lookup335: pallet_xcm::pallet::Call */ PalletXcmCall: { _enum: { send: { @@ -3152,7 +3155,7 @@ export default { }, }, }, - /** Lookup335: xcm::VersionedXcm */ + /** Lookup336: xcm::VersionedXcm */ XcmVersionedXcm: { _enum: { __Unused0: "Null", @@ -3162,9 +3165,9 @@ export default { V4: "StagingXcmV4Xcm", }, }, - /** Lookup336: xcm::v2::Xcm */ + /** Lookup337: xcm::v2::Xcm */ XcmV2Xcm: "Vec", - /** Lookup338: xcm::v2::Instruction */ + /** Lookup339: xcm::v2::Instruction */ XcmV2Instruction: { _enum: { WithdrawAsset: "XcmV2MultiassetMultiAssets", @@ -3260,7 +3263,7 @@ export default { UnsubscribeVersion: "Null", }, }, - /** Lookup339: xcm::v2::Response */ + /** Lookup340: xcm::v2::Response */ XcmV2Response: { _enum: { Null: "Null", @@ -3269,7 +3272,7 @@ export default { Version: "u32", }, }, - /** Lookup342: xcm::v2::traits::Error */ + /** Lookup343: xcm::v2::traits::Error */ XcmV2TraitsError: { _enum: { Overflow: "Null", @@ -3300,18 +3303,18 @@ export default { WeightNotComputable: "Null", }, }, - /** Lookup343: xcm::v2::OriginKind */ + /** Lookup344: xcm::v2::OriginKind */ XcmV2OriginKind: { _enum: ["Native", "SovereignAccount", "Superuser", "Xcm"], }, - /** Lookup344: xcm::v2::multiasset::MultiAssetFilter */ + /** Lookup345: xcm::v2::multiasset::MultiAssetFilter */ XcmV2MultiassetMultiAssetFilter: { _enum: { Definite: "XcmV2MultiassetMultiAssets", Wild: "XcmV2MultiassetWildMultiAsset", }, }, - /** Lookup345: xcm::v2::multiasset::WildMultiAsset */ + /** Lookup346: xcm::v2::multiasset::WildMultiAsset */ XcmV2MultiassetWildMultiAsset: { _enum: { All: "Null", @@ -3321,20 +3324,20 @@ export default { }, }, }, - /** Lookup346: xcm::v2::multiasset::WildFungibility */ + /** Lookup347: xcm::v2::multiasset::WildFungibility */ XcmV2MultiassetWildFungibility: { _enum: ["Fungible", "NonFungible"], }, - /** Lookup347: xcm::v2::WeightLimit */ + /** Lookup348: xcm::v2::WeightLimit */ XcmV2WeightLimit: { _enum: { Unlimited: "Null", Limited: "Compact", }, }, - /** Lookup348: xcm::v3::Xcm */ + /** Lookup349: xcm::v3::Xcm */ XcmV3Xcm: "Vec", - /** Lookup350: xcm::v3::Instruction */ + /** Lookup351: xcm::v3::Instruction */ XcmV3Instruction: { _enum: { WithdrawAsset: "XcmV3MultiassetMultiAssets", @@ -3474,7 +3477,7 @@ export default { }, }, }, - /** Lookup351: xcm::v3::Response */ + /** Lookup352: xcm::v3::Response */ XcmV3Response: { _enum: { Null: "Null", @@ -3485,7 +3488,7 @@ export default { DispatchResult: "XcmV3MaybeErrorCode", }, }, - /** Lookup353: xcm::v3::PalletInfo */ + /** Lookup354: xcm::v3::PalletInfo */ XcmV3PalletInfo: { index: "Compact", name: "Bytes", @@ -3494,20 +3497,20 @@ export default { minor: "Compact", patch: "Compact", }, - /** Lookup357: xcm::v3::QueryResponseInfo */ + /** Lookup358: xcm::v3::QueryResponseInfo */ XcmV3QueryResponseInfo: { destination: "StagingXcmV3MultiLocation", queryId: "Compact", maxWeight: "SpWeightsWeightV2Weight", }, - /** Lookup358: xcm::v3::multiasset::MultiAssetFilter */ + /** Lookup359: xcm::v3::multiasset::MultiAssetFilter */ XcmV3MultiassetMultiAssetFilter: { _enum: { Definite: "XcmV3MultiassetMultiAssets", Wild: "XcmV3MultiassetWildMultiAsset", }, }, - /** Lookup359: xcm::v3::multiasset::WildMultiAsset */ + /** Lookup360: xcm::v3::multiasset::WildMultiAsset */ XcmV3MultiassetWildMultiAsset: { _enum: { All: "Null", @@ -3523,11 +3526,11 @@ export default { }, }, }, - /** Lookup360: xcm::v3::multiasset::WildFungibility */ + /** Lookup361: xcm::v3::multiasset::WildFungibility */ XcmV3MultiassetWildFungibility: { _enum: ["Fungible", "NonFungible"], }, - /** Lookup372: staging_xcm_executor::traits::asset_transfer::TransferType */ + /** Lookup373: staging_xcm_executor::traits::asset_transfer::TransferType */ StagingXcmExecutorAssetTransferTransferType: { _enum: { Teleport: "Null", @@ -3536,7 +3539,7 @@ export default { RemoteReserve: "XcmVersionedLocation", }, }, - /** Lookup373: xcm::VersionedAssetId */ + /** Lookup374: xcm::VersionedAssetId */ XcmVersionedAssetId: { _enum: { __Unused0: "Null", @@ -3546,7 +3549,7 @@ export default { V4: "StagingXcmV4AssetAssetId", }, }, - /** Lookup374: pallet_assets::pallet::Call */ + /** Lookup375: pallet_assets::pallet::Call */ PalletAssetsCall: { _enum: { create: { @@ -3696,7 +3699,7 @@ export default { }, }, }, - /** Lookup375: pallet_foreign_asset_creator::pallet::Call */ + /** Lookup376: pallet_foreign_asset_creator::pallet::Call */ PalletForeignAssetCreatorCall: { _enum: { create_foreign_asset: { @@ -3718,7 +3721,7 @@ export default { }, }, }, - /** Lookup376: pallet_asset_rate::pallet::Call */ + /** Lookup377: pallet_asset_rate::pallet::Call */ PalletAssetRateCall: { _enum: { create: { @@ -3734,7 +3737,7 @@ export default { }, }, }, - /** Lookup377: pallet_message_queue::pallet::Call */ + /** Lookup378: pallet_message_queue::pallet::Call */ PalletMessageQueueCall: { _enum: { reap_page: { @@ -3749,7 +3752,7 @@ export default { }, }, }, - /** Lookup378: pallet_xcm_core_buyer::pallet::Call */ + /** Lookup379: pallet_xcm_core_buyer::pallet::Call */ PalletXcmCoreBuyerCall: { _enum: { buy_core: { @@ -3777,24 +3780,24 @@ export default { }, }, }, - /** Lookup379: tp_xcm_core_buyer::BuyCoreCollatorProof */ + /** Lookup380: tp_xcm_core_buyer::BuyCoreCollatorProof */ TpXcmCoreBuyerBuyCoreCollatorProof: { nonce: "u64", publicKey: "NimbusPrimitivesNimbusCryptoPublic", signature: "NimbusPrimitivesNimbusCryptoSignature", }, - /** Lookup380: nimbus_primitives::nimbus_crypto::Signature */ + /** Lookup381: nimbus_primitives::nimbus_crypto::Signature */ NimbusPrimitivesNimbusCryptoSignature: "[u8;64]", - /** Lookup382: pallet_xcm_core_buyer::pallet::RelayXcmWeightConfigInner */ + /** Lookup383: pallet_xcm_core_buyer::pallet::RelayXcmWeightConfigInner */ PalletXcmCoreBuyerRelayXcmWeightConfigInner: { buyExecutionCost: "u128", weightAtMost: "SpWeightsWeightV2Weight", }, - /** Lookup384: dancebox_runtime::xcm_config::RelayChain */ + /** Lookup385: dancebox_runtime::xcm_config::RelayChain */ DanceboxRuntimeXcmConfigRelayChain: { _enum: ["Westend", "Rococo"], }, - /** Lookup385: pallet_root_testing::pallet::Call */ + /** Lookup386: pallet_root_testing::pallet::Call */ PalletRootTestingCall: { _enum: { fill_block: { @@ -3803,27 +3806,27 @@ export default { trigger_defensive: "Null", }, }, - /** Lookup386: pallet_sudo::pallet::Error */ + /** Lookup387: pallet_sudo::pallet::Error */ PalletSudoError: { _enum: ["RequireSudo"], }, - /** Lookup387: pallet_utility::pallet::Error */ + /** Lookup388: pallet_utility::pallet::Error */ PalletUtilityError: { _enum: ["TooManyCalls"], }, - /** Lookup390: pallet_proxy::ProxyDefinition */ + /** Lookup391: pallet_proxy::ProxyDefinition */ PalletProxyProxyDefinition: { delegate: "AccountId32", proxyType: "DanceboxRuntimeProxyType", delay: "u32", }, - /** Lookup394: pallet_proxy::Announcement */ + /** Lookup395: pallet_proxy::Announcement */ PalletProxyAnnouncement: { real: "AccountId32", callHash: "H256", height: "u32", }, - /** Lookup396: pallet_proxy::pallet::Error */ + /** Lookup397: pallet_proxy::pallet::Error */ PalletProxyError: { _enum: [ "TooMany", @@ -3836,39 +3839,39 @@ export default { "NoSelfProxy", ], }, - /** Lookup397: pallet_migrations::pallet::Error */ + /** Lookup398: pallet_migrations::pallet::Error */ PalletMigrationsError: { _enum: ["PreimageMissing", "WrongUpperBound", "PreimageIsTooBig", "PreimageAlreadyExists"], }, - /** Lookup398: pallet_maintenance_mode::pallet::Error */ + /** Lookup399: pallet_maintenance_mode::pallet::Error */ PalletMaintenanceModeError: { _enum: ["AlreadyInMaintenanceMode", "NotInMaintenanceMode"], }, - /** Lookup399: pallet_tx_pause::pallet::Error */ + /** Lookup400: pallet_tx_pause::pallet::Error */ PalletTxPauseError: { _enum: ["IsPaused", "IsUnpaused", "Unpausable", "NotFound"], }, - /** Lookup401: pallet_balances::types::BalanceLock */ + /** Lookup402: pallet_balances::types::BalanceLock */ PalletBalancesBalanceLock: { id: "[u8;8]", amount: "u128", reasons: "PalletBalancesReasons", }, - /** Lookup402: pallet_balances::types::Reasons */ + /** Lookup403: pallet_balances::types::Reasons */ PalletBalancesReasons: { _enum: ["Fee", "Misc", "All"], }, - /** Lookup405: pallet_balances::types::ReserveData */ + /** Lookup406: pallet_balances::types::ReserveData */ PalletBalancesReserveData: { id: "[u8;8]", amount: "u128", }, - /** Lookup408: frame_support::traits::tokens::misc::IdAmount */ + /** Lookup409: frame_support::traits::tokens::misc::IdAmount */ FrameSupportTokensMiscIdAmountRuntimeHoldReason: { id: "DanceboxRuntimeRuntimeHoldReason", amount: "u128", }, - /** Lookup409: dancebox_runtime::RuntimeHoldReason */ + /** Lookup410: dancebox_runtime::RuntimeHoldReason */ DanceboxRuntimeRuntimeHoldReason: { _enum: { __Unused0: "Null", @@ -3908,28 +3911,28 @@ export default { PooledStaking: "PalletPooledStakingHoldReason", }, }, - /** Lookup410: pallet_stream_payment::pallet::HoldReason */ + /** Lookup411: pallet_stream_payment::pallet::HoldReason */ PalletStreamPaymentHoldReason: { _enum: ["StreamPayment", "StreamOpened"], }, - /** Lookup411: pallet_registrar::pallet::HoldReason */ + /** Lookup412: pallet_registrar::pallet::HoldReason */ PalletRegistrarHoldReason: { _enum: ["RegistrarDeposit"], }, - /** Lookup412: pallet_data_preservers::pallet::HoldReason */ + /** Lookup413: pallet_data_preservers::pallet::HoldReason */ PalletDataPreserversHoldReason: { _enum: ["ProfileDeposit"], }, - /** Lookup413: pallet_pooled_staking::pallet::HoldReason */ + /** Lookup414: pallet_pooled_staking::pallet::HoldReason */ PalletPooledStakingHoldReason: { _enum: ["PooledStake"], }, - /** Lookup416: frame_support::traits::tokens::misc::IdAmount */ + /** Lookup417: frame_support::traits::tokens::misc::IdAmount */ FrameSupportTokensMiscIdAmountRuntimeFreezeReason: { id: "DanceboxRuntimeRuntimeFreezeReason", amount: "u128", }, - /** Lookup417: dancebox_runtime::RuntimeFreezeReason */ + /** Lookup418: dancebox_runtime::RuntimeFreezeReason */ DanceboxRuntimeRuntimeFreezeReason: { _enum: { __Unused0: "Null", @@ -3947,11 +3950,11 @@ export default { StreamPayment: "PalletStreamPaymentFreezeReason", }, }, - /** Lookup418: pallet_stream_payment::pallet::FreezeReason */ + /** Lookup419: pallet_stream_payment::pallet::FreezeReason */ PalletStreamPaymentFreezeReason: { _enum: ["StreamPayment"], }, - /** Lookup420: pallet_balances::pallet::Error */ + /** Lookup421: pallet_balances::pallet::Error */ PalletBalancesError: { _enum: [ "VestingBalance", @@ -3968,12 +3971,12 @@ export default { "DeltaZero", ], }, - /** Lookup421: pallet_transaction_payment::Releases */ + /** Lookup422: pallet_transaction_payment::Releases */ PalletTransactionPaymentReleases: { _enum: ["V1Ancient", "V2"], }, /** - * Lookup422: pallet_stream_payment::pallet::Stream */ PalletStreamPaymentStream: { @@ -3987,7 +3990,7 @@ export default { openingDeposit: "u128", }, /** - * Lookup424: pallet_stream_payment::pallet::ChangeRequest */ PalletStreamPaymentChangeRequest: { @@ -3996,7 +3999,7 @@ export default { newConfig: "PalletStreamPaymentStreamConfig", depositChange: "Option", }, - /** Lookup426: pallet_stream_payment::pallet::Error */ + /** Lookup427: pallet_stream_payment::pallet::Error */ PalletStreamPaymentError: { _enum: [ "UnknownStreamId", @@ -4019,7 +4022,7 @@ export default { ], }, /** - * Lookup428: pallet_identity::types::Registration> */ PalletIdentityRegistration: { @@ -4027,18 +4030,18 @@ export default { deposit: "u128", info: "PalletIdentityLegacyIdentityInfo", }, - /** Lookup437: pallet_identity::types::RegistrarInfo */ + /** Lookup438: pallet_identity::types::RegistrarInfo */ PalletIdentityRegistrarInfo: { account: "AccountId32", fee: "u128", fields: "u64", }, - /** Lookup439: pallet_identity::types::AuthorityProperties> */ + /** Lookup440: pallet_identity::types::AuthorityProperties> */ PalletIdentityAuthorityProperties: { suffix: "Bytes", allocation: "u32", }, - /** Lookup442: pallet_identity::pallet::Error */ + /** Lookup443: pallet_identity::pallet::Error */ PalletIdentityError: { _enum: [ "TooManySubAccounts", @@ -4069,14 +4072,14 @@ export default { "NotExpired", ], }, - /** Lookup444: pallet_multisig::Multisig */ + /** Lookup445: pallet_multisig::Multisig */ PalletMultisigMultisig: { when: "PalletMultisigTimepoint", deposit: "u128", depositor: "AccountId32", approvals: "Vec", }, - /** Lookup446: pallet_multisig::pallet::Error */ + /** Lookup447: pallet_multisig::pallet::Error */ PalletMultisigError: { _enum: [ "MinimumThreshold", @@ -4095,12 +4098,12 @@ export default { "AlreadyStored", ], }, - /** Lookup455: pallet_registrar::pallet::DepositInfo */ + /** Lookup456: pallet_registrar::pallet::DepositInfo */ PalletRegistrarDepositInfo: { creator: "AccountId32", deposit: "u128", }, - /** Lookup456: pallet_registrar::pallet::Error */ + /** Lookup457: pallet_registrar::pallet::Error */ PalletRegistrarError: { _enum: [ "ParaIdAlreadyRegistered", @@ -4118,9 +4121,11 @@ export default { "InvalidRelayStorageProof", "InvalidRelayManagerSignature", "ParaStillExistsInRelay", + "HeadDataNecessary", + "WasmCodeNecessary", ], }, - /** Lookup457: pallet_configuration::HostConfiguration */ + /** Lookup458: pallet_configuration::HostConfiguration */ PalletConfigurationHostConfiguration: { maxCollators: "u32", minOrchestratorCollators: "u32", @@ -4131,22 +4136,22 @@ export default { parathreadsPerCollator: "u32", targetContainerChainFullness: "Perbill", }, - /** Lookup460: pallet_configuration::pallet::Error */ + /** Lookup461: pallet_configuration::pallet::Error */ PalletConfigurationError: { _enum: ["InvalidNewValue"], }, - /** Lookup461: dp_collator_assignment::AssignedCollators */ + /** Lookup462: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsAccountId32: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup466: tp_traits::ContainerChainBlockInfo */ + /** Lookup467: tp_traits::ContainerChainBlockInfo */ TpTraitsContainerChainBlockInfo: { blockNumber: "u32", author: "AccountId32", latestSlotNumber: "u64", }, - /** Lookup467: pallet_author_noting::pallet::Error */ + /** Lookup468: pallet_author_noting::pallet::Error */ PalletAuthorNotingError: { _enum: [ "FailedReading", @@ -4158,23 +4163,23 @@ export default { "NonAuraDigest", ], }, - /** Lookup468: dp_collator_assignment::AssignedCollators */ + /** Lookup469: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsPublic: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup473: pallet_services_payment::pallet::Error */ + /** Lookup474: pallet_services_payment::pallet::Error */ PalletServicesPaymentError: { _enum: ["InsufficientFundsToPurchaseCredits", "InsufficientCredits", "CreditPriceTooExpensive"], }, - /** Lookup474: pallet_data_preservers::types::RegisteredProfile */ + /** Lookup475: pallet_data_preservers::types::RegisteredProfile */ PalletDataPreserversRegisteredProfile: { account: "AccountId32", deposit: "u128", profile: "PalletDataPreserversProfile", assignment: "Option<(u32,DanceboxRuntimePreserversAssignementPaymentWitness)>", }, - /** Lookup480: pallet_data_preservers::pallet::Error */ + /** Lookup481: pallet_data_preservers::pallet::Error */ PalletDataPreserversError: { _enum: [ "NoBootNodes", @@ -4189,7 +4194,7 @@ export default { "CantDeleteAssignedProfile", ], }, - /** Lookup482: pallet_invulnerables::pallet::Error */ + /** Lookup483: pallet_invulnerables::pallet::Error */ PalletInvulnerablesError: { _enum: [ "TooManyInvulnerables", @@ -4199,22 +4204,22 @@ export default { "UnableToDeriveCollatorId", ], }, - /** Lookup487: sp_core::crypto::KeyTypeId */ + /** Lookup488: sp_core::crypto::KeyTypeId */ SpCoreCryptoKeyTypeId: "[u8;4]", - /** Lookup488: pallet_session::pallet::Error */ + /** Lookup489: pallet_session::pallet::Error */ PalletSessionError: { _enum: ["InvalidProof", "NoAssociatedValidatorId", "DuplicatedKey", "NoKeys", "NoAccount"], }, - /** Lookup492: pallet_author_inherent::pallet::Error */ + /** Lookup493: pallet_author_inherent::pallet::Error */ PalletAuthorInherentError: { _enum: ["AuthorAlreadySet", "NoAccountId", "CannotBeAuthor"], }, - /** Lookup494: pallet_pooled_staking::candidate::EligibleCandidate */ + /** Lookup495: pallet_pooled_staking::candidate::EligibleCandidate */ PalletPooledStakingCandidateEligibleCandidate: { candidate: "AccountId32", stake: "u128", }, - /** Lookup497: pallet_pooled_staking::pallet::PoolsKey */ + /** Lookup498: pallet_pooled_staking::pallet::PoolsKey */ PalletPooledStakingPoolsKey: { _enum: { CandidateTotalStake: "Null", @@ -4256,7 +4261,7 @@ export default { }, }, }, - /** Lookup499: pallet_pooled_staking::pallet::Error */ + /** Lookup500: pallet_pooled_staking::pallet::Error */ PalletPooledStakingError: { _enum: { InvalidPalletSetting: "Null", @@ -4275,12 +4280,12 @@ export default { SwapResultsInZeroShares: "Null", }, }, - /** Lookup500: pallet_inflation_rewards::pallet::ChainsToRewardValue */ + /** Lookup501: pallet_inflation_rewards::pallet::ChainsToRewardValue */ PalletInflationRewardsChainsToRewardValue: { paraIds: "Vec", rewardsPerChain: "u128", }, - /** Lookup501: pallet_treasury::Proposal */ + /** Lookup502: pallet_treasury::Proposal */ PalletTreasuryProposal: { proposer: "AccountId32", value: "u128", @@ -4288,7 +4293,7 @@ export default { bond: "u128", }, /** - * Lookup503: pallet_treasury::SpendStatus */ PalletTreasurySpendStatus: { @@ -4299,7 +4304,7 @@ export default { expireAt: "u32", status: "PalletTreasuryPaymentState", }, - /** Lookup504: pallet_treasury::PaymentState */ + /** Lookup505: pallet_treasury::PaymentState */ PalletTreasuryPaymentState: { _enum: { Pending: "Null", @@ -4309,9 +4314,9 @@ export default { Failed: "Null", }, }, - /** Lookup506: frame_support::PalletId */ + /** Lookup507: frame_support::PalletId */ FrameSupportPalletId: "[u8;8]", - /** Lookup507: pallet_treasury::pallet::Error */ + /** Lookup508: pallet_treasury::pallet::Error */ PalletTreasuryError: { _enum: [ "InvalidIndex", @@ -4327,7 +4332,7 @@ export default { "Inconclusive", ], }, - /** Lookup510: cumulus_pallet_xcmp_queue::OutboundChannelDetails */ + /** Lookup511: cumulus_pallet_xcmp_queue::OutboundChannelDetails */ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: "u32", state: "CumulusPalletXcmpQueueOutboundState", @@ -4335,21 +4340,21 @@ export default { firstIndex: "u16", lastIndex: "u16", }, - /** Lookup511: cumulus_pallet_xcmp_queue::OutboundState */ + /** Lookup512: cumulus_pallet_xcmp_queue::OutboundState */ CumulusPalletXcmpQueueOutboundState: { _enum: ["Ok", "Suspended"], }, - /** Lookup515: cumulus_pallet_xcmp_queue::QueueConfigData */ + /** Lookup516: cumulus_pallet_xcmp_queue::QueueConfigData */ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: "u32", dropThreshold: "u32", resumeThreshold: "u32", }, - /** Lookup516: cumulus_pallet_xcmp_queue::pallet::Error */ + /** Lookup517: cumulus_pallet_xcmp_queue::pallet::Error */ CumulusPalletXcmpQueueError: { _enum: ["BadQueueConfig", "AlreadySuspended", "AlreadyResumed", "TooManyActiveOutboundChannels", "TooBig"], }, - /** Lookup517: pallet_xcm::pallet::QueryStatus */ + /** Lookup518: pallet_xcm::pallet::QueryStatus */ PalletXcmQueryStatus: { _enum: { Pending: { @@ -4368,7 +4373,7 @@ export default { }, }, }, - /** Lookup521: xcm::VersionedResponse */ + /** Lookup522: xcm::VersionedResponse */ XcmVersionedResponse: { _enum: { __Unused0: "Null", @@ -4378,7 +4383,7 @@ export default { V4: "StagingXcmV4Response", }, }, - /** Lookup527: pallet_xcm::pallet::VersionMigrationStage */ + /** Lookup528: pallet_xcm::pallet::VersionMigrationStage */ PalletXcmVersionMigrationStage: { _enum: { MigrateSupportedVersion: "Null", @@ -4387,14 +4392,14 @@ export default { MigrateAndNotifyOldTargets: "Null", }, }, - /** Lookup529: pallet_xcm::pallet::RemoteLockedFungibleRecord */ + /** Lookup530: pallet_xcm::pallet::RemoteLockedFungibleRecord */ PalletXcmRemoteLockedFungibleRecord: { amount: "u128", owner: "XcmVersionedLocation", locker: "XcmVersionedLocation", consumers: "Vec<(Null,u128)>", }, - /** Lookup536: pallet_xcm::pallet::Error */ + /** Lookup537: pallet_xcm::pallet::Error */ PalletXcmError: { _enum: [ "Unreachable", @@ -4424,7 +4429,7 @@ export default { "LocalExecutionIncomplete", ], }, - /** Lookup537: pallet_assets::types::AssetDetails */ + /** Lookup538: pallet_assets::types::AssetDetails */ PalletAssetsAssetDetails: { owner: "AccountId32", issuer: "AccountId32", @@ -4439,22 +4444,22 @@ export default { approvals: "u32", status: "PalletAssetsAssetStatus", }, - /** Lookup538: pallet_assets::types::AssetStatus */ + /** Lookup539: pallet_assets::types::AssetStatus */ PalletAssetsAssetStatus: { _enum: ["Live", "Frozen", "Destroying"], }, - /** Lookup540: pallet_assets::types::AssetAccount */ + /** Lookup541: pallet_assets::types::AssetAccount */ PalletAssetsAssetAccount: { balance: "u128", status: "PalletAssetsAccountStatus", reason: "PalletAssetsExistenceReason", extra: "Null", }, - /** Lookup541: pallet_assets::types::AccountStatus */ + /** Lookup542: pallet_assets::types::AccountStatus */ PalletAssetsAccountStatus: { _enum: ["Liquid", "Frozen", "Blocked"], }, - /** Lookup542: pallet_assets::types::ExistenceReason */ + /** Lookup543: pallet_assets::types::ExistenceReason */ PalletAssetsExistenceReason: { _enum: { Consumer: "Null", @@ -4464,12 +4469,12 @@ export default { DepositFrom: "(AccountId32,u128)", }, }, - /** Lookup544: pallet_assets::types::Approval */ + /** Lookup545: pallet_assets::types::Approval */ PalletAssetsApproval: { amount: "u128", deposit: "u128", }, - /** Lookup545: pallet_assets::types::AssetMetadata> */ + /** Lookup546: pallet_assets::types::AssetMetadata> */ PalletAssetsAssetMetadata: { deposit: "u128", name: "Bytes", @@ -4477,7 +4482,7 @@ export default { decimals: "u8", isFrozen: "bool", }, - /** Lookup547: pallet_assets::pallet::Error */ + /** Lookup548: pallet_assets::pallet::Error */ PalletAssetsError: { _enum: [ "BalanceLow", @@ -4503,15 +4508,15 @@ export default { "BadAssetId", ], }, - /** Lookup548: pallet_foreign_asset_creator::pallet::Error */ + /** Lookup549: pallet_foreign_asset_creator::pallet::Error */ PalletForeignAssetCreatorError: { _enum: ["AssetAlreadyExists", "AssetDoesNotExist"], }, - /** Lookup549: pallet_asset_rate::pallet::Error */ + /** Lookup550: pallet_asset_rate::pallet::Error */ PalletAssetRateError: { _enum: ["UnknownAssetKind", "AlreadyExists", "Overflow"], }, - /** Lookup550: pallet_message_queue::BookState */ + /** Lookup551: pallet_message_queue::BookState */ PalletMessageQueueBookState: { _alias: { size_: "size", @@ -4523,12 +4528,12 @@ export default { messageCount: "u64", size_: "u64", }, - /** Lookup552: pallet_message_queue::Neighbours */ + /** Lookup553: pallet_message_queue::Neighbours */ PalletMessageQueueNeighbours: { prev: "CumulusPrimitivesCoreAggregateMessageOrigin", next: "CumulusPrimitivesCoreAggregateMessageOrigin", }, - /** Lookup554: pallet_message_queue::Page */ + /** Lookup555: pallet_message_queue::Page */ PalletMessageQueuePage: { remaining: "u32", remainingSize: "u32", @@ -4537,7 +4542,7 @@ export default { last: "u32", heap: "Bytes", }, - /** Lookup556: pallet_message_queue::pallet::Error */ + /** Lookup557: pallet_message_queue::pallet::Error */ PalletMessageQueueError: { _enum: [ "NotReapable", @@ -4551,13 +4556,13 @@ export default { "RecursiveDisallowed", ], }, - /** Lookup557: pallet_xcm_core_buyer::InFlightCoreBuyingOrder */ + /** Lookup558: pallet_xcm_core_buyer::InFlightCoreBuyingOrder */ PalletXcmCoreBuyerInFlightCoreBuyingOrder: { paraId: "u32", queryId: "u64", ttl: "u32", }, - /** Lookup558: pallet_xcm_core_buyer::pallet::Error */ + /** Lookup559: pallet_xcm_core_buyer::pallet::Error */ PalletXcmCoreBuyerError: { _enum: [ "InvalidProof", @@ -4579,22 +4584,22 @@ export default { "InvalidCollatorSignature", ], }, - /** Lookup563: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ + /** Lookup564: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ FrameSystemExtensionsCheckNonZeroSender: "Null", - /** Lookup564: frame_system::extensions::check_spec_version::CheckSpecVersion */ + /** Lookup565: frame_system::extensions::check_spec_version::CheckSpecVersion */ FrameSystemExtensionsCheckSpecVersion: "Null", - /** Lookup565: frame_system::extensions::check_tx_version::CheckTxVersion */ + /** Lookup566: frame_system::extensions::check_tx_version::CheckTxVersion */ FrameSystemExtensionsCheckTxVersion: "Null", - /** Lookup566: frame_system::extensions::check_genesis::CheckGenesis */ + /** Lookup567: frame_system::extensions::check_genesis::CheckGenesis */ FrameSystemExtensionsCheckGenesis: "Null", - /** Lookup569: frame_system::extensions::check_nonce::CheckNonce */ + /** Lookup570: frame_system::extensions::check_nonce::CheckNonce */ FrameSystemExtensionsCheckNonce: "Compact", - /** Lookup570: frame_system::extensions::check_weight::CheckWeight */ + /** Lookup571: frame_system::extensions::check_weight::CheckWeight */ FrameSystemExtensionsCheckWeight: "Null", - /** Lookup571: pallet_transaction_payment::ChargeTransactionPayment */ + /** Lookup572: pallet_transaction_payment::ChargeTransactionPayment */ PalletTransactionPaymentChargeTransactionPayment: "Compact", - /** Lookup572: cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim */ + /** Lookup573: cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim */ CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim: "Null", - /** Lookup573: dancebox_runtime::Runtime */ + /** Lookup574: dancebox_runtime::Runtime */ DanceboxRuntimeRuntime: "Null", }; diff --git a/typescript-api/src/dancebox/interfaces/types-lookup.ts b/typescript-api/src/dancebox/interfaces/types-lookup.ts index 1042d598c..ba5e5ed7a 100644 --- a/typescript-api/src/dancebox/interfaces/types-lookup.ts +++ b/typescript-api/src/dancebox/interfaces/types-lookup.ts @@ -3595,6 +3595,7 @@ declare module "@polkadot/types/lookup" { readonly asRegister: { readonly paraId: u32; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isDeregister: boolean; readonly asDeregister: { @@ -3617,6 +3618,7 @@ declare module "@polkadot/types/lookup" { readonly paraId: u32; readonly slotFrequency: TpTraitsSlotFrequency; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isSetParathreadParams: boolean; readonly asSetParathreadParams: { @@ -3636,6 +3638,7 @@ declare module "@polkadot/types/lookup" { readonly relayStorageProof: SpTrieStorageProof; readonly managerSignature: SpRuntimeMultiSignature; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isDeregisterWithRelayProof: boolean; readonly asDeregisterWithRelayProof: { @@ -3685,18 +3688,18 @@ declare module "@polkadot/types/lookup" { readonly tokenDecimals: u32; } - /** @name TpTraitsSlotFrequency (299) */ + /** @name TpTraitsSlotFrequency (300) */ interface TpTraitsSlotFrequency extends Struct { readonly min: u32; readonly max: u32; } - /** @name TpTraitsParathreadParams (301) */ + /** @name TpTraitsParathreadParams (302) */ interface TpTraitsParathreadParams extends Struct { readonly slotFrequency: TpTraitsSlotFrequency; } - /** @name PalletConfigurationCall (302) */ + /** @name PalletConfigurationCall (303) */ interface PalletConfigurationCall extends Enum { readonly isSetMaxCollators: boolean; readonly asSetMaxCollators: { @@ -3746,10 +3749,10 @@ declare module "@polkadot/types/lookup" { | "SetBypassConsistencyCheck"; } - /** @name PalletCollatorAssignmentCall (304) */ + /** @name PalletCollatorAssignmentCall (305) */ type PalletCollatorAssignmentCall = Null; - /** @name PalletAuthorNotingCall (305) */ + /** @name PalletAuthorNotingCall (306) */ interface PalletAuthorNotingCall extends Enum { readonly isSetLatestAuthorData: boolean; readonly asSetLatestAuthorData: { @@ -3769,15 +3772,15 @@ declare module "@polkadot/types/lookup" { readonly type: "SetLatestAuthorData" | "SetAuthor" | "KillAuthorData"; } - /** @name TpAuthorNotingInherentOwnParachainInherentData (306) */ + /** @name TpAuthorNotingInherentOwnParachainInherentData (307) */ interface TpAuthorNotingInherentOwnParachainInherentData extends Struct { readonly relayStorageProof: SpTrieStorageProof; } - /** @name PalletAuthorityAssignmentCall (307) */ + /** @name PalletAuthorityAssignmentCall (308) */ type PalletAuthorityAssignmentCall = Null; - /** @name PalletServicesPaymentCall (308) */ + /** @name PalletServicesPaymentCall (309) */ interface PalletServicesPaymentCall extends Enum { readonly isPurchaseCredits: boolean; readonly asPurchaseCredits: { @@ -3824,7 +3827,7 @@ declare module "@polkadot/types/lookup" { | "SetMaxTip"; } - /** @name PalletDataPreserversCall (309) */ + /** @name PalletDataPreserversCall (310) */ interface PalletDataPreserversCall extends Enum { readonly isCreateProfile: boolean; readonly asCreateProfile: { @@ -3882,7 +3885,7 @@ declare module "@polkadot/types/lookup" { | "ForceStartAssignment"; } - /** @name PalletDataPreserversProfile (310) */ + /** @name PalletDataPreserversProfile (311) */ interface PalletDataPreserversProfile extends Struct { readonly url: Bytes; readonly paraIds: PalletDataPreserversParaIdsFilter; @@ -3890,7 +3893,7 @@ declare module "@polkadot/types/lookup" { readonly assignmentRequest: DanceboxRuntimePreserversAssignementPaymentRequest; } - /** @name PalletDataPreserversParaIdsFilter (312) */ + /** @name PalletDataPreserversParaIdsFilter (313) */ interface PalletDataPreserversParaIdsFilter extends Enum { readonly isAnyParaId: boolean; readonly isWhitelist: boolean; @@ -3900,7 +3903,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AnyParaId" | "Whitelist" | "Blacklist"; } - /** @name PalletDataPreserversProfileMode (315) */ + /** @name PalletDataPreserversProfileMode (316) */ interface PalletDataPreserversProfileMode extends Enum { readonly isBootnode: boolean; readonly isRpc: boolean; @@ -3910,25 +3913,25 @@ declare module "@polkadot/types/lookup" { readonly type: "Bootnode" | "Rpc"; } - /** @name DanceboxRuntimePreserversAssignementPaymentRequest (316) */ + /** @name DanceboxRuntimePreserversAssignementPaymentRequest (317) */ interface DanceboxRuntimePreserversAssignementPaymentRequest extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name DanceboxRuntimePreserversAssignementPaymentExtra (317) */ + /** @name DanceboxRuntimePreserversAssignementPaymentExtra (318) */ interface DanceboxRuntimePreserversAssignementPaymentExtra extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name DanceboxRuntimePreserversAssignementPaymentWitness (318) */ + /** @name DanceboxRuntimePreserversAssignementPaymentWitness (319) */ interface DanceboxRuntimePreserversAssignementPaymentWitness extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name PalletInvulnerablesCall (319) */ + /** @name PalletInvulnerablesCall (320) */ interface PalletInvulnerablesCall extends Enum { readonly isAddInvulnerable: boolean; readonly asAddInvulnerable: { @@ -3941,7 +3944,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AddInvulnerable" | "RemoveInvulnerable"; } - /** @name PalletSessionCall (320) */ + /** @name PalletSessionCall (321) */ interface PalletSessionCall extends Enum { readonly isSetKeys: boolean; readonly asSetKeys: { @@ -3952,21 +3955,21 @@ declare module "@polkadot/types/lookup" { readonly type: "SetKeys" | "PurgeKeys"; } - /** @name DanceboxRuntimeSessionKeys (321) */ + /** @name DanceboxRuntimeSessionKeys (322) */ interface DanceboxRuntimeSessionKeys extends Struct { readonly nimbus: NimbusPrimitivesNimbusCryptoPublic; } - /** @name NimbusPrimitivesNimbusCryptoPublic (322) */ + /** @name NimbusPrimitivesNimbusCryptoPublic (323) */ interface NimbusPrimitivesNimbusCryptoPublic extends U8aFixed {} - /** @name PalletAuthorInherentCall (323) */ + /** @name PalletAuthorInherentCall (324) */ interface PalletAuthorInherentCall extends Enum { readonly isKickOffAuthorshipValidation: boolean; readonly type: "KickOffAuthorshipValidation"; } - /** @name PalletPooledStakingCall (324) */ + /** @name PalletPooledStakingCall (325) */ interface PalletPooledStakingCall extends Enum { readonly isRebalanceHold: boolean; readonly asRebalanceHold: { @@ -4014,7 +4017,7 @@ declare module "@polkadot/types/lookup" { | "SwapPool"; } - /** @name PalletPooledStakingAllTargetPool (325) */ + /** @name PalletPooledStakingAllTargetPool (326) */ interface PalletPooledStakingAllTargetPool extends Enum { readonly isJoining: boolean; readonly isAutoCompounding: boolean; @@ -4023,13 +4026,13 @@ declare module "@polkadot/types/lookup" { readonly type: "Joining" | "AutoCompounding" | "ManualRewards" | "Leaving"; } - /** @name PalletPooledStakingPendingOperationQuery (327) */ + /** @name PalletPooledStakingPendingOperationQuery (328) */ interface PalletPooledStakingPendingOperationQuery extends Struct { readonly delegator: AccountId32; readonly operation: PalletPooledStakingPendingOperationKey; } - /** @name PalletPooledStakingPendingOperationKey (328) */ + /** @name PalletPooledStakingPendingOperationKey (329) */ interface PalletPooledStakingPendingOperationKey extends Enum { readonly isJoiningAutoCompounding: boolean; readonly asJoiningAutoCompounding: { @@ -4049,7 +4052,7 @@ declare module "@polkadot/types/lookup" { readonly type: "JoiningAutoCompounding" | "JoiningManualRewards" | "Leaving"; } - /** @name PalletPooledStakingSharesOrStake (329) */ + /** @name PalletPooledStakingSharesOrStake (330) */ interface PalletPooledStakingSharesOrStake extends Enum { readonly isShares: boolean; readonly asShares: u128; @@ -4058,7 +4061,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Shares" | "Stake"; } - /** @name PalletTreasuryCall (332) */ + /** @name PalletTreasuryCall (333) */ interface PalletTreasuryCall extends Enum { readonly isSpendLocal: boolean; readonly asSpendLocal: { @@ -4091,7 +4094,7 @@ declare module "@polkadot/types/lookup" { readonly type: "SpendLocal" | "RemoveApproval" | "Spend" | "Payout" | "CheckStatus" | "VoidSpend"; } - /** @name CumulusPalletXcmpQueueCall (333) */ + /** @name CumulusPalletXcmpQueueCall (334) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isSuspendXcmExecution: boolean; readonly isResumeXcmExecution: boolean; @@ -4115,7 +4118,7 @@ declare module "@polkadot/types/lookup" { | "UpdateResumeThreshold"; } - /** @name PalletXcmCall (334) */ + /** @name PalletXcmCall (335) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -4218,7 +4221,7 @@ declare module "@polkadot/types/lookup" { | "TransferAssetsUsingTypeAndThen"; } - /** @name XcmVersionedXcm (335) */ + /** @name XcmVersionedXcm (336) */ interface XcmVersionedXcm extends Enum { readonly isV2: boolean; readonly asV2: XcmV2Xcm; @@ -4229,10 +4232,10 @@ declare module "@polkadot/types/lookup" { readonly type: "V2" | "V3" | "V4"; } - /** @name XcmV2Xcm (336) */ + /** @name XcmV2Xcm (337) */ interface XcmV2Xcm extends Vec {} - /** @name XcmV2Instruction (338) */ + /** @name XcmV2Instruction (339) */ interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV2MultiassetMultiAssets; @@ -4380,7 +4383,7 @@ declare module "@polkadot/types/lookup" { | "UnsubscribeVersion"; } - /** @name XcmV2Response (339) */ + /** @name XcmV2Response (340) */ interface XcmV2Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; @@ -4392,7 +4395,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Null" | "Assets" | "ExecutionResult" | "Version"; } - /** @name XcmV2TraitsError (342) */ + /** @name XcmV2TraitsError (343) */ interface XcmV2TraitsError extends Enum { readonly isOverflow: boolean; readonly isUnimplemented: boolean; @@ -4451,7 +4454,7 @@ declare module "@polkadot/types/lookup" { | "WeightNotComputable"; } - /** @name XcmV2OriginKind (343) */ + /** @name XcmV2OriginKind (344) */ interface XcmV2OriginKind extends Enum { readonly isNative: boolean; readonly isSovereignAccount: boolean; @@ -4460,7 +4463,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Native" | "SovereignAccount" | "Superuser" | "Xcm"; } - /** @name XcmV2MultiassetMultiAssetFilter (344) */ + /** @name XcmV2MultiassetMultiAssetFilter (345) */ interface XcmV2MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV2MultiassetMultiAssets; @@ -4469,7 +4472,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Definite" | "Wild"; } - /** @name XcmV2MultiassetWildMultiAsset (345) */ + /** @name XcmV2MultiassetWildMultiAsset (346) */ interface XcmV2MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; @@ -4480,14 +4483,14 @@ declare module "@polkadot/types/lookup" { readonly type: "All" | "AllOf"; } - /** @name XcmV2MultiassetWildFungibility (346) */ + /** @name XcmV2MultiassetWildFungibility (347) */ interface XcmV2MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: "Fungible" | "NonFungible"; } - /** @name XcmV2WeightLimit (347) */ + /** @name XcmV2WeightLimit (348) */ interface XcmV2WeightLimit extends Enum { readonly isUnlimited: boolean; readonly isLimited: boolean; @@ -4495,10 +4498,10 @@ declare module "@polkadot/types/lookup" { readonly type: "Unlimited" | "Limited"; } - /** @name XcmV3Xcm (348) */ + /** @name XcmV3Xcm (349) */ interface XcmV3Xcm extends Vec {} - /** @name XcmV3Instruction (350) */ + /** @name XcmV3Instruction (351) */ interface XcmV3Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV3MultiassetMultiAssets; @@ -4728,7 +4731,7 @@ declare module "@polkadot/types/lookup" { | "UnpaidExecution"; } - /** @name XcmV3Response (351) */ + /** @name XcmV3Response (352) */ interface XcmV3Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; @@ -4744,7 +4747,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Null" | "Assets" | "ExecutionResult" | "Version" | "PalletsInfo" | "DispatchResult"; } - /** @name XcmV3PalletInfo (353) */ + /** @name XcmV3PalletInfo (354) */ interface XcmV3PalletInfo extends Struct { readonly index: Compact; readonly name: Bytes; @@ -4754,14 +4757,14 @@ declare module "@polkadot/types/lookup" { readonly patch: Compact; } - /** @name XcmV3QueryResponseInfo (357) */ + /** @name XcmV3QueryResponseInfo (358) */ interface XcmV3QueryResponseInfo extends Struct { readonly destination: StagingXcmV3MultiLocation; readonly queryId: Compact; readonly maxWeight: SpWeightsWeightV2Weight; } - /** @name XcmV3MultiassetMultiAssetFilter (358) */ + /** @name XcmV3MultiassetMultiAssetFilter (359) */ interface XcmV3MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV3MultiassetMultiAssets; @@ -4770,7 +4773,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Definite" | "Wild"; } - /** @name XcmV3MultiassetWildMultiAsset (359) */ + /** @name XcmV3MultiassetWildMultiAsset (360) */ interface XcmV3MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; @@ -4789,14 +4792,14 @@ declare module "@polkadot/types/lookup" { readonly type: "All" | "AllOf" | "AllCounted" | "AllOfCounted"; } - /** @name XcmV3MultiassetWildFungibility (360) */ + /** @name XcmV3MultiassetWildFungibility (361) */ interface XcmV3MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: "Fungible" | "NonFungible"; } - /** @name StagingXcmExecutorAssetTransferTransferType (372) */ + /** @name StagingXcmExecutorAssetTransferTransferType (373) */ interface StagingXcmExecutorAssetTransferTransferType extends Enum { readonly isTeleport: boolean; readonly isLocalReserve: boolean; @@ -4806,7 +4809,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Teleport" | "LocalReserve" | "DestinationReserve" | "RemoteReserve"; } - /** @name XcmVersionedAssetId (373) */ + /** @name XcmVersionedAssetId (374) */ interface XcmVersionedAssetId extends Enum { readonly isV3: boolean; readonly asV3: XcmV3MultiassetAssetId; @@ -4815,7 +4818,7 @@ declare module "@polkadot/types/lookup" { readonly type: "V3" | "V4"; } - /** @name PalletAssetsCall (374) */ + /** @name PalletAssetsCall (375) */ interface PalletAssetsCall extends Enum { readonly isCreate: boolean; readonly asCreate: { @@ -5029,7 +5032,7 @@ declare module "@polkadot/types/lookup" { | "Block"; } - /** @name PalletForeignAssetCreatorCall (375) */ + /** @name PalletForeignAssetCreatorCall (376) */ interface PalletForeignAssetCreatorCall extends Enum { readonly isCreateForeignAsset: boolean; readonly asCreateForeignAsset: { @@ -5059,7 +5062,7 @@ declare module "@polkadot/types/lookup" { | "DestroyForeignAsset"; } - /** @name PalletAssetRateCall (376) */ + /** @name PalletAssetRateCall (377) */ interface PalletAssetRateCall extends Enum { readonly isCreate: boolean; readonly asCreate: { @@ -5078,7 +5081,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Create" | "Update" | "Remove"; } - /** @name PalletMessageQueueCall (377) */ + /** @name PalletMessageQueueCall (378) */ interface PalletMessageQueueCall extends Enum { readonly isReapPage: boolean; readonly asReapPage: { @@ -5095,7 +5098,7 @@ declare module "@polkadot/types/lookup" { readonly type: "ReapPage" | "ExecuteOverweight"; } - /** @name PalletXcmCoreBuyerCall (378) */ + /** @name PalletXcmCoreBuyerCall (379) */ interface PalletXcmCoreBuyerCall extends Enum { readonly isBuyCore: boolean; readonly asBuyCore: { @@ -5137,30 +5140,30 @@ declare module "@polkadot/types/lookup" { | "CleanUpExpiredInFlightOrders"; } - /** @name TpXcmCoreBuyerBuyCoreCollatorProof (379) */ + /** @name TpXcmCoreBuyerBuyCoreCollatorProof (380) */ interface TpXcmCoreBuyerBuyCoreCollatorProof extends Struct { readonly nonce: u64; readonly publicKey: NimbusPrimitivesNimbusCryptoPublic; readonly signature: NimbusPrimitivesNimbusCryptoSignature; } - /** @name NimbusPrimitivesNimbusCryptoSignature (380) */ + /** @name NimbusPrimitivesNimbusCryptoSignature (381) */ interface NimbusPrimitivesNimbusCryptoSignature extends U8aFixed {} - /** @name PalletXcmCoreBuyerRelayXcmWeightConfigInner (382) */ + /** @name PalletXcmCoreBuyerRelayXcmWeightConfigInner (383) */ interface PalletXcmCoreBuyerRelayXcmWeightConfigInner extends Struct { readonly buyExecutionCost: u128; readonly weightAtMost: SpWeightsWeightV2Weight; } - /** @name DanceboxRuntimeXcmConfigRelayChain (384) */ + /** @name DanceboxRuntimeXcmConfigRelayChain (385) */ interface DanceboxRuntimeXcmConfigRelayChain extends Enum { readonly isWestend: boolean; readonly isRococo: boolean; readonly type: "Westend" | "Rococo"; } - /** @name PalletRootTestingCall (385) */ + /** @name PalletRootTestingCall (386) */ interface PalletRootTestingCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -5170,33 +5173,33 @@ declare module "@polkadot/types/lookup" { readonly type: "FillBlock" | "TriggerDefensive"; } - /** @name PalletSudoError (386) */ + /** @name PalletSudoError (387) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: "RequireSudo"; } - /** @name PalletUtilityError (387) */ + /** @name PalletUtilityError (388) */ interface PalletUtilityError extends Enum { readonly isTooManyCalls: boolean; readonly type: "TooManyCalls"; } - /** @name PalletProxyProxyDefinition (390) */ + /** @name PalletProxyProxyDefinition (391) */ interface PalletProxyProxyDefinition extends Struct { readonly delegate: AccountId32; readonly proxyType: DanceboxRuntimeProxyType; readonly delay: u32; } - /** @name PalletProxyAnnouncement (394) */ + /** @name PalletProxyAnnouncement (395) */ interface PalletProxyAnnouncement extends Struct { readonly real: AccountId32; readonly callHash: H256; readonly height: u32; } - /** @name PalletProxyError (396) */ + /** @name PalletProxyError (397) */ interface PalletProxyError extends Enum { readonly isTooMany: boolean; readonly isNotFound: boolean; @@ -5217,7 +5220,7 @@ declare module "@polkadot/types/lookup" { | "NoSelfProxy"; } - /** @name PalletMigrationsError (397) */ + /** @name PalletMigrationsError (398) */ interface PalletMigrationsError extends Enum { readonly isPreimageMissing: boolean; readonly isWrongUpperBound: boolean; @@ -5226,14 +5229,14 @@ declare module "@polkadot/types/lookup" { readonly type: "PreimageMissing" | "WrongUpperBound" | "PreimageIsTooBig" | "PreimageAlreadyExists"; } - /** @name PalletMaintenanceModeError (398) */ + /** @name PalletMaintenanceModeError (399) */ interface PalletMaintenanceModeError extends Enum { readonly isAlreadyInMaintenanceMode: boolean; readonly isNotInMaintenanceMode: boolean; readonly type: "AlreadyInMaintenanceMode" | "NotInMaintenanceMode"; } - /** @name PalletTxPauseError (399) */ + /** @name PalletTxPauseError (400) */ interface PalletTxPauseError extends Enum { readonly isIsPaused: boolean; readonly isIsUnpaused: boolean; @@ -5242,14 +5245,14 @@ declare module "@polkadot/types/lookup" { readonly type: "IsPaused" | "IsUnpaused" | "Unpausable" | "NotFound"; } - /** @name PalletBalancesBalanceLock (401) */ + /** @name PalletBalancesBalanceLock (402) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (402) */ + /** @name PalletBalancesReasons (403) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -5257,19 +5260,19 @@ declare module "@polkadot/types/lookup" { readonly type: "Fee" | "Misc" | "All"; } - /** @name PalletBalancesReserveData (405) */ + /** @name PalletBalancesReserveData (406) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name FrameSupportTokensMiscIdAmountRuntimeHoldReason (408) */ + /** @name FrameSupportTokensMiscIdAmountRuntimeHoldReason (409) */ interface FrameSupportTokensMiscIdAmountRuntimeHoldReason extends Struct { readonly id: DanceboxRuntimeRuntimeHoldReason; readonly amount: u128; } - /** @name DanceboxRuntimeRuntimeHoldReason (409) */ + /** @name DanceboxRuntimeRuntimeHoldReason (410) */ interface DanceboxRuntimeRuntimeHoldReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentHoldReason; @@ -5282,51 +5285,51 @@ declare module "@polkadot/types/lookup" { readonly type: "StreamPayment" | "Registrar" | "DataPreservers" | "PooledStaking"; } - /** @name PalletStreamPaymentHoldReason (410) */ + /** @name PalletStreamPaymentHoldReason (411) */ interface PalletStreamPaymentHoldReason extends Enum { readonly isStreamPayment: boolean; readonly isStreamOpened: boolean; readonly type: "StreamPayment" | "StreamOpened"; } - /** @name PalletRegistrarHoldReason (411) */ + /** @name PalletRegistrarHoldReason (412) */ interface PalletRegistrarHoldReason extends Enum { readonly isRegistrarDeposit: boolean; readonly type: "RegistrarDeposit"; } - /** @name PalletDataPreserversHoldReason (412) */ + /** @name PalletDataPreserversHoldReason (413) */ interface PalletDataPreserversHoldReason extends Enum { readonly isProfileDeposit: boolean; readonly type: "ProfileDeposit"; } - /** @name PalletPooledStakingHoldReason (413) */ + /** @name PalletPooledStakingHoldReason (414) */ interface PalletPooledStakingHoldReason extends Enum { readonly isPooledStake: boolean; readonly type: "PooledStake"; } - /** @name FrameSupportTokensMiscIdAmountRuntimeFreezeReason (416) */ + /** @name FrameSupportTokensMiscIdAmountRuntimeFreezeReason (417) */ interface FrameSupportTokensMiscIdAmountRuntimeFreezeReason extends Struct { readonly id: DanceboxRuntimeRuntimeFreezeReason; readonly amount: u128; } - /** @name DanceboxRuntimeRuntimeFreezeReason (417) */ + /** @name DanceboxRuntimeRuntimeFreezeReason (418) */ interface DanceboxRuntimeRuntimeFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentFreezeReason; readonly type: "StreamPayment"; } - /** @name PalletStreamPaymentFreezeReason (418) */ + /** @name PalletStreamPaymentFreezeReason (419) */ interface PalletStreamPaymentFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly type: "StreamPayment"; } - /** @name PalletBalancesError (420) */ + /** @name PalletBalancesError (421) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -5355,14 +5358,14 @@ declare module "@polkadot/types/lookup" { | "DeltaZero"; } - /** @name PalletTransactionPaymentReleases (421) */ + /** @name PalletTransactionPaymentReleases (422) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: "V1Ancient" | "V2"; } - /** @name PalletStreamPaymentStream (422) */ + /** @name PalletStreamPaymentStream (423) */ interface PalletStreamPaymentStream extends Struct { readonly source: AccountId32; readonly target: AccountId32; @@ -5374,7 +5377,7 @@ declare module "@polkadot/types/lookup" { readonly openingDeposit: u128; } - /** @name PalletStreamPaymentChangeRequest (424) */ + /** @name PalletStreamPaymentChangeRequest (425) */ interface PalletStreamPaymentChangeRequest extends Struct { readonly requester: PalletStreamPaymentParty; readonly kind: PalletStreamPaymentChangeKind; @@ -5382,7 +5385,7 @@ declare module "@polkadot/types/lookup" { readonly depositChange: Option; } - /** @name PalletStreamPaymentError (426) */ + /** @name PalletStreamPaymentError (427) */ interface PalletStreamPaymentError extends Enum { readonly isUnknownStreamId: boolean; readonly isStreamIdOverflow: boolean; @@ -5421,27 +5424,27 @@ declare module "@polkadot/types/lookup" { | "CantFetchStatusBeforeLastTimeUpdated"; } - /** @name PalletIdentityRegistration (428) */ + /** @name PalletIdentityRegistration (429) */ interface PalletIdentityRegistration extends Struct { readonly judgements: Vec>; readonly deposit: u128; readonly info: PalletIdentityLegacyIdentityInfo; } - /** @name PalletIdentityRegistrarInfo (437) */ + /** @name PalletIdentityRegistrarInfo (438) */ interface PalletIdentityRegistrarInfo extends Struct { readonly account: AccountId32; readonly fee: u128; readonly fields: u64; } - /** @name PalletIdentityAuthorityProperties (439) */ + /** @name PalletIdentityAuthorityProperties (440) */ interface PalletIdentityAuthorityProperties extends Struct { readonly suffix: Bytes; readonly allocation: u32; } - /** @name PalletIdentityError (442) */ + /** @name PalletIdentityError (443) */ interface PalletIdentityError extends Enum { readonly isTooManySubAccounts: boolean; readonly isNotFound: boolean; @@ -5498,7 +5501,7 @@ declare module "@polkadot/types/lookup" { | "NotExpired"; } - /** @name PalletMultisigMultisig (444) */ + /** @name PalletMultisigMultisig (445) */ interface PalletMultisigMultisig extends Struct { readonly when: PalletMultisigTimepoint; readonly deposit: u128; @@ -5506,7 +5509,7 @@ declare module "@polkadot/types/lookup" { readonly approvals: Vec; } - /** @name PalletMultisigError (446) */ + /** @name PalletMultisigError (447) */ interface PalletMultisigError extends Enum { readonly isMinimumThreshold: boolean; readonly isAlreadyApproved: boolean; @@ -5539,13 +5542,13 @@ declare module "@polkadot/types/lookup" { | "AlreadyStored"; } - /** @name PalletRegistrarDepositInfo (455) */ + /** @name PalletRegistrarDepositInfo (456) */ interface PalletRegistrarDepositInfo extends Struct { readonly creator: AccountId32; readonly deposit: u128; } - /** @name PalletRegistrarError (456) */ + /** @name PalletRegistrarError (457) */ interface PalletRegistrarError extends Enum { readonly isParaIdAlreadyRegistered: boolean; readonly isParaIdNotRegistered: boolean; @@ -5562,6 +5565,8 @@ declare module "@polkadot/types/lookup" { readonly isInvalidRelayStorageProof: boolean; readonly isInvalidRelayManagerSignature: boolean; readonly isParaStillExistsInRelay: boolean; + readonly isHeadDataNecessary: boolean; + readonly isWasmCodeNecessary: boolean; readonly type: | "ParaIdAlreadyRegistered" | "ParaIdNotRegistered" @@ -5577,10 +5582,12 @@ declare module "@polkadot/types/lookup" { | "RelayStorageRootNotFound" | "InvalidRelayStorageProof" | "InvalidRelayManagerSignature" - | "ParaStillExistsInRelay"; + | "ParaStillExistsInRelay" + | "HeadDataNecessary" + | "WasmCodeNecessary"; } - /** @name PalletConfigurationHostConfiguration (457) */ + /** @name PalletConfigurationHostConfiguration (458) */ interface PalletConfigurationHostConfiguration extends Struct { readonly maxCollators: u32; readonly minOrchestratorCollators: u32; @@ -5592,26 +5599,26 @@ declare module "@polkadot/types/lookup" { readonly targetContainerChainFullness: Perbill; } - /** @name PalletConfigurationError (460) */ + /** @name PalletConfigurationError (461) */ interface PalletConfigurationError extends Enum { readonly isInvalidNewValue: boolean; readonly type: "InvalidNewValue"; } - /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (461) */ + /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (462) */ interface DpCollatorAssignmentAssignedCollatorsAccountId32 extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name TpTraitsContainerChainBlockInfo (466) */ + /** @name TpTraitsContainerChainBlockInfo (467) */ interface TpTraitsContainerChainBlockInfo extends Struct { readonly blockNumber: u32; readonly author: AccountId32; readonly latestSlotNumber: u64; } - /** @name PalletAuthorNotingError (467) */ + /** @name PalletAuthorNotingError (468) */ interface PalletAuthorNotingError extends Enum { readonly isFailedReading: boolean; readonly isFailedDecodingHeader: boolean; @@ -5630,13 +5637,13 @@ declare module "@polkadot/types/lookup" { | "NonAuraDigest"; } - /** @name DpCollatorAssignmentAssignedCollatorsPublic (468) */ + /** @name DpCollatorAssignmentAssignedCollatorsPublic (469) */ interface DpCollatorAssignmentAssignedCollatorsPublic extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletServicesPaymentError (473) */ + /** @name PalletServicesPaymentError (474) */ interface PalletServicesPaymentError extends Enum { readonly isInsufficientFundsToPurchaseCredits: boolean; readonly isInsufficientCredits: boolean; @@ -5644,7 +5651,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InsufficientFundsToPurchaseCredits" | "InsufficientCredits" | "CreditPriceTooExpensive"; } - /** @name PalletDataPreserversRegisteredProfile (474) */ + /** @name PalletDataPreserversRegisteredProfile (475) */ interface PalletDataPreserversRegisteredProfile extends Struct { readonly account: AccountId32; readonly deposit: u128; @@ -5652,7 +5659,7 @@ declare module "@polkadot/types/lookup" { readonly assignment: Option>; } - /** @name PalletDataPreserversError (480) */ + /** @name PalletDataPreserversError (481) */ interface PalletDataPreserversError extends Enum { readonly isNoBootNodes: boolean; readonly isUnknownProfileId: boolean; @@ -5677,7 +5684,7 @@ declare module "@polkadot/types/lookup" { | "CantDeleteAssignedProfile"; } - /** @name PalletInvulnerablesError (482) */ + /** @name PalletInvulnerablesError (483) */ interface PalletInvulnerablesError extends Enum { readonly isTooManyInvulnerables: boolean; readonly isAlreadyInvulnerable: boolean; @@ -5692,10 +5699,10 @@ declare module "@polkadot/types/lookup" { | "UnableToDeriveCollatorId"; } - /** @name SpCoreCryptoKeyTypeId (487) */ + /** @name SpCoreCryptoKeyTypeId (488) */ interface SpCoreCryptoKeyTypeId extends U8aFixed {} - /** @name PalletSessionError (488) */ + /** @name PalletSessionError (489) */ interface PalletSessionError extends Enum { readonly isInvalidProof: boolean; readonly isNoAssociatedValidatorId: boolean; @@ -5705,7 +5712,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InvalidProof" | "NoAssociatedValidatorId" | "DuplicatedKey" | "NoKeys" | "NoAccount"; } - /** @name PalletAuthorInherentError (492) */ + /** @name PalletAuthorInherentError (493) */ interface PalletAuthorInherentError extends Enum { readonly isAuthorAlreadySet: boolean; readonly isNoAccountId: boolean; @@ -5713,13 +5720,13 @@ declare module "@polkadot/types/lookup" { readonly type: "AuthorAlreadySet" | "NoAccountId" | "CannotBeAuthor"; } - /** @name PalletPooledStakingCandidateEligibleCandidate (494) */ + /** @name PalletPooledStakingCandidateEligibleCandidate (495) */ interface PalletPooledStakingCandidateEligibleCandidate extends Struct { readonly candidate: AccountId32; readonly stake: u128; } - /** @name PalletPooledStakingPoolsKey (497) */ + /** @name PalletPooledStakingPoolsKey (498) */ interface PalletPooledStakingPoolsKey extends Enum { readonly isCandidateTotalStake: boolean; readonly isJoiningShares: boolean; @@ -5789,7 +5796,7 @@ declare module "@polkadot/types/lookup" { | "LeavingSharesHeldStake"; } - /** @name PalletPooledStakingError (499) */ + /** @name PalletPooledStakingError (500) */ interface PalletPooledStakingError extends Enum { readonly isInvalidPalletSetting: boolean; readonly isDisabledFeature: boolean; @@ -5823,13 +5830,13 @@ declare module "@polkadot/types/lookup" { | "SwapResultsInZeroShares"; } - /** @name PalletInflationRewardsChainsToRewardValue (500) */ + /** @name PalletInflationRewardsChainsToRewardValue (501) */ interface PalletInflationRewardsChainsToRewardValue extends Struct { readonly paraIds: Vec; readonly rewardsPerChain: u128; } - /** @name PalletTreasuryProposal (501) */ + /** @name PalletTreasuryProposal (502) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -5837,7 +5844,7 @@ declare module "@polkadot/types/lookup" { readonly bond: u128; } - /** @name PalletTreasurySpendStatus (503) */ + /** @name PalletTreasurySpendStatus (504) */ interface PalletTreasurySpendStatus extends Struct { readonly assetKind: Null; readonly amount: u128; @@ -5847,7 +5854,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletTreasuryPaymentState; } - /** @name PalletTreasuryPaymentState (504) */ + /** @name PalletTreasuryPaymentState (505) */ interface PalletTreasuryPaymentState extends Enum { readonly isPending: boolean; readonly isAttempted: boolean; @@ -5858,10 +5865,10 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "Attempted" | "Failed"; } - /** @name FrameSupportPalletId (506) */ + /** @name FrameSupportPalletId (507) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (507) */ + /** @name PalletTreasuryError (508) */ interface PalletTreasuryError extends Enum { readonly isInvalidIndex: boolean; readonly isTooManyApprovals: boolean; @@ -5888,7 +5895,7 @@ declare module "@polkadot/types/lookup" { | "Inconclusive"; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (510) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (511) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -5897,21 +5904,21 @@ declare module "@polkadot/types/lookup" { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (511) */ + /** @name CumulusPalletXcmpQueueOutboundState (512) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: "Ok" | "Suspended"; } - /** @name CumulusPalletXcmpQueueQueueConfigData (515) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (516) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; } - /** @name CumulusPalletXcmpQueueError (516) */ + /** @name CumulusPalletXcmpQueueError (517) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isBadQueueConfig: boolean; readonly isAlreadySuspended: boolean; @@ -5926,7 +5933,7 @@ declare module "@polkadot/types/lookup" { | "TooBig"; } - /** @name PalletXcmQueryStatus (517) */ + /** @name PalletXcmQueryStatus (518) */ interface PalletXcmQueryStatus extends Enum { readonly isPending: boolean; readonly asPending: { @@ -5948,7 +5955,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "VersionNotifier" | "Ready"; } - /** @name XcmVersionedResponse (521) */ + /** @name XcmVersionedResponse (522) */ interface XcmVersionedResponse extends Enum { readonly isV2: boolean; readonly asV2: XcmV2Response; @@ -5959,7 +5966,7 @@ declare module "@polkadot/types/lookup" { readonly type: "V2" | "V3" | "V4"; } - /** @name PalletXcmVersionMigrationStage (527) */ + /** @name PalletXcmVersionMigrationStage (528) */ interface PalletXcmVersionMigrationStage extends Enum { readonly isMigrateSupportedVersion: boolean; readonly isMigrateVersionNotifiers: boolean; @@ -5973,7 +5980,7 @@ declare module "@polkadot/types/lookup" { | "MigrateAndNotifyOldTargets"; } - /** @name PalletXcmRemoteLockedFungibleRecord (529) */ + /** @name PalletXcmRemoteLockedFungibleRecord (530) */ interface PalletXcmRemoteLockedFungibleRecord extends Struct { readonly amount: u128; readonly owner: XcmVersionedLocation; @@ -5981,7 +5988,7 @@ declare module "@polkadot/types/lookup" { readonly consumers: Vec>; } - /** @name PalletXcmError (536) */ + /** @name PalletXcmError (537) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -6034,7 +6041,7 @@ declare module "@polkadot/types/lookup" { | "LocalExecutionIncomplete"; } - /** @name PalletAssetsAssetDetails (537) */ + /** @name PalletAssetsAssetDetails (538) */ interface PalletAssetsAssetDetails extends Struct { readonly owner: AccountId32; readonly issuer: AccountId32; @@ -6050,7 +6057,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletAssetsAssetStatus; } - /** @name PalletAssetsAssetStatus (538) */ + /** @name PalletAssetsAssetStatus (539) */ interface PalletAssetsAssetStatus extends Enum { readonly isLive: boolean; readonly isFrozen: boolean; @@ -6058,7 +6065,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Live" | "Frozen" | "Destroying"; } - /** @name PalletAssetsAssetAccount (540) */ + /** @name PalletAssetsAssetAccount (541) */ interface PalletAssetsAssetAccount extends Struct { readonly balance: u128; readonly status: PalletAssetsAccountStatus; @@ -6066,7 +6073,7 @@ declare module "@polkadot/types/lookup" { readonly extra: Null; } - /** @name PalletAssetsAccountStatus (541) */ + /** @name PalletAssetsAccountStatus (542) */ interface PalletAssetsAccountStatus extends Enum { readonly isLiquid: boolean; readonly isFrozen: boolean; @@ -6074,7 +6081,7 @@ declare module "@polkadot/types/lookup" { readonly type: "Liquid" | "Frozen" | "Blocked"; } - /** @name PalletAssetsExistenceReason (542) */ + /** @name PalletAssetsExistenceReason (543) */ interface PalletAssetsExistenceReason extends Enum { readonly isConsumer: boolean; readonly isSufficient: boolean; @@ -6086,13 +6093,13 @@ declare module "@polkadot/types/lookup" { readonly type: "Consumer" | "Sufficient" | "DepositHeld" | "DepositRefunded" | "DepositFrom"; } - /** @name PalletAssetsApproval (544) */ + /** @name PalletAssetsApproval (545) */ interface PalletAssetsApproval extends Struct { readonly amount: u128; readonly deposit: u128; } - /** @name PalletAssetsAssetMetadata (545) */ + /** @name PalletAssetsAssetMetadata (546) */ interface PalletAssetsAssetMetadata extends Struct { readonly deposit: u128; readonly name: Bytes; @@ -6101,7 +6108,7 @@ declare module "@polkadot/types/lookup" { readonly isFrozen: bool; } - /** @name PalletAssetsError (547) */ + /** @name PalletAssetsError (548) */ interface PalletAssetsError extends Enum { readonly isBalanceLow: boolean; readonly isNoAccount: boolean; @@ -6148,14 +6155,14 @@ declare module "@polkadot/types/lookup" { | "BadAssetId"; } - /** @name PalletForeignAssetCreatorError (548) */ + /** @name PalletForeignAssetCreatorError (549) */ interface PalletForeignAssetCreatorError extends Enum { readonly isAssetAlreadyExists: boolean; readonly isAssetDoesNotExist: boolean; readonly type: "AssetAlreadyExists" | "AssetDoesNotExist"; } - /** @name PalletAssetRateError (549) */ + /** @name PalletAssetRateError (550) */ interface PalletAssetRateError extends Enum { readonly isUnknownAssetKind: boolean; readonly isAlreadyExists: boolean; @@ -6163,7 +6170,7 @@ declare module "@polkadot/types/lookup" { readonly type: "UnknownAssetKind" | "AlreadyExists" | "Overflow"; } - /** @name PalletMessageQueueBookState (550) */ + /** @name PalletMessageQueueBookState (551) */ interface PalletMessageQueueBookState extends Struct { readonly begin: u32; readonly end: u32; @@ -6173,13 +6180,13 @@ declare module "@polkadot/types/lookup" { readonly size_: u64; } - /** @name PalletMessageQueueNeighbours (552) */ + /** @name PalletMessageQueueNeighbours (553) */ interface PalletMessageQueueNeighbours extends Struct { readonly prev: CumulusPrimitivesCoreAggregateMessageOrigin; readonly next: CumulusPrimitivesCoreAggregateMessageOrigin; } - /** @name PalletMessageQueuePage (554) */ + /** @name PalletMessageQueuePage (555) */ interface PalletMessageQueuePage extends Struct { readonly remaining: u32; readonly remainingSize: u32; @@ -6189,7 +6196,7 @@ declare module "@polkadot/types/lookup" { readonly heap: Bytes; } - /** @name PalletMessageQueueError (556) */ + /** @name PalletMessageQueueError (557) */ interface PalletMessageQueueError extends Enum { readonly isNotReapable: boolean; readonly isNoPage: boolean; @@ -6212,14 +6219,14 @@ declare module "@polkadot/types/lookup" { | "RecursiveDisallowed"; } - /** @name PalletXcmCoreBuyerInFlightCoreBuyingOrder (557) */ + /** @name PalletXcmCoreBuyerInFlightCoreBuyingOrder (558) */ interface PalletXcmCoreBuyerInFlightCoreBuyingOrder extends Struct { readonly paraId: u32; readonly queryId: u64; readonly ttl: u32; } - /** @name PalletXcmCoreBuyerError (558) */ + /** @name PalletXcmCoreBuyerError (559) */ interface PalletXcmCoreBuyerError extends Enum { readonly isInvalidProof: boolean; readonly isErrorValidatingXCM: boolean; @@ -6258,30 +6265,30 @@ declare module "@polkadot/types/lookup" { | "InvalidCollatorSignature"; } - /** @name FrameSystemExtensionsCheckNonZeroSender (563) */ + /** @name FrameSystemExtensionsCheckNonZeroSender (564) */ type FrameSystemExtensionsCheckNonZeroSender = Null; - /** @name FrameSystemExtensionsCheckSpecVersion (564) */ + /** @name FrameSystemExtensionsCheckSpecVersion (565) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (565) */ + /** @name FrameSystemExtensionsCheckTxVersion (566) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (566) */ + /** @name FrameSystemExtensionsCheckGenesis (567) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (569) */ + /** @name FrameSystemExtensionsCheckNonce (570) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (570) */ + /** @name FrameSystemExtensionsCheckWeight (571) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTransactionPaymentChargeTransactionPayment (571) */ + /** @name PalletTransactionPaymentChargeTransactionPayment (572) */ interface PalletTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim (572) */ + /** @name CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim (573) */ type CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim = Null; - /** @name DanceboxRuntimeRuntime (573) */ + /** @name DanceboxRuntimeRuntime (574) */ type DanceboxRuntimeRuntime = Null; } // declare module diff --git a/typescript-api/src/flashbox/interfaces/augment-api-errors.ts b/typescript-api/src/flashbox/interfaces/augment-api-errors.ts index 343590b3f..d13bd62ad 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-errors.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-errors.ts @@ -251,6 +251,8 @@ declare module "@polkadot/api-base/types/errors" { registrar: { /** Attempted to register a ParaId with a genesis data size greater than the limit */ GenesisDataTooBig: AugmentedError; + /** Tried to register a paraId in a relay context without specifying a proper HeadData. */ + HeadDataNecessary: AugmentedError; /** The provided signature from the parachain manager in the relay is not valid */ InvalidRelayManagerSignature: AugmentedError; /** The provided relay storage proof is not valid */ @@ -279,6 +281,8 @@ declare module "@polkadot/api-base/types/errors" { ParaStillExistsInRelay: AugmentedError; /** The relay storage root for the corresponding block number could not be retrieved */ RelayStorageRootNotFound: AugmentedError; + /** Tried to register a paraId in a relay context without specifying a wasm chain code. */ + WasmCodeNecessary: AugmentedError; /** Generic error */ [key: string]: AugmentedError; }; diff --git a/typescript-api/src/flashbox/interfaces/augment-api-query.ts b/typescript-api/src/flashbox/interfaces/augment-api-query.ts index 65d37d938..86e76afd3 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-query.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-query.ts @@ -650,6 +650,25 @@ declare module "@polkadot/api-base/types/storage" { [key: string]: QueryableStorageEntry; }; registrar: { + /** + * This storage aims to act as a 'buffer' for paraIds that must be deregistered at the end of the block execution + * by calling 'T::InnerRegistrar::deregister()' implementation. + * + * We need this buffer because when we are using this pallet on a relay-chain environment like Starlight (where + * 'T::InnerRegistrar' implementation is usually the 'paras_registrar' pallet) we need to deregister (via + * 'paras_registrar::deregister') the same paraIds we have in 'PendingToRemove', and we need to do this + * deregistration process inside 'on_finalize' hook. + * + * It can be the case that some paraIds need to be downgraded to a parathread before deregistering on + * 'paras_registrar'. This process usually takes 2 sessions, and the actual downgrade happens when the block + * finalizes. + * + * Therefore, if we tried to perform this relay deregistration process at the beginning of the session/block + * inside ('on_initialize') initializer_on_new_session() as we do for this pallet, it would fail due to the + * downgrade process could have not taken place yet. + */ + bufferedParasToDeregister: AugmentedQuery Observable>, []> & + QueryableStorageEntry; paraGenesisData: AugmentedQuery< ApiType, ( diff --git a/typescript-api/src/flashbox/interfaces/augment-api-tx.ts b/typescript-api/src/flashbox/interfaces/augment-api-tx.ts index dad208912..cf3110462 100644 --- a/typescript-api/src/flashbox/interfaces/augment-api-tx.ts +++ b/typescript-api/src/flashbox/interfaces/augment-api-tx.ts @@ -1516,9 +1516,10 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, - [u32, DpContainerChainGenesisDataContainerChainGenesisData] + [u32, DpContainerChainGenesisDataContainerChainGenesisData, Option] >; /** Register parathread */ registerParathread: AugmentedSubmittable< @@ -1529,9 +1530,10 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, - [u32, TpTraitsSlotFrequency, DpContainerChainGenesisDataContainerChainGenesisData] + [u32, TpTraitsSlotFrequency, DpContainerChainGenesisDataContainerChainGenesisData, Option] >; /** Register parachain or parathread */ registerWithRelayProof: AugmentedSubmittable< @@ -1557,7 +1559,8 @@ declare module "@polkadot/api-base/types/submittable" { | DpContainerChainGenesisDataContainerChainGenesisData | { storage?: any; name?: any; id?: any; forkId?: any; extensions?: any; properties?: any } | string - | Uint8Array + | Uint8Array, + headData: Option | null | Uint8Array | Bytes | string ) => SubmittableExtrinsic, [ u32, @@ -1566,6 +1569,7 @@ declare module "@polkadot/api-base/types/submittable" { SpTrieStorageProof, SpRuntimeMultiSignature, DpContainerChainGenesisDataContainerChainGenesisData, + Option, ] >; setParaManager: AugmentedSubmittable< diff --git a/typescript-api/src/flashbox/interfaces/lookup.ts b/typescript-api/src/flashbox/interfaces/lookup.ts index 3f1b17574..7a518747c 100644 --- a/typescript-api/src/flashbox/interfaces/lookup.ts +++ b/typescript-api/src/flashbox/interfaces/lookup.ts @@ -1414,6 +1414,7 @@ export default { register: { paraId: "u32", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, deregister: { paraId: "u32", @@ -1432,6 +1433,7 @@ export default { paraId: "u32", slotFrequency: "TpTraitsSlotFrequency", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, set_parathread_params: { paraId: "u32", @@ -1448,6 +1450,7 @@ export default { relayStorageProof: "SpTrieStorageProof", managerSignature: "SpRuntimeMultiSignature", genesisData: "DpContainerChainGenesisDataContainerChainGenesisData", + headData: "Option", }, deregister_with_relay_proof: { paraId: "u32", @@ -1481,16 +1484,16 @@ export default { ss58Format: "u32", tokenDecimals: "u32", }, - /** Lookup215: tp_traits::SlotFrequency */ + /** Lookup216: tp_traits::SlotFrequency */ TpTraitsSlotFrequency: { min: "u32", max: "u32", }, - /** Lookup217: tp_traits::ParathreadParams */ + /** Lookup218: tp_traits::ParathreadParams */ TpTraitsParathreadParams: { slotFrequency: "TpTraitsSlotFrequency", }, - /** Lookup218: pallet_configuration::pallet::Call */ + /** Lookup219: pallet_configuration::pallet::Call */ PalletConfigurationCall: { _enum: { set_max_collators: { @@ -1585,9 +1588,9 @@ export default { }, }, }, - /** Lookup220: pallet_collator_assignment::pallet::Call */ + /** Lookup221: pallet_collator_assignment::pallet::Call */ PalletCollatorAssignmentCall: "Null", - /** Lookup221: pallet_author_noting::pallet::Call */ + /** Lookup222: pallet_author_noting::pallet::Call */ PalletAuthorNotingCall: { _enum: { set_latest_author_data: { @@ -1604,13 +1607,13 @@ export default { }, }, }, - /** Lookup222: tp_author_noting_inherent::OwnParachainInherentData */ + /** Lookup223: tp_author_noting_inherent::OwnParachainInherentData */ TpAuthorNotingInherentOwnParachainInherentData: { relayStorageProof: "SpTrieStorageProof", }, - /** Lookup223: pallet_authority_assignment::pallet::Call */ + /** Lookup224: pallet_authority_assignment::pallet::Call */ PalletAuthorityAssignmentCall: "Null", - /** Lookup224: pallet_services_payment::pallet::Call */ + /** Lookup225: pallet_services_payment::pallet::Call */ PalletServicesPaymentCall: { _enum: { purchase_credits: { @@ -1643,7 +1646,7 @@ export default { }, }, }, - /** Lookup225: pallet_data_preservers::pallet::Call */ + /** Lookup226: pallet_data_preservers::pallet::Call */ PalletDataPreserversCall: { _enum: { __Unused0: "Null", @@ -1684,14 +1687,14 @@ export default { }, }, }, - /** Lookup226: pallet_data_preservers::types::Profile */ + /** Lookup227: pallet_data_preservers::types::Profile */ PalletDataPreserversProfile: { url: "Bytes", paraIds: "PalletDataPreserversParaIdsFilter", mode: "PalletDataPreserversProfileMode", assignmentRequest: "FlashboxRuntimePreserversAssignementPaymentRequest", }, - /** Lookup228: pallet_data_preservers::types::ParaIdsFilter */ + /** Lookup229: pallet_data_preservers::types::ParaIdsFilter */ PalletDataPreserversParaIdsFilter: { _enum: { AnyParaId: "Null", @@ -1699,7 +1702,7 @@ export default { Blacklist: "BTreeSet", }, }, - /** Lookup232: pallet_data_preservers::types::ProfileMode */ + /** Lookup233: pallet_data_preservers::types::ProfileMode */ PalletDataPreserversProfileMode: { _enum: { Bootnode: "Null", @@ -1708,19 +1711,19 @@ export default { }, }, }, - /** Lookup233: flashbox_runtime::PreserversAssignementPaymentRequest */ + /** Lookup234: flashbox_runtime::PreserversAssignementPaymentRequest */ FlashboxRuntimePreserversAssignementPaymentRequest: { _enum: ["Free"], }, - /** Lookup234: flashbox_runtime::PreserversAssignementPaymentExtra */ + /** Lookup235: flashbox_runtime::PreserversAssignementPaymentExtra */ FlashboxRuntimePreserversAssignementPaymentExtra: { _enum: ["Free"], }, - /** Lookup235: flashbox_runtime::PreserversAssignementPaymentWitness */ + /** Lookup236: flashbox_runtime::PreserversAssignementPaymentWitness */ FlashboxRuntimePreserversAssignementPaymentWitness: { _enum: ["Free"], }, - /** Lookup236: pallet_invulnerables::pallet::Call */ + /** Lookup237: pallet_invulnerables::pallet::Call */ PalletInvulnerablesCall: { _enum: { __Unused0: "Null", @@ -1732,7 +1735,7 @@ export default { }, }, }, - /** Lookup237: pallet_session::pallet::Call */ + /** Lookup238: pallet_session::pallet::Call */ PalletSessionCall: { _enum: { set_keys: { @@ -1745,17 +1748,17 @@ export default { purge_keys: "Null", }, }, - /** Lookup238: flashbox_runtime::SessionKeys */ + /** Lookup239: flashbox_runtime::SessionKeys */ FlashboxRuntimeSessionKeys: { nimbus: "NimbusPrimitivesNimbusCryptoPublic", }, - /** Lookup239: nimbus_primitives::nimbus_crypto::Public */ + /** Lookup240: nimbus_primitives::nimbus_crypto::Public */ NimbusPrimitivesNimbusCryptoPublic: "[u8;32]", - /** Lookup240: pallet_author_inherent::pallet::Call */ + /** Lookup241: pallet_author_inherent::pallet::Call */ PalletAuthorInherentCall: { _enum: ["kick_off_authorship_validation"], }, - /** Lookup241: pallet_treasury::pallet::Call */ + /** Lookup242: pallet_treasury::pallet::Call */ PalletTreasuryCall: { _enum: { __Unused0: "Null", @@ -1785,7 +1788,7 @@ export default { }, }, }, - /** Lookup242: pallet_root_testing::pallet::Call */ + /** Lookup243: pallet_root_testing::pallet::Call */ PalletRootTestingCall: { _enum: { fill_block: { @@ -1794,27 +1797,27 @@ export default { trigger_defensive: "Null", }, }, - /** Lookup243: pallet_sudo::pallet::Error */ + /** Lookup244: pallet_sudo::pallet::Error */ PalletSudoError: { _enum: ["RequireSudo"], }, - /** Lookup244: pallet_utility::pallet::Error */ + /** Lookup245: pallet_utility::pallet::Error */ PalletUtilityError: { _enum: ["TooManyCalls"], }, - /** Lookup247: pallet_proxy::ProxyDefinition */ + /** Lookup248: pallet_proxy::ProxyDefinition */ PalletProxyProxyDefinition: { delegate: "AccountId32", proxyType: "FlashboxRuntimeProxyType", delay: "u32", }, - /** Lookup251: pallet_proxy::Announcement */ + /** Lookup252: pallet_proxy::Announcement */ PalletProxyAnnouncement: { real: "AccountId32", callHash: "H256", height: "u32", }, - /** Lookup253: pallet_proxy::pallet::Error */ + /** Lookup254: pallet_proxy::pallet::Error */ PalletProxyError: { _enum: [ "TooMany", @@ -1827,39 +1830,39 @@ export default { "NoSelfProxy", ], }, - /** Lookup254: pallet_migrations::pallet::Error */ + /** Lookup255: pallet_migrations::pallet::Error */ PalletMigrationsError: { _enum: ["PreimageMissing", "WrongUpperBound", "PreimageIsTooBig", "PreimageAlreadyExists"], }, - /** Lookup255: pallet_maintenance_mode::pallet::Error */ + /** Lookup256: pallet_maintenance_mode::pallet::Error */ PalletMaintenanceModeError: { _enum: ["AlreadyInMaintenanceMode", "NotInMaintenanceMode"], }, - /** Lookup256: pallet_tx_pause::pallet::Error */ + /** Lookup257: pallet_tx_pause::pallet::Error */ PalletTxPauseError: { _enum: ["IsPaused", "IsUnpaused", "Unpausable", "NotFound"], }, - /** Lookup258: pallet_balances::types::BalanceLock */ + /** Lookup259: pallet_balances::types::BalanceLock */ PalletBalancesBalanceLock: { id: "[u8;8]", amount: "u128", reasons: "PalletBalancesReasons", }, - /** Lookup259: pallet_balances::types::Reasons */ + /** Lookup260: pallet_balances::types::Reasons */ PalletBalancesReasons: { _enum: ["Fee", "Misc", "All"], }, - /** Lookup262: pallet_balances::types::ReserveData */ + /** Lookup263: pallet_balances::types::ReserveData */ PalletBalancesReserveData: { id: "[u8;8]", amount: "u128", }, - /** Lookup265: frame_support::traits::tokens::misc::IdAmount */ + /** Lookup266: frame_support::traits::tokens::misc::IdAmount */ FrameSupportTokensMiscIdAmountRuntimeHoldReason: { id: "FlashboxRuntimeRuntimeHoldReason", amount: "u128", }, - /** Lookup266: flashbox_runtime::RuntimeHoldReason */ + /** Lookup267: flashbox_runtime::RuntimeHoldReason */ FlashboxRuntimeRuntimeHoldReason: { _enum: { __Unused0: "Null", @@ -1892,24 +1895,24 @@ export default { DataPreservers: "PalletDataPreserversHoldReason", }, }, - /** Lookup267: pallet_stream_payment::pallet::HoldReason */ + /** Lookup268: pallet_stream_payment::pallet::HoldReason */ PalletStreamPaymentHoldReason: { _enum: ["StreamPayment", "StreamOpened"], }, - /** Lookup268: pallet_registrar::pallet::HoldReason */ + /** Lookup269: pallet_registrar::pallet::HoldReason */ PalletRegistrarHoldReason: { _enum: ["RegistrarDeposit"], }, - /** Lookup269: pallet_data_preservers::pallet::HoldReason */ + /** Lookup270: pallet_data_preservers::pallet::HoldReason */ PalletDataPreserversHoldReason: { _enum: ["ProfileDeposit"], }, - /** Lookup272: frame_support::traits::tokens::misc::IdAmount */ + /** Lookup273: frame_support::traits::tokens::misc::IdAmount */ FrameSupportTokensMiscIdAmountRuntimeFreezeReason: { id: "FlashboxRuntimeRuntimeFreezeReason", amount: "u128", }, - /** Lookup273: flashbox_runtime::RuntimeFreezeReason */ + /** Lookup274: flashbox_runtime::RuntimeFreezeReason */ FlashboxRuntimeRuntimeFreezeReason: { _enum: { __Unused0: "Null", @@ -1927,11 +1930,11 @@ export default { StreamPayment: "PalletStreamPaymentFreezeReason", }, }, - /** Lookup274: pallet_stream_payment::pallet::FreezeReason */ + /** Lookup275: pallet_stream_payment::pallet::FreezeReason */ PalletStreamPaymentFreezeReason: { _enum: ["StreamPayment"], }, - /** Lookup276: pallet_balances::pallet::Error */ + /** Lookup277: pallet_balances::pallet::Error */ PalletBalancesError: { _enum: [ "VestingBalance", @@ -1948,12 +1951,12 @@ export default { "DeltaZero", ], }, - /** Lookup277: pallet_transaction_payment::Releases */ + /** Lookup278: pallet_transaction_payment::Releases */ PalletTransactionPaymentReleases: { _enum: ["V1Ancient", "V2"], }, /** - * Lookup278: pallet_stream_payment::pallet::Stream */ PalletStreamPaymentStream: { @@ -1967,7 +1970,7 @@ export default { openingDeposit: "u128", }, /** - * Lookup280: pallet_stream_payment::pallet::ChangeRequest */ PalletStreamPaymentChangeRequest: { @@ -1976,7 +1979,7 @@ export default { newConfig: "PalletStreamPaymentStreamConfig", depositChange: "Option", }, - /** Lookup282: pallet_stream_payment::pallet::Error */ + /** Lookup283: pallet_stream_payment::pallet::Error */ PalletStreamPaymentError: { _enum: [ "UnknownStreamId", @@ -1999,7 +2002,7 @@ export default { ], }, /** - * Lookup284: pallet_identity::types::Registration> */ PalletIdentityRegistration: { @@ -2007,18 +2010,18 @@ export default { deposit: "u128", info: "PalletIdentityLegacyIdentityInfo", }, - /** Lookup293: pallet_identity::types::RegistrarInfo */ + /** Lookup294: pallet_identity::types::RegistrarInfo */ PalletIdentityRegistrarInfo: { account: "AccountId32", fee: "u128", fields: "u64", }, - /** Lookup295: pallet_identity::types::AuthorityProperties> */ + /** Lookup296: pallet_identity::types::AuthorityProperties> */ PalletIdentityAuthorityProperties: { suffix: "Bytes", allocation: "u32", }, - /** Lookup298: pallet_identity::pallet::Error */ + /** Lookup299: pallet_identity::pallet::Error */ PalletIdentityError: { _enum: [ "TooManySubAccounts", @@ -2049,14 +2052,14 @@ export default { "NotExpired", ], }, - /** Lookup300: pallet_multisig::Multisig */ + /** Lookup301: pallet_multisig::Multisig */ PalletMultisigMultisig: { when: "PalletMultisigTimepoint", deposit: "u128", depositor: "AccountId32", approvals: "Vec", }, - /** Lookup302: pallet_multisig::pallet::Error */ + /** Lookup303: pallet_multisig::pallet::Error */ PalletMultisigError: { _enum: [ "MinimumThreshold", @@ -2075,12 +2078,12 @@ export default { "AlreadyStored", ], }, - /** Lookup311: pallet_registrar::pallet::DepositInfo */ + /** Lookup312: pallet_registrar::pallet::DepositInfo */ PalletRegistrarDepositInfo: { creator: "AccountId32", deposit: "u128", }, - /** Lookup312: pallet_registrar::pallet::Error */ + /** Lookup313: pallet_registrar::pallet::Error */ PalletRegistrarError: { _enum: [ "ParaIdAlreadyRegistered", @@ -2098,9 +2101,11 @@ export default { "InvalidRelayStorageProof", "InvalidRelayManagerSignature", "ParaStillExistsInRelay", + "HeadDataNecessary", + "WasmCodeNecessary", ], }, - /** Lookup313: pallet_configuration::HostConfiguration */ + /** Lookup314: pallet_configuration::HostConfiguration */ PalletConfigurationHostConfiguration: { maxCollators: "u32", minOrchestratorCollators: "u32", @@ -2111,22 +2116,22 @@ export default { parathreadsPerCollator: "u32", targetContainerChainFullness: "Perbill", }, - /** Lookup316: pallet_configuration::pallet::Error */ + /** Lookup317: pallet_configuration::pallet::Error */ PalletConfigurationError: { _enum: ["InvalidNewValue"], }, - /** Lookup317: dp_collator_assignment::AssignedCollators */ + /** Lookup318: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsAccountId32: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup322: tp_traits::ContainerChainBlockInfo */ + /** Lookup323: tp_traits::ContainerChainBlockInfo */ TpTraitsContainerChainBlockInfo: { blockNumber: "u32", author: "AccountId32", latestSlotNumber: "u64", }, - /** Lookup323: pallet_author_noting::pallet::Error */ + /** Lookup324: pallet_author_noting::pallet::Error */ PalletAuthorNotingError: { _enum: [ "FailedReading", @@ -2138,23 +2143,23 @@ export default { "NonAuraDigest", ], }, - /** Lookup324: dp_collator_assignment::AssignedCollators */ + /** Lookup325: dp_collator_assignment::AssignedCollators */ DpCollatorAssignmentAssignedCollatorsPublic: { orchestratorChain: "Vec", containerChains: "BTreeMap>", }, - /** Lookup329: pallet_services_payment::pallet::Error */ + /** Lookup330: pallet_services_payment::pallet::Error */ PalletServicesPaymentError: { _enum: ["InsufficientFundsToPurchaseCredits", "InsufficientCredits", "CreditPriceTooExpensive"], }, - /** Lookup330: pallet_data_preservers::types::RegisteredProfile */ + /** Lookup331: pallet_data_preservers::types::RegisteredProfile */ PalletDataPreserversRegisteredProfile: { account: "AccountId32", deposit: "u128", profile: "PalletDataPreserversProfile", assignment: "Option<(u32,FlashboxRuntimePreserversAssignementPaymentWitness)>", }, - /** Lookup336: pallet_data_preservers::pallet::Error */ + /** Lookup337: pallet_data_preservers::pallet::Error */ PalletDataPreserversError: { _enum: [ "NoBootNodes", @@ -2169,7 +2174,7 @@ export default { "CantDeleteAssignedProfile", ], }, - /** Lookup338: pallet_invulnerables::pallet::Error */ + /** Lookup339: pallet_invulnerables::pallet::Error */ PalletInvulnerablesError: { _enum: [ "TooManyInvulnerables", @@ -2179,22 +2184,22 @@ export default { "UnableToDeriveCollatorId", ], }, - /** Lookup343: sp_core::crypto::KeyTypeId */ + /** Lookup344: sp_core::crypto::KeyTypeId */ SpCoreCryptoKeyTypeId: "[u8;4]", - /** Lookup344: pallet_session::pallet::Error */ + /** Lookup345: pallet_session::pallet::Error */ PalletSessionError: { _enum: ["InvalidProof", "NoAssociatedValidatorId", "DuplicatedKey", "NoKeys", "NoAccount"], }, - /** Lookup348: pallet_author_inherent::pallet::Error */ + /** Lookup349: pallet_author_inherent::pallet::Error */ PalletAuthorInherentError: { _enum: ["AuthorAlreadySet", "NoAccountId", "CannotBeAuthor"], }, - /** Lookup349: pallet_inflation_rewards::pallet::ChainsToRewardValue */ + /** Lookup350: pallet_inflation_rewards::pallet::ChainsToRewardValue */ PalletInflationRewardsChainsToRewardValue: { paraIds: "Vec", rewardsPerChain: "u128", }, - /** Lookup350: pallet_treasury::Proposal */ + /** Lookup351: pallet_treasury::Proposal */ PalletTreasuryProposal: { proposer: "AccountId32", value: "u128", @@ -2202,7 +2207,7 @@ export default { bond: "u128", }, /** - * Lookup352: pallet_treasury::SpendStatus */ PalletTreasurySpendStatus: { @@ -2213,7 +2218,7 @@ export default { expireAt: "u32", status: "PalletTreasuryPaymentState", }, - /** Lookup353: pallet_treasury::PaymentState */ + /** Lookup354: pallet_treasury::PaymentState */ PalletTreasuryPaymentState: { _enum: { Pending: "Null", @@ -2223,9 +2228,9 @@ export default { Failed: "Null", }, }, - /** Lookup355: frame_support::PalletId */ + /** Lookup356: frame_support::PalletId */ FrameSupportPalletId: "[u8;8]", - /** Lookup356: pallet_treasury::pallet::Error */ + /** Lookup357: pallet_treasury::pallet::Error */ PalletTreasuryError: { _enum: [ "InvalidIndex", @@ -2241,22 +2246,22 @@ export default { "Inconclusive", ], }, - /** Lookup361: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ + /** Lookup362: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender */ FrameSystemExtensionsCheckNonZeroSender: "Null", - /** Lookup362: frame_system::extensions::check_spec_version::CheckSpecVersion */ + /** Lookup363: frame_system::extensions::check_spec_version::CheckSpecVersion */ FrameSystemExtensionsCheckSpecVersion: "Null", - /** Lookup363: frame_system::extensions::check_tx_version::CheckTxVersion */ + /** Lookup364: frame_system::extensions::check_tx_version::CheckTxVersion */ FrameSystemExtensionsCheckTxVersion: "Null", - /** Lookup364: frame_system::extensions::check_genesis::CheckGenesis */ + /** Lookup365: frame_system::extensions::check_genesis::CheckGenesis */ FrameSystemExtensionsCheckGenesis: "Null", - /** Lookup367: frame_system::extensions::check_nonce::CheckNonce */ + /** Lookup368: frame_system::extensions::check_nonce::CheckNonce */ FrameSystemExtensionsCheckNonce: "Compact", - /** Lookup368: frame_system::extensions::check_weight::CheckWeight */ + /** Lookup369: frame_system::extensions::check_weight::CheckWeight */ FrameSystemExtensionsCheckWeight: "Null", - /** Lookup369: pallet_transaction_payment::ChargeTransactionPayment */ + /** Lookup370: pallet_transaction_payment::ChargeTransactionPayment */ PalletTransactionPaymentChargeTransactionPayment: "Compact", - /** Lookup370: cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim */ + /** Lookup371: cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim */ CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim: "Null", - /** Lookup371: flashbox_runtime::Runtime */ + /** Lookup372: flashbox_runtime::Runtime */ FlashboxRuntimeRuntime: "Null", }; diff --git a/typescript-api/src/flashbox/interfaces/types-lookup.ts b/typescript-api/src/flashbox/interfaces/types-lookup.ts index c5ebd95d1..ce99b233e 100644 --- a/typescript-api/src/flashbox/interfaces/types-lookup.ts +++ b/typescript-api/src/flashbox/interfaces/types-lookup.ts @@ -1928,6 +1928,7 @@ declare module "@polkadot/types/lookup" { readonly asRegister: { readonly paraId: u32; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isDeregister: boolean; readonly asDeregister: { @@ -1950,6 +1951,7 @@ declare module "@polkadot/types/lookup" { readonly paraId: u32; readonly slotFrequency: TpTraitsSlotFrequency; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isSetParathreadParams: boolean; readonly asSetParathreadParams: { @@ -1969,6 +1971,7 @@ declare module "@polkadot/types/lookup" { readonly relayStorageProof: SpTrieStorageProof; readonly managerSignature: SpRuntimeMultiSignature; readonly genesisData: DpContainerChainGenesisDataContainerChainGenesisData; + readonly headData: Option; } & Struct; readonly isDeregisterWithRelayProof: boolean; readonly asDeregisterWithRelayProof: { @@ -2018,18 +2021,18 @@ declare module "@polkadot/types/lookup" { readonly tokenDecimals: u32; } - /** @name TpTraitsSlotFrequency (215) */ + /** @name TpTraitsSlotFrequency (216) */ interface TpTraitsSlotFrequency extends Struct { readonly min: u32; readonly max: u32; } - /** @name TpTraitsParathreadParams (217) */ + /** @name TpTraitsParathreadParams (218) */ interface TpTraitsParathreadParams extends Struct { readonly slotFrequency: TpTraitsSlotFrequency; } - /** @name PalletConfigurationCall (218) */ + /** @name PalletConfigurationCall (219) */ interface PalletConfigurationCall extends Enum { readonly isSetMaxCollators: boolean; readonly asSetMaxCollators: { @@ -2079,10 +2082,10 @@ declare module "@polkadot/types/lookup" { | "SetBypassConsistencyCheck"; } - /** @name PalletCollatorAssignmentCall (220) */ + /** @name PalletCollatorAssignmentCall (221) */ type PalletCollatorAssignmentCall = Null; - /** @name PalletAuthorNotingCall (221) */ + /** @name PalletAuthorNotingCall (222) */ interface PalletAuthorNotingCall extends Enum { readonly isSetLatestAuthorData: boolean; readonly asSetLatestAuthorData: { @@ -2102,15 +2105,15 @@ declare module "@polkadot/types/lookup" { readonly type: "SetLatestAuthorData" | "SetAuthor" | "KillAuthorData"; } - /** @name TpAuthorNotingInherentOwnParachainInherentData (222) */ + /** @name TpAuthorNotingInherentOwnParachainInherentData (223) */ interface TpAuthorNotingInherentOwnParachainInherentData extends Struct { readonly relayStorageProof: SpTrieStorageProof; } - /** @name PalletAuthorityAssignmentCall (223) */ + /** @name PalletAuthorityAssignmentCall (224) */ type PalletAuthorityAssignmentCall = Null; - /** @name PalletServicesPaymentCall (224) */ + /** @name PalletServicesPaymentCall (225) */ interface PalletServicesPaymentCall extends Enum { readonly isPurchaseCredits: boolean; readonly asPurchaseCredits: { @@ -2157,7 +2160,7 @@ declare module "@polkadot/types/lookup" { | "SetMaxTip"; } - /** @name PalletDataPreserversCall (225) */ + /** @name PalletDataPreserversCall (226) */ interface PalletDataPreserversCall extends Enum { readonly isCreateProfile: boolean; readonly asCreateProfile: { @@ -2215,7 +2218,7 @@ declare module "@polkadot/types/lookup" { | "ForceStartAssignment"; } - /** @name PalletDataPreserversProfile (226) */ + /** @name PalletDataPreserversProfile (227) */ interface PalletDataPreserversProfile extends Struct { readonly url: Bytes; readonly paraIds: PalletDataPreserversParaIdsFilter; @@ -2223,7 +2226,7 @@ declare module "@polkadot/types/lookup" { readonly assignmentRequest: FlashboxRuntimePreserversAssignementPaymentRequest; } - /** @name PalletDataPreserversParaIdsFilter (228) */ + /** @name PalletDataPreserversParaIdsFilter (229) */ interface PalletDataPreserversParaIdsFilter extends Enum { readonly isAnyParaId: boolean; readonly isWhitelist: boolean; @@ -2233,7 +2236,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AnyParaId" | "Whitelist" | "Blacklist"; } - /** @name PalletDataPreserversProfileMode (232) */ + /** @name PalletDataPreserversProfileMode (233) */ interface PalletDataPreserversProfileMode extends Enum { readonly isBootnode: boolean; readonly isRpc: boolean; @@ -2243,25 +2246,25 @@ declare module "@polkadot/types/lookup" { readonly type: "Bootnode" | "Rpc"; } - /** @name FlashboxRuntimePreserversAssignementPaymentRequest (233) */ + /** @name FlashboxRuntimePreserversAssignementPaymentRequest (234) */ interface FlashboxRuntimePreserversAssignementPaymentRequest extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name FlashboxRuntimePreserversAssignementPaymentExtra (234) */ + /** @name FlashboxRuntimePreserversAssignementPaymentExtra (235) */ interface FlashboxRuntimePreserversAssignementPaymentExtra extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name FlashboxRuntimePreserversAssignementPaymentWitness (235) */ + /** @name FlashboxRuntimePreserversAssignementPaymentWitness (236) */ interface FlashboxRuntimePreserversAssignementPaymentWitness extends Enum { readonly isFree: boolean; readonly type: "Free"; } - /** @name PalletInvulnerablesCall (236) */ + /** @name PalletInvulnerablesCall (237) */ interface PalletInvulnerablesCall extends Enum { readonly isAddInvulnerable: boolean; readonly asAddInvulnerable: { @@ -2274,7 +2277,7 @@ declare module "@polkadot/types/lookup" { readonly type: "AddInvulnerable" | "RemoveInvulnerable"; } - /** @name PalletSessionCall (237) */ + /** @name PalletSessionCall (238) */ interface PalletSessionCall extends Enum { readonly isSetKeys: boolean; readonly asSetKeys: { @@ -2285,21 +2288,21 @@ declare module "@polkadot/types/lookup" { readonly type: "SetKeys" | "PurgeKeys"; } - /** @name FlashboxRuntimeSessionKeys (238) */ + /** @name FlashboxRuntimeSessionKeys (239) */ interface FlashboxRuntimeSessionKeys extends Struct { readonly nimbus: NimbusPrimitivesNimbusCryptoPublic; } - /** @name NimbusPrimitivesNimbusCryptoPublic (239) */ + /** @name NimbusPrimitivesNimbusCryptoPublic (240) */ interface NimbusPrimitivesNimbusCryptoPublic extends U8aFixed {} - /** @name PalletAuthorInherentCall (240) */ + /** @name PalletAuthorInherentCall (241) */ interface PalletAuthorInherentCall extends Enum { readonly isKickOffAuthorshipValidation: boolean; readonly type: "KickOffAuthorshipValidation"; } - /** @name PalletTreasuryCall (241) */ + /** @name PalletTreasuryCall (242) */ interface PalletTreasuryCall extends Enum { readonly isSpendLocal: boolean; readonly asSpendLocal: { @@ -2332,7 +2335,7 @@ declare module "@polkadot/types/lookup" { readonly type: "SpendLocal" | "RemoveApproval" | "Spend" | "Payout" | "CheckStatus" | "VoidSpend"; } - /** @name PalletRootTestingCall (242) */ + /** @name PalletRootTestingCall (243) */ interface PalletRootTestingCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -2342,33 +2345,33 @@ declare module "@polkadot/types/lookup" { readonly type: "FillBlock" | "TriggerDefensive"; } - /** @name PalletSudoError (243) */ + /** @name PalletSudoError (244) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: "RequireSudo"; } - /** @name PalletUtilityError (244) */ + /** @name PalletUtilityError (245) */ interface PalletUtilityError extends Enum { readonly isTooManyCalls: boolean; readonly type: "TooManyCalls"; } - /** @name PalletProxyProxyDefinition (247) */ + /** @name PalletProxyProxyDefinition (248) */ interface PalletProxyProxyDefinition extends Struct { readonly delegate: AccountId32; readonly proxyType: FlashboxRuntimeProxyType; readonly delay: u32; } - /** @name PalletProxyAnnouncement (251) */ + /** @name PalletProxyAnnouncement (252) */ interface PalletProxyAnnouncement extends Struct { readonly real: AccountId32; readonly callHash: H256; readonly height: u32; } - /** @name PalletProxyError (253) */ + /** @name PalletProxyError (254) */ interface PalletProxyError extends Enum { readonly isTooMany: boolean; readonly isNotFound: boolean; @@ -2389,7 +2392,7 @@ declare module "@polkadot/types/lookup" { | "NoSelfProxy"; } - /** @name PalletMigrationsError (254) */ + /** @name PalletMigrationsError (255) */ interface PalletMigrationsError extends Enum { readonly isPreimageMissing: boolean; readonly isWrongUpperBound: boolean; @@ -2398,14 +2401,14 @@ declare module "@polkadot/types/lookup" { readonly type: "PreimageMissing" | "WrongUpperBound" | "PreimageIsTooBig" | "PreimageAlreadyExists"; } - /** @name PalletMaintenanceModeError (255) */ + /** @name PalletMaintenanceModeError (256) */ interface PalletMaintenanceModeError extends Enum { readonly isAlreadyInMaintenanceMode: boolean; readonly isNotInMaintenanceMode: boolean; readonly type: "AlreadyInMaintenanceMode" | "NotInMaintenanceMode"; } - /** @name PalletTxPauseError (256) */ + /** @name PalletTxPauseError (257) */ interface PalletTxPauseError extends Enum { readonly isIsPaused: boolean; readonly isIsUnpaused: boolean; @@ -2414,14 +2417,14 @@ declare module "@polkadot/types/lookup" { readonly type: "IsPaused" | "IsUnpaused" | "Unpausable" | "NotFound"; } - /** @name PalletBalancesBalanceLock (258) */ + /** @name PalletBalancesBalanceLock (259) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (259) */ + /** @name PalletBalancesReasons (260) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -2429,19 +2432,19 @@ declare module "@polkadot/types/lookup" { readonly type: "Fee" | "Misc" | "All"; } - /** @name PalletBalancesReserveData (262) */ + /** @name PalletBalancesReserveData (263) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name FrameSupportTokensMiscIdAmountRuntimeHoldReason (265) */ + /** @name FrameSupportTokensMiscIdAmountRuntimeHoldReason (266) */ interface FrameSupportTokensMiscIdAmountRuntimeHoldReason extends Struct { readonly id: FlashboxRuntimeRuntimeHoldReason; readonly amount: u128; } - /** @name FlashboxRuntimeRuntimeHoldReason (266) */ + /** @name FlashboxRuntimeRuntimeHoldReason (267) */ interface FlashboxRuntimeRuntimeHoldReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentHoldReason; @@ -2452,45 +2455,45 @@ declare module "@polkadot/types/lookup" { readonly type: "StreamPayment" | "Registrar" | "DataPreservers"; } - /** @name PalletStreamPaymentHoldReason (267) */ + /** @name PalletStreamPaymentHoldReason (268) */ interface PalletStreamPaymentHoldReason extends Enum { readonly isStreamPayment: boolean; readonly isStreamOpened: boolean; readonly type: "StreamPayment" | "StreamOpened"; } - /** @name PalletRegistrarHoldReason (268) */ + /** @name PalletRegistrarHoldReason (269) */ interface PalletRegistrarHoldReason extends Enum { readonly isRegistrarDeposit: boolean; readonly type: "RegistrarDeposit"; } - /** @name PalletDataPreserversHoldReason (269) */ + /** @name PalletDataPreserversHoldReason (270) */ interface PalletDataPreserversHoldReason extends Enum { readonly isProfileDeposit: boolean; readonly type: "ProfileDeposit"; } - /** @name FrameSupportTokensMiscIdAmountRuntimeFreezeReason (272) */ + /** @name FrameSupportTokensMiscIdAmountRuntimeFreezeReason (273) */ interface FrameSupportTokensMiscIdAmountRuntimeFreezeReason extends Struct { readonly id: FlashboxRuntimeRuntimeFreezeReason; readonly amount: u128; } - /** @name FlashboxRuntimeRuntimeFreezeReason (273) */ + /** @name FlashboxRuntimeRuntimeFreezeReason (274) */ interface FlashboxRuntimeRuntimeFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly asStreamPayment: PalletStreamPaymentFreezeReason; readonly type: "StreamPayment"; } - /** @name PalletStreamPaymentFreezeReason (274) */ + /** @name PalletStreamPaymentFreezeReason (275) */ interface PalletStreamPaymentFreezeReason extends Enum { readonly isStreamPayment: boolean; readonly type: "StreamPayment"; } - /** @name PalletBalancesError (276) */ + /** @name PalletBalancesError (277) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -2519,14 +2522,14 @@ declare module "@polkadot/types/lookup" { | "DeltaZero"; } - /** @name PalletTransactionPaymentReleases (277) */ + /** @name PalletTransactionPaymentReleases (278) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: "V1Ancient" | "V2"; } - /** @name PalletStreamPaymentStream (278) */ + /** @name PalletStreamPaymentStream (279) */ interface PalletStreamPaymentStream extends Struct { readonly source: AccountId32; readonly target: AccountId32; @@ -2538,7 +2541,7 @@ declare module "@polkadot/types/lookup" { readonly openingDeposit: u128; } - /** @name PalletStreamPaymentChangeRequest (280) */ + /** @name PalletStreamPaymentChangeRequest (281) */ interface PalletStreamPaymentChangeRequest extends Struct { readonly requester: PalletStreamPaymentParty; readonly kind: PalletStreamPaymentChangeKind; @@ -2546,7 +2549,7 @@ declare module "@polkadot/types/lookup" { readonly depositChange: Option; } - /** @name PalletStreamPaymentError (282) */ + /** @name PalletStreamPaymentError (283) */ interface PalletStreamPaymentError extends Enum { readonly isUnknownStreamId: boolean; readonly isStreamIdOverflow: boolean; @@ -2585,27 +2588,27 @@ declare module "@polkadot/types/lookup" { | "CantFetchStatusBeforeLastTimeUpdated"; } - /** @name PalletIdentityRegistration (284) */ + /** @name PalletIdentityRegistration (285) */ interface PalletIdentityRegistration extends Struct { readonly judgements: Vec>; readonly deposit: u128; readonly info: PalletIdentityLegacyIdentityInfo; } - /** @name PalletIdentityRegistrarInfo (293) */ + /** @name PalletIdentityRegistrarInfo (294) */ interface PalletIdentityRegistrarInfo extends Struct { readonly account: AccountId32; readonly fee: u128; readonly fields: u64; } - /** @name PalletIdentityAuthorityProperties (295) */ + /** @name PalletIdentityAuthorityProperties (296) */ interface PalletIdentityAuthorityProperties extends Struct { readonly suffix: Bytes; readonly allocation: u32; } - /** @name PalletIdentityError (298) */ + /** @name PalletIdentityError (299) */ interface PalletIdentityError extends Enum { readonly isTooManySubAccounts: boolean; readonly isNotFound: boolean; @@ -2662,7 +2665,7 @@ declare module "@polkadot/types/lookup" { | "NotExpired"; } - /** @name PalletMultisigMultisig (300) */ + /** @name PalletMultisigMultisig (301) */ interface PalletMultisigMultisig extends Struct { readonly when: PalletMultisigTimepoint; readonly deposit: u128; @@ -2670,7 +2673,7 @@ declare module "@polkadot/types/lookup" { readonly approvals: Vec; } - /** @name PalletMultisigError (302) */ + /** @name PalletMultisigError (303) */ interface PalletMultisigError extends Enum { readonly isMinimumThreshold: boolean; readonly isAlreadyApproved: boolean; @@ -2703,13 +2706,13 @@ declare module "@polkadot/types/lookup" { | "AlreadyStored"; } - /** @name PalletRegistrarDepositInfo (311) */ + /** @name PalletRegistrarDepositInfo (312) */ interface PalletRegistrarDepositInfo extends Struct { readonly creator: AccountId32; readonly deposit: u128; } - /** @name PalletRegistrarError (312) */ + /** @name PalletRegistrarError (313) */ interface PalletRegistrarError extends Enum { readonly isParaIdAlreadyRegistered: boolean; readonly isParaIdNotRegistered: boolean; @@ -2726,6 +2729,8 @@ declare module "@polkadot/types/lookup" { readonly isInvalidRelayStorageProof: boolean; readonly isInvalidRelayManagerSignature: boolean; readonly isParaStillExistsInRelay: boolean; + readonly isHeadDataNecessary: boolean; + readonly isWasmCodeNecessary: boolean; readonly type: | "ParaIdAlreadyRegistered" | "ParaIdNotRegistered" @@ -2741,10 +2746,12 @@ declare module "@polkadot/types/lookup" { | "RelayStorageRootNotFound" | "InvalidRelayStorageProof" | "InvalidRelayManagerSignature" - | "ParaStillExistsInRelay"; + | "ParaStillExistsInRelay" + | "HeadDataNecessary" + | "WasmCodeNecessary"; } - /** @name PalletConfigurationHostConfiguration (313) */ + /** @name PalletConfigurationHostConfiguration (314) */ interface PalletConfigurationHostConfiguration extends Struct { readonly maxCollators: u32; readonly minOrchestratorCollators: u32; @@ -2756,26 +2763,26 @@ declare module "@polkadot/types/lookup" { readonly targetContainerChainFullness: Perbill; } - /** @name PalletConfigurationError (316) */ + /** @name PalletConfigurationError (317) */ interface PalletConfigurationError extends Enum { readonly isInvalidNewValue: boolean; readonly type: "InvalidNewValue"; } - /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (317) */ + /** @name DpCollatorAssignmentAssignedCollatorsAccountId32 (318) */ interface DpCollatorAssignmentAssignedCollatorsAccountId32 extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name TpTraitsContainerChainBlockInfo (322) */ + /** @name TpTraitsContainerChainBlockInfo (323) */ interface TpTraitsContainerChainBlockInfo extends Struct { readonly blockNumber: u32; readonly author: AccountId32; readonly latestSlotNumber: u64; } - /** @name PalletAuthorNotingError (323) */ + /** @name PalletAuthorNotingError (324) */ interface PalletAuthorNotingError extends Enum { readonly isFailedReading: boolean; readonly isFailedDecodingHeader: boolean; @@ -2794,13 +2801,13 @@ declare module "@polkadot/types/lookup" { | "NonAuraDigest"; } - /** @name DpCollatorAssignmentAssignedCollatorsPublic (324) */ + /** @name DpCollatorAssignmentAssignedCollatorsPublic (325) */ interface DpCollatorAssignmentAssignedCollatorsPublic extends Struct { readonly orchestratorChain: Vec; readonly containerChains: BTreeMap>; } - /** @name PalletServicesPaymentError (329) */ + /** @name PalletServicesPaymentError (330) */ interface PalletServicesPaymentError extends Enum { readonly isInsufficientFundsToPurchaseCredits: boolean; readonly isInsufficientCredits: boolean; @@ -2808,7 +2815,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InsufficientFundsToPurchaseCredits" | "InsufficientCredits" | "CreditPriceTooExpensive"; } - /** @name PalletDataPreserversRegisteredProfile (330) */ + /** @name PalletDataPreserversRegisteredProfile (331) */ interface PalletDataPreserversRegisteredProfile extends Struct { readonly account: AccountId32; readonly deposit: u128; @@ -2816,7 +2823,7 @@ declare module "@polkadot/types/lookup" { readonly assignment: Option>; } - /** @name PalletDataPreserversError (336) */ + /** @name PalletDataPreserversError (337) */ interface PalletDataPreserversError extends Enum { readonly isNoBootNodes: boolean; readonly isUnknownProfileId: boolean; @@ -2841,7 +2848,7 @@ declare module "@polkadot/types/lookup" { | "CantDeleteAssignedProfile"; } - /** @name PalletInvulnerablesError (338) */ + /** @name PalletInvulnerablesError (339) */ interface PalletInvulnerablesError extends Enum { readonly isTooManyInvulnerables: boolean; readonly isAlreadyInvulnerable: boolean; @@ -2856,10 +2863,10 @@ declare module "@polkadot/types/lookup" { | "UnableToDeriveCollatorId"; } - /** @name SpCoreCryptoKeyTypeId (343) */ + /** @name SpCoreCryptoKeyTypeId (344) */ interface SpCoreCryptoKeyTypeId extends U8aFixed {} - /** @name PalletSessionError (344) */ + /** @name PalletSessionError (345) */ interface PalletSessionError extends Enum { readonly isInvalidProof: boolean; readonly isNoAssociatedValidatorId: boolean; @@ -2869,7 +2876,7 @@ declare module "@polkadot/types/lookup" { readonly type: "InvalidProof" | "NoAssociatedValidatorId" | "DuplicatedKey" | "NoKeys" | "NoAccount"; } - /** @name PalletAuthorInherentError (348) */ + /** @name PalletAuthorInherentError (349) */ interface PalletAuthorInherentError extends Enum { readonly isAuthorAlreadySet: boolean; readonly isNoAccountId: boolean; @@ -2877,13 +2884,13 @@ declare module "@polkadot/types/lookup" { readonly type: "AuthorAlreadySet" | "NoAccountId" | "CannotBeAuthor"; } - /** @name PalletInflationRewardsChainsToRewardValue (349) */ + /** @name PalletInflationRewardsChainsToRewardValue (350) */ interface PalletInflationRewardsChainsToRewardValue extends Struct { readonly paraIds: Vec; readonly rewardsPerChain: u128; } - /** @name PalletTreasuryProposal (350) */ + /** @name PalletTreasuryProposal (351) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -2891,7 +2898,7 @@ declare module "@polkadot/types/lookup" { readonly bond: u128; } - /** @name PalletTreasurySpendStatus (352) */ + /** @name PalletTreasurySpendStatus (353) */ interface PalletTreasurySpendStatus extends Struct { readonly assetKind: Null; readonly amount: u128; @@ -2901,7 +2908,7 @@ declare module "@polkadot/types/lookup" { readonly status: PalletTreasuryPaymentState; } - /** @name PalletTreasuryPaymentState (353) */ + /** @name PalletTreasuryPaymentState (354) */ interface PalletTreasuryPaymentState extends Enum { readonly isPending: boolean; readonly isAttempted: boolean; @@ -2912,10 +2919,10 @@ declare module "@polkadot/types/lookup" { readonly type: "Pending" | "Attempted" | "Failed"; } - /** @name FrameSupportPalletId (355) */ + /** @name FrameSupportPalletId (356) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (356) */ + /** @name PalletTreasuryError (357) */ interface PalletTreasuryError extends Enum { readonly isInvalidIndex: boolean; readonly isTooManyApprovals: boolean; @@ -2942,30 +2949,30 @@ declare module "@polkadot/types/lookup" { | "Inconclusive"; } - /** @name FrameSystemExtensionsCheckNonZeroSender (361) */ + /** @name FrameSystemExtensionsCheckNonZeroSender (362) */ type FrameSystemExtensionsCheckNonZeroSender = Null; - /** @name FrameSystemExtensionsCheckSpecVersion (362) */ + /** @name FrameSystemExtensionsCheckSpecVersion (363) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (363) */ + /** @name FrameSystemExtensionsCheckTxVersion (364) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (364) */ + /** @name FrameSystemExtensionsCheckGenesis (365) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (367) */ + /** @name FrameSystemExtensionsCheckNonce (368) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (368) */ + /** @name FrameSystemExtensionsCheckWeight (369) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTransactionPaymentChargeTransactionPayment (369) */ + /** @name PalletTransactionPaymentChargeTransactionPayment (370) */ interface PalletTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim (370) */ + /** @name CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim (371) */ type CumulusPrimitivesStorageWeightReclaimStorageWeightReclaim = Null; - /** @name FlashboxRuntimeRuntime (371) */ + /** @name FlashboxRuntimeRuntime (372) */ type FlashboxRuntimeRuntime = Null; } // declare module