Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 476
JoshOrndorff Avatar asked Nov 12 '20 14:11

JoshOrndorff


1 Answers

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

like image 191
Dan Forbes Avatar answered Oct 16 '22 06:10

Dan Forbes