mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
Merkle Mountain Range & BEEFY integration (#2101)
* Switch branch. * Implement basic MMR leaf. * Revert "Switch branch." This reverts commit 7f4d41c67f27ca560c53fc63fd3bd06ac182403c. * Bump substrate. * Integrate BEEFY. Bump all. Fix missing imports. * Use beefy pallet to get authorities. * Bump BEEFY repo. * Use next authority set instead of the current one. * Start BEEFY service. * Fix BEEFY start up. * Cache BEEFY authority set. * Add BEEFY ValidatorSetId to MMR * Fix code. * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Review grumbles. * Update beefy repo. * Work-around missing protocol. * Revert "Work-around missing protocol." This reverts commit 0a6257a8bccc1c67e966898cdedc408c6469ffd6. * Add beefy peers set config. * Expose storage of BEEFY. * Uncompress BEEFY keys for merkle tree. * Update ordering. * Switch to branch. * Bump deps. * Switch to custom beefy. * Add MMR RuntimeApi and custom rpc. * Add set length details. * Fix compilation. * Expose MmrLeaf storage. * Expose MmrLeaf storage. * Don't use session handler, and rather compute & cache beefy details on call. * Don't use session handler, and rather compute & cache beefy details on call. * Fixes. * Update Cargo.lock. * Switch back to master. * Update lockfile. * Fix xcm print issue. * Cargo.lock. * Use master branch. * Remove extra dep. * Fix tests. * Update Cargo.lock * Add BEEFY & MMR to westend. * Implement session keys migration. * Update testnet script. * start BEEFY for all node types * Update Cargo.lock * fix Cargo.toml * resolve another merge conflict * add Westend BEEFY keys * Apply suggestions from code review Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Update BEEFY. * Add Rococo BEEFY keys * resolve merge issue * fix pallet indices * fix Westend OldSessionKey * remove unused imports in Westend runtime * Fix compilation for Westend. * address review * start BEEFY gadget conditionally * address review again * fix typo * remove duplicate * remove another duplicate * well * add missing stuff * cleanup Cargo.toml files - revert unnecessary changes - add missing /std dependencies - remove unused dependencies * runtime: remove unused structs from rococo runtime * node: cleanup service Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> Co-authored-by: adoerr <0xad@gmx.net> Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -66,6 +66,8 @@ use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
|
||||
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
|
||||
use pallet_session::historical as session_historical;
|
||||
use static_assertions::const_assert;
|
||||
use beefy_primitives::ecdsa::AuthorityId as BeefyId;
|
||||
use pallet_mmr_primitives as mmr;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use pallet_staking::StakerStatus;
|
||||
@@ -1217,6 +1219,38 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
|
||||
fn validator_set() -> beefy_primitives::ValidatorSet<BeefyId> {
|
||||
// dummy implementation due to lack of BEEFY pallet.
|
||||
beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
impl mmr::MmrApi<Block, Hash> for Runtime {
|
||||
fn generate_proof(_leaf_index: u64)
|
||||
-> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof<Hash>), mmr::Error>
|
||||
{
|
||||
// dummy implementation due to lack of MMR pallet.
|
||||
Err(mmr::Error::GenerateProof)
|
||||
}
|
||||
|
||||
fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof<Hash>)
|
||||
-> Result<(), mmr::Error>
|
||||
{
|
||||
// dummy implementation due to lack of MMR pallet.
|
||||
Err(mmr::Error::Verify)
|
||||
}
|
||||
|
||||
fn verify_proof_stateless(
|
||||
_root: Hash,
|
||||
_leaf: mmr::EncodableOpaqueLeaf,
|
||||
_proof: mmr::Proof<Hash>
|
||||
) -> Result<(), mmr::Error> {
|
||||
// dummy implementation due to lack of MMR pallet.
|
||||
Err(mmr::Error::Verify)
|
||||
}
|
||||
}
|
||||
|
||||
impl fg_primitives::GrandpaApi<Block> for Runtime {
|
||||
fn grandpa_authorities() -> Vec<(GrandpaId, u64)> {
|
||||
Grandpa::grandpa_authorities()
|
||||
|
||||
Reference in New Issue
Block a user