Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
873 changes: 549 additions & 324 deletions Cargo.lock

Large diffs are not rendered by default.

526 changes: 352 additions & 174 deletions Cargo.toml

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions runtime/basilisk/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,15 @@ impl AmmTradeWeights<Trade<AssetId>> for RouterWeightInfo {
fn buy_and_calculate_buy_trade_amounts_weight(_route: &[Trade<AssetId>]) -> Weight {
Weight::zero()
}
}

parameter_types! {
pub const MaxNumberOfTrades: u8 = 5;
fn set_route_weight(_: &[Trade<AssetId>]) -> Weight {
Weight::zero()
}
}

impl pallet_route_executor::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AssetId = AssetId;
type Balance = Balance;
type MaxNumberOfTrades = MaxNumberOfTrades;
type Currency = MultiInspectAdapter<AccountId, AssetId, Balance, Balances, Tokens, NativeAssetId>;
type AMM = (XYK, LBP);
type WeightInfo = RouterWeightInfo;
Expand Down
3 changes: 2 additions & 1 deletion runtime/basilisk/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ impl pallet_transaction_multi_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AcceptedCurrencyOrigin = MajorityTechCommitteeOrRoot;
type Currencies = Currencies;
type SpotPriceProvider = pallet_xyk::XYKSpotPrice<Runtime>;
type WeightInfo = weights::payment::BasiliskWeight<Runtime>;
type WeightToFee = WeightToFee;
type NativeAssetId = NativeAssetId;
type RouteProvider = Router;
type OraclePriceProvider = OraclePriceProvider<AssetId, EmaOracle, BSX>;
}

/// The type used to represent the kinds of proxying allowed.
Expand Down
12 changes: 3 additions & 9 deletions runtime/basilisk/src/weights/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,8 @@ 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))
}
// Storage: XYK ShareToken (r:1 w:0)
// Proof: XYK ShareToken (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
// Storage: System Account (r:1 w:0)
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
// Storage: Tokens Accounts (r:1 w:0)
// Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
fn get_spot_price() -> Weight {
// Minimum execution time: 21_535 nanoseconds.
Weight::from_parts(21_794_000, 0).saturating_add(T::DbWeight::get().reads(3 as u64))
fn get_oracle_price() -> Weight {
// TODO update weights
Weight::from_parts(22_029_000, 0)
}
}
3 changes: 3 additions & 0 deletions runtime/basilisk/src/weights/route_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ impl<T: frame_system::Config> WeightInfo for BasiliskWeight<T> {
fn calculate_and_execute_buy_in_lbp(_c: u32, _b: u32) -> Weight {
Weight::zero()
}
fn set_route_for_xyk() -> Weight {
Weight::zero()
}
}
8 changes: 4 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,16 @@ 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 {
Weight::zero()
}
}
13 changes: 10 additions & 3 deletions runtime/basilisk/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Config for XcmConfig {
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetLocker = ();
type AssetExchanger = XcmAssetExchanger<Runtime, TempAccount, CurrencyIdConvert, Currencies, DefaultPoolType>;
type AssetExchanger = XcmAssetExchanger<Runtime, TempAccount, CurrencyIdConvert, Currencies>;
type AssetClaims = PolkadotXcm;
type SubscriptionService = PolkadotXcm;
type PalletInstancesInfo = AllPalletsWithSystem;
Expand All @@ -180,6 +180,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 @@ -191,8 +197,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