Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Merge from Snowbridge #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ use parachains_common::{
};
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain::SystemParachains;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumAccountConvertsFor;
use rococo_runtime_constants::system_parachain;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use xcm::latest::prelude::*;
use xcm_builder::{
Expand Down Expand Up @@ -536,20 +536,6 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
ForeignAssetsInstance,
>;

match_types! {
pub type SystemParachains: impl Contains<MultiLocation> = {
MultiLocation {
parents: 1,
interior: X1(Parachain(
system_parachain::ASSET_HUB_ID |
system_parachain::BRIDGE_HUB_ID |
system_parachain::CONTRACTS_ID |
system_parachain::ENCOINTER_ID
)),
}
};
}

/// Locations that will not be charged fees in the executor,
/// either execution or delivery.
/// We only waive fees for system functions, which these locations represent.
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/runtimes/assets/common/src/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ pub struct FromNetwork<SelfNetworkId>(sp_std::marker::PhantomData<SelfNetworkId>
impl<SelfNetworkId: Get<NetworkId>> ContainsPair<MultiLocation, MultiLocation>
for FromNetwork<SelfNetworkId>
{
fn contains(&a: &MultiLocation, b: &MultiLocation) -> bool {
fn contains(&a: &MultiLocation, _b: &MultiLocation) -> bool {
// TODO: check that a.starts_with(b)
match a {
MultiLocation { parents: 2, interior } => {
matches!(interior.first(), Some(GlobalConsensus(network)) if *network == SelfNetworkId::get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl pallet_message_queue::Config for Runtime {
type ServiceWeight = MessageQueueServiceWeight;
type MessageProcessor = EthereumOutboundQueue;
type QueueChangeHandler = ();
type QueuePausedQuery = ();
type QueuePausedQuery = EthereumOutboundQueue;
type WeightInfo = ();
}

Expand Down Expand Up @@ -531,28 +531,16 @@ impl snowbridge_inbound_queue::Config for Runtime {
MessageToXcm<CreateAssetCall, CreateAssetExecutionFee, SendTokenExecutionFee>;
}

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 {
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;
type DeliveryFeePerGas = DeliveryFeePerGas;
type DeliveryRefundPerGas = DeliveryRefundPerGas;
type DeliveryReward = DeliveryReward;
type WeightToFee = WeightToFee;
type WeightInfo = weights::snowbridge_outbound_queue::WeightInfo<Runtime>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<T: frame_system::Config> 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`
Expand All @@ -60,7 +60,7 @@ impl<T: frame_system::Config> 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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use parachains_common::{
};
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain;
use rococo_runtime_constants::system_parachain::SystemParachains;
use snowbridge_router_primitives::outbound::EthereumBlobExporter;
use sp_core::{Get, H256};
use sp_runtime::traits::AccountIdConversion;
Expand Down Expand Up @@ -263,20 +263,6 @@ pub type Barrier = TrailingSetTopicAsId<
>,
>;

match_types! {
pub type SystemParachains: impl Contains<MultiLocation> = {
MultiLocation {
parents: 1,
interior: X1(Parachain(
system_parachain::ASSET_HUB_ID |
system_parachain::BRIDGE_HUB_ID |
system_parachain::CONTRACTS_ID |
system_parachain::ENCOINTER_ID
)),
}
};
}

/// Locations that will not be charged fees in the executor,
/// either execution or delivery.
/// We only waive fees for system functions, which these locations represent.
Expand Down
Loading