This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Description
We should read the storage of the relay chain at the relay parent, but if it's not present fall back to a default hardcoded value of 0. Adding a utility function for reading the asynchronous backing parameters from the host configuration would be helpful for writing collators in the future.
|
async fn max_ancestry_lookback( |
|
_relay_parent: PHash, |
|
_relay_client: &impl RelayChainInterface, |
|
) -> usize { |
|
// TODO [https://github.com/paritytech/polkadot/pull/5022] |
|
// We need to read the relay-chain state to know what the maximum |
|
// age truly is, but that depends on those pallets existing. |
|
// |
|
// For now, just provide the conservative value of '2'. |
|
// Overestimating can cause problems, as we'd be building on forks of the |
|
// chain that can never get included. Underestimating is less of an issue. |
|
2 |
|
} |