-
Notifications
You must be signed in to change notification settings - Fork 4
Block + Event Channel Design Proposal #12
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
Conversation
| blocks_read_per_epoch: u64, | ||
| start_height: BlockNumberOrTag, | ||
| end_height: BlockNumberOrTag, | ||
| current: Header, |
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.
not sure if this makes a difference but to save memory we could just store the block number rather than the entire header?
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.
we need the hash too for the reorg detection
LeoPatOZ
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.
Looking good i think this is a great starting point for the rest of the scanner

The responsibility of the block scanner is to process blocks in the correct order and to gracefully handle reorgs.
It reads blocks and feeds them into a channel, with the calling code being able to "receive" the blocks as they come. The idea is for this to enable us to gracefully handle
historic -> livetransition when initiating the event scanning, as blocks would be "fed" to the channel as they're fetched from the chain.Using this as the base type, we are able to create an
event scannerwrapper that handles actual event processing.