Skip to content

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

Merged
merged 5 commits into from
Aug 5, 2025
Merged

feat: blob cache #5

merged 5 commits into from
Aug 5, 2025

Conversation

prestwich
Copy link
Member

@prestwich prestwich commented Aug 4, 2025

adds a blob cache that wraps a blob fetcher

this is a BREAKING change to the api

  • BlockExtraction -> BlobFetcher
  • corresponding changes to error & builder types

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@prestwich prestwich marked this pull request as ready for review August 4, 2025 17:09
@prestwich prestwich requested a review from a team as a code owner August 4, 2025 17:09
use signet_zenith::Zenith::BlockSubmitted;
use signet_zenith::ZenithBlock;
use std::{
sync::{Arc, Mutex},
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

/// # Panics
/// This function will panic if the cache task fails to spawn.
pub fn spawn(self) -> CacheHandle {
let (sender, inst) = mpsc::channel(12);
Copy link
Member

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},
Copy link
Member

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

@prestwich prestwich force-pushed the prestwich/blob-cache branch from 4125eb6 to c77ae5b Compare August 5, 2025 13:46
@prestwich prestwich merged commit 59dd6fe into main Aug 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants