Skip to content

Commit

Permalink
adjust code to updated xcmp queue
Browse files Browse the repository at this point in the history
  • Loading branch information
apopiak committed Dec 5, 2023
1 parent 59d451f commit 3f9cf87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions integration-tests/src/xcm_rate_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ fn deferred_messages_should_be_executable_by_root() {
basilisk_runtime::RuntimeOrigin::root(),
max_weight,
OTHER_PARA_ID.into(),
basilisk_runtime::MaxBucketsProcessed::get(),
));

let fee = basilisk_runtime::Tokens::free_balance(AUSD, &basilisk_runtime::Treasury::account_id());
Expand Down
9 changes: 5 additions & 4 deletions runtime/basilisk/src/weights/xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ impl<T: frame_system::Config> WeightInfo for BasiliskWeight<T> {
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
fn service_deferred() -> Weight {
fn service_deferred(_b: u32) -> Weight {
Weight::zero()
}
fn discard_deferred_bucket() -> Weight {
fn discard_deferred_bucket(_m: u32) -> Weight {
Weight::zero()
}
fn discard_deferred_individual() -> Weight {
fn discard_deferred_individual(_m: u32) -> Weight {
Weight::zero()
}
fn try_place_in_deferred_queue() -> Weight {
fn try_place_in_deferred_queue(_m: u32) -> Weight {
// TODO: run benchmarks
Weight::zero()
}
}
11 changes: 9 additions & 2 deletions runtime/basilisk/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ impl cumulus_pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
}

parameter_types! {
pub const MaxDeferredMessages: u32 = 20;
pub const MaxDeferredBuckets: u32 = 1_000;
pub const MaxBucketsProcessed: u32 = 3;
}

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -175,8 +181,9 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type PriceForSiblingDelivery = ();
type WeightInfo = weights::xcmp_queue::BasiliskWeight<Runtime>;
type ExecuteDeferredOrigin = EnsureRoot<AccountId>;
type MaxDeferredMessages = ConstU32<100>;
type MaxDeferredBuckets = ConstU32<1_000>;
type MaxDeferredMessages = MaxDeferredMessages;
type MaxDeferredBuckets = MaxDeferredBuckets;
type MaxBucketsProcessed = MaxBucketsProcessed;
type RelayChainBlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
type XcmDeferFilter = XcmRateLimiter;
}
Expand Down

0 comments on commit 3f9cf87

Please sign in to comment.