8 stable releases

new 15.0.0 Jan 10, 2025
1.15.3 Dec 10, 2024
1.15.1 Oct 15, 2024
1.15.0 Sep 19, 2024
1.6.3 May 13, 2024

#33 in Magic Beans

Download history 104/week @ 2024-09-14 57/week @ 2024-09-21 9/week @ 2024-09-28 147/week @ 2024-10-12 13/week @ 2024-10-19 278/week @ 2024-12-07 46/week @ 2024-12-14

324 downloads per month

Apache-2.0 and GPL-3.0-or-later…

220KB
2.5K SLoC

ISMP Parachain Inherent

This exports the inherent provider which includes ISMP parachain consensus updates as block inherents.

Usage

To use this, you'll need to include the inherent into your collator parameters like so:

fn start_consensus(
    client: Arc<FullClient>,
    backend: Arc<FullBackend>,
    block_import: ParachainBlockImport,
    prometheus_registry: Option<&Registry>,
    telemetry: Option<TelemetryHandle>,
    task_manager: &TaskManager,
    relay_chain_interface: Arc<dyn RelayChainInterface>,
    transaction_pool: Arc<sc_transaction_pool::FullPool<opaque::Block, FullClient>>,
    sync_oracle: Arc<SyncingService<opaque::Block>>,
    keystore: KeystorePtr,
    relay_chain_slot_duration: Duration,
    para_id: ParaId,
    collator_key: CollatorPair,
    overseer_handle: OverseerHandle,
    announce_block: Arc<dyn Fn(opaque::Hash, Option<Vec<u8>>) + Send + Sync>,
) {
    // .. omitted calls

    let (client_clone, relay_chain_interface_clone) =
        (client.clone(), relay_chain_interface.clone());
    let params = lookahead::Params {
        create_inherent_data_providers: move |parent, ()| {
            let client = client_clone.clone();
            let relay_chain_interface = relay_chain_interface_clone.clone();
            async move {
                let inherent = ismp_parachain_inherent::ConsensusInherentProvider::create(
                    parent,
                    client,
                    relay_chain_interface,
                ).await?;

                Ok(inherent)
            }
        },
        ..Default::default()
        // omitted fields
    };

    // ..omitted calls
}

License

This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs.

Dependencies

~110–150MB
~3M SLoC