From 5880d486cddafb735aa285dbcdc46745fd0e6fb4 Mon Sep 17 00:00:00 2001 From: Erwan Date: Tue, 11 Jul 2023 14:04:53 -0400 Subject: [PATCH] dex: lift temporary consensus rule --- .../src/component/action_handler/position/open.rs | 3 --- crates/core/component/dex/src/lp/position.rs | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/crates/core/component/dex/src/component/action_handler/position/open.rs b/crates/core/component/dex/src/component/action_handler/position/open.rs index ae0a4089be..11e57c2675 100644 --- a/crates/core/component/dex/src/component/action_handler/position/open.rs +++ b/crates/core/component/dex/src/component/action_handler/position/open.rs @@ -25,9 +25,6 @@ impl ActionHandler for PositionOpen { // + the trading function doesn't specify a cyclic pair, // + the fee is <=50%. self.position.check_stateless()?; - // This is a temporary check that limits DEX values to 60 bits. - // To lift this check, delete this line and the method it invokes. - self.position.temporary_check()?; Ok(()) } diff --git a/crates/core/component/dex/src/lp/position.rs b/crates/core/component/dex/src/lp/position.rs index af60f08006..8bf74ceb04 100644 --- a/crates/core/component/dex/src/lp/position.rs +++ b/crates/core/component/dex/src/lp/position.rs @@ -144,21 +144,6 @@ impl Position { } } - /// Implements temporary limiting reserve/valuations values to 60 bits, for more - /// details, please check issue #2560. - pub fn temporary_check(&self) -> anyhow::Result<()> { - let max_60_bits: u128 = (1 << 60) - 1; - if self.reserves.r1.value() > max_60_bits || self.reserves.r2.value() > max_60_bits { - anyhow::bail!("we are temporarily limiting reserves to be at most 60 bits wide") - } else if self.phi.component.p.value() > max_60_bits - || self.phi.component.q.value() > max_60_bits - { - anyhow::bail!("we are temporarily limiting trading function coefficient to be at most 60 bits wide") - } else { - Ok(()) - } - } - /// Returns the amount of the given asset that is currently in the position's reserves. pub fn reserves_for(&self, asset: asset::Id) -> Option { if asset == self.phi.pair.asset_1() {