Skip to content
Commit 33b61f0e authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

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: default avatarAndré Silva <[email protected]>

* Update client/consensus/aura/src/lib.rs

Co-authored-by: default avatarAndré Silva <[email protected]>

* Update client/consensus/aura/src/lib.rs

Co-authored-by: default avatarAndré Silva <[email protected]>

* FMT

Co-authored-by: default avatarAndré Silva <[email protected]>
parent ca779b36
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment