Skip to content

Commit 3e88447

Browse files
authored
chore: remove unused function in OnlineBlobProvider (#875)
1 parent 874c7ed commit 3e88447

File tree

2 files changed

+8
-41
lines changed

2 files changed

+8
-41
lines changed

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rust-analyzer.rustfmt.extraArgs": [
3+
"+nightly"
4+
]
5+
}

bin/host/src/blobs.rs

+3-41
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! Contains an online implementation of the `BlobProvider` trait.
22
3-
use alloy_eips::eip4844::{Blob, BlobTransactionSidecarItem, IndexedBlobHash};
3+
use alloy_eips::eip4844::{BlobTransactionSidecarItem, IndexedBlobHash};
44
use alloy_rpc_types_beacon::sidecar::{BeaconBlobBundle, BlobData};
5-
use async_trait::async_trait;
6-
use kona_derive::{errors::BlobProviderError, traits::BlobProvider};
5+
use kona_derive::errors::BlobProviderError;
76
use op_alloy_protocol::BlockInfo;
87
use reqwest::Client;
98

@@ -62,7 +61,7 @@ impl APIGenesisResponse {
6261
}
6362
}
6463

65-
/// An online implementation of the [BlobProvider] trait.
64+
/// An online provider to fetch blob sidecars.
6665
#[derive(Debug, Clone)]
6766
pub struct OnlineBlobProvider {
6867
/// The base url.
@@ -198,40 +197,3 @@ impl OnlineBlobProvider {
198197
.collect::<Vec<BlobTransactionSidecarItem>>())
199198
}
200199
}
201-
202-
#[async_trait]
203-
impl BlobProvider for OnlineBlobProvider {
204-
type Error = BlobProviderError;
205-
206-
/// Fetches blob sidecars that were confirmed in the specified L1 block with the given indexed
207-
/// hashes. The blobs are validated for their index and hashes using the specified
208-
/// [IndexedBlobHash].
209-
async fn get_blobs(
210-
&mut self,
211-
block_ref: &BlockInfo,
212-
blob_hashes: &[IndexedBlobHash],
213-
) -> Result<Vec<Box<Blob>>, Self::Error> {
214-
// Fetch the blob sidecars for the given block reference and blob hashes.
215-
let sidecars = self.fetch_filtered_sidecars(block_ref, blob_hashes).await?;
216-
217-
// Validate the blob sidecars straight away with the num hashes.
218-
let blobs = sidecars
219-
.into_iter()
220-
.enumerate()
221-
.map(|(i, sidecar)| {
222-
let hash = blob_hashes
223-
.get(i)
224-
.ok_or(BlobProviderError::Backend("Missing blob hash".to_string()))?;
225-
match sidecar.verify_blob(&alloy_eips::eip4844::IndexedBlobHash {
226-
hash: hash.hash,
227-
index: hash.index,
228-
}) {
229-
Ok(_) => Ok(sidecar.blob),
230-
Err(e) => Err(BlobProviderError::Backend(e.to_string())),
231-
}
232-
})
233-
.collect::<Result<Vec<Box<Blob>>, BlobProviderError>>()
234-
.map_err(|e| BlobProviderError::Backend(e.to_string()))?;
235-
Ok(blobs)
236-
}
237-
}

0 commit comments

Comments
 (0)