-
Notifications
You must be signed in to change notification settings - Fork 1.1k
offchain-worker: Do not intialize the entire System again
#10235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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
left a comment
There was a problem hiding this 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()); | ||
| } |
There was a problem hiding this comment.
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.
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
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.