Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Sep 16, 2024
1 parent c1f8d6b commit 757a639
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 24 deletions.
3 changes: 2 additions & 1 deletion crates/derive/src/online/blob_provider.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Contains an online implementation of the [BlobProvider] trait.
use alloc::{boxed::Box, string::String, vec::Vec};
pub use alloy_eips::eip4844::Blob;
use anyhow::{anyhow, ensure};
use async_trait::async_trait;
use core::marker::PhantomData;
use kona_primitives::{APIBlobSidecar, Blob, BlobSidecar, IndexedBlobHash};
use kona_primitives::{APIBlobSidecar, BlobSidecar, IndexedBlobHash};
use op_alloy_protocol::BlockInfo;
use tracing::warn;

Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/traits/data_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
//! pipeline's stages.
use alloc::{boxed::Box, fmt::Debug, vec::Vec};
use alloy_eips::eip4844::Blob;
use alloy_primitives::Bytes;
use anyhow::Result;
use async_trait::async_trait;
use kona_primitives::{Blob, IndexedBlobHash};
use kona_primitives::IndexedBlobHash;
use op_alloy_protocol::BlockInfo;

use crate::errors::{BlobProviderError, StageResult};
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/traits/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use alloy_consensus::{Header, Receipt, TxEnvelope};
use alloy_eips::eip4844::Blob;
use alloy_primitives::{Address, Bytes, B256};
use anyhow::Result;
use async_trait::async_trait;
use core::fmt::Debug;
use hashbrown::HashMap;
use kona_primitives::{Blob, IndexedBlobHash, L2ExecutionPayloadEnvelope};
use kona_primitives::{IndexedBlobHash, L2ExecutionPayloadEnvelope};
use op_alloy_genesis::{RollupConfig, SystemConfig};
use op_alloy_protocol::{BlockInfo, L2BlockInfo};

Expand Down
3 changes: 2 additions & 1 deletion crates/primitives/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use super::{L2BlockInfo, Withdrawal};
use alloc::vec::Vec;
use alloy_eips::eip4895::Withdrawal;
use alloy_primitives::{Address, Bytes, B256};
use op_alloy_protocol::L2BlockInfo;

/// Payload attributes.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
Expand Down
3 changes: 1 addition & 2 deletions crates/primitives/src/blob.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! EIP4844 Blob Type
use alloc::vec;
use alloy_eips::eip4844::{Blob, BYTES_PER_BLOB, VERSIONED_HASH_VERSION_KZG};
use alloy_primitives::{Bytes, B256};
use anyhow::Result;

use super::{Blob, BYTES_PER_BLOB, VERSIONED_HASH_VERSION_KZG};

/// The blob encoding version
pub(crate) const BLOB_ENCODING_VERSION: u8 = 0;

Expand Down
14 changes: 0 additions & 14 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@

extern crate alloc;

// Re-export `alloy-consensus` types.
pub use alloy_consensus::{
Header, Receipt, Signed, TxEip1559, TxEip2930, TxEip4844, TxEip4844Variant,
TxEip4844WithSidecar, TxEnvelope, TxLegacy,
};

// Re-export `alloy-eips` eip4844 types.
pub use alloy_eips::eip4844::{Blob, BYTES_PER_BLOB, VERSIONED_HASH_VERSION_KZG};

/// Re-export the [Withdrawal] type from the [alloy_eips] crate.
///
/// [Withdrawal]: alloy_eips::eip4895::Withdrawal
pub use alloy_eips::eip4895::Withdrawal;

pub mod block;
pub use block::{Block, BlockKind, OpBlock};

Expand Down
7 changes: 3 additions & 4 deletions crates/primitives/src/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use alloc::{string::String, vec::Vec};
use alloy_eips::eip4844::Blob;
use alloy_primitives::FixedBytes;

#[cfg(feature = "online")]
use alloy_eips::eip4844::VERSIONED_HASH_VERSION_KZG;

#[cfg(feature = "online")]
use crate::IndexedBlobHash;
#[cfg(feature = "online")]
Expand All @@ -29,10 +32,6 @@ pub const KZG_PROOF_SIZE: usize = 48;
/// KZG Commitment Size
pub const KZG_COMMITMENT_SIZE: usize = 48;

/// The versioned hash version for KZG.
#[cfg(feature = "online")]
pub(crate) const VERSIONED_HASH_VERSION_KZG: u8 = 0x01;

#[cfg(feature = "serde")]
fn parse_u64_string<'de, T, D>(de: D) -> Result<T, D::Error>
where
Expand Down

0 comments on commit 757a639

Please sign in to comment.