-
Notifications
You must be signed in to change notification settings - Fork 0
feat: blob cache #5
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
use signet_zenith::Zenith::BlockSubmitted; | ||
use signet_zenith::ZenithBlock; | ||
use std::{ | ||
sync::{Arc, Mutex}, |
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 should use the tokio Mutex, not the std one. we want to yield back to the executor when acquiring a lock
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.
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.
ah good catch. we're only holding data so it's fine
crates/blobber/src/cache.rs
Outdated
/// # Panics | ||
/// This function will panic if the cache task fails to spawn. | ||
pub fn spawn(self) -> CacheHandle { | ||
let (sender, inst) = mpsc::channel(12); |
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 number should also be a constant
use signet_zenith::Zenith::BlockSubmitted; | ||
use signet_zenith::ZenithBlock; | ||
use std::{ | ||
sync::{Arc, Mutex}, |
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.
ah good catch. we're only holding data so it's fine
4125eb6
to
c77ae5b
Compare
adds a blob cache that wraps a blob fetcher
this is a BREAKING change to the api
BlockExtraction
->BlobFetcher