Skip to content

Commit

Permalink
Update cumulus configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeddes committed Oct 12, 2023
1 parent 55b6360 commit 3c18482
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
21 changes: 13 additions & 8 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use frame_support::{
construct_runtime,
parameter_types,
dispatch::DispatchClass,
traits::{ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Everything},
traits::{ConstBool, ConstU32, ConstU64, ConstU8, Everything},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -610,21 +610,28 @@ impl snowbridge_inbound_queue::Config for Runtime {
type Helper = Runtime;
}


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 GasMeter = snowbridge_core::outbound::ConstantGasMeter;
type Balance = Balance;
type Fee = ConstU128<10>;
type Reward = ConstU128<10>;
type MaxMessagePayloadSize = MaxMessagePayloadSize;
type MaxMessagesPerBlock = MaxMessagesPerBlock;
type DeliveryFeePerGas = DeliveryFeePerGas;
type DeliveryRefundPerGas = DeliveryRefundPerGas;
type DeliveryReward = DeliveryReward;
type WeightInfo = ();
}

Expand Down Expand Up @@ -697,11 +704,9 @@ impl snowbridge_control::Config for Runtime {
type OwnParaId = ParachainInfo;
type OutboundQueue = EthereumOutboundQueue;
type MessageHasher = BlakeTwo256;
type AgentOwnerOrigin = EnsureXcm<Everything>;
type ChannelOwnerOrigin = EnsureXcm<Everything>;
type SiblingOrigin = EnsureXcm<xcm_config::AllowSiblingsOnly>;
type AgentIdOf = xcm_config::AgentIdOf;
type TreasuryAccount = TreasuryAccount;
type Fee = ConstU128<100000000000>; //should be enough to cover the existentialDeposit
type Token = Balances;
type WeightInfo = weights::snowbridge_control::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,14 @@ impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter {
}
}
}

pub struct AllowSiblingsOnly;
impl Contains<MultiLocation> for AllowSiblingsOnly {
fn contains(location: &MultiLocation) -> bool {
if let MultiLocation { parents: 1, interior: X1(Parachain(_)) } = location {
true
} else {
false
}
}
}

0 comments on commit 3c18482

Please sign in to comment.