Skip to content

Commit

Permalink
Some remaining fixes (mostly insubstantial) for relay (paritytech#2859)
Browse files Browse the repository at this point in the history
* if bundled version is `None` and cli said "use bundled" => error

* update chain spec and transaction versions

* use generated runtime wrapper for PBH and KBH

* trigger CI

* Revert "trigger CI"

This reverts commit 7d9f51e34829d9224b352300d062e365243def5e.

* Revert "Revert "trigger CI""

This reverts commit c86ca0e264367e39abad29b9f09f09578a980568.

* Revert "Revert "Revert "trigger CI"""

This reverts commit 95e7da258bb2ace4ed2cafdb01833317f38cfcfc.
  • Loading branch information
svyatonik authored Mar 4, 2024
1 parent 503f64b commit af8480e
Show file tree
Hide file tree
Showing 22 changed files with 8,242 additions and 85 deletions.
12 changes: 8 additions & 4 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 @@ -36,15 +36,15 @@ impl MessagesCliBridge for BridgeHubKusamaToBridgeHubPolkadotMessagesCliBridge {
substrate_relay_helper::generate_receive_message_proof_call_builder!(
BridgeHubKusamaMessagesToBridgeHubPolkadotMessageLane,
BridgeHubKusamaMessagesToBridgeHubPolkadotMessageLaneReceiveMessagesProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::runtime::BridgeKusamaMessagesCall::receive_messages_proof
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::BridgeKusamaMessagesCall::receive_messages_proof
);

substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
BridgeHubKusamaMessagesToBridgeHubPolkadotMessageLane,
BridgeHubKusamaMessagesToBridgeHubPolkadotMessageLaneReceiveMessagesDeliveryProofCallBuilder,
relay_bridge_hub_kusama_client::runtime::Call::BridgePolkadotMessages,
relay_bridge_hub_kusama_client::runtime::BridgePolkadotMessagesCall::receive_messages_delivery_proof
relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotMessages,
relay_bridge_hub_kusama_client::BridgeMessagesCall::receive_messages_delivery_proof
);

/// BridgeHubKusama-to-BridgeHubPolkadot messages lane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ impl MessagesCliBridge for BridgeHubPolkadotToBridgeHubKusamaMessagesCliBridge {
substrate_relay_helper::generate_receive_message_proof_call_builder!(
BridgeHubPolkadotMessagesToBridgeHubKusamaMessageLane,
BridgeHubPolkadotMessagesToBridgeHubKusamaMessageLaneReceiveMessagesProofCallBuilder,
relay_bridge_hub_kusama_client::runtime::Call::BridgePolkadotMessages,
relay_bridge_hub_kusama_client::runtime::BridgePolkadotMessagesCall::receive_messages_proof
relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotMessages,
relay_bridge_hub_kusama_client::BridgeMessagesCall::receive_messages_proof
);

substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
BridgeHubPolkadotMessagesToBridgeHubKusamaMessageLane,
BridgeHubPolkadotMessagesToBridgeHubKusamaMessageLaneReceiveMessagesDeliveryProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::runtime::BridgeKusamaMessagesCall::receive_messages_delivery_proof
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::BridgeKusamaMessagesCall::receive_messages_delivery_proof
);

/// BridgeHubPolkadot-to-BridgeHubKusama messages lane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub struct KusamaFinalityToBridgeHubPolkadot;
substrate_relay_helper::generate_submit_finality_proof_call_builder!(
KusamaFinalityToBridgeHubPolkadot,
SubmitFinalityProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgeKusamaGrandpa,
relay_bridge_hub_polkadot_client::runtime::BridgeKusamaGrandpaCall::submit_finality_proof
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaGrandpa,
relay_bridge_hub_polkadot_client::BridgeKusamaGrandpaCall::submit_finality_proof
);

