mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
primitives: rm alloy BlobTransactionSidecar reexport (#12310)
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
//! Command for debugging block building.
|
//! Command for debugging block building.
|
||||||
use alloy_consensus::TxEip4844;
|
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_primitives::{Address, Bytes, B256, U256};
|
||||||
use alloy_rlp::Decodable;
|
use alloy_rlp::Decodable;
|
||||||
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
|
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
|
||||||
@ -27,9 +27,8 @@ use reth_node_api::{
|
|||||||
};
|
};
|
||||||
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
|
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
revm_primitives::KzgSettings, BlobTransaction, BlobTransactionSidecar,
|
revm_primitives::KzgSettings, BlobTransaction, PooledTransactionsElement, SealedBlock,
|
||||||
PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, SealedHeader, Transaction,
|
SealedBlockWithSenders, SealedHeader, Transaction, TransactionSigned,
|
||||||
TransactionSigned,
|
|
||||||
};
|
};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
|
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
|
||||||
|
|||||||
@ -3,7 +3,10 @@
|
|||||||
//! Optimism builder support
|
//! Optimism builder support
|
||||||
|
|
||||||
use crate::{builder::decode_eip_1559_params, error::EIP1559ParamError};
|
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_primitives::{keccak256, Address, Bytes, B256, B64, U256};
|
||||||
use alloy_rlp::Encodable;
|
use alloy_rlp::Encodable;
|
||||||
use alloy_rpc_types_engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId};
|
use alloy_rpc_types_engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId};
|
||||||
@ -15,9 +18,7 @@ use reth_chainspec::EthereumHardforks;
|
|||||||
use reth_optimism_chainspec::OpChainSpec;
|
use reth_optimism_chainspec::OpChainSpec;
|
||||||
use reth_payload_builder::EthPayloadBuilderAttributes;
|
use reth_payload_builder::EthPayloadBuilderAttributes;
|
||||||
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
|
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
|
||||||
use reth_primitives::{
|
use reth_primitives::{transaction::WithEncoded, SealedBlock, TransactionSigned, Withdrawals};
|
||||||
transaction::WithEncoded, BlobTransactionSidecar, SealedBlock, TransactionSigned, Withdrawals,
|
|
||||||
};
|
|
||||||
use reth_rpc_types_compat::engine::payload::{
|
use reth_rpc_types_compat::engine::payload::{
|
||||||
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
|
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use alloy_consensus::TxEip4844;
|
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 alloy_primitives::hex;
|
||||||
use criterion::{
|
use criterion::{
|
||||||
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
||||||
@ -12,7 +14,6 @@ use proptest::{
|
|||||||
test_runner::{RngAlgorithm, TestRng, TestRunner},
|
test_runner::{RngAlgorithm, TestRng, TestRunner},
|
||||||
};
|
};
|
||||||
use proptest_arbitrary_interop::arb;
|
use proptest_arbitrary_interop::arb;
|
||||||
use reth_primitives::BlobTransactionSidecar;
|
|
||||||
|
|
||||||
// constant seed to use for the rng
|
// constant seed to use for the rng
|
||||||
const SEED: [u8; 32] = hex!("1337133713371337133713371337133713371337133713371337133713371337");
|
const SEED: [u8; 32] = hex!("1337133713371337133713371337133713371337133713371337133713371337");
|
||||||
|
|||||||
@ -47,8 +47,7 @@ pub use reth_primitives_traits::{
|
|||||||
pub use static_file::StaticFileSegment;
|
pub use static_file::StaticFileSegment;
|
||||||
|
|
||||||
pub use transaction::{
|
pub use transaction::{
|
||||||
BlobTransaction, BlobTransactionSidecar, PooledTransactionsElement,
|
BlobTransaction, PooledTransactionsElement, PooledTransactionsElementEcRecovered,
|
||||||
PooledTransactionsElementEcRecovered,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use transaction::{
|
pub use transaction::{
|
||||||
|
|||||||
@ -31,7 +31,7 @@ pub use error::{
|
|||||||
};
|
};
|
||||||
pub use meta::TransactionMeta;
|
pub use meta::TransactionMeta;
|
||||||
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
|
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
|
||||||
pub use sidecar::{BlobTransaction, BlobTransactionSidecar};
|
pub use sidecar::BlobTransaction;
|
||||||
|
|
||||||
pub use compat::FillTxEnv;
|
pub use compat::FillTxEnv;
|
||||||
pub use signature::{extract_chain_id, legacy_parity, recover_signer, recover_signer_unchecked};
|
pub use signature::{extract_chain_id, legacy_parity, recover_signer, recover_signer_unchecked};
|
||||||
|
|||||||
@ -6,10 +6,9 @@ use super::{
|
|||||||
signature::{recover_signer, with_eip155_parity},
|
signature::{recover_signer, with_eip155_parity},
|
||||||
TxEip7702,
|
TxEip7702,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{BlobTransaction, Transaction, TransactionSigned, TransactionSignedEcRecovered};
|
||||||
BlobTransaction, BlobTransactionSidecar, Transaction, TransactionSigned,
|
use alloy_eips::eip4844::BlobTransactionSidecar;
|
||||||
TransactionSignedEcRecovered,
|
|
||||||
};
|
|
||||||
use alloy_consensus::{
|
use alloy_consensus::{
|
||||||
constants::EIP4844_TX_TYPE_ID,
|
constants::EIP4844_TX_TYPE_ID,
|
||||||
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
|
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
|
||||||
@ -546,7 +545,7 @@ impl<'a> arbitrary::Arbitrary<'a> for PooledTransactionsElement {
|
|||||||
match Self::try_from(tx_signed) {
|
match Self::try_from(tx_signed) {
|
||||||
Ok(Self::BlobTransaction(mut tx)) => {
|
Ok(Self::BlobTransaction(mut tx)) => {
|
||||||
// Successfully converted to a BlobTransaction, now generate a sidecar.
|
// 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(Self::BlobTransaction(tx))
|
||||||
}
|
}
|
||||||
Ok(tx) => Ok(tx), // Successfully converted, but not a BlobTransaction.
|
Ok(tx) => Ok(tx), // Successfully converted, but not a BlobTransaction.
|
||||||
|
|||||||
@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
use crate::{Transaction, TransactionSigned};
|
use crate::{Transaction, TransactionSigned};
|
||||||
use alloy_consensus::{constants::EIP4844_TX_TYPE_ID, TxEip4844WithSidecar};
|
use alloy_consensus::{constants::EIP4844_TX_TYPE_ID, TxEip4844WithSidecar};
|
||||||
|
use alloy_eips::eip4844::BlobTransactionSidecar;
|
||||||
use alloy_primitives::{Signature, TxHash};
|
use alloy_primitives::{Signature, TxHash};
|
||||||
use alloy_rlp::Header;
|
use alloy_rlp::Header;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[doc(inline)]
|
|
||||||
pub use alloy_eips::eip4844::BlobTransactionSidecar;
|
|
||||||
|
|
||||||
/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their
|
/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their
|
||||||
/// corresponding proofs.
|
/// corresponding proofs.
|
||||||
///
|
///
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
//! A simple diskstore for blobs
|
//! A simple diskstore for blobs
|
||||||
|
|
||||||
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize};
|
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize};
|
||||||
use alloy_eips::eip4844::BlobAndProofV1;
|
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
|
||||||
use alloy_primitives::{TxHash, B256};
|
use alloy_primitives::{TxHash, B256};
|
||||||
use parking_lot::{Mutex, RwLock};
|
use parking_lot::{Mutex, RwLock};
|
||||||
use reth_primitives::BlobTransactionSidecar;
|
|
||||||
use schnellru::{ByLength, LruMap};
|
use schnellru::{ByLength, LruMap};
|
||||||
use std::{collections::HashSet, fmt, fs, io, path::PathBuf, sync::Arc};
|
use std::{collections::HashSet, fmt, fs, io, path::PathBuf, sync::Arc};
|
||||||
use tracing::{debug, trace};
|
use tracing::{debug, trace};
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
use crate::blobstore::{
|
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize};
|
||||||
BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize, BlobTransactionSidecar,
|
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
|
||||||
};
|
|
||||||
use alloy_eips::eip4844::BlobAndProofV1;
|
|
||||||
use alloy_primitives::B256;
|
use alloy_primitives::B256;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
//! Storage for blob data of EIP4844 transactions.
|
//! Storage for blob data of EIP4844 transactions.
|
||||||
|
|
||||||
use alloy_eips::eip4844::BlobAndProofV1;
|
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
|
||||||
use alloy_primitives::B256;
|
use alloy_primitives::B256;
|
||||||
pub use disk::{DiskFileBlobStore, DiskFileBlobStoreConfig, OpenDiskFileBlobStore};
|
pub use disk::{DiskFileBlobStore, DiskFileBlobStoreConfig, OpenDiskFileBlobStore};
|
||||||
pub use mem::InMemoryBlobStore;
|
pub use mem::InMemoryBlobStore;
|
||||||
pub use noop::NoopBlobStore;
|
pub use noop::NoopBlobStore;
|
||||||
use reth_primitives::BlobTransactionSidecar;
|
|
||||||
use std::{
|
use std::{
|
||||||
fmt,
|
fmt,
|
||||||
sync::{
|
sync::{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobTransactionSidecar};
|
use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError};
|
||||||
use alloy_eips::eip4844::BlobAndProofV1;
|
use alloy_eips::eip4844::{BlobAndProofV1, BlobTransactionSidecar};
|
||||||
use alloy_primitives::B256;
|
use alloy_primitives::B256;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|||||||
@ -151,12 +151,12 @@
|
|||||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||||
|
|
||||||
use crate::{identifier::TransactionId, pool::PoolInner};
|
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 alloy_primitives::{Address, TxHash, B256, U256};
|
||||||
use aquamarine as _;
|
use aquamarine as _;
|
||||||
use reth_eth_wire_types::HandleMempoolData;
|
use reth_eth_wire_types::HandleMempoolData;
|
||||||
use reth_execution_types::ChangedAccount;
|
use reth_execution_types::ChangedAccount;
|
||||||
use reth_primitives::{BlobTransactionSidecar, PooledTransactionsElement};
|
use reth_primitives::PooledTransactionsElement;
|
||||||
use reth_storage_api::StateProviderFactory;
|
use reth_storage_api::StateProviderFactory;
|
||||||
use std::{collections::HashSet, sync::Arc};
|
use std::{collections::HashSet, sync::Arc};
|
||||||
use tokio::sync::mpsc::Receiver;
|
use tokio::sync::mpsc::Receiver;
|
||||||
|
|||||||
@ -16,10 +16,12 @@ use crate::{
|
|||||||
PooledTransactionsElement, PropagatedTransactions, TransactionEvents, TransactionOrigin,
|
PooledTransactionsElement, PropagatedTransactions, TransactionEvents, TransactionOrigin,
|
||||||
TransactionPool, TransactionValidationOutcome, TransactionValidator, ValidPoolTransaction,
|
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 alloy_primitives::{Address, TxHash, B256, U256};
|
||||||
use reth_eth_wire_types::HandleMempoolData;
|
use reth_eth_wire_types::HandleMempoolData;
|
||||||
use reth_primitives::BlobTransactionSidecar;
|
|
||||||
use std::{collections::HashSet, marker::PhantomData, sync::Arc};
|
use std::{collections::HashSet, marker::PhantomData, sync::Arc};
|
||||||
use tokio::sync::{mpsc, mpsc::Receiver};
|
use tokio::sync::{mpsc, mpsc::Receiver};
|
||||||
|
|
||||||
|
|||||||
@ -86,9 +86,9 @@ use parking_lot::{Mutex, RwLock, RwLockReadGuard};
|
|||||||
use reth_eth_wire_types::HandleMempoolData;
|
use reth_eth_wire_types::HandleMempoolData;
|
||||||
use reth_execution_types::ChangedAccount;
|
use reth_execution_types::ChangedAccount;
|
||||||
|
|
||||||
|
use alloy_eips::eip4844::BlobTransactionSidecar;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
BlobTransaction, BlobTransactionSidecar, PooledTransactionsElement, TransactionSigned,
|
BlobTransaction, PooledTransactionsElement, TransactionSigned, TransactionSignedEcRecovered,
|
||||||
TransactionSignedEcRecovered,
|
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
|
|||||||
@ -14,7 +14,7 @@ use alloy_consensus::{
|
|||||||
use alloy_eips::{
|
use alloy_eips::{
|
||||||
eip1559::MIN_PROTOCOL_BASE_FEE,
|
eip1559::MIN_PROTOCOL_BASE_FEE,
|
||||||
eip2930::AccessList,
|
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 alloy_primitives::{Address, Bytes, ChainId, Signature, TxHash, TxKind, B256, U256};
|
||||||
use paste::paste;
|
use paste::paste;
|
||||||
@ -23,9 +23,8 @@ use rand::{
|
|||||||
prelude::Distribution,
|
prelude::Distribution,
|
||||||
};
|
};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
|
transaction::TryFromRecoveredTransactionError, PooledTransactionsElementEcRecovered,
|
||||||
PooledTransactionsElementEcRecovered, Transaction, TransactionSigned,
|
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||||
TransactionSignedEcRecovered, TxType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
|
use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
|
||||||
|
|||||||
@ -14,16 +14,15 @@ use alloy_consensus::{
|
|||||||
use alloy_eips::{
|
use alloy_eips::{
|
||||||
eip2718::Encodable2718,
|
eip2718::Encodable2718,
|
||||||
eip2930::AccessList,
|
eip2930::AccessList,
|
||||||
eip4844::{BlobAndProofV1, BlobTransactionValidationError},
|
eip4844::{BlobAndProofV1, BlobTransactionSidecar, BlobTransactionValidationError},
|
||||||
};
|
};
|
||||||
use alloy_primitives::{Address, TxHash, TxKind, B256, U256};
|
use alloy_primitives::{Address, TxHash, TxKind, B256, U256};
|
||||||
use futures_util::{ready, Stream};
|
use futures_util::{ready, Stream};
|
||||||
use reth_eth_wire_types::HandleMempoolData;
|
use reth_eth_wire_types::HandleMempoolData;
|
||||||
use reth_execution_types::ChangedAccount;
|
use reth_execution_types::ChangedAccount;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
|
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, PooledTransactionsElement,
|
||||||
PooledTransactionsElement, PooledTransactionsElementEcRecovered, SealedBlock, Transaction,
|
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
|
||||||
TransactionSignedEcRecovered,
|
|
||||||
};
|
};
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@ -6,9 +6,10 @@ use crate::{
|
|||||||
traits::{PoolTransaction, TransactionOrigin},
|
traits::{PoolTransaction, TransactionOrigin},
|
||||||
PriceBumpConfig,
|
PriceBumpConfig,
|
||||||
};
|
};
|
||||||
|
use alloy_eips::eip4844::BlobTransactionSidecar;
|
||||||
use alloy_primitives::{Address, TxHash, B256, U256};
|
use alloy_primitives::{Address, TxHash, B256, U256};
|
||||||
use futures_util::future::Either;
|
use futures_util::future::Either;
|
||||||
use reth_primitives::{BlobTransactionSidecar, SealedBlock, TransactionSignedEcRecovered};
|
use reth_primitives::{SealedBlock, TransactionSignedEcRecovered};
|
||||||
use std::{fmt, future::Future, time::Instant};
|
use std::{fmt, future::Future, time::Instant};
|
||||||
|
|
||||||
mod constants;
|
mod constants;
|
||||||
|
|||||||
Reference in New Issue
Block a user