-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat/ocw/bookkeeping #5200
feat/ocw/bookkeeping #5200
Conversation
ed6990d to
5d11ae9
Compare
075c9f9 to
d5ff49b
Compare
tomusdrw
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.
Looks good overall, I'd change the logic a bit though.
import_notification_streamis left as it works now - not guaranteed for every block, and also not running for initial sync. Has some extra data in the notification though.
2all_blocks_import_notification_stream- a more "lightweight" stream, but guaranteed to run for each and every imported block. This is what offchain workers should be using now. Additionally the information if it was an initial sync or not should be passed as parameter in the stream, so that we can for instance keep backward compatibility for extisting offchain workers (the filtering would be done within the runtime though, not outside).
f4868db to
e9ca0eb
Compare
f059032 to
28a464c
Compare
c0dfe8b to
1b76596
Compare
74d1137 to
f09046b
Compare
|
Note that this contains changes of #5455 |
Co-Authored-By: Kian Paimani <[email protected]>
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.
None were critical to request changes, but I had some comments that preferably need addressing before merge.
tomusdrw
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.
A bunch of docs improvements, functionally it looks good.
| } | ||
|
|
||
| impl Externalities for BasicExternalities { | ||
| fn set_offchain_storage(&mut self, _key: &[u8], _value: Option<&[u8]>) {} |
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.
I think in this case it's better to work with borrowed data, cause we can avoid a clone if indexing is disabled. That said we should probably unify the API (and introduce Storage*Ref to work with slices). I'd leave it as a separate PR though.
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
Co-Authored-By: Tomasz Drwięga <[email protected]>
|
Companion and this look good, I think we can merge once CI completes here. cc @TriplEight companion PR task may not be working correctly; I've tried restarting it but we'll see if it works. |
|
@rphmeier I've checked and it seems to be caused by GitHub availability issues. |
|
Quick question, should the overlay maintain a commit and prospective state? |
|
Good point - although at the moment our use-cases are in |
Changes in order to allow writing data during block import to the offchain database, so that the offchain worker has access to this data.
The implementation introduces a new interface accessible from runtime.
Related #3722
polkadot companion: paritytech/polkadot#1025