substrate_relay_helper::generate_report_equivocation_call_builder!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl SubmitParachainHeadsCallBuilder<BridgeHubKusamaToBridgeHubPolkadot>
parachains: Vec<(ParaId, ParaHash)>,
parachain_heads_proof: ParaHeadsProof,
) -> CallOf<relay_bridge_hub_polkadot_client::BridgeHubPolkadot> {
relay_bridge_hub_polkadot_client::runtime::Call::BridgeKusamaParachain(
relay_bridge_hub_polkadot_client::runtime::BridgeParachainCall::submit_parachain_heads {
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaParachains(
relay_bridge_hub_polkadot_client::BridgeParachainCall::submit_parachain_heads {
at_relay_block: (at_relay_block.0, at_relay_block.1),
parachains,
parachain_heads_proof,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub struct PolkadotFinalityToBridgeHubKusama;
substrate_relay_helper::generate_submit_finality_proof_call_builder!(
PolkadotFinalityToBridgeHubKusama,
SubmitFinalityProofCallBuilder,
relay_bridge_hub_kusama_client::runtime::Call::BridgePolkadotGrandpa,
relay_bridge_hub_kusama_client::runtime::BridgePolkadotGrandpaCall::submit_finality_proof
relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotGrandpa,
relay_bridge_hub_kusama_client::BridgeGrandpaCall::submit_finality_proof
);

substrate_relay_helper::generate_report_equivocation_call_builder!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl SubmitParachainHeadsCallBuilder<BridgeHubPolkadotToBridgeHubKusama>
parachains: Vec<(ParaId, ParaHash)>,
parachain_heads_proof: ParaHeadsProof,
) -> CallOf<relay_bridge_hub_kusama_client::BridgeHubKusama> {
relay_bridge_hub_kusama_client::runtime::Call::BridgePolkadotParachain(
bp_parachains::BridgeParachainCall::submit_parachain_heads {
relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotParachains(
relay_bridge_hub_kusama_client::BridgeParachainCall::submit_parachain_heads {
at_relay_block: (at_relay_block.0, at_relay_block.1),
parachains,
parachain_heads_proof,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ substrate_relay_helper::generate_receive_message_proof_call_builder!(
substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
BridgeHubPolkadotMessagesToPolkadotBulletinMessageLane,
BridgeHubPolkadotMessagesToPolkadotBulletinMessageLaneReceiveMessagesDeliveryProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgePolkadotBulletinMessages,
relay_bridge_hub_polkadot_client::runtime::BridgePolkadotBulletinMessagesCall::receive_messages_delivery_proof
// TODO: https://github.com/paritytech/parity-bridges-common/issues/2547 - use BridgePolkadotBulletinMessages
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::BridgePolkadotBulletinMessagesCall::receive_messages_delivery_proof
);

/// BridgeHubPolkadot-to-PolkadotBulletin messages lane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ pub struct PolkadotBulletinFinalityToBridgeHubPolkadot;
substrate_relay_helper::generate_submit_finality_proof_call_builder!(
PolkadotBulletinFinalityToBridgeHubPolkadot,
SubmitFinalityProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgePolkadotBulletinGrandpa,
relay_bridge_hub_polkadot_client::runtime::BridgePolkadotBulletinGrandpaCall::submit_finality_proof
// TODO: https://github.com/paritytech/parity-bridges-common/issues/2547 - use BridgePolkadotBulletinGrandpa
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaGrandpa,
relay_bridge_hub_polkadot_client::BridgePolkadotBulletinGrandpaCall::submit_finality_proof
);

substrate_relay_helper::generate_report_equivocation_call_builder!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ impl MessagesCliBridge for PolkadotBulletinToBridgeHubPolkadotMessagesCliBridge
substrate_relay_helper::generate_receive_message_proof_call_builder!(
PolkadotBulletinMessagesToBridgeHubPolkadotMessageLane,
PolkadotBulletinMessagesToBridgeHubPolkadotMessageLaneReceiveMessagesProofCallBuilder,
relay_bridge_hub_polkadot_client::runtime::Call::BridgePolkadotBulletinMessages,
relay_bridge_hub_polkadot_client::runtime::BridgePolkadotBulletinMessagesCall::receive_messages_proof
// TODO: https://github.com/paritytech/parity-bridges-common/issues/2547 - use BridgePolkadotBulletinMessages
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaMessages,
relay_bridge_hub_polkadot_client::BridgePolkadotBulletinMessagesCall::receive_messages_proof
);

substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
Expand Down
5 changes: 3 additions & 2 deletions relays/bin-substrate/src/chains/kusama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ use relay_kusama_client::Kusama;
use relay_substrate_client::SimpleRuntimeVersion;

impl CliChain for Kusama {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_001_002, transaction_version: 25 });
}

impl CliChain for BridgeHubKusama {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 9410, transaction_version: 21 });
Some(SimpleRuntimeVersion { spec_version: 1_001_000, transaction_version: 4 });
}
5 changes: 3 additions & 2 deletions relays/bin-substrate/src/chains/polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ use relay_polkadot_client::Polkadot;
use relay_substrate_client::SimpleRuntimeVersion;

impl CliChain for Polkadot {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_001_002, transaction_version: 25 });
}

impl CliChain for BridgeHubPolkadot {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 9410, transaction_version: 22 });
Some(SimpleRuntimeVersion { spec_version: 1_001_000, transaction_version: 3 });
}
5 changes: 3 additions & 2 deletions relays/bin-substrate/src/chains/rococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ use relay_rococo_client::Rococo;
use relay_substrate_client::SimpleRuntimeVersion;

impl CliChain for Rococo {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_008_000, transaction_version: 24 });
}

