mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
primitives: rm alloy_consensus::transaction reexports (#11191)
This commit is contained in:
12
Cargo.lock
generated
12
Cargo.lock
generated
@ -6173,6 +6173,7 @@ dependencies = [
|
|||||||
name = "reth"
|
name = "reth"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
"alloy-rpc-types",
|
"alloy-rpc-types",
|
||||||
"aquamarine",
|
"aquamarine",
|
||||||
@ -6379,6 +6380,7 @@ dependencies = [
|
|||||||
name = "reth-blockchain-tree"
|
name = "reth-blockchain-tree"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"aquamarine",
|
"aquamarine",
|
||||||
@ -6427,6 +6429,7 @@ dependencies = [
|
|||||||
name = "reth-chain-state"
|
name = "reth-chain-state"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"alloy-signer",
|
"alloy-signer",
|
||||||
@ -6632,6 +6635,7 @@ dependencies = [
|
|||||||
name = "reth-consensus-common"
|
name = "reth-consensus-common"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"mockall",
|
"mockall",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
@ -7157,6 +7161,7 @@ name = "reth-eth-wire-types"
|
|||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-chains",
|
"alloy-chains",
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
@ -7297,6 +7302,7 @@ dependencies = [
|
|||||||
name = "reth-evm-ethereum"
|
name = "reth-evm-ethereum"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
@ -7319,6 +7325,7 @@ dependencies = [
|
|||||||
name = "reth-evm-optimism"
|
name = "reth-evm-optimism"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"reth-chainspec",
|
"reth-chainspec",
|
||||||
@ -7371,6 +7378,7 @@ dependencies = [
|
|||||||
name = "reth-exex"
|
name = "reth-exex"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"eyre",
|
"eyre",
|
||||||
@ -7580,6 +7588,7 @@ dependencies = [
|
|||||||
name = "reth-network"
|
name = "reth-network"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-node-bindings",
|
"alloy-node-bindings",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
@ -8291,6 +8300,7 @@ dependencies = [
|
|||||||
name = "reth-provider"
|
name = "reth-provider"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"alloy-rpc-types-engine",
|
"alloy-rpc-types-engine",
|
||||||
@ -8918,6 +8928,7 @@ dependencies = [
|
|||||||
name = "reth-testing-utils"
|
name = "reth-testing-utils"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
@ -8953,6 +8964,7 @@ dependencies = [
|
|||||||
name = "reth-transaction-pool"
|
name = "reth-transaction-pool"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
|
|||||||
@ -68,6 +68,7 @@ reth-prune.workspace = true
|
|||||||
# crypto
|
# crypto
|
||||||
alloy-rlp.workspace = true
|
alloy-rlp.workspace = true
|
||||||
alloy-rpc-types = { workspace = true, features = ["engine"] }
|
alloy-rpc-types = { workspace = true, features = ["engine"] }
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
# tracing
|
# tracing
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
//! Command for debugging block building.
|
//! Command for debugging block building.
|
||||||
|
use alloy_consensus::TxEip4844;
|
||||||
use alloy_rlp::Decodable;
|
use alloy_rlp::Decodable;
|
||||||
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
|
use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
@ -25,7 +26,7 @@ use reth_payload_builder::database::CachedReads;
|
|||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
revm_primitives::KzgSettings, Address, BlobTransaction, BlobTransactionSidecar, Bytes,
|
revm_primitives::KzgSettings, Address, BlobTransaction, BlobTransactionSidecar, Bytes,
|
||||||
PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned,
|
PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned,
|
||||||
TxEip4844, B256, U256,
|
B256, U256,
|
||||||
};
|
};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
|
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
|
||||||
|
|||||||
@ -59,6 +59,7 @@ reth-evm-ethereum.workspace = true
|
|||||||
parking_lot.workspace = true
|
parking_lot.workspace = true
|
||||||
assert_matches.workspace = true
|
assert_matches.workspace = true
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
test-utils = []
|
test-utils = []
|
||||||
|
|||||||
@ -1375,6 +1375,7 @@ where
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use alloy_consensus::TxEip1559;
|
||||||
use alloy_genesis::{Genesis, GenesisAccount};
|
use alloy_genesis::{Genesis, GenesisAccount};
|
||||||
use alloy_primitives::{keccak256, Address, Sealable, B256};
|
use alloy_primitives::{keccak256, Address, Sealable, B256};
|
||||||
use assert_matches::assert_matches;
|
use assert_matches::assert_matches;
|
||||||
@ -1390,7 +1391,7 @@ mod tests {
|
|||||||
proofs::{calculate_receipt_root, calculate_transaction_root},
|
proofs::{calculate_receipt_root, calculate_transaction_root},
|
||||||
revm_primitives::AccountInfo,
|
revm_primitives::AccountInfo,
|
||||||
Account, BlockBody, Header, Signature, Transaction, TransactionSigned,
|
Account, BlockBody, Header, Signature, Transaction, TransactionSigned,
|
||||||
TransactionSignedEcRecovered, TxEip1559, Withdrawals,
|
TransactionSignedEcRecovered, Withdrawals,
|
||||||
};
|
};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
test_utils::{
|
test_utils::{
|
||||||
|
|||||||
@ -42,12 +42,14 @@ pin-project.workspace = true
|
|||||||
# optional deps for test-utils
|
# optional deps for test-utils
|
||||||
alloy-signer = { workspace = true, optional = true }
|
alloy-signer = { workspace = true, optional = true }
|
||||||
alloy-signer-local = { workspace = true, optional = true }
|
alloy-signer-local = { workspace = true, optional = true }
|
||||||
|
alloy-consensus = { workspace = true, optional = true }
|
||||||
rand = { workspace = true, optional = true }
|
rand = { workspace = true, optional = true }
|
||||||
revm = { workspace = true, optional = true }
|
revm = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
alloy-signer.workspace = true
|
alloy-signer.workspace = true
|
||||||
alloy-signer-local.workspace = true
|
alloy-signer-local.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
revm.workspace = true
|
revm.workspace = true
|
||||||
|
|
||||||
@ -55,6 +57,7 @@ revm.workspace = true
|
|||||||
test-utils = [
|
test-utils = [
|
||||||
"alloy-signer",
|
"alloy-signer",
|
||||||
"alloy-signer-local",
|
"alloy-signer-local",
|
||||||
|
"alloy-consensus",
|
||||||
"rand",
|
"rand",
|
||||||
"revm"
|
"revm"
|
||||||
]
|
]
|
||||||
|
|||||||
@ -2,6 +2,7 @@ use crate::{
|
|||||||
in_memory::ExecutedBlock, CanonStateNotification, CanonStateNotifications,
|
in_memory::ExecutedBlock, CanonStateNotification, CanonStateNotifications,
|
||||||
CanonStateSubscriptions,
|
CanonStateSubscriptions,
|
||||||
};
|
};
|
||||||
|
use alloy_consensus::TxEip1559;
|
||||||
use alloy_primitives::{Address, BlockNumber, B256, U256};
|
use alloy_primitives::{Address, BlockNumber, B256, U256};
|
||||||
use alloy_signer::SignerSync;
|
use alloy_signer::SignerSync;
|
||||||
use alloy_signer_local::PrivateKeySigner;
|
use alloy_signer_local::PrivateKeySigner;
|
||||||
@ -13,7 +14,7 @@ use reth_primitives::{
|
|||||||
constants::{EIP1559_INITIAL_BASE_FEE, EMPTY_ROOT_HASH},
|
constants::{EIP1559_INITIAL_BASE_FEE, EMPTY_ROOT_HASH},
|
||||||
proofs::{calculate_receipt_root, calculate_transaction_root, calculate_withdrawals_root},
|
proofs::{calculate_receipt_root, calculate_transaction_root, calculate_withdrawals_root},
|
||||||
BlockBody, Header, Receipt, Receipts, Requests, SealedBlock, SealedBlockWithSenders,
|
BlockBody, Header, Receipt, Receipts, Requests, SealedBlock, SealedBlockWithSenders,
|
||||||
SealedHeader, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559,
|
SealedHeader, Transaction, TransactionSigned, TransactionSignedEcRecovered,
|
||||||
};
|
};
|
||||||
use reth_trie::{root::state_root_unhashed, updates::TrieUpdates, HashedPostState};
|
use reth_trie::{root::state_root_unhashed, updates::TrieUpdates, HashedPostState};
|
||||||
use revm::{db::BundleState, primitives::AccountInfo};
|
use revm::{db::BundleState, primitives::AccountInfo};
|
||||||
|
|||||||
@ -24,3 +24,5 @@ revm-primitives.workspace = true
|
|||||||
reth-storage-api.workspace = true
|
reth-storage-api.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
mockall = "0.12"
|
mockall = "0.12"
|
||||||
|
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|||||||
@ -302,6 +302,7 @@ pub fn validate_against_parent_4844(
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use alloy_consensus::TxEip4844;
|
||||||
use alloy_primitives::{
|
use alloy_primitives::{
|
||||||
hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, Parity, Sealable, U256,
|
hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, Parity, Sealable, U256,
|
||||||
};
|
};
|
||||||
@ -310,7 +311,7 @@ mod tests {
|
|||||||
use reth_chainspec::ChainSpecBuilder;
|
use reth_chainspec::ChainSpecBuilder;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
proofs, Account, BlockBody, BlockHashOrNumber, Signature, Transaction, TransactionSigned,
|
proofs, Account, BlockBody, BlockHashOrNumber, Signature, Transaction, TransactionSigned,
|
||||||
TxEip4844, Withdrawal, Withdrawals,
|
Withdrawal, Withdrawals,
|
||||||
};
|
};
|
||||||
use reth_storage_api::{
|
use reth_storage_api::{
|
||||||
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
|
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
|
||||||
|
|||||||
@ -36,6 +36,7 @@ reth-primitives = { workspace = true, features = ["secp256k1"] }
|
|||||||
secp256k1.workspace = true
|
secp256k1.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
|
|||||||
@ -472,6 +472,7 @@ where
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use alloy_consensus::TxLegacy;
|
||||||
use alloy_eips::{
|
use alloy_eips::{
|
||||||
eip2935::{HISTORY_STORAGE_ADDRESS, HISTORY_STORAGE_CODE},
|
eip2935::{HISTORY_STORAGE_ADDRESS, HISTORY_STORAGE_CODE},
|
||||||
eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS},
|
eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS},
|
||||||
@ -481,7 +482,7 @@ mod tests {
|
|||||||
use reth_chainspec::{ChainSpecBuilder, ForkCondition};
|
use reth_chainspec::{ChainSpecBuilder, ForkCondition};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
constants::{EMPTY_ROOT_HASH, ETH_TO_WEI},
|
constants::{EMPTY_ROOT_HASH, ETH_TO_WEI},
|
||||||
public_key_to_address, Account, Block, BlockBody, Transaction, TxLegacy,
|
public_key_to_address, Account, Block, BlockBody, Transaction,
|
||||||
};
|
};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState,
|
database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState,
|
||||||
|
|||||||
@ -57,6 +57,7 @@ reth-provider = { workspace = true, features = ["test-utils"] }
|
|||||||
reth-testing-utils.workspace = true
|
reth-testing-utils.workspace = true
|
||||||
|
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
secp256k1.workspace = true
|
secp256k1.workspace = true
|
||||||
tempfile.workspace = true
|
tempfile.workspace = true
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use alloy_consensus::TxEip2930;
|
||||||
use alloy_genesis::{Genesis, GenesisAccount};
|
use alloy_genesis::{Genesis, GenesisAccount};
|
||||||
use alloy_primitives::{b256, Address, TxKind, U256};
|
use alloy_primitives::{b256, Address, TxKind, U256};
|
||||||
use eyre::OptionExt;
|
use eyre::OptionExt;
|
||||||
@ -10,7 +11,7 @@ use reth_evm::execute::{
|
|||||||
use reth_evm_ethereum::execute::EthExecutorProvider;
|
use reth_evm_ethereum::execute::EthExecutorProvider;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
constants::ETH_TO_WEI, Block, BlockBody, BlockWithSenders, Header, Receipt, Requests,
|
constants::ETH_TO_WEI, Block, BlockBody, BlockWithSenders, Header, Receipt, Requests,
|
||||||
SealedBlockWithSenders, Transaction, TxEip2930,
|
SealedBlockWithSenders, Transaction,
|
||||||
};
|
};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::ProviderNodeTypes, BlockWriter as _, ExecutionOutcome, LatestStateProviderRef,
|
providers::ProviderNodeTypes, BlockWriter as _, ExecutionOutcome, LatestStateProviderRef,
|
||||||
|
|||||||
@ -41,6 +41,7 @@ arbitrary = { workspace = true, features = ["derive"] }
|
|||||||
proptest.workspace = true
|
proptest.workspace = true
|
||||||
proptest-arbitrary-interop.workspace = true
|
proptest-arbitrary-interop.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
arbitrary = [
|
arbitrary = [
|
||||||
|
|||||||
@ -112,11 +112,12 @@ mod tests {
|
|||||||
message::RequestPair, BlockBodies, BlockHeaders, GetBlockBodies, GetBlockHeaders,
|
message::RequestPair, BlockBodies, BlockHeaders, GetBlockBodies, GetBlockHeaders,
|
||||||
HeadersDirection,
|
HeadersDirection,
|
||||||
};
|
};
|
||||||
|
use alloy_consensus::TxLegacy;
|
||||||
use alloy_primitives::{hex, TxKind, U256};
|
use alloy_primitives::{hex, TxKind, U256};
|
||||||
use alloy_rlp::{Decodable, Encodable};
|
use alloy_rlp::{Decodable, Encodable};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
alloy_primitives::Parity, BlockHashOrNumber, Header, Signature, Transaction,
|
alloy_primitives::Parity, BlockHashOrNumber, Header, Signature, Transaction,
|
||||||
TransactionSigned, TxLegacy,
|
TransactionSigned,
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
|||||||
@ -77,12 +77,13 @@ impl FromIterator<PooledTransactionsElement> for PooledTransactions {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{message::RequestPair, GetPooledTransactions, PooledTransactions};
|
use crate::{message::RequestPair, GetPooledTransactions, PooledTransactions};
|
||||||
|
use alloy_consensus::{TxEip1559, TxLegacy};
|
||||||
use alloy_primitives::{hex, TxKind, U256};
|
use alloy_primitives::{hex, TxKind, U256};
|
||||||
use alloy_rlp::{Decodable, Encodable};
|
use alloy_rlp::{Decodable, Encodable};
|
||||||
use reth_chainspec::MIN_TRANSACTION_GAS;
|
use reth_chainspec::MIN_TRANSACTION_GAS;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
alloy_primitives::Parity, PooledTransactionsElement, Signature, Transaction,
|
alloy_primitives::Parity, PooledTransactionsElement, Signature, Transaction,
|
||||||
TransactionSigned, TxEip1559, TxLegacy,
|
TransactionSigned,
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
|||||||
@ -87,6 +87,7 @@ reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
|||||||
# alloy deps for testing against nodes
|
# alloy deps for testing against nodes
|
||||||
alloy-node-bindings.workspace = true
|
alloy-node-bindings.workspace = true
|
||||||
alloy-provider= { workspace = true, features = ["admin-api"] }
|
alloy-provider= { workspace = true, features = ["admin-api"] }
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
serial_test.workspace = true
|
serial_test.workspace = true
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use alloy_consensus::TxEip2930;
|
||||||
use alloy_primitives::{Bytes, TxKind, U256};
|
use alloy_primitives::{Bytes, TxKind, U256};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use reth_eth_wire::HeadersDirection;
|
use reth_eth_wire::HeadersDirection;
|
||||||
@ -16,7 +17,7 @@ use reth_network_p2p::{
|
|||||||
headers::client::{HeadersClient, HeadersRequest},
|
headers::client::{HeadersClient, HeadersRequest},
|
||||||
};
|
};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
alloy_primitives::Parity, Block, Header, Signature, Transaction, TransactionSigned, TxEip2930,
|
alloy_primitives::Parity, Block, Header, Signature, Transaction, TransactionSigned,
|
||||||
};
|
};
|
||||||
use reth_provider::test_utils::MockEthProvider;
|
use reth_provider::test_utils::MockEthProvider;
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use alloy_consensus::TxLegacy;
|
||||||
use alloy_primitives::U256;
|
use alloy_primitives::U256;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
use reth_network::{test_utils::Testnet, NetworkEvent, NetworkEventListenerProvider};
|
use reth_network::{test_utils::Testnet, NetworkEvent, NetworkEventListenerProvider};
|
||||||
use reth_network_api::PeersInfo;
|
use reth_network_api::PeersInfo;
|
||||||
use reth_primitives::{Signature, TransactionSigned, TxLegacy};
|
use reth_primitives::{Signature, TransactionSigned};
|
||||||
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
||||||
use reth_transaction_pool::{test_utils::TransactionGenerator, PoolTransaction, TransactionPool};
|
use reth_transaction_pool::{test_utils::TransactionGenerator, PoolTransaction, TransactionPool};
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,7 @@ tracing.workspace = true
|
|||||||
reth-revm = { workspace = true, features = ["test-utils"] }
|
reth-revm = { workspace = true, features = ["test-utils"] }
|
||||||
reth-optimism-chainspec.workspace = true
|
reth-optimism-chainspec.workspace = true
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
optimism = [
|
optimism = [
|
||||||
|
|||||||
@ -464,12 +464,12 @@ where
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::OpChainSpec;
|
use crate::OpChainSpec;
|
||||||
|
use alloy_consensus::TxEip1559;
|
||||||
use alloy_primitives::{b256, Address, StorageKey, StorageValue};
|
use alloy_primitives::{b256, Address, StorageKey, StorageValue};
|
||||||
use reth_chainspec::{ChainSpecBuilder, MIN_TRANSACTION_GAS};
|
use reth_chainspec::{ChainSpecBuilder, MIN_TRANSACTION_GAS};
|
||||||
use reth_optimism_chainspec::optimism_deposit_tx_signature;
|
use reth_optimism_chainspec::optimism_deposit_tx_signature;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
Account, Block, BlockBody, Signature, Transaction, TransactionSigned, TxEip1559,
|
Account, Block, BlockBody, Signature, Transaction, TransactionSigned, BASE_MAINNET,
|
||||||
BASE_MAINNET,
|
|
||||||
};
|
};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
database::StateProviderDatabase, test_utils::StateProviderTest, L1_BLOCK_CONTRACT,
|
database::StateProviderDatabase, test_utils::StateProviderTest, L1_BLOCK_CONTRACT,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
|
use alloy_consensus::TxEip4844;
|
||||||
use alloy_eips::eip4844::env_settings::EnvKzgSettings;
|
use alloy_eips::eip4844::env_settings::EnvKzgSettings;
|
||||||
use alloy_primitives::hex;
|
use alloy_primitives::hex;
|
||||||
use criterion::{
|
use criterion::{
|
||||||
@ -11,7 +12,7 @@ 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, TxEip4844};
|
use reth_primitives::BlobTransactionSidecar;
|
||||||
use revm_primitives::MAX_BLOB_NUMBER_PER_BLOCK;
|
use revm_primitives::MAX_BLOB_NUMBER_PER_BLOCK;
|
||||||
|
|
||||||
// constant seed to use for the rng
|
// constant seed to use for the rng
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
constants::EMPTY_TRANSACTIONS, transaction::extract_chain_id, Block, BlockBody, Signature,
|
constants::EMPTY_TRANSACTIONS, transaction::extract_chain_id, Block, BlockBody, Signature,
|
||||||
Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
|
Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxType,
|
||||||
TxEip1559, TxEip2930, TxEip4844, TxLegacy, TxType,
|
|
||||||
};
|
};
|
||||||
use alloc::{string::ToString, vec::Vec};
|
use alloc::{string::ToString, vec::Vec};
|
||||||
|
use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxLegacy};
|
||||||
use alloy_primitives::{Parity, TxKind};
|
use alloy_primitives::{Parity, TxKind};
|
||||||
use alloy_rlp::Error as RlpError;
|
use alloy_rlp::Error as RlpError;
|
||||||
use alloy_serde::WithOtherFields;
|
use alloy_serde::WithOtherFields;
|
||||||
|
|||||||
@ -63,9 +63,9 @@ pub use transaction::BlobTransactionValidationError;
|
|||||||
pub use transaction::{
|
pub use transaction::{
|
||||||
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
|
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
|
||||||
IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionMeta,
|
IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionMeta,
|
||||||
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxEip1559, TxEip2930,
|
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHashOrNumber,
|
||||||
TxEip4844, TxEip7702, TxHashOrNumber, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
|
TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||||
EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
|
LEGACY_TX_TYPE_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Re-exports
|
// Re-exports
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use crate::{keccak256, Address, BlockHashOrNumber, Bytes, TxHash, B256, U256};
|
|||||||
use alloy_eips::eip7702::SignedAuthorization;
|
use alloy_eips::eip7702::SignedAuthorization;
|
||||||
use alloy_primitives::TxKind;
|
use alloy_primitives::TxKind;
|
||||||
|
|
||||||
use alloy_consensus::SignableTransaction;
|
use alloy_consensus::{SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::Parity;
|
use alloy_primitives::Parity;
|
||||||
use alloy_rlp::{
|
use alloy_rlp::{
|
||||||
@ -18,8 +18,6 @@ use rayon::prelude::{IntoParallelIterator, ParallelIterator};
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use signature::{decode_with_eip155_chain_id, with_eip155_parity};
|
use signature::{decode_with_eip155_chain_id, with_eip155_parity};
|
||||||
|
|
||||||
pub use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
|
|
||||||
|
|
||||||
pub use error::{
|
pub use error::{
|
||||||
InvalidTransactionError, TransactionConversionError, TryFromRecoveredTransactionError,
|
InvalidTransactionError, TransactionConversionError, TryFromRecoveredTransactionError,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,11 +8,13 @@ use super::{
|
|||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
Address, BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction,
|
Address, BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction,
|
||||||
TransactionSigned, TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxHash,
|
TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID,
|
||||||
TxLegacy, B256, EIP4844_TX_TYPE_ID,
|
|
||||||
};
|
};
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use alloy_consensus::{SignableTransaction, TxEip4844WithSidecar};
|
use alloy_consensus::{
|
||||||
|
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
|
||||||
|
SignableTransaction, TxEip4844WithSidecar,
|
||||||
|
};
|
||||||
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE};
|
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE};
|
||||||
use bytes::Buf;
|
use bytes::Buf;
|
||||||
use derive_more::{AsRef, Deref};
|
use derive_more::{AsRef, Deref};
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
#![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))]
|
#![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))]
|
||||||
|
|
||||||
use crate::{
|
use crate::{keccak256, Signature, Transaction, TransactionSigned, TxHash, EIP4844_TX_TYPE_ID};
|
||||||
keccak256, Signature, Transaction, TransactionSigned, TxEip4844, TxHash, EIP4844_TX_TYPE_ID,
|
use alloy_consensus::{transaction::TxEip4844, TxEip4844WithSidecar};
|
||||||
};
|
|
||||||
use alloy_consensus::TxEip4844WithSidecar;
|
|
||||||
use alloy_rlp::{Decodable, Error as RlpError, Header};
|
use alloy_rlp::{Decodable, Error as RlpError, Header};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|||||||
@ -23,23 +23,23 @@ pub(crate) const COMPACT_IDENTIFIER_EIP1559: usize = 2;
|
|||||||
#[cfg(any(test, feature = "reth-codec"))]
|
#[cfg(any(test, feature = "reth-codec"))]
|
||||||
pub(crate) const COMPACT_EXTENDED_IDENTIFIER_FLAG: usize = 3;
|
pub(crate) const COMPACT_EXTENDED_IDENTIFIER_FLAG: usize = 3;
|
||||||
|
|
||||||
/// Identifier for legacy transaction, however [`TxLegacy`](crate::TxLegacy) this is technically not
|
/// Identifier for legacy transaction, however [`TxLegacy`](alloy_consensus::TxLegacy) this is
|
||||||
/// typed.
|
/// technically not typed.
|
||||||
pub const LEGACY_TX_TYPE_ID: u8 = 0;
|
pub const LEGACY_TX_TYPE_ID: u8 = 0;
|
||||||
|
|
||||||
/// Identifier for [`TxEip2930`](crate::TxEip2930) transaction.
|
/// Identifier for [`TxEip2930`](alloy_consensus::TxEip2930) transaction.
|
||||||
pub const EIP2930_TX_TYPE_ID: u8 = 1;
|
pub const EIP2930_TX_TYPE_ID: u8 = 1;
|
||||||
|
|
||||||
/// Identifier for [`TxEip1559`](crate::TxEip1559) transaction.
|
/// Identifier for [`TxEip1559`](alloy_consensus::TxEip1559) transaction.
|
||||||
pub const EIP1559_TX_TYPE_ID: u8 = 2;
|
pub const EIP1559_TX_TYPE_ID: u8 = 2;
|
||||||
|
|
||||||
/// Identifier for [`TxEip4844`](crate::TxEip4844) transaction.
|
/// Identifier for [`TxEip4844`](alloy_consensus::TxEip4844) transaction.
|
||||||
pub const EIP4844_TX_TYPE_ID: u8 = 3;
|
pub const EIP4844_TX_TYPE_ID: u8 = 3;
|
||||||
|
|
||||||
/// Identifier for [`TxEip7702`](crate::TxEip7702) transaction.
|
/// Identifier for [`TxEip7702`](alloy_consensus::TxEip7702) transaction.
|
||||||
pub const EIP7702_TX_TYPE_ID: u8 = 4;
|
pub const EIP7702_TX_TYPE_ID: u8 = 4;
|
||||||
|
|
||||||
/// Identifier for [`TxDeposit`](crate::TxDeposit) transaction.
|
/// Identifier for [`TxDeposit`](op_alloy_consensus::TxDeposit) transaction.
|
||||||
#[cfg(feature = "optimism")]
|
#[cfg(feature = "optimism")]
|
||||||
pub const DEPOSIT_TX_TYPE_ID: u8 = 126;
|
pub const DEPOSIT_TX_TYPE_ID: u8 = 126;
|
||||||
|
|
||||||
|
|||||||
@ -90,6 +90,8 @@ reth-testing-utils.workspace = true
|
|||||||
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
||||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||||
|
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
jsonrpsee-types.workspace = true
|
jsonrpsee-types.workspace = true
|
||||||
jsonrpsee = { workspace = true, features = ["client"] }
|
jsonrpsee = { workspace = true, features = ["client"] }
|
||||||
|
|
||||||
|
|||||||
@ -471,7 +471,7 @@ mod tests {
|
|||||||
if let Some(base_fee_per_gas) = header.base_fee_per_gas {
|
if let Some(base_fee_per_gas) = header.base_fee_per_gas {
|
||||||
let transaction = TransactionSigned {
|
let transaction = TransactionSigned {
|
||||||
transaction: reth_primitives::Transaction::Eip1559(
|
transaction: reth_primitives::Transaction::Eip1559(
|
||||||
reth_primitives::TxEip1559 {
|
alloy_consensus::TxEip1559 {
|
||||||
max_priority_fee_per_gas: random_fee,
|
max_priority_fee_per_gas: random_fee,
|
||||||
max_fee_per_gas: random_fee + base_fee_per_gas,
|
max_fee_per_gas: random_fee + base_fee_per_gas,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
||||||
/// will automatically apply to this type.
|
/// will automatically apply to this type.
|
||||||
///
|
///
|
||||||
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::transaction::TxEip1559`]
|
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::TxEip1559`]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Compact, Default, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash, Compact, Default, Serialize, Deserialize)]
|
||||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||||
#[cfg_attr(test, crate::add_arbitrary_tests(compact))]
|
#[cfg_attr(test, crate::add_arbitrary_tests(compact))]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use crate::Compact;
|
use crate::Compact;
|
||||||
use alloy_consensus::transaction::TxEip2930 as AlloyTxEip2930;
|
use alloy_consensus::TxEip2930 as AlloyTxEip2930;
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::{Bytes, ChainId, TxKind, U256};
|
use alloy_primitives::{Bytes, ChainId, TxKind, U256};
|
||||||
use reth_codecs_derive::add_arbitrary_tests;
|
use reth_codecs_derive::add_arbitrary_tests;
|
||||||
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
||||||
/// will automatically apply to this type.
|
/// will automatically apply to this type.
|
||||||
///
|
///
|
||||||
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::transaction::TxEip2930`]
|
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::TxEip2930`]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
||||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||||
#[add_arbitrary_tests(compact)]
|
#[add_arbitrary_tests(compact)]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use crate::{Compact, CompactPlaceholder};
|
use crate::{Compact, CompactPlaceholder};
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use alloy_consensus::transaction::TxEip4844 as AlloyTxEip4844;
|
use alloy_consensus::TxEip4844 as AlloyTxEip4844;
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::{Address, Bytes, ChainId, B256, U256};
|
use alloy_primitives::{Address, Bytes, ChainId, B256, U256};
|
||||||
use reth_codecs_derive::add_arbitrary_tests;
|
use reth_codecs_derive::add_arbitrary_tests;
|
||||||
@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
||||||
/// will automatically apply to this type.
|
/// will automatically apply to this type.
|
||||||
///
|
///
|
||||||
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::transaction::TxEip4844`]
|
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::TxEip4844`]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
||||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||||
#[add_arbitrary_tests(compact)]
|
#[add_arbitrary_tests(compact)]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use crate::Compact;
|
use crate::Compact;
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use alloy_consensus::transaction::TxEip7702 as AlloyTxEip7702;
|
use alloy_consensus::TxEip7702 as AlloyTxEip7702;
|
||||||
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
|
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
|
||||||
use alloy_primitives::{Address, Bytes, ChainId, U256};
|
use alloy_primitives::{Address, Bytes, ChainId, U256};
|
||||||
use reth_codecs_derive::add_arbitrary_tests;
|
use reth_codecs_derive::add_arbitrary_tests;
|
||||||
@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
/// By deriving `Compact` here, any future changes or enhancements to the `Compact` derive
|
||||||
/// will automatically apply to this type.
|
/// will automatically apply to this type.
|
||||||
///
|
///
|
||||||
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::transaction::TxEip7702`]
|
/// Notice: Make sure this struct is 1:1 with [`alloy_consensus::TxEip7702`]
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
|
||||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||||
#[add_arbitrary_tests(compact)]
|
#[add_arbitrary_tests(compact)]
|
||||||
|
|||||||
@ -64,6 +64,7 @@ strum.workspace = true
|
|||||||
# test-utils
|
# test-utils
|
||||||
once_cell = { workspace = true, optional = true }
|
once_cell = { workspace = true, optional = true }
|
||||||
reth-ethereum-engine-primitives = { workspace = true, optional = true }
|
reth-ethereum-engine-primitives = { workspace = true, optional = true }
|
||||||
|
alloy-consensus = { workspace = true, optional = true }
|
||||||
|
|
||||||
# parallel utils
|
# parallel utils
|
||||||
rayon.workspace = true
|
rayon.workspace = true
|
||||||
@ -81,6 +82,8 @@ rand.workspace = true
|
|||||||
once_cell.workspace = true
|
once_cell.workspace = true
|
||||||
eyre.workspace = true
|
eyre.workspace = true
|
||||||
|
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
optimism = ["reth-primitives/optimism", "reth-execution-types/optimism", "reth-optimism-primitives"]
|
optimism = ["reth-primitives/optimism", "reth-execution-types/optimism", "reth-optimism-primitives"]
|
||||||
serde = ["reth-execution-types/serde"]
|
serde = ["reth-execution-types/serde"]
|
||||||
@ -91,4 +94,5 @@ test-utils = [
|
|||||||
"reth-chain-state/test-utils",
|
"reth-chain-state/test-utils",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"reth-ethereum-engine-primitives",
|
"reth-ethereum-engine-primitives",
|
||||||
|
"alloy-consensus",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
//! Dummy blocks and data for tests
|
//! Dummy blocks and data for tests
|
||||||
use crate::{DatabaseProviderRW, ExecutionOutcome};
|
use crate::{DatabaseProviderRW, ExecutionOutcome};
|
||||||
|
use alloy_consensus::TxLegacy;
|
||||||
use alloy_primitives::{Log, Parity, Sealable, TxKind};
|
use alloy_primitives::{Log, Parity, Sealable, TxKind};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use reth_db::tables;
|
use reth_db::tables;
|
||||||
@ -7,7 +8,7 @@ use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
|
|||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
alloy_primitives, b256, hex_literal::hex, Account, Address, BlockBody, BlockNumber, Bytes,
|
alloy_primitives, b256, hex_literal::hex, Account, Address, BlockBody, BlockNumber, Bytes,
|
||||||
Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction,
|
Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction,
|
||||||
TransactionSigned, TxLegacy, TxType, Withdrawal, Withdrawals, B256, U256,
|
TransactionSigned, TxType, Withdrawal, Withdrawals, B256, U256,
|
||||||
};
|
};
|
||||||
use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
|
use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
|
||||||
use revm::{
|
use revm::{
|
||||||
|
|||||||
@ -54,6 +54,7 @@ rand = { workspace = true, optional = true }
|
|||||||
paste = { workspace = true, optional = true }
|
paste = { workspace = true, optional = true }
|
||||||
proptest = { workspace = true, optional = true }
|
proptest = { workspace = true, optional = true }
|
||||||
proptest-arbitrary-interop = { workspace = true, optional = true }
|
proptest-arbitrary-interop = { workspace = true, optional = true }
|
||||||
|
alloy-consensus = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reth-primitives = { workspace = true, features = ["arbitrary"] }
|
reth-primitives = { workspace = true, features = ["arbitrary"] }
|
||||||
@ -68,11 +69,12 @@ pprof = { workspace = true, features = ["criterion", "flamegraph"] }
|
|||||||
assert_matches.workspace = true
|
assert_matches.workspace = true
|
||||||
tempfile.workspace = true
|
tempfile.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["serde"]
|
default = ["serde"]
|
||||||
serde = ["dep:serde"]
|
serde = ["dep:serde"]
|
||||||
test-utils = ["rand", "paste", "serde"]
|
test-utils = ["rand", "paste", "serde", "alloy-consensus"]
|
||||||
arbitrary = ["proptest", "reth-primitives/arbitrary", "proptest-arbitrary-interop"]
|
arbitrary = ["proptest", "reth-primitives/arbitrary", "proptest-arbitrary-interop"]
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
use crate::EthPooledTransaction;
|
use crate::EthPooledTransaction;
|
||||||
|
use alloy_consensus::{TxEip1559, TxEip4844, TxLegacy};
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::{Address, TxKind, B256, U256};
|
use alloy_primitives::{Address, TxKind, B256, U256};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use reth_chainspec::MAINNET;
|
use reth_chainspec::MAINNET;
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
constants::MIN_PROTOCOL_BASE_FEE, sign_message, Bytes, Transaction, TransactionSigned,
|
constants::MIN_PROTOCOL_BASE_FEE, sign_message, Bytes, Transaction, TransactionSigned,
|
||||||
TxEip1559, TxEip4844, TxLegacy,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A generator for transactions for testing purposes.
|
/// A generator for transactions for testing purposes.
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use crate::{
|
|||||||
CoinbaseTipOrdering, EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
|
CoinbaseTipOrdering, EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
|
||||||
ValidPoolTransaction,
|
ValidPoolTransaction,
|
||||||
};
|
};
|
||||||
|
use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxLegacy};
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::{Address, Bytes, ChainId, TxHash, TxKind, B256, U256};
|
use alloy_primitives::{Address, Bytes, ChainId, TxHash, TxKind, B256, U256};
|
||||||
use paste::paste;
|
use paste::paste;
|
||||||
@ -18,9 +19,8 @@ use reth_primitives::{
|
|||||||
constants::{eip4844::DATA_GAS_PER_BLOB, MIN_PROTOCOL_BASE_FEE},
|
constants::{eip4844::DATA_GAS_PER_BLOB, MIN_PROTOCOL_BASE_FEE},
|
||||||
transaction::TryFromRecoveredTransactionError,
|
transaction::TryFromRecoveredTransactionError,
|
||||||
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
|
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
|
||||||
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559, TxEip2930,
|
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||||
TxEip4844, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID,
|
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
|
||||||
LEGACY_TX_TYPE_ID,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
|
use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
|
||||||
|
|||||||
@ -1392,10 +1392,8 @@ impl<Tx: PoolTransaction> Stream for NewSubpoolTransactionStream<Tx> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use reth_primitives::{
|
use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
|
||||||
constants::eip4844::DATA_GAS_PER_BLOB, Signature, TransactionSigned, TxEip1559, TxEip2930,
|
use reth_primitives::{constants::eip4844::DATA_GAS_PER_BLOB, Signature, TransactionSigned};
|
||||||
TxEip4844, TxEip7702, TxLegacy,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pool_size_invariants() {
|
fn test_pool_size_invariants() {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ reth-primitives = { workspace = true, features = ["secp256k1"] }
|
|||||||
alloy-eips.workspace = true
|
alloy-eips.workspace = true
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
alloy-primitives.workspace = true
|
alloy-primitives.workspace = true
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
secp256k1 = { workspace = true, features = ["rand"] }
|
secp256k1 = { workspace = true, features = ["rand"] }
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
//! Generators for different data structures like block headers, block bodies and ranges of those.
|
//! Generators for different data structures like block headers, block bodies and ranges of those.
|
||||||
|
|
||||||
|
use alloy_consensus::TxLegacy;
|
||||||
use alloy_eips::{
|
use alloy_eips::{
|
||||||
eip6110::DepositRequest, eip7002::WithdrawalRequest, eip7251::ConsolidationRequest,
|
eip6110::DepositRequest, eip7002::WithdrawalRequest, eip7251::ConsolidationRequest,
|
||||||
};
|
};
|
||||||
@ -10,7 +11,7 @@ use rand::{
|
|||||||
};
|
};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
proofs, sign_message, Account, BlockBody, Header, Log, Receipt, Request, Requests, SealedBlock,
|
proofs, sign_message, Account, BlockBody, Header, Log, Receipt, Request, Requests, SealedBlock,
|
||||||
SealedHeader, StorageEntry, Transaction, TransactionSigned, TxLegacy, Withdrawal, Withdrawals,
|
SealedHeader, StorageEntry, Transaction, TransactionSigned, Withdrawal, Withdrawals,
|
||||||
};
|
};
|
||||||
use secp256k1::{Keypair, Secp256k1};
|
use secp256k1::{Keypair, Secp256k1};
|
||||||
use std::{
|
use std::{
|
||||||
@ -497,9 +498,10 @@ pub fn random_request<R: Rng>(rng: &mut R) -> Request {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use alloy_consensus::TxEip1559;
|
||||||
use alloy_eips::eip2930::AccessList;
|
use alloy_eips::eip2930::AccessList;
|
||||||
use alloy_primitives::Parity;
|
use alloy_primitives::Parity;
|
||||||
use reth_primitives::{hex, public_key_to_address, Signature, TxEip1559};
|
use reth_primitives::{hex, public_key_to_address, Signature};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user