[][src]Struct sp_version::RuntimeVersion

pub struct RuntimeVersion {
    pub spec_name: RuntimeString,
    pub impl_name: RuntimeString,
    pub authoring_version: u32,
    pub spec_version: u32,
    pub impl_version: u32,
    pub apis: ApisVec,
    pub transaction_version: u32,
}

Runtime version. This should not be thought of as classic Semver (major/minor/tiny). This triplet have different semantics and mis-interpretation could cause problems. In particular: bug fixes should result in an increment of spec_version and possibly authoring_version, absolutely not impl_version since they change the semantics of the runtime.

Fields

spec_name: RuntimeString

Identifies the different Substrate runtimes. There'll be at least polkadot and node. A different on-chain spec_name to that of the native runtime would normally result in node not attempting to sync or author blocks.

impl_name: RuntimeString

Name of the implementation of the spec. This is of little consequence for the node and serves only to differentiate code of different implementation teams. For this codebase, it will be parity-polkadot. If there were a non-Rust implementation of the Polkadot runtime (e.g. C++), then it would identify itself with an accordingly different impl_name.

authoring_version: u32

authoring_version is the version of the authorship interface. An authoring node will not attempt to author blocks unless this is equal to its native runtime.

spec_version: u32

Version of the runtime specification. A full-node will not attempt to use its native runtime in substitute for the on-chain Wasm runtime unless all of spec_name, spec_version and authoring_version are the same between Wasm and native.

impl_version: u32

Version of the implementation of the specification. Nodes are free to ignore this; it serves only as an indication that the code is different; as long as the other two versions are the same then while the actual code may be different, it is nonetheless required to do the same thing. Non-consensus-breaking optimizations are about the only changes that could be made which would result in only the impl_version changing.

apis: ApisVec

List of supported API "features" along with their versions.

transaction_version: u32

All existing dispatches are fully compatible when this number doesn't change. If this number changes, then spec_version must change, also.

This number must change when an existing dispatchable (module ID, dispatch ID) is changed, either through an alteration in its user-level semantics, a parameter added/removed/changed, a dispatchable being removed, a module being removed, or a dispatchable/module changing its index.

It need not change when a new module is added or when a dispatchable is added.

Implementations

impl RuntimeVersion[src]

pub fn can_call_with(&self, other: &RuntimeVersion) -> bool[src]

Check if this version matches other version for calling into runtime.

pub fn has_api_with<P: Fn(u32) -> bool>(&self, id: &ApiId, predicate: P) -> bool[src]

Check if the given api with api_id is implemented and the version passes the given predicate.

Trait Implementations

impl Clone for RuntimeVersion[src]

impl Debug for RuntimeVersion[src]

impl Decode for RuntimeVersion[src]

impl Default for RuntimeVersion[src]

impl<'de> Deserialize<'de> for RuntimeVersion[src]

impl Display for RuntimeVersion[src]

impl Encode for RuntimeVersion[src]

impl EncodeLike<RuntimeVersion> for RuntimeVersion[src]

impl Eq for RuntimeVersion[src]

impl PartialEq<RuntimeVersion> for RuntimeVersion[src]

impl Serialize for RuntimeVersion[src]

impl StructuralEq for RuntimeVersion[src]

impl StructuralPartialEq for RuntimeVersion[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> Clear for T where
    T: PartialEq<T> + Eq + Default
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> Error for T where
    T: 'static + Send + Debug + Display

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 

pub fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDisplay for T where
    T: Display
[src]

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> MaybeSerialize for T where
    T: Serialize
[src]

impl<T> MaybeSerializeDeserialize for T where
    T: DeserializeOwned + Serialize
[src]

impl<T> Member for T where
    T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,