Skip to content

Commit

Permalink
Merge pull request #850 from galacticcouncil/remove_xcm_stale_code
Browse files Browse the repository at this point in the history
refactor: remove xcm stale code
  • Loading branch information
Roznovjak authored Jun 24, 2024
2 parents d5f7005 + 06a2f3b commit 769c33d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/hydradx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hydradx-runtime"
version = "244.0.0"
version = "245.0.0"
authors = ["GalacticCouncil"]
edition = "2021"
license = "Apache 2.0"
Expand Down
2 changes: 1 addition & 1 deletion runtime/hydradx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("hydradx"),
impl_name: create_runtime_str!("hydradx"),
authoring_version: 1,
spec_version: 244,
spec_version: 245,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
25 changes: 1 addition & 24 deletions runtime/hydradx/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use pallet_evm::AddressMapping;
pub use pallet_xcm::GenesisConfig as XcmGenesisConfig;
use pallet_xcm::XcmPassthrough;
use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling};
use polkadot_parachain::primitives::{RelayChainBlockNumber, Sibling};
use polkadot_parachain::primitives::Sibling;
use polkadot_xcm::v3::MultiLocation;
use polkadot_xcm::v4::{prelude::*, Asset, InteriorLocation, Weight as XcmWeight};
use scale_info::TypeInfo;
Expand Down Expand Up @@ -196,9 +196,6 @@ impl cumulus_pallet_xcm::Config for Runtime {
}

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

Expand Down Expand Up @@ -280,27 +277,7 @@ 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 = 600 * 36; // 36 hours
pub MaxDeferDuration: RelayChainBlockNumber = 600 * 24 * 10; // 10 days

pub MessageQueueServiceWeight: Weight = Perbill::from_percent(25) * BlockWeights::get().max_block;
pub const MessageQueueMaxStale: u32 = 8;
pub const MessageQueueHeapSize: u32 = 128 * 1048;
Expand Down

0 comments on commit 769c33d

Please sign in to comment.