diff --git a/Cargo.lock b/Cargo.lock index 436f8b4993..07f8c2cb34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -976,7 +976,7 @@ dependencies = [ [[package]] name = "basilisk-runtime" -version = "107.0.0" +version = "108.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -7252,7 +7252,7 @@ dependencies = [ [[package]] name = "pallet-marketplace" -version = "5.0.16" +version = "5.0.17" dependencies = [ "frame-benchmarking", "frame-support", @@ -8106,7 +8106,7 @@ dependencies = [ [[package]] name = "pallet-xyk-liquidity-mining" -version = "1.1.9" +version = "1.1.10" dependencies = [ "frame-support", "frame-system", @@ -10659,7 +10659,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.0.0" +version = "1.0.1" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index b15a076ec8..7b9f93d7a2 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.0.0" +version = "1.0.1" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/marketplace/Cargo.toml b/pallets/marketplace/Cargo.toml index 6b59da31f5..6721038af9 100644 --- a/pallets/marketplace/Cargo.toml +++ b/pallets/marketplace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-marketplace" -version = "5.0.16" +version = "5.0.17" authors = ["GalacticCoucil"] description = "The marketplace for trading NFTs" edition = "2018" diff --git a/pallets/xyk-liquidity-mining/Cargo.toml b/pallets/xyk-liquidity-mining/Cargo.toml index 8c764695d5..9a7bb2549a 100644 --- a/pallets/xyk-liquidity-mining/Cargo.toml +++ b/pallets/xyk-liquidity-mining/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-xyk-liquidity-mining" -version = "1.1.9" +version = "1.1.10" description = "Liquidity mining" authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index eb22e64d76..bbc8433b78 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk-runtime" -version = "107.0.0" +version = "108.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index a0ac00ae05..6eb85f5197 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -102,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("basilisk"), impl_name: create_runtime_str!("basilisk"), authoring_version: 1, - spec_version: 107, + spec_version: 108, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/basilisk/src/xcm.rs b/runtime/basilisk/src/xcm.rs index 31c655285c..15a8927262 100644 --- a/runtime/basilisk/src/xcm.rs +++ b/runtime/basilisk/src/xcm.rs @@ -269,8 +269,25 @@ impl pallet_xcm::Config for Runtime { type RemoteLockConsumerIdentifier = (); } +#[test] +fn defer_duration_configuration() { + use sp_runtime::{traits::One, FixedPointNumber, FixedU128}; + /// Calculate the configuration value for the defer duration based on the desired defer duration and + /// the threshold percentage when to start deferring. + /// - `defer_by`: the desired defer duration when reaching the rate limit + /// - `a``: the fraction of the rate limit where we start deferring, e.g. 0.9 + fn defer_duration(defer_by: u32, a: FixedU128) -> u32 { + assert!(a < FixedU128::one()); + // defer_by * a / (1 - a) + (FixedU128::one() / (FixedU128::one() - a)).saturating_mul_int(a.saturating_mul_int(defer_by)) + } + assert_eq!( + defer_duration(600 * 4, FixedU128::from_rational(9, 10)), + DeferDuration::get() + ); +} parameter_types! { - pub DeferDuration: RelayChainBlockNumber = 100; // 10 min + pub DeferDuration: RelayChainBlockNumber = 600 * 36; // 36 hours pub MaxDeferDuration: RelayChainBlockNumber = 600 * 24 * 10; // 10 days }