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§
Modules§
- availability_
chunks - Helpers for the validator->chunk index mapping.
- backing_
implicit_ view - A utility for managing the implicit view of the relay-chain derived from active leaves and the minimum allowed relay-parents that parachain candidates can have and be backed in those leaves’ children.
- database
- Database trait for subsystem. Database trait for polkadot db.
- inclusion_
emulator - An emulator for node-side code to predict the results of on-chain parachain inclusion and predict future constraints.
- metrics
- This module reexports Prometheus types and defines the
Metrics
trait. - nesting_
sender - Nested message sending
- reexports
- These reexports are required so that external crates can use the
delegated_subsystem
macro properly. - reputation
- A utility abstraction to collect and send reputation changes.
- runtime
- Convenient and efficient runtime info access. Convenient interface to runtime information.
- vstaging
- Helpers for working with unreleased runtime calls Contains helpers for staging runtime calls.
Structs§
- Metronome
- Create a stream of ticks with a defined cycle duration.
- Timeout
- A future that wraps another future with a
Delay
allowing for time-limited futures. - Validator
- Local validator information
Enums§
- Error
- Utility errors
- Overseer
Error - An error type that describes faults that may happen
Constants§
- JOB_
CHANNEL_ CAPACITY - Capacity of channels to and from individual jobs
- JOB_
GRACEFUL_ STOP_ DURATION - Duration a job will wait after sending a stop signal before hard-aborting.
- MIN_
GOSSIP_ PEERS - The minimum amount of peers to send gossip messages to.
Traits§
- Subsystem
- A trait that describes the
Subsystem
s that can run on theOrchestra
. - Timeout
Ext - Extends
Future
to allow time-limited futures.
Functions§
- choose_
random_ subset - Choose a random subset of
min
elements. But always includeis_priority
elements. - choose_
random_ subset_ with_ rng - Choose a random subset of
min
elements using a specific Random GeneratorRng
But always includeis_priority
elements. - determine_
new_ blocks - Given a new chain-head hash, this determines the hashes of all new blocks we should track metadata for, given this head.
- executor_
params_ at_ relay_ parent - Requests executor parameters from the runtime effective at given relay-parent. First obtains
session index at the relay-parent, relying on the fact that it should be cached by the runtime
API caching layer even if the block itself has already been pruned. Then requests executor
parameters by session index.
Returns an error if failed to communicate to the runtime, or the parameters are not in the
storage, which should never happen.
Returns default execution parameters if the runtime doesn’t yet support
SessionExecutorParams
API call. Otherwise, returns execution parameters returned by the runtime. - find_
validator_ group - Find the validator group the given validator index belongs to.
- gen_
ratio - Returns a
bool
with a probability ofa / b
of being true. - gen_
ratio_ rng - Returns a
bool
with a probability ofa / b
of being true. - has_
required_ runtime - Verifies if
ParachainHost
runtime api is at least at versionrequired_runtime_version
. This method is used to determine if a given runtime call is supported by the runtime. - request_
assumed_ validation_ data - Request
AssumedValidationData
from the runtime - request_
async_ backing_ params - Request
AsyncBackingParams
from the runtime - request_
authorities - Request
Authorities
from the runtime - request_
availability_ cores - Request
AvailabilityCores
from the runtime - request_
backing_ constraints - Request
BackingConstraints
from the runtime - request_
candidate_ events - Request
CandidateEvents
from the runtime - request_
candidate_ pending_ availability - Request
CandidatePendingAvailability
from the runtime - request_
candidates_ pending_ availability - Request
CandidatesPendingAvailability
from the runtime - request_
claim_ queue - Request
ClaimQueue
from the runtime - request_
disabled_ validators - Request
DisabledValidators
from the runtime - request_
from_ runtime - Request some data from the
RuntimeApi
. - request_
key_ ownership_ proof - Request
KeyOwnershipProof
from the runtime - request_
min_ backing_ votes - Request
MinimumBackingVotes
from the runtime - request_
node_ features - Request
NodeFeatures
from the runtime - request_
on_ chain_ votes - Request
FetchOnChainVotes
from the runtime - request_
para_ backing_ state - Request
ParaBackingState
from the runtime - request_
persisted_ validation_ data - Request
PersistedValidationData
from the runtime - request_
runtime_ api_ version - Request
Version
from the runtime - request_
session_ executor_ params - Request
SessionExecutorParams
from the runtime - request_
session_ index_ for_ child - Request
SessionIndexForChild
from the runtime - request_
session_ info - Request
SessionInfo
from the runtime - request_
submit_ report_ dispute_ lost - Request
SubmitReportDisputeLost
from the runtime - request_
unapplied_ slashes - Request
UnappliedSlashes
from the runtime - request_
validation_ code - Request
ValidationCode
from the runtime - request_
validation_ code_ by_ hash - Request
ValidationCodeByHash
from the runtime - request_
validation_ code_ hash - Request
ValidationCodeHash
from the runtime - request_
validator_ groups - Request
ValidatorGroups
from the runtime - request_
validators - Request
Validators
from the runtime - sign
- Sign the given data with the given validator ID.
- signing_
key - From the given set of validators, find the first key we can sign with, if any.
- signing_
key_ and_ index - 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 Aliases§
- Runtime
ApiReceiver - A type alias for Runtime API receivers.