cumulus icon indicating copy to clipboard operation
cumulus copied to clipboard

Parent search for Aura should draw upon real asynchronous backing parameters

Open rphmeier opened this issue 2 years ago • 2 comments

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.

https://github.com/paritytech/cumulus/blob/89af9a6beeab877138a3719a1c83d22fddfd128b/client/consensus/aura/src/collators/lookahead.rs#L338-L350

rphmeier avatar Jun 07 '23 23:06 rphmeier

I see 2 approaches we could follow there.

  1. Introduce async_backing_params method to RelayChainInterface and attempt to call into runtime API, defaulting to { 0, 0 } in case it's not available. Unfortunately, the error in this case is
ApiError(Application(Execution(Other("Exported method ParachainHost_staging_async_backing_params is not found"))))

Doing String::contains is ugly and overall is a bad practice.

  1. Use existing RelayChainInterface::get_storage_by_key, to read AbridgedHostConfiguration. Async backing parameters were placed directly under these fields (here), thus it should be safe, parameters were added in V6 migration on all chains. This diverges a little from what relay node does, but looks like a cleaner solution to me.

slumber avatar Aug 22 '23 21:08 slumber

Yes, I recommend approach (2). It will be more future-proof.

rphmeier avatar Aug 23 '23 17:08 rphmeier