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

primitives: rm alloy BlobTransactionSidecar reexport #12310

Merged
merged 5 commits into from
Nov 5, 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
7 changes: 3 additions & 4 deletions bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Command for debugging block building.
use alloy_consensus::TxEip4844;
use alloy_eips::eip2718::Encodable2718;
use alloy_eips::{eip2718::Encodable2718, eip4844::BlobTransactionSidecar};
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rlp::Decodable;
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
Expand All @@ -27,9 +27,8 @@ use reth_node_api::{
};
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
use reth_primitives::{
revm_primitives::KzgSettings, BlobTransaction, BlobTransactionSidecar,
PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, SealedHeader, Transaction,
TransactionSigned,
revm_primitives::KzgSettings, BlobTransaction, PooledTransactionsElement, SealedBlock,
SealedBlockWithSenders, SealedHeader, Transaction, TransactionSigned,
};
use reth_provider::{
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
Expand Down
9 changes: 5 additions & 4 deletions crates/optimism/payload/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
//! Optimism builder support

use crate::{builder::decode_eip_1559_params, error::EIP1559ParamError};
use alloy_eips::{eip1559::BaseFeeParams, eip2718::Decodable2718, eip7685::Requests};
use alloy_eips::{
eip1559::BaseFeeParams, eip2718::Decodable2718, eip4844::BlobTransactionSidecar,
eip7685::Requests,
};
use alloy_primitives::{keccak256, Address, Bytes, B256, B64, U256};
use alloy_rlp::Encodable;
use alloy_rpc_types_engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId};
Expand All @@ -15,9 +18,7 @@ use reth_chainspec::EthereumHardforks;
use reth_optimism_chainspec::OpChainSpec;
use reth_payload_builder::EthPayloadBuilderAttributes;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
use reth_primitives::{
transaction::WithEncoded, BlobTransactionSidecar, SealedBlock, TransactionSigned, Withdrawals,
};
use reth_primitives::{transaction::WithEncoded, SealedBlock, TransactionSigned, Withdrawals};
use reth_rpc_types_compat::engine::payload::{
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
};
Expand Down
5 changes: 3 additions & 2 deletions crates/primitives/benches/validate_blob_tx.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#![allow(missing_docs)]

