From d91bced8f5185084e58f8652b8feb5fef3f17a4b Mon Sep 17 00:00:00 2001 From: Guantong <04637@163.com> Date: Fri, 30 Sep 2022 14:40:10 +0800 Subject: [PATCH] Missing part companion for darwinia-network/darwinia-messages-substrate#169 --- Cargo.lock | 38 +++++++++---------- .../crab-parachain/src/pallets/fee_market.rs | 2 + .../src/pallets/fee_market.rs | 2 + 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6963e022..a145f76f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -689,7 +689,7 @@ dependencies = [ [[package]] name = "bp-crab" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-darwinia-core", "bp-messages", @@ -704,7 +704,7 @@ dependencies = [ [[package]] name = "bp-crab-parachain" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-darwinia-core", "bp-messages", @@ -719,7 +719,7 @@ dependencies = [ [[package]] name = "bp-darwinia-core" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-messages", "bp-runtime", @@ -735,7 +735,7 @@ dependencies = [ [[package]] name = "bp-header-chain" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-runtime", "finality-grandpa", @@ -752,7 +752,7 @@ dependencies = [ [[package]] name = "bp-message-dispatch" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-runtime", "frame-support", @@ -765,7 +765,7 @@ dependencies = [ [[package]] name = "bp-messages" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bitvec 1.0.1", "bp-runtime", @@ -782,7 +782,7 @@ dependencies = [ [[package]] name = "bp-pangolin" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-darwinia-core", "bp-messages", @@ -797,7 +797,7 @@ dependencies = [ [[package]] name = "bp-pangolin-parachain" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-darwinia-core", "bp-messages", @@ -812,7 +812,7 @@ dependencies = [ [[package]] name = "bp-parachains" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-polkadot-core", "bp-runtime", @@ -826,7 +826,7 @@ dependencies = [ [[package]] name = "bp-polkadot-core" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-messages", "bp-runtime", @@ -846,7 +846,7 @@ dependencies = [ [[package]] name = "bp-runtime" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "frame-support", "hash-db", @@ -864,7 +864,7 @@ dependencies = [ [[package]] name = "bp-test-utils" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-header-chain", "ed25519-dalek", @@ -879,7 +879,7 @@ dependencies = [ [[package]] name = "bridge-runtime-common" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-message-dispatch", "bp-messages", @@ -5575,7 +5575,7 @@ dependencies = [ [[package]] name = "pallet-bridge-dispatch" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-message-dispatch", "bp-runtime", @@ -5592,7 +5592,7 @@ dependencies = [ [[package]] name = "pallet-bridge-grandpa" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-header-chain", "bp-runtime", @@ -5615,7 +5615,7 @@ dependencies = [ [[package]] name = "pallet-bridge-messages" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bitvec 1.0.1", "bp-message-dispatch", @@ -5637,7 +5637,7 @@ dependencies = [ [[package]] name = "pallet-bridge-parachains" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-parachains", "bp-polkadot-core", @@ -5784,7 +5784,7 @@ dependencies = [ [[package]] name = "pallet-fee-market" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#0b4bc831d488f30b29c515203ea024b7ba064faf" +source = "git+https://github.com/darwinia-network/darwinia-messages-substrate?branch=prepare-polkadot-v0.9.27#2824cc1c1bdf13135ababc6d89e7eb98b396e270" dependencies = [ "bp-messages", "bp-runtime", @@ -11590,7 +11590,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.5", "rand 0.8.5", "static_assertions", diff --git a/runtime/crab-parachain/src/pallets/fee_market.rs b/runtime/crab-parachain/src/pallets/fee_market.rs index 05957e16..fea8f32b 100644 --- a/runtime/crab-parachain/src/pallets/fee_market.rs +++ b/runtime/crab-parachain/src/pallets/fee_market.rs @@ -32,6 +32,7 @@ frame_support::parameter_types! { pub const DutyRelayersRewardRatio: Permill = Permill::from_percent(60); pub const MessageRelayersRewardRatio: Permill = Permill::from_percent(80); pub const ConfirmRelayersRewardRatio: Permill = Permill::from_percent(20); + pub const AssignedRelayerSlashRatio: Permill = Permill::from_percent(20); } impl Config for Runtime { @@ -47,4 +48,5 @@ impl Config for Runtime { type Slot = Slot; type TreasuryPalletId = TreasuryPalletId; type WeightInfo = (); + type AssignedRelayerSlashRatio = AssignedRelayerSlashRatio; } diff --git a/runtime/pangolin-parachain/src/pallets/fee_market.rs b/runtime/pangolin-parachain/src/pallets/fee_market.rs index cbdb9ee8..c56aa07e 100644 --- a/runtime/pangolin-parachain/src/pallets/fee_market.rs +++ b/runtime/pangolin-parachain/src/pallets/fee_market.rs @@ -36,6 +36,7 @@ frame_support::parameter_types! { pub const DutyRelayersRewardRatio: Permill = Permill::from_percent(60); pub const MessageRelayersRewardRatio: Permill = Permill::from_percent(80); pub const ConfirmRelayersRewardRatio: Permill = Permill::from_percent(20); + pub const AssignedRelayerSlashRatio: Permill = Permill::from_percent(20); } impl Config for Runtime { @@ -51,4 +52,5 @@ impl Config for Runtime { type Slot = Slot; type TreasuryPalletId = TreasuryPalletId; type WeightInfo = WeightInfo; + type AssignedRelayerSlashRatio = AssignedRelayerSlashRatio; }