Skip to content

Commit 1f8e448

Browse files
bkonturserban300svyatonik
authored
Bridges V2 refactoring backport and pallet_bridge_messages simplifications (#4935)
## Summary This PR contains migrated code from the Bridges V2 [branch](#4427) from the old `parity-bridges-common` [repo](https://github.com/paritytech/parity-bridges-common/tree/bridges-v2). Even though the PR looks large, it does not (or should not) contain any significant changes (also not relevant for audit). This PR is a requirement for permissionless lanes, as they were implemented on top of these changes. ## TODO - [x] generate fresh weights for BridgeHubs - [x] run `polkadot-fellows` bridges zombienet tests with actual runtime 1.2.5. or 1.2.6 to check compatibility - ☑️ working, checked with 1.2.8 fellows BridgeHubs - [x] run `polkadot-sdk` bridges zombienet tests - ☑️ with old relayer in CI (1.6.5) - [x] run `polkadot-sdk` bridges zombienet tests (locally) - with the relayer based on this branch - paritytech/parity-bridges-common#3022 - [x] check/fix relayer companion in bridges repo - paritytech/parity-bridges-common#3022 - [x] extract pruning stuff to separate PR #4944 Relates to: paritytech/parity-bridges-common#2976 Relates to: paritytech/parity-bridges-common#2451 --------- Signed-off-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Serban Iorga <serban@parity.io> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: command-bot <>
1 parent 2a555c3 commit 1f8e448

108 files changed

Lines changed: 4708 additions & 4639 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 6 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bridges/bin/runtime-common/Cargo.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ workspace = true
1212

1313
[dependencies]
1414
codec = { features = ["derive"], workspace = true }
15-
hash-db = { workspace = true }
1615
log = { workspace = true }
1716
scale-info = { features = ["derive"], workspace = true }
1817
static_assertions = { optional = true, workspace = true, default-features = true }
1918
tuplex = { workspace = true }
2019

2120
# Bridge dependencies
22-
2321
bp-header-chain = { workspace = true }
2422
bp-messages = { workspace = true }
2523
bp-parachains = { workspace = true }
@@ -34,25 +32,23 @@ pallet-bridge-parachains = { workspace = true }
3432
pallet-bridge-relayers = { workspace = true }
3533

3634
# Substrate dependencies
37-
3835
frame-support = { workspace = true }
3936
frame-system = { workspace = true }
4037
pallet-transaction-payment = { workspace = true }
4138
pallet-utility = { workspace = true }
42-
sp-api = { workspace = true }
43-
sp-core = { workspace = true }
4439
sp-io = { workspace = true }
4540
sp-runtime = { workspace = true }
4641
sp-std = { workspace = true }
47-
sp-trie = { workspace = true }
42+
sp-trie = { optional = true, workspace = true }
4843

4944
# Polkadot dependencies
5045
xcm = { workspace = true }
5146
xcm-builder = { workspace = true }
5247

5348
[dev-dependencies]
54-
bp-test-utils = { workspace = true, default-features = true }
55-
pallet-balances = { workspace = true, default-features = true }
49+
bp-test-utils = { workspace = true }
50+
pallet-balances = { workspace = true }
51+
pallet-bridge-messages = { features = ["std", "test-helpers"], workspace = true }
5652

5753
[features]
5854
default = ["std"]
@@ -63,22 +59,21 @@ std = [
6359
"bp-polkadot-core/std",
6460
"bp-relayers/std",
6561
"bp-runtime/std",
62+
"bp-test-utils/std",
6663
"bp-xcm-bridge-hub-router/std",
6764
"bp-xcm-bridge-hub/std",
6865
"codec/std",
6966
"frame-support/std",
7067
"frame-system/std",
71-
"hash-db/std",
7268
"log/std",
69+
"pallet-balances/std",
7370
"pallet-bridge-grandpa/std",
7471
"pallet-bridge-messages/std",
7572
"pallet-bridge-parachains/std",
7673
"pallet-bridge-relayers/std",
7774
"pallet-transaction-payment/std",
7875
"pallet-utility/std",
7976
"scale-info/std",
80-
"sp-api/std",
81-
"sp-core/std",
8277
"sp-io/std",
8378
"sp-runtime/std",
8479
"sp-std/std",
@@ -88,15 +83,22 @@ std = [
8883
"xcm/std",
8984
]
9085
runtime-benchmarks = [
86+
"bp-runtime/test-helpers",
9187
"frame-support/runtime-benchmarks",
9288
"frame-system/runtime-benchmarks",
9389
"pallet-balances/runtime-benchmarks",
9490
"pallet-bridge-grandpa/runtime-benchmarks",
9591
"pallet-bridge-messages/runtime-benchmarks",
92+
"pallet-bridge-messages/test-helpers",
9693
"pallet-bridge-parachains/runtime-benchmarks",
9794
"pallet-bridge-relayers/runtime-benchmarks",
9895
"pallet-utility/runtime-benchmarks",
9996
"sp-runtime/runtime-benchmarks",
97+
"sp-trie",
10098
"xcm-builder/runtime-benchmarks",
10199
]
102100
integrity-test = ["static_assertions"]
101+
test-helpers = [
102+
"bp-runtime/test-helpers",
103+
"sp-trie",
104+
]

bridges/bin/runtime-common/src/extensions/priority_calculator.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ mod integrity_tests {
319319
pub mod per_message {
320320
use super::*;
321321

322+
use bp_messages::ChainWithMessages;
322323
use pallet_bridge_messages::WeightInfoExt;
323324

324325
/// Ensures that the value of `PriorityBoostPerMessage` matches the value of
@@ -339,7 +340,7 @@ mod integrity_tests {
339340
BalanceOf<Runtime>: Send + Sync + FixedPointOperand,
340341
{
341342
let maximal_messages_in_delivery_transaction =
342-
Runtime::MaxUnconfirmedMessagesAtInboundLane::get();
343+
Runtime::BridgedChain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
343344
super::ensure_priority_boost_is_sane::<PriorityBoostPerMessage, BalanceOf<Runtime>>(
344345
"PriorityBoostPerMessage",
345346
maximal_messages_in_delivery_transaction,

0 commit comments

Comments
 (0)