use alloy_consensus::TxEip4844;
use alloy_eips::eip4844::{env_settings::EnvKzgSettings, MAX_BLOBS_PER_BLOCK};
use alloy_eips::eip4844::{
env_settings::EnvKzgSettings, BlobTransactionSidecar, MAX_BLOBS_PER_BLOCK,
};
use alloy_primitives::hex;
use criterion::{
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
Expand All @@ -12,7 +14,6 @@ use proptest::{
test_runner::{RngAlgorithm, TestRng, TestRunner},
};
use proptest_arbitrary_interop::arb;
use reth_primitives::BlobTransactionSidecar;

// constant seed to use for the rng
const SEED: [u8; 32] = hex!("1337133713371337133713371337133713371337133713371337133713371337");
Expand Down
3 changes: 1 addition & 2 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ pub use reth_primitives_traits::{
pub use static_file::StaticFileSegment;

pub use transaction::{
BlobTransaction, BlobTransactionSidecar, PooledTransactionsElement,
PooledTransactionsElementEcRecovered,
BlobTransaction, PooledTransactionsElement, PooledTransactionsElementEcRecovered,
};

pub use transaction::{
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use error::{
};
pub use meta::TransactionMeta;
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
pub use sidecar::{BlobTransaction, BlobTransactionSidecar};
pub use sidecar::BlobTransaction;

pub use compat::FillTxEnv;
pub use signature::{extract_chain_id, legacy_parity, recover_signer, recover_signer_unchecked};
Expand Down
9 changes: 4 additions & 5 deletions crates/primitives/src/transaction/pooled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ use super::{
signature::{recover_signer, with_eip155_parity},
TxEip7702,
};
use crate::{
BlobTransaction, BlobTransactionSidecar, Transaction, TransactionSigned,
TransactionSignedEcRecovered,
};
use crate::{BlobTransaction, Transaction, TransactionSigned, TransactionSignedEcRecovered};
use alloy_eips::eip4844::BlobTransactionSidecar;

use alloy_consensus::{
constants::EIP4844_TX_TYPE_ID,
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
Expand Down Expand Up @@ -546,7 +545,7 @@ impl<'a> arbitrary::Arbitrary<'a> for PooledTransactionsElement {
match Self::try_from(tx_signed) {
Ok(Self::BlobTransaction(mut tx)) => {
// Successfully converted to a BlobTransaction, now generate a sidecar.
tx.transaction.sidecar = crate::BlobTransactionSidecar::arbitrary(u)?;
tx.transaction.sidecar = alloy_eips::eip4844::BlobTransactionSidecar::arbitrary(u)?;
Ok(Self::BlobTransaction(tx))
}
Ok(tx) => Ok(tx), // Successfully converted, but not a BlobTransaction.
Expand Down
4 changes: 1 addition & 3 deletions crates/primitives/src/transaction/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

use crate::{Transaction, TransactionSigned};
use alloy_consensus::{constants::EIP4844_TX_TYPE_ID, TxEip4844WithSidecar};
use alloy_eips::eip4844::BlobTransactionSidecar;
use alloy_primitives::{Signature, TxHash};
use alloy_rlp::Header;
use serde::{Deserialize, Serialize};

#[doc(inline)]
pub use alloy_eips::eip4844::BlobTransactionSidecar;

/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their
/// corresponding proofs.
///
Expand Down
3 changes: 1 addition & 2 deletions crates/transaction-pool/src/blobstore/disk.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//! A simple diskstore for blobs

use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize};
use alloy_eips::eip4844::BlobAndProofV1;
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
use alloy_primitives::{TxHash, B256};
use parking_lot::{Mutex, RwLock};
use reth_primitives::BlobTransactionSidecar;
use schnellru::{ByLength, LruMap};
use std::{collections::HashSet, fmt, fs, io, path::PathBuf, sync::Arc};
use tracing::{debug, trace};
Expand Down
6 changes: 2 additions & 4 deletions crates/transaction-pool/src/blobstore/mem.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::blobstore::{
BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize, BlobTransactionSidecar,
};
use alloy_eips::eip4844::BlobAndProofV1;
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize};
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
use alloy_primitives::B256;
use parking_lot::RwLock;
use std::{collections::HashMap, sync::Arc};
Expand Down
3 changes: 1 addition & 2 deletions crates/transaction-pool/src/blobstore/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! Storage for blob data of EIP4844 transactions.

use alloy_eips::eip4844::BlobAndProofV1;
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
use alloy_primitives::B256;
pub use disk::{DiskFileBlobStore, DiskFileBlobStoreConfig, OpenDiskFileBlobStore};
pub use mem::InMemoryBlobStore;
pub use noop::NoopBlobStore;
use reth_primitives::BlobTransactionSidecar;
use std::{
fmt,
sync::{
Expand Down
4 changes: 2 additions & 2 deletions crates/transaction-pool/src/blobstore/noop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobTransactionSidecar};
use alloy_eips::eip4844::BlobAndProofV1;
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError};
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
use alloy_primitives::B256;
use std::sync::Arc;

Expand Down
4 changes: 2 additions & 2 deletions crates/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use crate::{identifier::TransactionId, pool::PoolInner};
use alloy_eips::eip4844::BlobAndProofV1;
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
use alloy_primitives::{Address, TxHash, B256, U256};
use aquamarine as _;
use reth_eth_wire_types::HandleMempoolData;
use reth_execution_types::ChangedAccount;
use reth_primitives::{BlobTransactionSidecar, PooledTransactionsElement};
use reth_primitives::PooledTransactionsElement;
use reth_storage_api::StateProviderFactory;
use std::{collections::HashSet, sync::Arc};
use tokio::sync::mpsc::Receiver;
Expand Down
6 changes: 4 additions & 2 deletions crates/transaction-pool/src/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ use crate::{
PooledTransactionsElement, PropagatedTransactions, TransactionEvents, TransactionOrigin,
TransactionPool, TransactionValidationOutcome, TransactionValidator, ValidPoolTransaction,
};
use alloy_eips::{eip1559::ETHEREUM_BLOCK_GAS_LIMIT, eip4844::BlobAndProofV1};
use alloy_eips::{
eip1559::ETHEREUM_BLOCK_GAS_LIMIT,
eip4844::{BlobAndProofV1, BlobTransactionSidecar},
};
use alloy_primitives::{Address, TxHash, B256, U256};
use reth_eth_wire_types::HandleMempoolData;
use reth_primitives::BlobTransactionSidecar;
use std::{collections::HashSet, marker::PhantomData, sync::Arc};
use tokio::sync::{mpsc, mpsc::Receiver};

Expand Down
4 changes: 2 additions & 2 deletions crates/transaction-pool/src/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ use parking_lot::{Mutex, RwLock, RwLockReadGuard};
use reth_eth_wire_types::HandleMempoolData;
use reth_execution_types::ChangedAccount;

use alloy_eips::eip4844::BlobTransactionSidecar;
use reth_primitives::{
BlobTransaction, BlobTransactionSidecar, PooledTransactionsElement, TransactionSigned,
TransactionSignedEcRecovered,
BlobTransaction, PooledTransactionsElement, TransactionSigned, TransactionSignedEcRecovered,
};
use std::{
collections::{HashMap, HashSet},
Expand Down
7 changes: 3 additions & 4 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use alloy_consensus::{
use alloy_eips::{
eip1559::MIN_PROTOCOL_BASE_FEE,
eip2930::AccessList,
eip4844::{BlobTransactionValidationError, DATA_GAS_PER_BLOB},
eip4844::{BlobTransactionSidecar, BlobTransactionValidationError, DATA_GAS_PER_BLOB},
};
use alloy_primitives::{Address, Bytes, ChainId, Signature, TxHash, TxKind, B256, U256};
use paste::paste;
Expand All @@ -23,9 +23,8 @@ use rand::{
prelude::Distribution,
};
use reth_primitives::{
transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
PooledTransactionsElementEcRecovered, Transaction, TransactionSigned,
TransactionSignedEcRecovered, TxType,
transaction::TryFromRecoveredTransactionError, PooledTransactionsElementEcRecovered,
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
};

use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
Expand Down
7 changes: 3 additions & 4 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ use alloy_consensus::{
use alloy_eips::{
eip2718::Encodable2718,
eip2930::AccessList,
eip4844::{BlobAndProofV1, BlobTransactionValidationError},
eip4844::{BlobAndProofV1, BlobTransactionSidecar, BlobTransactionValidationError},
};
use alloy_primitives::{Address, TxHash, TxKind, B256, U256};
use futures_util::{ready, Stream};
use reth_eth_wire_types::HandleMempoolData;
use reth_execution_types::ChangedAccount;
use reth_primitives::{
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
PooledTransactionsElement, PooledTransactionsElementEcRecovered, SealedBlock, Transaction,
TransactionSignedEcRecovered,
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, PooledTransactionsElement,
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down
3 changes: 2 additions & 1 deletion crates/transaction-pool/src/validate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ use crate::{
traits::{PoolTransaction, TransactionOrigin},
PriceBumpConfig,
};
use alloy_eips::eip4844::BlobTransactionSidecar;
use alloy_primitives::{Address, TxHash, B256, U256};
use futures_util::future::Either;
use reth_primitives::{BlobTransactionSidecar, SealedBlock, TransactionSignedEcRecovered};
use reth_primitives::{SealedBlock, TransactionSignedEcRecovered};
use std::{fmt, future::Future, time::Instant};

mod constants;
Expand Down
Loading