#run-time #version #substrate #polkadot #module #api #runtime-version

no-std sp-version

Version module for the Substrate runtime; Provides a function that returns the runtime version. (polkadot v1.15.0)

55 releases (35 major breaking)

37.0.0 Jul 18, 2024
36.0.0 Jun 21, 2024
35.0.0 May 23, 2024
34.0.0 Apr 30, 2024
2.0.0-alpha.5 Mar 24, 2020

#45 in #polkadot

Download history 3943/week @ 2024-07-22 4316/week @ 2024-07-29 4326/week @ 2024-08-05 5700/week @ 2024-08-12 5476/week @ 2024-08-19 5459/week @ 2024-08-26 4165/week @ 2024-09-02 4605/week @ 2024-09-09 18546/week @ 2024-09-16 30741/week @ 2024-09-23 33657/week @ 2024-09-30 32101/week @ 2024-10-07 34510/week @ 2024-10-14 39550/week @ 2024-10-21 30563/week @ 2024-10-28 43085/week @ 2024-11-04

148,657 downloads per month
Used in 627 crates (57 directly)

Apache-2.0

430KB
6.5K SLoC

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

License: Apache-2.0


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

~17–29MB
~483K SLoC