56 releases (36 major breaking)

38.0.0 Jan 7, 2025
37.0.0 Jul 18, 2024
36.0.0 Jun 21, 2024
35.0.0 May 23, 2024
2.0.0-alpha.5 Mar 24, 2020

#941 in Magic Beans

Download history 28816/week @ 2024-09-27 36071/week @ 2024-10-04 33921/week @ 2024-10-11 38401/week @ 2024-10-18 33296/week @ 2024-10-25 41517/week @ 2024-11-01 46844/week @ 2024-11-08 57183/week @ 2024-11-15 55621/week @ 2024-11-22 53800/week @ 2024-11-29 60319/week @ 2024-12-06 55096/week @ 2024-12-13 19102/week @ 2024-12-20 20600/week @ 2024-12-27 46412/week @ 2025-01-03 50545/week @ 2025-01-10

144,614 downloads per month
Used in 644 crates (60 directly)

Apache-2.0

1MB
8K SLoC

Version module for the Substrate runtime; Provides a function that returns the runtime version.

License: Apache-2.0

Release

Polkadot SDK Stable 2412


lib.rs:

Substrate runtime version

Each runtime that should be executed by a Substrate based node needs to have a runtime version. The runtime version is defined by RuntimeVersion. The runtime version is used to distinguish different runtimes. The most important field is the spec_version. The spec_version should be increased in a runtime when a new runtime build includes breaking changes that would make other runtimes unable to import blocks built by this runtime or vice-versa, where the new runtime could not import blocks built by the old runtime. The runtime version also carries other version information about the runtime, see RuntimeVersion for more information on this.

Substrate will fetch the runtime version from a wasm blob by first checking the runtime_version link section or calling the Core::version runtime api. The link section can be generated in the runtime using the runtime_version attribute. The Core runtime api also needs to be implemented for the runtime using impl_runtime_apis!.

Dependencies

~16–29MB
~468K SLoC