Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay v1.6.1: added support for bridge-hub-kusama/1002004 + aligned kusama/1002004, P to polkadot/1002000 #3007

Merged
merged 8 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
18 changes: 10 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,25 @@ chain runtimes are changes: `Polkadot`, `Kusama`, `PBH`, `KBH`.
When one of involved chains is upgraded, we need to update the relayer code to
support it. Normally it means:

1. Bumping bundled chain versions in following places:
1. Bumping bundled chain versions (`spec_version`, `transaction_version`) in following places:

- for `Rococo` and `RBH`: [here](https://github.com/paritytech/parity-bridges-common/blob/master/relays/bin-substrate/src/chains/rococo.rs);
- for `Rococo` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-rococo/src/lib.rs) and `RBH` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-bridge-hub-rococo/src/lib.rs);

- for `Westend` and `WBH`: [here](https://github.com/paritytech/parity-bridges-common/blob/master/relays/bin-substrate/src/chains/westend.rs);
- for `Westend` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-westend/src/lib.rs) and `WBH` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-bridge-hub-westend/src/lib.rs);

- for `Kusama` and `KBH`: [here](https://github.com/paritytech/parity-bridges-common/blob/master/relays/bin-substrate/src/chains/polkadot.rs)
- for `Kusama` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-kusama/src/lib.rs) and `KBH` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-bridge-hub-kusama/src/lib.rs);

- for `Polkadot` and `PBH`: [here](https://github.com/paritytech/parity-bridges-common/blob/master/relays/bin-substrate/src/chains/polkadot.rs);
- for `Polkadot` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-polkadot/src/lib.rs) and `PBH` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-bridge-hub-polkadot/src/lib.rs);

