1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Smoldot
// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//! Inherents, together with transactions, form the body of a block.
//!
//! The body of a block consists of a list of what is called extrinsics. An extrinsic can be
//! either a transaction, when it was submitted by a user, or an inherent, which is what this
//! module is about.
//!
//! When a block is authored, one of the first steps is for the block author to generate the list
//! of inherents. This is done by calling a runtime function, passing as parameter an encoded
//! [`InherentData`].
//!
//! When a block is later verified, the inherents are verified by calling a runtime function and
//! passing as parameter an encoded [`InherentData`] as well.
/// Values of the inherents to pass to the runtime.
///
/// Historically, the inherent data included an Aura or Babe slot number, using the identifiers
/// `auraslot` or `babeslot`. The runtime-side verification of the slot number has been removed in
/// May 2021, and all the checks performed by the runtime are now performed by the client instead.
/// Older runtime versions still require the slot number. For this reason, verifying the inherents
/// (calling `BlockBuilder_check_inherents`) of blocks that are using older runtime versions will
/// lead to errors concerning the Aura or Babe modules that should simply be ignored. Authoring
/// blocks using older runtime versions is not supported anymore.