From cfac5bb4dfc3ed0cb7786622cd73ac6f8ed815d2 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Tue, 8 Aug 2023 15:27:07 +0300 Subject: [PATCH] Grandpa: Store the authority set changes (#2336) (#2337) * Grandpa: Store the authority set changes --- bridges/bin/millau/runtime/src/lib.rs | 12 +-- .../bin/rialto-parachain/runtime/src/lib.rs | 6 +- bridges/bin/rialto/runtime/src/lib.rs | 6 +- bridges/modules/grandpa/src/lib.rs | 75 ++++++++++++++----- bridges/modules/grandpa/src/storage_types.rs | 4 +- bridges/modules/parachains/src/lib.rs | 22 ++++-- bridges/primitives/chain-millau/Cargo.toml | 5 +- bridges/primitives/header-chain/src/lib.rs | 9 +++ bridges/primitives/runtime/src/chain.rs | 8 +- bridges/relays/client-kusama/src/lib.rs | 6 +- bridges/relays/client-millau/src/lib.rs | 6 +- bridges/relays/client-polkadot/src/lib.rs | 8 +- bridges/relays/client-rialto/src/lib.rs | 6 +- bridges/relays/client-rococo/src/lib.rs | 6 +- bridges/relays/client-substrate/src/chain.rs | 6 +- bridges/relays/client-westend/src/lib.rs | 6 +- bridges/relays/client-wococo/src/lib.rs | 6 +- 17 files changed, 128 insertions(+), 69 deletions(-) diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index f0e23cc8d77f6..75f82c5343981 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -883,9 +883,9 @@ impl_runtime_apis! { BridgeRialtoGrandpa::best_finalized() } - fn accepted_grandpa_finality_proofs( - ) -> Vec> { - BridgeRialtoGrandpa::accepted_finality_proofs() + fn synced_headers_grandpa_info( + ) -> Vec> { + BridgeRialtoGrandpa::synced_headers_grandpa_info() } } @@ -894,9 +894,9 @@ impl_runtime_apis! { BridgeWestendGrandpa::best_finalized() } - fn accepted_grandpa_finality_proofs( - ) -> Vec> { - BridgeWestendGrandpa::accepted_finality_proofs() + fn synced_headers_grandpa_info( + ) -> Vec> { + BridgeWestendGrandpa::synced_headers_grandpa_info() } } diff --git a/bridges/bin/rialto-parachain/runtime/src/lib.rs b/bridges/bin/rialto-parachain/runtime/src/lib.rs index db3113ce4489c..eb15806b4e39e 100644 --- a/bridges/bin/rialto-parachain/runtime/src/lib.rs +++ b/bridges/bin/rialto-parachain/runtime/src/lib.rs @@ -747,9 +747,9 @@ impl_runtime_apis! { BridgeMillauGrandpa::best_finalized() } - fn accepted_grandpa_finality_proofs( - ) -> Vec> { - BridgeMillauGrandpa::accepted_finality_proofs() + fn synced_headers_grandpa_info( + ) -> Vec> { + BridgeMillauGrandpa::synced_headers_grandpa_info() } } diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index b4e64072afc0e..8af330b328b6a 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -695,9 +695,9 @@ impl_runtime_apis! { BridgeMillauGrandpa::best_finalized() } - fn accepted_grandpa_finality_proofs( - ) -> Vec> { - BridgeMillauGrandpa::accepted_finality_proofs() + fn synced_headers_grandpa_info( + ) -> Vec> { + BridgeMillauGrandpa::synced_headers_grandpa_info() } } diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index fd9361948b653..259a6c0f36b79 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -39,8 +39,8 @@ pub use storage_types::StoredAuthoritySet; use bp_header_chain::{ - justification::GrandpaJustification, ChainWithGrandpa, GrandpaConsensusLogReader, HeaderChain, - InitializationData, StoredHeaderData, StoredHeaderDataBuilder, + justification::GrandpaJustification, AuthoritySet, ChainWithGrandpa, GrandpaConsensusLogReader, + HeaderChain, HeaderGrandpaInfo, InitializationData, StoredHeaderData, StoredHeaderDataBuilder, }; use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule}; use finality_grandpa::voter_set::VoterSet; @@ -194,11 +194,12 @@ pub mod pallet { let authority_set = >::get(); let unused_proof_size = authority_set.unused_proof_size(); let set_id = authority_set.set_id; - verify_justification::(&justification, hash, number, authority_set.into())?; + let authority_set: AuthoritySet = authority_set.into(); + verify_justification::(&justification, hash, number, authority_set)?; - let is_authorities_change_enacted = + let maybe_new_authority_set = try_enact_authority_change::(&finality_target, set_id)?; - let may_refund_call_fee = is_authorities_change_enacted && + let may_refund_call_fee = maybe_new_authority_set.is_some() && // if we have seen too many mandatory headers in this block, we don't want to refund Self::free_mandatory_headers_remaining() > 0 && // if arguments out of expected bounds, we don't want to refund @@ -237,7 +238,14 @@ pub mod pallet { let actual_weight = pre_dispatch_weight .set_proof_size(pre_dispatch_weight.proof_size().saturating_sub(unused_proof_size)); - Self::deposit_event(Event::UpdatedBestFinalizedHeader { number, hash, justification }); + Self::deposit_event(Event::UpdatedBestFinalizedHeader { + number, + hash, + grandpa_info: HeaderGrandpaInfo { + justification, + authority_set: maybe_new_authority_set, + }, + }); Ok(PostDispatchInfo { actual_weight: Some(actual_weight), pays_fee }) } @@ -402,8 +410,8 @@ pub mod pallet { UpdatedBestFinalizedHeader { number: BridgedBlockNumber, hash: BridgedBlockHash, - /// Justification. - justification: GrandpaJustification>, + /// The Grandpa info associated to the new best finalized header. + grandpa_info: HeaderGrandpaInfo>, }, } @@ -439,9 +447,7 @@ pub mod pallet { pub(crate) fn try_enact_authority_change, I: 'static>( header: &BridgedHeader, current_set_id: sp_consensus_grandpa::SetId, - ) -> Result { - let mut change_enacted = false; - + ) -> Result, DispatchError> { // We don't support forced changes - at that point governance intervention is required. ensure!( GrandpaConsensusLogReader::>::find_forced_change( @@ -470,7 +476,6 @@ pub mod pallet { // Since our header schedules a change and we know the delay is 0, it must also enact // the change. >::put(&next_authorities); - change_enacted = true; log::info!( target: LOG_TARGET, @@ -479,9 +484,11 @@ pub mod pallet { current_set_id + 1, next_authorities, ); + + return Ok(Some(next_authorities.into())) }; - Ok(change_enacted) + Ok(None) } /// Verify a GRANDPA justification (finality proof) for a given header. @@ -610,13 +617,13 @@ where ::RuntimeEvent: TryInto>, { /// Get the GRANDPA justifications accepted in the current block. - pub fn accepted_finality_proofs() -> Vec>> { + pub fn synced_headers_grandpa_info() -> Vec>> { frame_system::Pallet::::read_events_no_consensus() .filter_map(|event| { - if let Event::::UpdatedBestFinalizedHeader { justification, .. } = + if let Event::::UpdatedBestFinalizedHeader { grandpa_info, .. } = event.event.try_into().ok()? { - return Some(justification) + return Some(grandpa_info) } None }) @@ -927,12 +934,18 @@ mod tests { event: TestEvent::Grandpa(Event::UpdatedBestFinalizedHeader { number: *header.number(), hash: header.hash(), - justification: justification.clone(), + grandpa_info: HeaderGrandpaInfo { + justification: justification.clone(), + authority_set: None, + }, }), topics: vec![], }], ); - assert_eq!(Pallet::::accepted_finality_proofs(), vec![justification]); + assert_eq!( + Pallet::::synced_headers_grandpa_info(), + vec![HeaderGrandpaInfo { justification, authority_set: None }] + ); }) } @@ -1038,7 +1051,7 @@ mod tests { let result = Pallet::::submit_finality_proof( RuntimeOrigin::signed(1), Box::new(header.clone()), - justification, + justification.clone(), ); assert_ok!(result); assert_eq!(result.unwrap().pays_fee, frame_support::dispatch::Pays::No); @@ -1053,6 +1066,30 @@ mod tests { StoredAuthoritySet::::try_new(next_authorities, next_set_id) .unwrap(), ); + + // Here + assert_eq!( + System::events(), + vec![EventRecord { + phase: Phase::Initialization, + event: TestEvent::Grandpa(Event::UpdatedBestFinalizedHeader { + number: *header.number(), + hash: header.hash(), + grandpa_info: HeaderGrandpaInfo { + justification: justification.clone(), + authority_set: Some(>::get().into()), + }, + }), + topics: vec![], + }], + ); + assert_eq!( + Pallet::::synced_headers_grandpa_info(), + vec![HeaderGrandpaInfo { + justification, + authority_set: Some(>::get().into()), + }] + ); }) } diff --git a/bridges/modules/grandpa/src/storage_types.rs b/bridges/modules/grandpa/src/storage_types.rs index 704482863350b..59fcb5d3f077f 100644 --- a/bridges/modules/grandpa/src/storage_types.rs +++ b/bridges/modules/grandpa/src/storage_types.rs @@ -20,7 +20,7 @@ use crate::{Config, Error}; use bp_header_chain::{AuthoritySet, ChainWithGrandpa}; use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{traits::Get, BoundedVec, RuntimeDebugNoBound}; +use frame_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound}; use scale_info::TypeInfo; use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId}; use sp_std::marker::PhantomData; @@ -39,7 +39,7 @@ impl, I: 'static> Get for StoredAuthorityListLimit { } /// A bounded GRANDPA Authority List and ID. -#[derive(Clone, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, RuntimeDebugNoBound)] +#[derive(CloneNoBound, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, RuntimeDebugNoBound)] #[scale_info(skip_type_params(T, I))] pub struct StoredAuthoritySet, I: 'static> { /// List of GRANDPA authorities for the current round. diff --git a/bridges/modules/parachains/src/lib.rs b/bridges/modules/parachains/src/lib.rs index 3380b63aa5cfb..24bc3535e619e 100644 --- a/bridges/modules/parachains/src/lib.rs +++ b/bridges/modules/parachains/src/lib.rs @@ -697,7 +697,7 @@ pub(crate) mod tests { use bp_test_utils::prepare_parachain_heads_proof; use codec::Encode; - use bp_header_chain::justification::GrandpaJustification; + use bp_header_chain::{justification::GrandpaJustification, HeaderGrandpaInfo}; use bp_parachains::{ BestParaHeadHash, BridgeParachainCall, ImportedParaHeadsKeyProvider, ParasInfoKeyProvider, }; @@ -1036,7 +1036,10 @@ pub(crate) mod tests { pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader { number: 1, hash: relay_1_hash, - justification + grandpa_info: HeaderGrandpaInfo { + justification, + authority_set: None, + }, } ), topics: vec![], @@ -1174,7 +1177,10 @@ pub(crate) mod tests { pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader { number: 1, hash: relay_1_hash, - justification + grandpa_info: HeaderGrandpaInfo { + justification, + authority_set: None, + } } ), topics: vec![], @@ -1224,7 +1230,10 @@ pub(crate) mod tests { pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader { number: 1, hash: relay_1_hash, - justification: justification.clone() + grandpa_info: HeaderGrandpaInfo { + justification: justification.clone(), + authority_set: None, + } } ), topics: vec![], @@ -1262,7 +1271,10 @@ pub(crate) mod tests { pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader { number: 1, hash: relay_1_hash, - justification + grandpa_info: HeaderGrandpaInfo { + justification, + authority_set: None, + } } ), topics: vec![], diff --git a/bridges/primitives/chain-millau/Cargo.toml b/bridges/primitives/chain-millau/Cargo.toml index d12e76a8d04e6..4d7f1580c2371 100644 --- a/bridges/primitives/chain-millau/Cargo.toml +++ b/bridges/primitives/chain-millau/Cargo.toml @@ -8,7 +8,10 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] -fixed-hash = { version = "0.8.0", default-features = false } +# TODO: Consume `fixed-hash` from crates.io when the following fix is published: +# https://github.com/paritytech/parity-common/commit/d3a9327124a66e52ca1114bb8640c02c18c134b8 +# Expected in a version > 0.8.0 +fixed-hash = { git = "https://github.com/paritytech/parity-common", branch = "master", default-features = false } hash256-std-hasher = { version = "0.15.2", default-features = false } impl-codec = { version = "0.6", default-features = false } impl-serde = { version = "0.4.0", default-features = false } diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index 1f5102203ca2f..720dafdd93b09 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -172,6 +172,15 @@ impl ConsensusLogReader for GrandpaConsensusLogReader { } } +/// The Grandpa-related info associated to a header. +#[derive(Encode, Decode, Debug, PartialEq, Clone, TypeInfo)] +pub struct HeaderGrandpaInfo { + /// The header justification + pub justification: justification::GrandpaJustification
, + /// The authority set introduced by the header. + pub authority_set: Option, +} + /// A minimized version of `pallet-bridge-grandpa::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] #[allow(non_camel_case_types)] diff --git a/bridges/primitives/runtime/src/chain.rs b/bridges/primitives/runtime/src/chain.rs index a5fb8a28809d8..a1b7e8d54b4f6 100644 --- a/bridges/primitives/runtime/src/chain.rs +++ b/bridges/primitives/runtime/src/chain.rs @@ -295,8 +295,8 @@ macro_rules! decl_bridge_finality_runtime_apis { $( /// Name of the `FinalityApi::accepted__finality_proofs` /// runtime method. - pub const [<$chain:upper _ACCEPTED_ $consensus:upper _FINALITY_PROOFS_METHOD>]: &str = - stringify!([<$chain:camel FinalityApi_accepted_ $consensus:lower _finality_proofs>]); + pub const [<$chain:upper _SYNCED_HEADERS_ $consensus:upper _INFO_METHOD>]: &str = + stringify!([<$chain:camel FinalityApi_synced_headers_ $consensus:lower _info>]); )? sp_api::decl_runtime_apis! { @@ -310,7 +310,7 @@ macro_rules! decl_bridge_finality_runtime_apis { $( /// Returns the justifications accepted in the current block. - fn []( + fn []( ) -> Vec<$justification_type>; )? } @@ -321,7 +321,7 @@ macro_rules! decl_bridge_finality_runtime_apis { } }; ($chain: ident, grandpa) => { - decl_bridge_finality_runtime_apis!($chain, grandpa => bp_header_chain::justification::GrandpaJustification
); + decl_bridge_finality_runtime_apis!($chain, grandpa => bp_header_chain::HeaderGrandpaInfo
); }; } diff --git a/bridges/relays/client-kusama/src/lib.rs b/bridges/relays/client-kusama/src/lib.rs index 0f4172248f382..477ea1b108f2d 100644 --- a/bridges/relays/client-kusama/src/lib.rs +++ b/bridges/relays/client-kusama/src/lib.rs @@ -16,7 +16,7 @@ //! Types used to connect to the Kusama chain. -use bp_kusama::{AccountInfoStorageMapKeyProvider, KUSAMA_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD}; +use bp_kusama::{AccountInfoStorageMapKeyProvider, KUSAMA_SYNCED_HEADERS_GRANDPA_INFO_METHOD}; use bp_runtime::ChainId; use relay_substrate_client::{ Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider, @@ -50,8 +50,8 @@ impl Chain for Kusama { } impl ChainWithGrandpa for Kusama { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - KUSAMA_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + KUSAMA_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl ChainWithBalances for Kusama { diff --git a/bridges/relays/client-millau/src/lib.rs b/bridges/relays/client-millau/src/lib.rs index 1e899c7fdac3d..90def2d3bd5b6 100644 --- a/bridges/relays/client-millau/src/lib.rs +++ b/bridges/relays/client-millau/src/lib.rs @@ -17,7 +17,7 @@ //! Types used to connect to the Millau-Substrate chain. use bp_messages::MessageNonce; -use bp_millau::MILLAU_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; +use bp_millau::MILLAU_SYNCED_HEADERS_GRANDPA_INFO_METHOD; use bp_runtime::ChainId; use codec::{Compact, Decode, Encode}; use relay_substrate_client::{ @@ -67,8 +67,8 @@ impl Chain for Millau { } impl ChainWithGrandpa for Millau { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - MILLAU_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + MILLAU_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl ChainWithBalances for Millau { diff --git a/bridges/relays/client-polkadot/src/lib.rs b/bridges/relays/client-polkadot/src/lib.rs index f65f06c7de4e1..a906944c8f498 100644 --- a/bridges/relays/client-polkadot/src/lib.rs +++ b/bridges/relays/client-polkadot/src/lib.rs @@ -16,9 +16,7 @@ //! Types used to connect to the Polkadot chain. -use bp_polkadot::{ - AccountInfoStorageMapKeyProvider, POLKADOT_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD, -}; +use bp_polkadot::{AccountInfoStorageMapKeyProvider, POLKADOT_SYNCED_HEADERS_GRANDPA_INFO_METHOD}; use bp_runtime::ChainId; use relay_substrate_client::{ Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider, @@ -52,8 +50,8 @@ impl Chain for Polkadot { } impl ChainWithGrandpa for Polkadot { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - POLKADOT_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + POLKADOT_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl ChainWithBalances for Polkadot { diff --git a/bridges/relays/client-rialto/src/lib.rs b/bridges/relays/client-rialto/src/lib.rs index 00c98876e477c..c12d27bc1d916 100644 --- a/bridges/relays/client-rialto/src/lib.rs +++ b/bridges/relays/client-rialto/src/lib.rs @@ -17,7 +17,7 @@ //! Types used to connect to the Rialto-Substrate chain. use bp_messages::MessageNonce; -use bp_rialto::RIALTO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; +use bp_rialto::RIALTO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; use bp_runtime::ChainId; use codec::{Compact, Decode, Encode}; use relay_substrate_client::{ @@ -52,8 +52,8 @@ impl Chain for Rialto { } impl ChainWithGrandpa for Rialto { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - RIALTO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + RIALTO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl RelayChain for Rialto { diff --git a/bridges/relays/client-rococo/src/lib.rs b/bridges/relays/client-rococo/src/lib.rs index 5254b877ea82a..c4221e0dd004b 100644 --- a/bridges/relays/client-rococo/src/lib.rs +++ b/bridges/relays/client-rococo/src/lib.rs @@ -16,7 +16,7 @@ //! Types used to connect to the Rococo-Substrate chain. -use bp_rococo::ROCOCO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; +use bp_rococo::ROCOCO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; use bp_runtime::ChainId; use relay_substrate_client::{ Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider, @@ -50,8 +50,8 @@ impl Chain for Rococo { } impl ChainWithGrandpa for Rococo { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - ROCOCO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + ROCOCO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl ChainWithBalances for Rococo { diff --git a/bridges/relays/client-substrate/src/chain.rs b/bridges/relays/client-substrate/src/chain.rs index 0d178da3db898..fe0ec3ebb0a36 100644 --- a/bridges/relays/client-substrate/src/chain.rs +++ b/bridges/relays/client-substrate/src/chain.rs @@ -79,12 +79,12 @@ pub trait RelayChain: Chain { /// Keep in mind that parachains are relying on relay chain GRANDPA, so they should not implement /// this trait. pub trait ChainWithGrandpa: Chain + UnderlyingChainWithGrandpaProvider { - /// Name of the runtime API method that is returning the GRANDPA justifications accepted - /// by the `submit_finality_proofs` extrinsic in the queried block. + /// Name of the runtime API method that is returning the GRANDPA info associated with the + /// headers accepted by the `submit_finality_proofs` extrinsic in the queried block. /// /// Keep in mind that this method is normally provided by the other chain, which is /// bridged with this chain. - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str; } /// Substrate-based parachain from minimal relay-client point of view. diff --git a/bridges/relays/client-westend/src/lib.rs b/bridges/relays/client-westend/src/lib.rs index 67f1f61c547b8..e76bf65b82d89 100644 --- a/bridges/relays/client-westend/src/lib.rs +++ b/bridges/relays/client-westend/src/lib.rs @@ -17,7 +17,7 @@ //! Types used to connect to the Westend chain. use bp_runtime::ChainId; -use bp_westend::WESTEND_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; +use bp_westend::WESTEND_SYNCED_HEADERS_GRANDPA_INFO_METHOD; use relay_substrate_client::{ Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider, }; @@ -50,8 +50,8 @@ impl Chain for Westend { } impl ChainWithGrandpa for Westend { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - WESTEND_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + WESTEND_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl RelayChain for Westend { diff --git a/bridges/relays/client-wococo/src/lib.rs b/bridges/relays/client-wococo/src/lib.rs index acb41be50e6d5..e4d23a27dcd39 100644 --- a/bridges/relays/client-wococo/src/lib.rs +++ b/bridges/relays/client-wococo/src/lib.rs @@ -17,7 +17,7 @@ //! Types used to connect to the Wococo-Substrate chain. use bp_runtime::ChainId; -use bp_wococo::WOCOCO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; +use bp_wococo::WOCOCO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; use relay_substrate_client::{ Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider, }; @@ -50,8 +50,8 @@ impl Chain for Wococo { } impl ChainWithGrandpa for Wococo { - const ACCEPTED_FINALITY_PROOFS_METHOD: &'static str = - WOCOCO_ACCEPTED_GRANDPA_FINALITY_PROOFS_METHOD; + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + WOCOCO_SYNCED_HEADERS_GRANDPA_INFO_METHOD; } impl ChainWithBalances for Wococo {