50 releases (31 major breaking)

33.0.0 Apr 30, 2024
32.0.0 Apr 8, 2024
31.0.0 Mar 18, 2024
30.0.0 Feb 26, 2024
2.0.0-alpha.5 Mar 24, 2020

#1159 in Magic Beans

Download history 2917/week @ 2024-01-22 2428/week @ 2024-01-29 2880/week @ 2024-02-05 4097/week @ 2024-02-12 4085/week @ 2024-02-19 4789/week @ 2024-02-26 3720/week @ 2024-03-04 3238/week @ 2024-03-11 4780/week @ 2024-03-18 4149/week @ 2024-03-25 4701/week @ 2024-04-01 5137/week @ 2024-04-08 5281/week @ 2024-04-15 4393/week @ 2024-04-22 4349/week @ 2024-04-29 4168/week @ 2024-05-06

18,593 downloads per month
Used in 403 crates (311 directly)


43K SLoC

System Module

The System module 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.


The System module 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.


Dispatchable Functions

The System module does not implement any dispatchable functions.

Public Functions

See the Pallet struct for details of publicly available functions.

Signed Extensions

The System module 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::Nonce.
  • 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.



Import the System module and derive your module's configuration trait from the system trait.

Example - Get extrinsic count and parent hash for the current block

pub mod pallet {
    use super::*;
    use frame_support::pallet_prelude::*;
    use frame_system::pallet_prelude::*;

    pub trait Config: frame_system::Config {}

    pub struct Pallet<T>(_);

    impl<T: Config> Pallet<T> {
        pub fn system_module_example(origin: OriginFor<T>) -> DispatchResult {
            let _sender = ensure_signed(origin)?;
            let _extrinsic_count = <system::Pallet<T>>::extrinsic_count();
            let _parent_hash = <system::Pallet<T>>::parent_hash();

License: Apache-2.0


~512K SLoC