impl CliChain for BridgeHubRococo {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_003_000, transaction_version: 3 });
Some(SimpleRuntimeVersion { spec_version: 1_008_000, transaction_version: 4 });
}
5 changes: 3 additions & 2 deletions relays/bin-substrate/src/chains/westend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ use relay_substrate_client::SimpleRuntimeVersion;
use relay_westend_client::Westend;

impl CliChain for Westend {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_008_000, transaction_version: 24 });
}

impl CliChain for BridgeHubWestend {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 1_003_000, transaction_version: 3 });
Some(SimpleRuntimeVersion { spec_version: 1_008_000, transaction_version: 4 });
}
4 changes: 3 additions & 1 deletion relays/bin-substrate/src/cli/chain_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ macro_rules! declare_chain_runtime_version_params_cli_schema {
},
RuntimeVersionType::Bundle => match bundle_runtime_version {
Some(runtime_version) => ChainRuntimeVersion::Custom(runtime_version),
None => ChainRuntimeVersion::Auto
None => {
return Err(anyhow::format_err!("Cannot use bundled runtime version of {}: it is not known to the relay", stringify!($chain_prefix)));
}
},
})
}
Expand Down
17 changes: 7 additions & 10 deletions relays/bin-substrate/src/cli/init_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ impl BridgeInitializer for KusamaToBridgeHubPolkadotCliBridge {
fn encode_init_bridge(
init_data: <Self::Engine as Engine<Self::Source>>::InitializationData,
) -> <Self::Target as Chain>::Call {
relay_bridge_hub_polkadot_client::runtime::Call::BridgeKusamaGrandpa(
relay_bridge_hub_polkadot_client::runtime::BridgeKusamaGrandpaCall::initialize {
init_data,
},
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaGrandpa(
relay_bridge_hub_polkadot_client::BridgeKusamaGrandpaCall::initialize { init_data },
)
}
}
Expand All @@ -160,10 +158,8 @@ impl BridgeInitializer for PolkadotToBridgeHubKusamaCliBridge {
fn encode_init_bridge(
init_data: <Self::Engine as Engine<Self::Source>>::InitializationData,
) -> <Self::Target as Chain>::Call {
relay_bridge_hub_kusama_client::runtime::Call::BridgePolkadotGrandpa(
relay_bridge_hub_kusama_client::runtime::BridgePolkadotGrandpaCall::initialize {
init_data,
},
relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotGrandpa(
relay_bridge_hub_kusama_client::BridgeGrandpaCall::initialize { init_data },
)
}
}
Expand Down Expand Up @@ -191,8 +187,9 @@ impl BridgeInitializer for PolkadotBulletinToBridgeHubPolkadotCliBridge {
fn encode_init_bridge(
init_data: <Self::Engine as Engine<Self::Source>>::InitializationData,
) -> <Self::Target as Chain>::Call {
relay_bridge_hub_polkadot_client::runtime::Call::BridgePolkadotBulletinGrandpa(
relay_bridge_hub_polkadot_client::runtime::BridgePolkadotBulletinGrandpaCall::initialize {
// TODO: https://github.com/paritytech/parity-bridges-common/issues/2547 - use BridgePolkadotBulletinGrandpa
relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaGrandpa(
relay_bridge_hub_polkadot_client::BridgePolkadotBulletinGrandpaCall::initialize {
init_data,
},
)
Expand Down
9 changes: 6 additions & 3 deletions relays/client-bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ workspace = true
[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive"] }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
relay-substrate-client = { path = "../client-substrate" }
#relay-substrate-client = { path = "../client-substrate" }
subxt = { version = "0.32.1", default-features = false, features = ["native"] }

# Bridge dependencies

bp-bridge-hub-kusama = { path = "../../primitives/chain-bridge-hub-kusama" }
bp-bridge-hub-polkadot = { path = "../../primitives/chain-bridge-hub-polkadot" }
bp-header-chain = { path = "../../primitives/header-chain" }
bp-messages = { path = "../../primitives/messages" }
bp-parachains = { path = "../../primitives/parachains" }
bp-polkadot = { path = "../../primitives/chain-polkadot" }

bp-polkadot-core = { path = "../../primitives/polkadot-core" }
bridge-runtime-common = { path = "../../bin/runtime-common" }
relay-substrate-client = { path = "../client-substrate" }

# Substrate Dependencies

sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
Loading

0 comments on commit af8480e

Please sign in to comment.