Skip to content

xcm-emulator improved callback triggering (on_initialize, on_finalize, on_idle, OnSystemEvent).#8083

Merged
bkontur merged 21 commits into
masterfrom
bko-xcm-emulator-fixes
Apr 7, 2025
Merged

xcm-emulator improved callback triggering (on_initialize, on_finalize, on_idle, OnSystemEvent).#8083
bkontur merged 21 commits into
masterfrom
bko-xcm-emulator-fixes

Conversation

@bkontur
Copy link
Copy Markdown
Contributor

@bkontur bkontur commented Mar 28, 2025

This PR fixes several issues related to xcm-emulator:

  • Corrects parent head propagation to the PersistedValidationData and OnSystemEvent callback.
  • Triggers on_initialize for all pallets, not just ParachainSystem.
  • Triggers on_finalize for all pallets, not just ParachainSystem.
  • Triggers on_idle for all parachain pallets.

@bkontur bkontur added T6-XCM This PR/Issue is related to XCM. T10-tests This PR/Issue is related to tests. labels Mar 28, 2025
@bkontur
Copy link
Copy Markdown
Contributor Author

bkontur commented Mar 28, 2025

/cmd prdoc --audience runtime_dev --bump patch

@bkontur bkontur moved this to In Progress in @bkontur's board Mar 28, 2025
Comment thread prdoc/pr_8083.prdoc Outdated
bkontur added a commit that referenced this pull request Mar 31, 2025
Process `set_validation_data` and `Timestamp::set` as inherents for parachain would be processed

Remove unnecessary import

Process `on_initialize` / `on_finalize` / `on_idle` for all parachain pallets (and not just parachain_system)

Cargo.lock
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/14192709436
Failed job name: test-linux-stable

bkontur added a commit that referenced this pull request Apr 2, 2025
Process `set_validation_data` and `Timestamp::set` as inherents for parachain would be processed

Remove unnecessary import

Process `on_initialize` / `on_finalize` / `on_idle` for all parachain pallets (and not just parachain_system)

Cargo.lock
Comment thread cumulus/xcm/xcm-emulator/src/lib.rs
bkontur added a commit that referenced this pull request Apr 2, 2025
Process `set_validation_data` and `Timestamp::set` as inherents for parachain would be processed

Remove unnecessary import

Process `on_initialize` / `on_finalize` / `on_idle` for all parachain pallets (and not just parachain_system)

Cargo.lock
bkontur added a commit that referenced this pull request Apr 2, 2025
Process `set_validation_data` and `Timestamp::set` as inherents for parachain would be processed

Remove unnecessary import

Process `on_initialize` / `on_finalize` / `on_idle` for all parachain pallets (and not just parachain_system)

Cargo.lock
@bkontur bkontur requested a review from bkchr April 2, 2025 22:59
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 5, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jun 23, 2025
…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>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 24, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jun 26, 2025
…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>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jul 2, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
dimartiro pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jul 2, 2025
…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>
@bkontur bkontur moved this from Todo to Done in @bkontur's board Jul 23, 2025
alstjd0921 pushed a commit to bifrost-platform/polkadot-sdk that referenced this pull request Aug 14, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Sep 17, 2025
Backport paritytech#8083 into `stable2503` from bkontur.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Sep 17, 2025
…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>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Sep 17, 2025
…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>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Sep 18, 2025
…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>
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
…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>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 15, 2026
…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>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 15, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T6-XCM This PR/Issue is related to XCM. T10-tests This PR/Issue is related to tests.

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants