Skip to content

Commit

Permalink
[Do Not Merge until RBH/WBH upgrade] Relayers use new submit_finality…
Browse files Browse the repository at this point in the history
…_proof_ex call in Rococo <> Westend bridge (paritytech#2827)

* use codegen runtime in WBH + update codegen files for RBH + WBH

* use submit_finality_proof_ex for Rococo <> Westend bridge
  • Loading branch information
svyatonik authored Mar 1, 2024
1 parent f1c1487 commit ccf18d6
Show file tree
Hide file tree
Showing 13 changed files with 6,561 additions and 466 deletions.
2 changes: 1 addition & 1 deletion 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 @@ -35,8 +35,8 @@ impl MessagesCliBridge for BridgeHubRococoToBridgeHubWestendMessagesCliBridge {
substrate_relay_helper::generate_receive_message_proof_call_builder!(
BridgeHubRococoMessagesToBridgeHubWestendMessageLane,
BridgeHubRococoMessagesToBridgeHubWestendMessageLaneReceiveMessagesProofCallBuilder,
relay_bridge_hub_westend_client::runtime::Call::BridgeRococoMessages,
relay_bridge_hub_westend_client::runtime::BridgeRococoMessagesCall::receive_messages_proof
relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoMessages,
relay_bridge_hub_westend_client::BridgeMessagesCall::receive_messages_proof
);

substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ substrate_relay_helper::generate_receive_message_proof_call_builder!(
substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!(
BridgeHubWestendMessagesToBridgeHubRococoMessageLane,
BridgeHubWestendMessagesToBridgeHubRococoMessageLaneReceiveMessagesDeliveryProofCallBuilder,
relay_bridge_hub_westend_client::runtime::Call::BridgeRococoMessages,
relay_bridge_hub_westend_client::runtime::BridgeRococoMessagesCall::receive_messages_delivery_proof
relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoMessages,
relay_bridge_hub_westend_client::BridgeMessagesCall::receive_messages_delivery_proof
);

/// Description of BridgeHubWestend -> BridgeHubRococo messages bridge.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ use substrate_relay_helper::{
#[derive(Clone, Debug)]
pub struct RococoFinalityToBridgeHubWestend;

substrate_relay_helper::generate_submit_finality_proof_call_builder!(
substrate_relay_helper::generate_submit_finality_proof_ex_call_builder!(
RococoFinalityToBridgeHubWestend,
SubmitFinalityProofCallBuilder,
relay_bridge_hub_westend_client::runtime::Call::BridgeRococoGrandpa,
relay_bridge_hub_westend_client::runtime::BridgeRococoGrandpaCall::submit_finality_proof
relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoGrandpa,
relay_bridge_hub_westend_client::BridgeGrandpaCall::submit_finality_proof_ex
);

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<BridgeHubRococoToBridgeHubWestend>
parachains: Vec<(ParaId, ParaHash)>,
parachain_heads_proof: ParaHeadsProof,
) -> CallOf<relay_bridge_hub_westend_client::BridgeHubWestend> {
relay_bridge_hub_westend_client::runtime::Call::BridgeRococoParachains(
relay_bridge_hub_westend_client::runtime::BridgeParachainCall::submit_parachain_heads {
relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoParachains(
relay_bridge_hub_westend_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 @@ -31,11 +31,11 @@ use substrate_relay_helper::{
#[derive(Clone, Debug)]
pub struct WestendFinalityToBridgeHubRococo;

substrate_relay_helper::generate_submit_finality_proof_call_builder!(
substrate_relay_helper::generate_submit_finality_proof_ex_call_builder!(
WestendFinalityToBridgeHubRococo,
SubmitFinalityProofCallBuilder,
relay_bridge_hub_rococo_client::RuntimeCall::BridgeWestendGrandpa,
relay_bridge_hub_rococo_client::BridgeGrandpaCall::submit_finality_proof
relay_bridge_hub_rococo_client::BridgeGrandpaCall::submit_finality_proof_ex
);

substrate_relay_helper::generate_report_equivocation_call_builder!(
Expand Down
6 changes: 2 additions & 4 deletions relays/bin-substrate/src/cli/init_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@ impl BridgeInitializer for RococoToBridgeHubWestendCliBridge {
fn encode_init_bridge(
init_data: <Self::Engine as Engine<Self::Source>>::InitializationData,
) -> <Self::Target as Chain>::Call {
relay_bridge_hub_westend_client::runtime::Call::BridgeRococoGrandpa(
relay_bridge_hub_westend_client::runtime::BridgeRococoGrandpaCall::initialize {
init_data,
},
relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoGrandpa(
relay_bridge_hub_westend_client::BridgeGrandpaCall::initialize { init_data },
)
}
}
Expand Down
Loading

0 comments on commit ccf18d6

Please sign in to comment.