offchain-worker: Do not intialize the entire System again#10235
Merged
offchain-worker: Do not intialize the entire System again#10235
System again#10235Conversation
When calling `offchain-worker` we were initializing the entire `System` again with the same block we are running on top of. However, with [the change to require strictly increasing block numbers](#10180) the offchain-worker was failing. This is now solved by just registering the missing digests. The rest of the changes done by `initialize` are not important for offchain workers. The pull request ensures that we are actually testing this behavior of the offchain worker now.
kianenigma
approved these changes
Nov 6, 2025
Contributor
kianenigma
left a comment
There was a problem hiding this comment.
Should be backported to the same releases that source PR was going too.
franciscoaguirre
approved these changes
Nov 6, 2025
gui1117
reviewed
Nov 7, 2025
| let existing_digest = frame_system::Pallet::<System>::digest(); | ||
| for digest in digests.logs().iter().filter(|d| !existing_digest.logs.contains(d)) { | ||
| frame_system::Pallet::<System>::deposit_log(digest.clone()); | ||
| } |
Contributor
There was a problem hiding this comment.
what about well_known_keys::INTRABLOCK_ENTROPY it gets removed in finalize, maybe we should bring it back, some offchain worker could read into it.
Member
Author
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
gui1117
approved these changes
Nov 8, 2025
auto-merge was automatically disabled
November 10, 2025 14:04
Pull Request is not mergeable
|
Successfully created backport PR for |
paritytech-release-backport-bot bot
pushed a commit
that referenced
this pull request
Nov 10, 2025
When calling `offchain-worker` we were initializing the entire `System` again with the same block we are running on top of. However, with [the change to require strictly increasing block numbers](#10180) the offchain-worker was failing. This is now solved by just registering the missing digests. The rest of the changes done by `initialize` are not important for offchain workers. The pull request ensures that we are actually testing this behavior of the offchain worker now. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit 405e0bd)
paritytech-release-backport-bot bot
pushed a commit
that referenced
this pull request
Nov 10, 2025
When calling `offchain-worker` we were initializing the entire `System` again with the same block we are running on top of. However, with [the change to require strictly increasing block numbers](#10180) the offchain-worker was failing. This is now solved by just registering the missing digests. The rest of the changes done by `initialize` are not important for offchain workers. The pull request ensures that we are actually testing this behavior of the offchain worker now. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit 405e0bd)
|
Successfully created backport PR for |
EgrPrty
pushed a commit
that referenced
this pull request
Nov 10, 2025
Backport #10235 into `stable2506` from bkchr. 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: Bastian Köcher <git@kchr.de> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
EgrPrty
pushed a commit
that referenced
this pull request
Nov 11, 2025
Backport #10235 into `stable2509` from bkchr. 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: Bastian Köcher <git@kchr.de> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Egor_P <egor@parity.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When calling
offchain-workerwe were initializing the entireSystemagain with the same block we are running on top of. However, with the change to require strictly increasing block numbers the offchain-worker was failing. This is now solved by just registering the missing digests. The rest of the changes done byinitializeare not important for offchain workers.The pull request ensures that we are actually testing this behavior of the offchain worker now.