In Substrate, what's the difference between `spec_version` and `authoring_version`?
Asked Answered
S

1

6

Each Substrate runtime has a RuntimeVersion. The fields in this RuntimeVersion struct indicate when various aspects of the runtime change and each field has its own semantics described in those docs.

I'm not sure what authoring_version means and when exactly it should change. The description in the docs is not totally clear to me

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.

If possible please provide examples of upgrades where:

  • both spec_version and authoring_version would change
  • spec_version would change, but authoring_version would not
  • authoring_version would change, but spec_version would not
Superhighway answered 12/11, 2020 at 14:58 Comment(0)
S
5

I will share an answer provided to me by Substrate core developer Bastian Köcher:

There aren't that much changes that result in a bump of the authoring_version

If you for example change the BlockBuilder runtime api in a non-backwards compatible way, you will need to bump the authoring_version

As validators will not be able to build new blocks, without updating the node implementation

And if you just change the runtime api in such a way that you make it incompatible to the previous while don't changing any internals in the runtime that would lead to a different storage root, you would only bump the authoring_version. However, I expect that this probably never happens in reality

Skink answered 16/11, 2020 at 17:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.