mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 02:21:14 +00:00
Companion for: pallet-mmr: move offchain logic to client-side gadget (#6321)
* Spawn MMR gadget when offchain indexing is enabled
* companion PR code review changes: 1st iteration
* Code review changes: 2nd iteration
* update lockfile for {"substrate"}
Co-authored-by: acatangiu <adrian@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -95,6 +95,7 @@ pub use polkadot_client::PolkadotExecutorDispatch;
|
||||
|
||||
pub use chain_spec::{KusamaChainSpec, PolkadotChainSpec, RococoChainSpec, WestendChainSpec};
|
||||
pub use consensus_common::{block_validation::Chain, Proposal, SelectChain};
|
||||
use mmr_gadget::MmrGadget;
|
||||
#[cfg(feature = "full-node")]
|
||||
pub use polkadot_client::{
|
||||
AbstractClient, Client, ClientHandle, ExecuteWithClient, FullBackend, FullClient,
|
||||
@@ -758,6 +759,7 @@ where
|
||||
{
|
||||
use polkadot_node_network_protocol::request_response::IncomingRequest;
|
||||
|
||||
let is_offchain_indexing_enabled = config.offchain_worker.indexing_enabled;
|
||||
let role = config.role.clone();
|
||||
let force_authoring = config.force_authoring;
|
||||
let backoff_authoring_blocks = {
|
||||
@@ -1219,6 +1221,18 @@ where
|
||||
} else {
|
||||
task_manager.spawn_handle().spawn_blocking("beefy-gadget", None, gadget);
|
||||
}
|
||||
|
||||
if is_offchain_indexing_enabled {
|
||||
task_manager.spawn_handle().spawn_blocking(
|
||||
"mmr-gadget",
|
||||
None,
|
||||
MmrGadget::start(
|
||||
client.clone(),
|
||||
backend.clone(),
|
||||
sp_mmr_primitives::INDEXING_PREFIX.to_vec(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let config = grandpa::Config {
|
||||
|
||||
Reference in New Issue
Block a user