[JAM parachain-service] Implement additional data support - #13022
Conversation
bkchr
left a comment
There was a problem hiding this comment.
I think this goes into the right direction, but I would do some conceptual changes.
sp-additional-datashould only expose generic/shared host functions, types and constants. E.g. only thefinalizehost functions and nothing aroundread_relay_state.cumulus-client-addtional-datashould be changed to host all the relevant bits and pieces for reading the relay state.
trait RelayState {
fn read(key: Vec<u8>) -> Option<Vec<u8>> {
self.get_extension<RelayStateExt>()?.read(key)
}
}sp-addiotional-data should expose some AdditionalDataExt (this is for example used by finalize to generate the hash). This extension should just contain "pointers" to all the other extensions that also host additonal data. So, that it can later on all self.all_additional_datas.iter().map(|dp| dp.finalize()).fold_into_hash().
|
|
||
| use sp_runtime_interface::{pass_by::PassFatPointerAndRead, runtime_interface}; | ||
|
|
||
| #[allow(unused_imports)] |
There was a problem hiding this comment.
I don't remember, there was some CI test failing because of this. But there were many of them unused. Would be a good idea to get the CI in a running state on the current state of the parchain-service branch before merging more stuff on top
| @@ -0,0 +1,23 @@ | |||
| [package] | |||
| name = "cumulus-client-additional-data" | |||
There was a problem hiding this comment.
I would expect that this is specific for only reading relay chain state.
There was a problem hiding this comment.
for now, but maybe follow-up use cases will emerge
I agree that the substrate crate should be kept generic. The reality is that the So IMO, it makes sense to either:
This sounds very similar to the idea number 1 above. Do you agree that it'd then make sense to also have a common |
No, we should not add any strings there. We just need some generic |
Split the block "additional data" mechanism into a producer-agnostic core and a relay-specific side
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
Implements paritytech/parachain-service#14
Completes the implementation started on the
parchain-servicebranch.V3 parachains now rely on this new data transport for the relay state proof