Skip to content

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Nov 6, 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 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.

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.
@bkchr bkchr requested a review from a team as a code owner November 6, 2025 21:24
@bkchr bkchr added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Nov 6, 2025
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be backported to the same releases that source PR was going too.

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());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bkchr bkchr added A4-backport-stable2506 Pull request must be backported to the stable2506 release branch A4-backport-stable2509 Pull request must be backported to the stable2509 release branch labels Nov 7, 2025
@bkchr
Copy link
Member Author

bkchr commented Nov 7, 2025

/cmd prdoc --audience runtime_dev --bump patch

@bkchr bkchr enabled auto-merge November 7, 2025 10:59
@paritytech-workflow-stopper
Copy link

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

@bkchr bkchr removed A4-backport-stable2506 Pull request must be backported to the stable2506 release branch A4-backport-stable2509 Pull request must be backported to the stable2509 release branch labels Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T1-FRAME This PR/Issue is related to core FRAME, the framework.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants