Skip to content
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

chore(derive): Sources Touchups #266

Merged
merged 2 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/derive/src/sources/blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
use alloc::{boxed::Box, vec::Vec};
use alloy_consensus::{Transaction, TxEip4844Variant, TxEnvelope, TxType};
use alloy_primitives::{Address, Bytes, TxKind};
use anyhow::Result;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use tracing::warn;

Expand Down Expand Up @@ -101,7 +101,7 @@ where
TxEnvelope::Eip4844(blob_tx_wrapper) => Some(blob_tx_wrapper.hash()),
_ => None,
};
warn!("Blob tx has calldata, which will be ignored: {hash:?}");
warn!(target: "blob-source", "Blob tx has calldata, which will be ignored: {hash:?}");
}
let blob_hashes = if let Some(b) = blob_hashes {
b
Expand Down Expand Up @@ -138,8 +138,8 @@ where

let blobs =
self.blob_fetcher.get_blobs(&self.block_ref, &blob_hashes).await.map_err(|e| {
warn!("Failed to fetch blobs: {e}");
anyhow::anyhow!("Failed to fetch blobs: {e}")
warn!(target: "blob-source", "Failed to fetch blobs: {e}");
anyhow!("Failed to fetch blobs: {e}")
})?;

// Fill the blob pointers.
Expand Down Expand Up @@ -196,7 +196,7 @@ where
match next_data.decode() {
Ok(d) => Some(Ok(d)),
Err(_) => {
warn!("Failed to decode blob data, skipping");
warn!(target: "blob-source", "Failed to decode blob data, skipping");
self.next().await
}
}
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/sources/calldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
use alloc::{boxed::Box, collections::VecDeque};
use alloy_consensus::{Transaction, TxEnvelope};
use alloy_primitives::{Address, Bytes, TxKind};
use anyhow::Result;
use async_trait::async_trait;

/// A data iterator that reads from calldata.
Expand Down Expand Up @@ -48,7 +49,7 @@ impl<CP: ChainProvider + Send> CalldataSource<CP> {
}

/// Loads the calldata into the source if it is not open.
async fn load_calldata(&mut self) -> anyhow::Result<()> {
async fn load_calldata(&mut self) -> Result<()> {
if self.open {
return Ok(());
}
Expand Down
Loading