Crate frame_system[][src]

System Pallet

The System pallet provides low-level access to core types and cross-cutting utilities. It acts as the base layer for other pallets to interact with the Substrate framework components.

Overview

The System pallet defines the core data types used in a Substrate runtime. It also provides several utility functions (see Pallet) for other FRAME pallets.

In addition, it manages the storage items for extrinsics data, indexes, event records, and digest items, among other things that support the execution of the current block.

It also handles low-level tasks like depositing logs, basic set up and take down of temporary storage entries, and access to previous block hashes.

Interface

Dispatchable Functions

The System pallet does not implement any dispatchable functions.

Public Functions

See the Pallet struct for details of publicly available functions.

Signed Extensions

The System pallet defines the following extensions:

  • CheckWeight: Checks the weight and length of the block and ensure that it does not exceed the limits.
  • CheckNonce: Checks the nonce of the transaction. Contains a single payload of type T::Index.
  • CheckEra: Checks the era of the transaction. Contains a single payload of type Era.
  • CheckGenesis: Checks the provided genesis hash of the transaction. Must be a part of the signed payload of the transaction.
  • CheckSpecVersion: Checks that the runtime version is the same as the one used to sign the transaction.
  • CheckTxVersion: Checks that the transaction version is the same as the one used to sign the transaction.

Lookup the runtime aggregator file (e.g. node/runtime) to see the full list of signed extensions included in a chain.

Re-exports

pub use weights::WeightInfo;
pub use pallet::*;

Modules

limits

Block resource limits configuration structures.

mocking

Provide types to help defining a mock environment when testing pallets.

offchain

Module helpers for off-chain calls.

pallet
pallet_prelude

Prelude to be used alongside pallet macro, for ease of use.

weights

Weights for frame_system THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 DATE: 2020-10-28, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

Structs

AccountInfo

Information of an account.

ChainContext
CheckEra

Check for transaction mortality.

CheckGenesis

Genesis hash check to provide replay protection between different networks.

CheckMortality

Check for transaction mortality.

CheckNonce

Nonce check and increment to give replay protection for transactions.

CheckSpecVersion

Ensure the runtime version registered in the transaction is the same as at present.

CheckTxVersion

Ensure the transaction version registered in the transaction is the same as at present.

CheckWeight

Block resource (weight) limit check.

Consumer

Event handler which registers a consumer when created.

EnsureNever
EnsureNone
EnsureOneOf

The "OR gate" implementation of EnsureOrigin.

EnsureRoot
EnsureSigned
EnsureSignedBy
EventRecord

Record of an event happening.

LastRuntimeUpgradeInfo

Stores the spec_version and spec_name of when the last runtime upgrade happened.

Provider

Event handler which registers a provider when created.

Enums

DecRefError

Some resultant status relevant to decrementing a provider reference.

DecRefStatus

Some resultant status relevant to decrementing a provider reference.

IncRefError

Some resultant status relevant to incrementing a provider reference.

IncRefStatus

Some resultant status relevant to incrementing a provider reference.

InitKind

A type of block initialization to perform.

Phase

A phase of a block's execution.

RawOrigin

Origin for the System pallet.

RefStatus

Reference status; can be either referenced or unreferenced.

Functions

ensure_none

Ensure that the origin o represents an unsigned extrinsic. Returns Ok or an Err otherwise.

ensure_root

Ensure that the origin o represents the root. Returns Ok or an Err otherwise.

ensure_signed

Ensure that the origin o represents a signed extrinsic (i.e. transaction). Returns Ok with the account that signed the extrinsic or an Err otherwise.

extrinsics_data_root

Compute the trie root of a list of extrinsics.

extrinsics_root

Compute the trie root of a list of extrinsics.

split_inner

Split an option into two constituent options, as defined by a splitter function.

Type Definitions

ConsumedWeight

An object to track the currently used extrinsic weight in a block.

DigestItemOf
DigestOf
Key
KeyValue
RefCount

Type used to encode the number of references an account has.