You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taken from the design doc regarding BlockchainEvents (link):
Given that LockImportRun is the trigger for storage, finality and block import notifications we will be able to implement the BlockchainEvents and PreCommitActions traits.
BlockchainEvents contains the methods for registering channels for storage, finality and block import notifications. I propose adding a RegisterXXXNotification and accompanying UnregisterXXXNotification method for the finality and block import notifications. The storage notifcations are a little more complicated. Based on the rust code the sc_api::StorageNotifications type handles registering and unregistering of storage notifications. Listening on storage notifications is actually based on supplied top trie keys as well child trie keys (see code). We should mirror the implementation of the associated registry and business logic around going through registered storage notification listeners, and only notifying listeners based on the supplied top and child filter keys.
Taken from the design doc regarding pinning and unpinning blocks where notifications are sent:
... One thing to note is that blocks are pinned (stored in memory, and not pruned) in db.Backend when notifications are sent out. That means unpinning of blocks falls on the recipient of said notifications. This is usally handled in the rust code by reference counting the notifications with pin handles, and unpinning happens when the notification gets dropped (see code). Since in Go we don't have the Drop trait, we will need to manually drop the handle which will essentially unpin the block from the db.Backend and allow pruning to happen.
Acceptance Criteria
Introduction of BlockchainEvents interface.
Implementation of BlockchainEvents into Client type.
Implement background reference counting async worker to unpin.
Issue Summary
Taken from the design doc regarding
BlockchainEvents
(link):Taken from the design doc regarding pinning and unpinning blocks where notifications are sent:
Acceptance Criteria
BlockchainEvents
interface.BlockchainEvents
intoClient
type.Other information and links
BlockchainEvents
.The text was updated successfully, but these errors were encountered: