Trait bp_beefy::ChainWithBeefy
source · pub trait ChainWithBeefy: Chain {
type CommitmentHasher: Hash;
type MmrHashing: Hash<Output = Self::MmrHash>;
type MmrHash: Hash + Parameter + Copy + AsRef<[u8]> + Default + MaybeSerializeDeserialize + PartialOrd;
type BeefyMmrLeafExtra: Parameter;
type AuthorityId: BeefyAuthorityId<Self::CommitmentHasher> + Parameter;
type AuthorityIdToMerkleLeaf: Convert<Self::AuthorityId, Vec<u8>>;
}
Expand description
Substrate-based chain with BEEFY && MMR pallets deployed.
Both BEEFY and MMR pallets and their clients may be configured to use different primitives. Some of types can be configured in low-level pallets, but are constrained when BEEFY+MMR bundle is used.
Required Associated Types§
sourcetype CommitmentHasher: Hash
type CommitmentHasher: Hash
The hashing algorithm used to compute the digest of the BEEFY commitment.
Corresponds to the hashing algorithm, used by sc_consensus_beefy::BeefyKeystore
.
sourcetype MmrHashing: Hash<Output = Self::MmrHash>
type MmrHashing: Hash<Output = Self::MmrHash>
The hashing algorithm used to build the MMR.
The same algorithm is also used to compute merkle roots in BEEFY (e.g. validator addresses root in leaf data).
Corresponds to the Hashing
field of the pallet-mmr
configuration.
sourcetype MmrHash: Hash + Parameter + Copy + AsRef<[u8]> + Default + MaybeSerializeDeserialize + PartialOrd
type MmrHash: Hash + Parameter + Copy + AsRef<[u8]> + Default + MaybeSerializeDeserialize + PartialOrd
The output type of the hashing algorithm used to build the MMR.
This type is actually stored in the MMR.
Corresponds to the Hash
field of the pallet-mmr
configuration.
sourcetype BeefyMmrLeafExtra: Parameter
type BeefyMmrLeafExtra: Parameter
The type expected for the MMR leaf extra data.
sourcetype AuthorityId: BeefyAuthorityId<Self::CommitmentHasher> + Parameter
type AuthorityId: BeefyAuthorityId<Self::CommitmentHasher> + Parameter
A way to identify a BEEFY validator.
Corresponds to the BeefyId
field of the pallet-beefy
configuration.
sourcetype AuthorityIdToMerkleLeaf: Convert<Self::AuthorityId, Vec<u8>>
type AuthorityIdToMerkleLeaf: Convert<Self::AuthorityId, Vec<u8>>
A way to convert validator id to its raw representation in the BEEFY merkle tree.
Corresponds to the BeefyAuthorityToMerkleLeaf
field of the pallet-beefy-mmr
configuration.