From 95f3c78b8ad743cc6b9060a0b909a95568af3d84 Mon Sep 17 00:00:00 2001 From: Vincent Geddes Date: Mon, 30 Oct 2023 18:45:19 +0200 Subject: [PATCH 1/2] Runtime changes for refactored outbound-queue pallet --- Cargo.lock | 3 +-- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 10 ++-------- .../src/weights/snowbridge_outbound_queue.rs | 4 ++-- .../polkadot-parachain/src/chain_spec/bridge_hubs.rs | 1 + 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f36db27fbbb2..576e3836c943 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16797,7 +16797,6 @@ dependencies = [ name = "snowbridge-core" version = "0.1.1" dependencies = [ - "derivative", "ethabi-decode", "frame-support", "frame-system", @@ -16807,6 +16806,7 @@ dependencies = [ "serde", "snowbridge-beacon-primitives", "snowbridge-ethereum", + "sp-arithmetic", "sp-core", "sp-runtime", "sp-std", @@ -16898,7 +16898,6 @@ dependencies = [ "frame-system", "hex-literal", "parity-scale-codec", - "rlp", "scale-info", "serde", "snowbridge-core", diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index c1c4ca880826..730a966f472d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -492,7 +492,7 @@ impl pallet_message_queue::Config for Runtime { type ServiceWeight = MessageQueueServiceWeight; type MessageProcessor = EthereumOutboundQueue; type QueueChangeHandler = (); - type QueuePausedQuery = (); + type QueuePausedQuery = EthereumOutboundQueue; type WeightInfo = (); } @@ -535,9 +535,6 @@ pub const GWEI: u128 = 1_000_000_000; parameter_types! { pub const MaxMessagePayloadSize: u32 = 2048; pub const MaxMessagesPerBlock: u32 = 32; - pub const DeliveryFeePerGas: u128 = 10; - pub const DeliveryRefundPerGas: u128 = 10 * GWEI; - pub const DeliveryReward: u128 = 1000 * GWEI; } impl snowbridge_outbound_queue::Config for Runtime { @@ -549,9 +546,6 @@ impl snowbridge_outbound_queue::Config for Runtime { type OwnParaId = ParachainInfo; type GasMeter = snowbridge_core::outbound::ConstantGasMeter; type Balance = Balance; - type DeliveryFeePerGas = DeliveryFeePerGas; - type DeliveryRefundPerGas = DeliveryRefundPerGas; - type DeliveryReward = DeliveryReward; type WeightToFee = WeightToFee; type WeightInfo = weights::snowbridge_outbound_queue::WeightInfo; } @@ -690,7 +684,7 @@ construct_runtime!( BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event} = 47, EthereumInboundQueue: snowbridge_inbound_queue::{Pallet, Call, Storage, Event} = 48, - EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event} = 49, + EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Config, Event} = 49, EthereumBeaconClient: snowbridge_ethereum_beacon_client::{Pallet, Call, Storage, Event} = 50, EthereumControl: snowbridge_control::{Pallet, Call, Storage, Event} = 51, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs index 4836c0f830f5..c5b872d7b362 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs @@ -50,7 +50,7 @@ impl snowbridge_outbound_queue::WeightInfo for WeightIn /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) /// Storage: System Digest (r:1 w:1) /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) - fn commit_messages() -> Weight { + fn commit() -> Weight { // Proof Size summary in bytes: // Measured: `1094` // Estimated: `2579` @@ -60,7 +60,7 @@ impl snowbridge_outbound_queue::WeightInfo for WeightIn .saturating_add(T::DbWeight::get().writes(1_u64)) } - fn commit_one_message() -> Weight { + fn commit_single() -> Weight { // Proof Size summary in bytes: // Measured: `1094` // Estimated: `2579` diff --git a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs index ca5583fe2e53..b6925453e837 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -325,6 +325,7 @@ pub mod rococo { owner: bridges_pallet_owner, ..Default::default() }, + ethereum_outbound_queue: Default::default(), } } } From 0f1377ed2e727a1aa5b7cb9ef93810bba5d9f18c Mon Sep 17 00:00:00 2001 From: Vincent Geddes Date: Tue, 31 Oct 2023 20:13:31 +0200 Subject: [PATCH 2/2] Update bridge --- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 14 ++++---------- .../src/chain_spec/bridge_hubs.rs | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 730a966f472d..a25355b93cea 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -530,19 +530,13 @@ impl snowbridge_inbound_queue::Config for Runtime { MessageToXcm; } -pub const GWEI: u128 = 1_000_000_000; - -parameter_types! { - pub const MaxMessagePayloadSize: u32 = 2048; - pub const MaxMessagesPerBlock: u32 = 32; -} - impl snowbridge_outbound_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Hashing = Keccak256; type MessageQueue = MessageQueue; - type MaxMessagePayloadSize = MaxMessagePayloadSize; - type MaxMessagesPerBlock = MaxMessagesPerBlock; + type Decimals = ConstU8<12>; + type MaxMessagePayloadSize = ConstU32<2048>; + type MaxMessagesPerBlock = ConstU32<32>; type OwnParaId = ParachainInfo; type GasMeter = snowbridge_core::outbound::ConstantGasMeter; type Balance = Balance; @@ -684,7 +678,7 @@ construct_runtime!( BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event} = 47, EthereumInboundQueue: snowbridge_inbound_queue::{Pallet, Call, Storage, Event} = 48, - EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Config, Event} = 49, + EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event} = 49, EthereumBeaconClient: snowbridge_ethereum_beacon_client::{Pallet, Call, Storage, Event} = 50, EthereumControl: snowbridge_control::{Pallet, Call, Storage, Event} = 51, diff --git a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs index b6925453e837..ca5583fe2e53 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -325,7 +325,6 @@ pub mod rococo { owner: bridges_pallet_owner, ..Default::default() }, - ethereum_outbound_queue: Default::default(), } } }