The title is quite self-explanatory, how can i get the blocknumber of the relay chain I'm connected to (Kusama) instead of my local blocknumber ?
All of this in a substrate/cumulus environment
The title is quite self-explanatory, how can i get the blocknumber of the relay chain I'm connected to (Kusama) instead of my local blocknumber ?
All of this in a substrate/cumulus environment
Copyright © 2021 Jogjafile Inc.
I assume that you mean not Substrate, but Cumulus, to be specific, since you are talking about parachains.
Cumulus parachains' runtimes receive the so called
PersistedValidationDatafrom the collators. It has several pieces of information passed by the relay-chain. It does includerelay_parent_number. That is the relay chain block number from which the parachain block in question was created.In a cumulus parachain runtime,
PersistedValidationDatacan be accessed through thevalidation_datagetter.Be advised, this data is submitted by a collator in an inherent. That means, among other things, this data is not available in the
on_initializehooks.