Crate polkadot_node_subsystem_util[][src]

Expand description

Utility module for subsystems

Many subsystems have common interests such as canceling a bunch of spawned jobs, or determining what their validator ID is. These common interests are factored into this module.

This crate also reexports Prometheus metric types which are expected to be implemented by subsystems.

Re-exports

pub use metered_channel as metered;

Modules

This module reexports Prometheus types and defines the [Metrics] trait.

These reexports are required so that external crates can use the delegated_subsystem macro properly.

A rolling session window cache. A rolling window of sessions and cached session info, updated by the state of newly imported blocks.

Convenient and efficient runtime info access. Convenient interface to runtime information.

Structs

A sender for messages from jobs, as well as commands to the overseer.

A subsystem which wraps jobs.

Create a stream of ticks with a defined cycle duration.

A future that wraps another future with a Delay allowing for time-limited futures.

Local validator information

Enums

Utility errors

Commands from a job to the broader subsystem.

Error which can be returned by the jobs manager

An error type that describes faults that may happen

Constants

Capacity of channels to and from individual jobs

Duration a job will wait after sending a stop signal before hard-aborting.

The minimum amount of peers to send gossip messages to.

Traits

This trait governs jobs.

A trait that describes the Subsystems that can run on the Overseer.

Extends Future to allow time-limited futures.

Functions

Choose a random subset of min elements. But always include is_priority elements.

Given a new chain-head hash, this determines the hashes of all new blocks we should track metadata for, given this head.

Find the validator group the given validator index belongs to.

Returns a bool with a probability of a / b of being true.

Request AssumedValidationData from the runtime

Request Authorities from the runtime

Request AvailabilityCores from the runtime

Request CandidateEvents from the runtime

Request CandidatePendingAvailability from the runtime

Request some data from the RuntimeApi.

Request PersistedValidationData from the runtime

Request SessionIndexForChild from the runtime

Request SessionInfo from the runtime

Request ValidationCode from the runtime

Request ValidatorGroups from the runtime

Request Validators from the runtime

From the given set of validators, find the first key we can sign with, if any.

From the given set of validators, find the first key we can sign with, if any, and return it along with the validator index.

Type Definitions

A type alias for Runtime API receivers.