-
Notifications
You must be signed in to change notification settings - Fork 974
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
service/block: Implement block store #113
Conversation
e9b49f8
to
133367f
Compare
A question this PR raises is how to best make the most recent (arbitrary number) number of blocks quickly available for sampling as those are most likely going to be sampled from the most following a new block event in the network. Do we store the block data in mem for a while and then pop it out after X number of new blocks? |
This sounds reasonable to me, perhaps do what geth does and allow the user to specify a command line argument that sets the max RAM allowed to be used by the cache, so that very big blocks don't DoS nodes in the future. If a node has to restart for whatever reason, then you'd also have to rebuild this cache by reading the disk. I think some kind of ring buffer struct would be fine here since for sampling you'll want to access the entire block. Current PR LGTM. |
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.
👍🏼
Co-authored-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
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.
☀️🕺🏻🎉🍾
This PR implements the block store which allows block data to be stored and retrieved via the provided
DAGService
. Theblock.Service
receives anipld.DAGService
upon construction and uses it for writing and reading block data. Block data can be retrieved via theDataAvailabilityHeader
.Merging blocked by #110.
Resolves #47.
Related to #25.