From 8304c1cedd8d8ddf998b8c1d53b33b99264aa41c Mon Sep 17 00:00:00 2001 From: lemunozm Date: Mon, 12 Aug 2024 20:35:07 +0200 Subject: [PATCH] development and altair compiling --- Cargo.lock | 6 ++---- runtime/altair/Cargo.toml | 12 ++++-------- runtime/altair/src/lib.rs | 20 +++++++++++++------- runtime/development/Cargo.toml | 12 ++++-------- runtime/development/src/lib.rs | 18 ++++++++++++------ 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52e5294fbf..cf6a97317a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,7 +123,6 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" name = "altair-runtime" version = "0.14.0" dependencies = [ - "axelar-gateway-precompile", "cfg-primitives", "cfg-traits", "cfg-types", @@ -149,7 +148,6 @@ dependencies = [ "frame-try-runtime", "hex", "hex-literal", - "liquidity-pools-gateway-routers", "log", "orml-asset-registry", "orml-tokens", @@ -160,6 +158,7 @@ dependencies = [ "pallet-anchors", "pallet-aura", "pallet-authorship", + "pallet-axelar-router", "pallet-balances", "pallet-base-fee", "pallet-block-rewards", @@ -3081,7 +3080,6 @@ dependencies = [ name = "development-runtime" version = "0.14.0" dependencies = [ - "axelar-gateway-precompile", "cfg-primitives", "cfg-traits", "cfg-types", @@ -3107,7 +3105,6 @@ dependencies = [ "frame-try-runtime", "hex", "hex-literal", - "liquidity-pools-gateway-routers", "log", "orml-asset-registry", "orml-tokens", @@ -3119,6 +3116,7 @@ dependencies = [ "pallet-anchors-v2", "pallet-aura", "pallet-authorship", + "pallet-axelar-router", "pallet-balances", "pallet-base-fee", "pallet-block-rewards", diff --git a/runtime/altair/Cargo.toml b/runtime/altair/Cargo.toml index d4353693d6..ea5009dd4e 100644 --- a/runtime/altair/Cargo.toml +++ b/runtime/altair/Cargo.toml @@ -68,11 +68,9 @@ cfg-primitives = { workspace = true } cfg-traits = { workspace = true } cfg-types = { workspace = true } cfg-utils = { workspace = true } -liquidity-pools-gateway-routers = { workspace = true } runtime-common = { workspace = true } # Pallet list -axelar-gateway-precompile = { workspace = true } chainbridge = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } @@ -85,6 +83,7 @@ orml-xtokens = { workspace = true } pallet-anchors = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } +pallet-axelar-router = { workspace = true } pallet-balances = { workspace = true } pallet-base-fee = { workspace = true } pallet-block-rewards = { workspace = true } @@ -200,9 +199,7 @@ std = [ "cfg-traits/std", "cfg-types/std", "runtime-common/std", - "liquidity-pools-gateway-routers/std", # Pallet list - "axelar-gateway-precompile/std", "chainbridge/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", @@ -215,6 +212,7 @@ std = [ "pallet-anchors/std", "pallet-aura/std", "pallet-authorship/std", + "pallet-axelar-router/std", "pallet-balances/std", "pallet-base-fee/std", "pallet-block-rewards/std", @@ -295,9 +293,7 @@ runtime-benchmarks = [ "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", "runtime-common/runtime-benchmarks", - "liquidity-pools-gateway-routers/runtime-benchmarks", # Pallet list - "axelar-gateway-precompile/runtime-benchmarks", "chainbridge/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", @@ -305,6 +301,7 @@ runtime-benchmarks = [ "orml-tokens/runtime-benchmarks", "orml-xtokens/runtime-benchmarks", "pallet-anchors/runtime-benchmarks", + "pallet-axelar-router/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-block-rewards/runtime-benchmarks", "pallet-bridge/runtime-benchmarks", @@ -375,9 +372,7 @@ try-runtime = [ "cfg-traits/try-runtime", "cfg-types/try-runtime", "runtime-common/try-runtime", - "liquidity-pools-gateway-routers/try-runtime", # Pallet list - "axelar-gateway-precompile/try-runtime", "chainbridge/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", @@ -390,6 +385,7 @@ try-runtime = [ "pallet-anchors/try-runtime", "pallet-aura/try-runtime", "pallet-authorship/try-runtime", + "pallet-axelar-router/try-runtime", "pallet-balances/try-runtime", "pallet-base-fee/try-runtime", "pallet-block-rewards/try-runtime", diff --git a/runtime/altair/src/lib.rs b/runtime/altair/src/lib.rs index fe0d5dd8f8..3889aadaf9 100644 --- a/runtime/altair/src/lib.rs +++ b/runtime/altair/src/lib.rs @@ -31,6 +31,7 @@ use cfg_primitives::{ }; use cfg_traits::{investments::OrderManager, Millis, PoolUpdateGuard, Seconds}; use cfg_types::{ + domain_address::DomainAddress, fee_keys::{Fee, FeeKey}, fixed_point::{Quantity, Rate, Ratio}, investments::InvestmentPortfolio, @@ -116,6 +117,7 @@ use runtime_common::{ permissions::{IsUnfrozenTrancheInvestor, PoolAdminCheck}, remarks::Remark, rewards::SingleCurrencyMovement, + routing::{EvmAccountCodeChecker, RouterDispatcher, RouterId}, transfer_filter::{PreLpTransfer, PreNativeTransfer}, xcm::AccountIdToLocation, xcm_transactor, AllowanceDeposit, CurrencyED, @@ -1756,7 +1758,7 @@ impl pallet_liquidity_pools::Config for Runtime { parameter_types! { pub const MaxIncomingMessageSize: u32 = 1024; - pub Sender: AccountId = gateway::get_gateway_account::(); + pub Sender: DomainAddress = gateway::get_gateway_account::(); } impl pallet_liquidity_pools_gateway::Config for Runtime { @@ -1766,7 +1768,8 @@ impl pallet_liquidity_pools_gateway::Config for Runtime { type MaxIncomingMessageSize = MaxIncomingMessageSize; type Message = pallet_liquidity_pools::Message; type MessageQueue = LiquidityPoolsGatewayQueue; - type Router = liquidity_pools_gateway_routers::DomainRouter; + type MessageSender = RouterDispatcher; + type RouterId = RouterId; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type Sender = Sender; @@ -1774,7 +1777,7 @@ impl pallet_liquidity_pools_gateway::Config for Runtime { } impl pallet_liquidity_pools_gateway_queue::Config for Runtime { - type Message = GatewayMessage; + type Message = GatewayMessage; type MessageNonce = LPGatewayQueueMessageNonce; type MessageProcessor = LiquidityPoolsGateway; type RuntimeEvent = RuntimeEvent; @@ -1884,10 +1887,13 @@ impl pallet_ethereum::Config for Runtime { impl pallet_ethereum_transaction::Config for Runtime {} -impl axelar_gateway_precompile::Config for Runtime { - type AdminOrigin = EnsureRootOr; +impl pallet_axelar_router::Config for Runtime { + type AdminOrigin = EnsureRoot; + type EvmAccountCodeChecker = EvmAccountCodeChecker; + type Middleware = RouterId; + type Receiver = LiquidityPoolsGateway; type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); + type Transactor = EthereumTransaction; } impl pallet_conviction_voting::Config for Runtime { @@ -2109,7 +2115,7 @@ construct_runtime!( BaseFee: pallet_base_fee::{Pallet, Call, Config, Storage, Event} = 162, Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 163, EthereumTransaction: pallet_ethereum_transaction::{Pallet, Storage} = 164, - LiquidityPoolsAxelarGateway: axelar_gateway_precompile::{Pallet, Call, Storage, Event} = 165, + AxelarRouter: pallet_axelar_router::{Pallet, Call, Storage, Event} = 165, // Our pallets (part 2) // Removed: Migration = 199 diff --git a/runtime/development/Cargo.toml b/runtime/development/Cargo.toml index b1a6719608..ac92c94e31 100644 --- a/runtime/development/Cargo.toml +++ b/runtime/development/Cargo.toml @@ -68,11 +68,9 @@ cfg-primitives = { workspace = true } cfg-traits = { workspace = true } cfg-types = { workspace = true } cfg-utils = { workspace = true } -liquidity-pools-gateway-routers = { workspace = true } runtime-common = { workspace = true } # Pallet list -axelar-gateway-precompile = { workspace = true } chainbridge = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } @@ -86,6 +84,7 @@ pallet-anchors = { workspace = true } pallet-anchors-v2 = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } +pallet-axelar-router = { workspace = true } pallet-balances = { workspace = true } pallet-base-fee = { workspace = true } pallet-block-rewards = { workspace = true } @@ -201,9 +200,7 @@ std = [ "cfg-traits/std", "cfg-types/std", "runtime-common/std", - "liquidity-pools-gateway-routers/std", # Pallet list - "axelar-gateway-precompile/std", "chainbridge/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", @@ -217,6 +214,7 @@ std = [ "pallet-anchors-v2/std", "pallet-aura/std", "pallet-authorship/std", + "pallet-axelar-router/std", "pallet-balances/std", "pallet-base-fee/std", "pallet-block-rewards/std", @@ -296,9 +294,7 @@ runtime-benchmarks = [ "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", "runtime-common/runtime-benchmarks", - "liquidity-pools-gateway-routers/runtime-benchmarks", # Pallet list - "axelar-gateway-precompile/runtime-benchmarks", "chainbridge/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", @@ -307,6 +303,7 @@ runtime-benchmarks = [ "orml-xtokens/runtime-benchmarks", "pallet-anchors/runtime-benchmarks", "pallet-anchors-v2/runtime-benchmarks", + "pallet-axelar-router/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-block-rewards/runtime-benchmarks", "pallet-bridge/runtime-benchmarks", @@ -377,9 +374,7 @@ try-runtime = [ "cfg-traits/try-runtime", "cfg-types/try-runtime", "runtime-common/try-runtime", - "liquidity-pools-gateway-routers/try-runtime", # Pallet list - "axelar-gateway-precompile/try-runtime", "chainbridge/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", @@ -393,6 +388,7 @@ try-runtime = [ "pallet-anchors-v2/try-runtime", "pallet-aura/try-runtime", "pallet-authorship/try-runtime", + "pallet-axelar-router/try-runtime", "pallet-balances/try-runtime", "pallet-base-fee/try-runtime", "pallet-block-rewards/try-runtime", diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index 67bf57c52c..973921019e 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -34,6 +34,7 @@ use cfg_traits::{ Seconds, }; use cfg_types::{ + domain_address::DomainAddress, fee_keys::{Fee, FeeKey}, fixed_point::{Quantity, Rate, Ratio}, investments::InvestmentPortfolio, @@ -124,6 +125,7 @@ use runtime_common::{ permissions::{IsUnfrozenTrancheInvestor, PoolAdminCheck}, remarks::Remark, rewards::SingleCurrencyMovement, + routing::{EvmAccountCodeChecker, RouterDispatcher, RouterId}, transfer_filter::{PreLpTransfer, PreNativeTransfer}, xcm::AccountIdToLocation, xcm_transactor, AllowanceDeposit, CurrencyED, @@ -1861,7 +1863,7 @@ impl pallet_liquidity_pools::Config for Runtime { parameter_types! { pub const MaxIncomingMessageSize: u32 = 1024; - pub Sender: AccountId = gateway::get_gateway_account::(); + pub Sender: DomainAddress = gateway::get_gateway_account::(); } impl pallet_liquidity_pools_gateway::Config for Runtime { @@ -1871,7 +1873,8 @@ impl pallet_liquidity_pools_gateway::Config for Runtime { type MaxIncomingMessageSize = MaxIncomingMessageSize; type Message = pallet_liquidity_pools::Message; type MessageQueue = LiquidityPoolsGatewayQueue; - type Router = liquidity_pools_gateway_routers::DomainRouter; + type MessageSender = RouterDispatcher; + type RouterId = RouterId; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type Sender = Sender; @@ -1879,7 +1882,7 @@ impl pallet_liquidity_pools_gateway::Config for Runtime { } impl pallet_liquidity_pools_gateway_queue::Config for Runtime { - type Message = GatewayMessage; + type Message = GatewayMessage; type MessageNonce = LPGatewayQueueMessageNonce; type MessageProcessor = LiquidityPoolsGateway; type RuntimeEvent = RuntimeEvent; @@ -1990,10 +1993,13 @@ impl pallet_ethereum::Config for Runtime { impl pallet_ethereum_transaction::Config for Runtime {} -impl axelar_gateway_precompile::Config for Runtime { +impl pallet_axelar_router::Config for Runtime { type AdminOrigin = EnsureRoot; + type EvmAccountCodeChecker = EvmAccountCodeChecker; + type Middleware = RouterId; + type Receiver = LiquidityPoolsGateway; type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); + type Transactor = EthereumTransaction; } impl pallet_conviction_voting::Config for Runtime { @@ -2219,7 +2225,7 @@ construct_runtime!( BaseFee: pallet_base_fee::{Pallet, Call, Config, Storage, Event} = 162, Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 163, EthereumTransaction: pallet_ethereum_transaction::{Pallet, Storage} = 164, - LiquidityPoolsAxelarGateway: axelar_gateway_precompile::{Pallet, Call, Storage, Event} = 165, + AxelarRouter: pallet_axelar_router::{Pallet, Call, Storage, Event} = 165, // Removed: Migration = 199 // admin stuff