Add possibility of executing or mocking additional inherents in xcm-emulator#8809
Conversation
|
@bkontur what do you think about this? |
…ocking-additional-inherents
Actually, I was thinking about the same (or a similar) solution - to place the actual inherents behind a trait or callback (with a default implementation for However, I didn’t want to introduce a major breaking change at that time, and I also wasn’t sure whether the callback would require any parameters. For example, we actually need @girazoki How do you plan to use |
In our case, we are simply thinking about "mocking" the appropriate storage items on the pallets to make them think inherents have passed correctly, so we would not need any parameters. but it is true that if one would be willing to add the inherent call, then we might require some of the parameters. We can add some parameters, like those we add for |
However one thing I just realized is that all that information should already be available in the cumulus parachainSystem pallet for anyone to use it after the |
It seems like a bit of a hack or workaround, and I don't see any parallel with the existing pallet flow ( If you only need to trigger this once when the chain starts, you can use this But if you really need it on every block, then I'd say let's stick with |
…ocking-additional-inherents
|
/cmd prdoc --audience runtime_dev |
3288aa3
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (#8809) With the addition of #8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
…mulator (paritytech#8809) With the addition of paritytech#8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form `wasInherentSet` `on_initialize` and asserting that such inherent was set `on_finalize`. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets. My proposal is to add an item to the xcm-emulator parachain configuration of the form `AdditionalInherentCode`, which simply executes code that returns a `DispatchResult`. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both. This item is optional, meaning that if it is non-set then it would do nothing --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
With the addition of #8083 there is no possibility right now of making the xcm-executor work with custom inherents. Custom inherents are usually driven by killing a storage item of the form
wasInherentSeton_initializeand asserting that such inherent was seton_finalize. Before the xcm-emulator worked as these hooks were running just for the ParachainSystem pallet, but now, they run for all pallets.My proposal is to add an item to the xcm-emulator parachain configuration of the form
AdditionalInherentCode, which simply executes code that returns aDispatchResult. Whether users want to mock a storage item or run the inherent is up to them, this hook would allow them to do both.This item is optional, meaning that if it is non-set then it would do nothing