- for `PBC`: [here](https://github.com/paritytech/parity-bridges-common/blob/master/relays/bin-substrate/src/chains/polkadot_bulletin.rs).
- for `PBC` [here](https://github.com/paritytech/parity-bridges-common/blob/master/relay-clients/client-polkadot-bulletin/src/lib.rs).

2. Regenerating bundled runtime wrapper code using `runtime-codegen` binary:

If you can start updated chain node, it could be done using following command
(assuming you're in the root of the repository):
```sh
cd tools/runtime-codegen
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-rpc.polkadot.io:443" > ../../relays/client-rococo/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-rpc.polkadot.io:443" > ../../relay-clients/client-rococo/src/codegen_runtime.rs
```

Otherwise, you'll need a runtime file. You may download it from:
Expand All @@ -158,9 +158,11 @@ cargo run --bin runtime-codegen -- --from-wasm-file rococo_runtime.compact.compr

**IMPORTANT**: due to [well-known issue](https://github.com/paritytech/parity-bridges-common/issues/2669)
with runtime codegen, you'll get compilation errors after updating.
To fix it, execute following commands:
To fix it, execute following commands
(assuming you're back in the root of the repository):
```sh
cargo +nightly fmt --all
find . -name codegen_runtime.rs -exec \
sed -i 's/::sp_runtime::generic::Header<::core::primitive::u32>/::sp_runtime::generic::Header<::core::primitive::u32, ::sp_runtime::traits::BlakeTwo256>/g' {} +
cargo +nightly fmt --all
```
201 changes: 45 additions & 156 deletions relay-clients/client-bridge-hub-kusama/src/codegen_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ pub mod api {
PolkadotXcm(runtime_types::pallet_xcm::pallet::Call),
#[codec(index = 32)]
CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Call),
#[codec(index = 33)]
DmpQueue(runtime_types::cumulus_pallet_dmp_queue::pallet::Call),
#[codec(index = 40)]
Utility(runtime_types::pallet_utility::pallet::Call),
#[codec(index = 41)]
Expand Down Expand Up @@ -401,8 +399,6 @@ pub mod api {
PolkadotXcm(runtime_types::pallet_xcm::pallet::Event),
#[codec(index = 32)]
CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Event),
#[codec(index = 33)]
DmpQueue(runtime_types::cumulus_pallet_dmp_queue::pallet::Event),
#[codec(index = 40)]
Utility(runtime_types::pallet_utility::pallet::Event),
#[codec(index = 41)]
Expand Down Expand Up @@ -459,62 +455,6 @@ pub mod api {
pub struct RefundSignedExtensionAdapter<_0>(pub _0);
}
}
pub mod cumulus_pallet_dmp_queue {
use super::runtime_types;
pub mod pallet {
use super::runtime_types;
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum Call {}
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum Event {
#[codec(index = 0)]
StartedExport,
#[codec(index = 1)]
Exported { page: ::core::primitive::u32 },
#[codec(index = 2)]
ExportFailed { page: ::core::primitive::u32 },
#[codec(index = 3)]
CompletedExport,
#[codec(index = 4)]
StartedOverweightExport,
#[codec(index = 5)]
ExportedOverweight { index: ::core::primitive::u64 },
#[codec(index = 6)]
ExportOverweightFailed { index: ::core::primitive::u64 },
#[codec(index = 7)]
CompletedOverweightExport,
#[codec(index = 8)]
StartedCleanup,
#[codec(index = 9)]
CleanedSome { keys_removed: ::core::primitive::u32 },
#[codec(index = 10)]
Completed { error: ::core::primitive::bool },
}
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum MigrationState {
#[codec(index = 0)]
NotStarted,
#[codec(index = 1)]
StartedExport { next_begin_used: ::core::primitive::u32 },
#[codec(index = 2)]
CompletedExport,
#[codec(index = 3)]
StartedOverweightExport { next_overweight_index: ::core::primitive::u64 },
#[codec(index = 4)]
CompletedOverweightExport,
#[codec(index = 5)]
StartedCleanup {
cursor: ::core::option::Option<
runtime_types::bounded_collections::bounded_vec::BoundedVec<
::core::primitive::u8,
>,
>,
},
#[codec(index = 6)]
Completed,
}
}
}
pub mod cumulus_pallet_parachain_system {
use super::runtime_types;
pub mod pallet {
Expand Down Expand Up @@ -1962,80 +1902,7 @@ pub mod api {
use super::runtime_types;
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum Call {
#[codec(index = 0)]
send {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
message: ::std::boxed::Box<runtime_types::xcm::VersionedXcm>,
},
#[codec(index = 1)]
teleport_assets {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
fee_asset_item: ::core::primitive::u32,
},
#[codec(index = 2)]
reserve_transfer_assets {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
fee_asset_item: ::core::primitive::u32,
},
#[codec(index = 3)]
execute {
message: ::std::boxed::Box<runtime_types::xcm::VersionedXcm2>,
max_weight: ::sp_weights::Weight,
},
#[codec(index = 4)]
force_xcm_version {
location:
::std::boxed::Box<runtime_types::staging_xcm::v4::location::Location>,
version: ::core::primitive::u32,
},
#[codec(index = 5)]
force_default_xcm_version {
maybe_xcm_version: ::core::option::Option<::core::primitive::u32>,
},
#[codec(index = 6)]
force_subscribe_version_notify {
location: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
},
#[codec(index = 7)]
force_unsubscribe_version_notify {
location: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
},
#[codec(index = 8)]
limited_reserve_transfer_assets {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
fee_asset_item: ::core::primitive::u32,
weight_limit: runtime_types::xcm::v3::WeightLimit,
},
#[codec(index = 9)]
limited_teleport_assets {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
fee_asset_item: ::core::primitive::u32,
weight_limit: runtime_types::xcm::v3::WeightLimit,
},
#[codec(index = 10)]
force_suspension { suspended: ::core::primitive::bool },
#[codec(index = 11)]
transfer_assets {
dest: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
fee_asset_item: ::core::primitive::u32,
weight_limit: runtime_types::xcm::v3::WeightLimit,
},
#[codec(index = 12)]
claim_assets {
assets: ::std::boxed::Box<runtime_types::xcm::VersionedAssets>,
beneficiary: ::std::boxed::Box<runtime_types::xcm::VersionedLocation>,
},
}
# [codec (index = 0)] send { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , message : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , } , # [codec (index = 1)] teleport_assets { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 2)] reserve_transfer_assets { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 3)] execute { message : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedXcm2 > , max_weight : :: sp_weights :: Weight , } , # [codec (index = 4)] force_xcm_version { location : :: std :: boxed :: Box < runtime_types :: staging_xcm :: v4 :: location :: Location > , version : :: core :: primitive :: u32 , } , # [codec (index = 5)] force_default_xcm_version { maybe_xcm_version : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 6)] force_subscribe_version_notify { location : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 7)] force_unsubscribe_version_notify { location : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 8)] limited_reserve_transfer_assets { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 9)] limited_teleport_assets { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 10)] force_suspension { suspended : :: core :: primitive :: bool , } , # [codec (index = 11)] transfer_assets { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 12)] claim_assets { assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , beneficiary : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 13)] transfer_assets_using_type_and_then { dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , assets_transfer_type : :: std :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , remote_fees_id : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedAssetId > , fees_transfer_type : :: std :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , custom_xcm_on_dest : :: std :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all on one line - is cargo fmt happy with this? 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, strange, but it is ok :D

paritytech/subxt#1629

#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum Error {
#[codec(index = 0)]
Expand Down Expand Up @@ -2762,52 +2629,54 @@ pub mod api {
#[codec(index = 0)]
SkippedSyncCommitteePeriod,
#[codec(index = 1)]
IrrelevantUpdate,
SyncCommitteeUpdateRequired,
#[codec(index = 2)]
NotBootstrapped,
IrrelevantUpdate,
#[codec(index = 3)]
SyncCommitteeParticipantsNotSupermajority,
NotBootstrapped,
#[codec(index = 4)]
InvalidHeaderMerkleProof,
SyncCommitteeParticipantsNotSupermajority,
#[codec(index = 5)]
InvalidSyncCommitteeMerkleProof,
InvalidHeaderMerkleProof,
#[codec(index = 6)]
InvalidExecutionHeaderProof,
InvalidSyncCommitteeMerkleProof,
#[codec(index = 7)]
InvalidAncestryMerkleProof,
InvalidExecutionHeaderProof,
#[codec(index = 8)]
InvalidBlockRootsRootMerkleProof,
InvalidAncestryMerkleProof,
#[codec(index = 9)]
InvalidFinalizedHeaderGap,
InvalidBlockRootsRootMerkleProof,
#[codec(index = 10)]
HeaderNotFinalized,
InvalidFinalizedHeaderGap,
#[codec(index = 11)]
BlockBodyHashTreeRootFailed,
HeaderNotFinalized,
#[codec(index = 12)]
HeaderHashTreeRootFailed,
BlockBodyHashTreeRootFailed,
#[codec(index = 13)]
SyncCommitteeHashTreeRootFailed,
HeaderHashTreeRootFailed,
#[codec(index = 14)]
SigningRootHashTreeRootFailed,
SyncCommitteeHashTreeRootFailed,
#[codec(index = 15)]
ForkDataHashTreeRootFailed,
SigningRootHashTreeRootFailed,
#[codec(index = 16)]
ExpectedFinalizedHeaderNotStored,
ForkDataHashTreeRootFailed,
#[codec(index = 17)]
BLSPreparePublicKeysFailed,
ExpectedFinalizedHeaderNotStored,
#[codec(index = 18)]
BLSPreparePublicKeysFailed,
#[codec(index = 19)]
BLSVerificationFailed(
runtime_types::snowbridge_beacon_primitives::bls::BlsError,
),
#[codec(index = 19)]
InvalidUpdateSlot,
#[codec(index = 20)]
InvalidSyncCommitteeUpdate,
InvalidUpdateSlot,
#[codec(index = 21)]
ExecutionHeaderTooFarBehind,
InvalidSyncCommitteeUpdate,
#[codec(index = 22)]
ExecutionHeaderSkippedBlock,
ExecutionHeaderTooFarBehind,
#[codec(index = 23)]
ExecutionHeaderSkippedBlock,
#[codec(index = 24)]
Halted,
}
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
Expand Down Expand Up @@ -4106,6 +3975,26 @@ pub mod api {
pub struct Xcm2(pub ::std::vec::Vec<runtime_types::staging_xcm::v4::Instruction2>);
}
}
pub mod staging_xcm_executor {
use super::runtime_types;
pub mod traits {
use super::runtime_types;
pub mod asset_transfer {
use super::runtime_types;
#[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)]
pub enum TransferType {
#[codec(index = 0)]
Teleport,
#[codec(index = 1)]
LocalReserve,
#[codec(index = 2)]
DestinationReserve,
#[codec(index = 3)]
RemoteReserve(runtime_types::xcm::VersionedLocation),
}
}
}
}
pub mod xcm {
use super::runtime_types;
pub mod double_encoded {
Expand Down
2 changes: 1 addition & 1 deletion relay-clients/client-bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ impl ChainWithMessages for BridgeHubKusama {

impl ChainWithRuntimeVersion for BridgeHubKusama {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_002_000, transaction_version: 4 });
Some(SimpleRuntimeVersion { spec_version: 1_002_004, transaction_version: 4 });
}
71 changes: 0 additions & 71 deletions relay-clients/client-bridge-hub-kusama/src/runtime_wrapper.rs

This file was deleted.

Loading