Add relay storage root to persisted validation data (#2161)

* Cont.: Implement the state root obtaining during inclusion

During inclusion now we obtain the storage root by passing it through
the inclusion_inherent.

* Fix tests

* Bump rococo spec version

* Reorder the parent header into the end

of the inclusion inherent.

When the parent header is in the beginning, it shifts the other two
fields, so that a previous version won't be able to decode that. If
we put the parent header in the end, the other two fields will stay
at their positions, thus make it possible to decode with the previous
version.

That allows us to perform upgrade of rococo runtime without needing of
simultanuous upgrade of nodes and runtime, or restart of the network.

* Squash a stray tab
This commit is contained in:
Sergei Shulepov
2021-01-04 17:58:20 +01:00
committed by GitHub
parent 930978ce77
commit a864eaa093
14 changed files with 120 additions and 36 deletions
+2
View File
@@ -284,6 +284,8 @@ pub struct PersistedValidationData<N = BlockNumber> {
pub parent_head: HeadData,
/// The relay-chain block number this is in the context of.
pub block_number: N,
/// The relay-chain block storage root this is in the context of.
pub relay_storage_root: Hash,
/// The list of MQC heads for the inbound channels paired with the sender para ids. This
/// vector is sorted ascending by the para id and doesn't contain multiple entries with the same
/// sender.