primitives: rm alloy BlobTransactionSidecar reexport (#12310)

This commit is contained in:
Thomas Coratger
2024-11-05 15:40:10 +01:00
committed by GitHub
parent 5af551782c
commit 0e83203658
17 changed files with 40 additions and 46 deletions

View File

@ -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};
@ -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,

View File

@ -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};
@ -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,
};

View File

@ -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,
@ -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");

View File

@ -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::{

View File

@ -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};

View File

@ -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},
@ -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.

View File

@ -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.
///

View File

@ -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};

View File

@ -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};

View File

@ -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::{

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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},

View File

@ -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;
@ -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};

View File

@ -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};

View File

@ -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;