Aura: Adds some compatibility mode to support old chains (#12492)
* Aura: Adds some compatibility mode to support old chains In https://github.com/paritytech/substrate/pull/9132 we changed the way how we get the authorities from the runtime. Before this mentioned pr we would call `initialize_block` before calling the authorities runtime function. The problem with this was that when you have a block X that would switch the authority set, it would already be signed by an authority of the new set. This was wrong, as a block should only be signed by the current authority set. As this change is a hard fork, this pr brings back the possibility for users that have a chain running with this old logic to upgrade. They will need to use: ``` CompatibilityMode::UseInitializeBlock { until: some_block_in_the_future } ``` Using this compatibility mode will make the node behave like the old nodes, aka calling `initialize_block` before doing the actual runtime call to `authorities`. Then when the given `until` block is being build/imported the node switches to the new behaviour of not calling `initialize_block` before. This is a hard fork, so the `until` block should be chosen wisely as a point where all nodes in the network have upgraded. * Fixes * Make docs ready * Update client/consensus/aura/src/lib.rs Co-authored-by:André Silva <123550+andresilva@users.noreply.github.com> * Update client/consensus/aura/src/lib.rs Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com> * Update client/consensus/aura/src/lib.rs Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com> * FMT Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com>
Showing
- substrate/bin/node-template/node/src/service.rs 2 additions, 0 deletionssubstrate/bin/node-template/node/src/service.rs
- substrate/client/consensus/aura/src/import_queue.rs 42 additions, 42 deletionssubstrate/client/consensus/aura/src/import_queue.rs
- substrate/client/consensus/aura/src/lib.rs 101 additions, 14 deletionssubstrate/client/consensus/aura/src/lib.rs
- substrate/client/service/src/client/client.rs 1 addition, 1 deletionsubstrate/client/service/src/client/client.rs
- substrate/primitives/consensus/aura/src/lib.rs 1 addition, 1 deletionsubstrate/primitives/consensus/aura/src/lib.rs
Please register or sign in to comment