Trait bp_header_chain::ChainWithGrandpa
source · pub trait ChainWithGrandpa: Chain {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str;
const MAX_AUTHORITIES_COUNT: u32;
const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32;
const MAX_MANDATORY_HEADER_SIZE: u32;
const AVERAGE_HEADER_SIZE: u32;
}
Expand description
Substrate-based chain that is using direct GRANDPA finality.
Keep in mind that parachains are relying on relay chain GRANDPA, so they should not implement this trait.
Required Associated Constants§
sourceconst WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str
Name of the bridge GRANDPA pallet (used in construct_runtime
macro call) that is deployed
at some other chain to bridge with this ChainWithGrandpa
.
We assume that all chains that are bridging with this ChainWithGrandpa
are using
the same name.
sourceconst MAX_AUTHORITIES_COUNT: u32
const MAX_AUTHORITIES_COUNT: u32
Max number of GRANDPA authorities at the chain.
This is a strict constant. If bridged chain will have more authorities than that, the GRANDPA bridge pallet may halt.
sourceconst REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32
const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32
Max reasonable number of headers in votes_ancestries
vector of the GRANDPA justification.
This isn’t a strict limit. The relay may submit justifications with more headers in its ancestry and the pallet will accept such justification. The limit is only used to compute maximal refund amount and submitting justifications which exceed the limit, may be costly to submitter.
sourceconst MAX_MANDATORY_HEADER_SIZE: u32
const MAX_MANDATORY_HEADER_SIZE: u32
Maximal size of the mandatory chain header. Mandatory header is the header that enacts new GRANDPA authorities set (so it has large digest inside).
This isn’t a strict limit. The relay may submit larger headers and the pallet will accept the call. The limit is only used to compute maximal refund amount and doing calls which exceed the limit, may be costly to submitter.
sourceconst AVERAGE_HEADER_SIZE: u32
const AVERAGE_HEADER_SIZE: u32
Average size of the chain header. We don’t expect to see there headers that change GRANDPA authorities set (GRANDPA will probably be able to finalize at least one additional header per session on non test chains), so this is average size of headers that aren’t changing the set.
This isn’t a strict limit. The relay may submit justifications with larger headers and the
pallet will accept the call. However, if the total size of all submit_finality_proof
arguments exceeds the maximal size, computed using this average size, relayer will only get
partial refund.
We expect some headers on production chains that are above this size. But they are rare and if rellayer cares about its profitability, we expect it’ll select other headers for submission.