-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Transaction versioning in the RuntimeVersion #5582
Conversation
primitives/version/src/lib.rs
Outdated
/// index. | ||
/// | ||
/// It need *not* change when a new module is added or when a dispatchable is added. | ||
pub transaction_version: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to move to the bottom, or we brick everything^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that will not be enough. We need to change the version of the Core
runtime api and make sure to put the changed_in
attribute above the version
function.
The old version
function should have the old RuntimeVersion
struct as return value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.
This is already a transaction version
And this could fix #3925 ? |
They are quite different things; the The specific semantics are:
In both cases, |
I see. It should be possible to create some automation to detect if we need to bump transaction version by comparing metadata from wasm? Manually tracking it is error prone. Also maybe we need a better name? because have two different thing with exact same name is confusing. |
Yeah that should be possible to automate; you'd just need to check if there's an alteration/removal to existing pallets, dispatchables, including their docs. |
seems like tests need updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some test and also found a bug with these tests. I think we should test syncing Kusama and if that works it should be mergable.
This just adds the
transaction_version
field in theRuntimeVersion
, which just tracks the compatibility of dispatchables, useful for hardware wallets.Polkadot companion: paritytech/polkadot#987