mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
primitives: use alloy *_TX_TYPE_ID constants (#11853)
This commit is contained in:
@ -61,8 +61,6 @@ 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},
|
||||||
InvalidTransactionError, Signature, Transaction, TransactionMeta, TransactionSigned,
|
InvalidTransactionError, Signature, Transaction, TransactionMeta, TransactionSigned,
|
||||||
TransactionSignedEcRecovered, TransactionSignedNoHash, TxHashOrNumber, TxType,
|
TransactionSignedEcRecovered, TransactionSignedNoHash, TxHashOrNumber, TxType,
|
||||||
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
|
||||||
LEGACY_TX_TYPE_ID,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Re-exports
|
// Re-exports
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
#[cfg(feature = "reth-codec")]
|
#[cfg(feature = "reth-codec")]
|
||||||
use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR};
|
use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR};
|
||||||
use crate::{
|
use crate::{logs_bloom, TxType};
|
||||||
logs_bloom, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID,
|
|
||||||
EIP7702_TX_TYPE_ID,
|
|
||||||
};
|
|
||||||
use alloc::{vec, vec::Vec};
|
use alloc::{vec, vec::Vec};
|
||||||
|
use alloy_consensus::constants::{
|
||||||
|
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||||
|
};
|
||||||
use alloy_primitives::{Bloom, Bytes, Log, B256};
|
use alloy_primitives::{Bloom, Bytes, Log, B256};
|
||||||
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
|
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
|
||||||
use bytes::{Buf, BufMut};
|
use bytes::{Buf, BufMut};
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
//! Transaction types.
|
//! Transaction types.
|
||||||
|
|
||||||
use crate::BlockHashOrNumber;
|
use crate::BlockHashOrNumber;
|
||||||
|
#[cfg(any(test, feature = "reth-codec"))]
|
||||||
|
use alloy_consensus::constants::{EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID};
|
||||||
use alloy_consensus::{
|
use alloy_consensus::{
|
||||||
SignableTransaction, Transaction as _, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy,
|
SignableTransaction, Transaction as _, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy,
|
||||||
};
|
};
|
||||||
@ -37,10 +39,7 @@ pub use compat::FillTxEnv;
|
|||||||
pub use signature::{
|
pub use signature::{
|
||||||
extract_chain_id, legacy_parity, recover_signer, recover_signer_unchecked, Signature,
|
extract_chain_id, legacy_parity, recover_signer, recover_signer_unchecked, Signature,
|
||||||
};
|
};
|
||||||
pub use tx_type::{
|
pub use tx_type::TxType;
|
||||||
TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
|
||||||
LEGACY_TX_TYPE_ID,
|
|
||||||
};
|
|
||||||
pub use variant::TransactionSignedVariant;
|
pub use variant::TransactionSignedVariant;
|
||||||
|
|
||||||
pub(crate) mod access_list;
|
pub(crate) mod access_list;
|
||||||
|
|||||||
@ -8,9 +8,10 @@ use super::{
|
|||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
BlobTransaction, BlobTransactionSidecar, Signature, Transaction, TransactionSigned,
|
BlobTransaction, BlobTransactionSidecar, Signature, Transaction, TransactionSigned,
|
||||||
TransactionSignedEcRecovered, EIP4844_TX_TYPE_ID,
|
TransactionSignedEcRecovered,
|
||||||
};
|
};
|
||||||
use alloy_consensus::{
|
use alloy_consensus::{
|
||||||
|
constants::EIP4844_TX_TYPE_ID,
|
||||||
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
|
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
|
||||||
SignableTransaction, TxEip4844WithSidecar,
|
SignableTransaction, TxEip4844WithSidecar,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))]
|
#![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))]
|
||||||
|
|
||||||
use crate::{Signature, Transaction, TransactionSigned, EIP4844_TX_TYPE_ID};
|
use crate::{Signature, Transaction, TransactionSigned};
|
||||||
use alloy_consensus::{transaction::TxEip4844, TxEip4844WithSidecar};
|
use alloy_consensus::{
|
||||||
|
constants::EIP4844_TX_TYPE_ID, transaction::TxEip4844, TxEip4844WithSidecar,
|
||||||
|
};
|
||||||
use alloy_primitives::{keccak256, TxHash};
|
use alloy_primitives::{keccak256, TxHash};
|
||||||
use alloy_rlp::{Decodable, Error as RlpError, Header};
|
use alloy_rlp::{Decodable, Error as RlpError, Header};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
use alloy_consensus::constants::{
|
||||||
|
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||||
|
LEGACY_TX_TYPE_ID,
|
||||||
|
};
|
||||||
use alloy_primitives::{U64, U8};
|
use alloy_primitives::{U64, U8};
|
||||||
use alloy_rlp::{Decodable, Encodable};
|
use alloy_rlp::{Decodable, Encodable};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -23,22 +27,6 @@ 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`](alloy_consensus::TxLegacy) this is
|
|
||||||
/// technically not typed.
|
|
||||||
pub const LEGACY_TX_TYPE_ID: u8 = 0;
|
|
||||||
|
|
||||||
/// Identifier for [`TxEip2930`](alloy_consensus::TxEip2930) transaction.
|
|
||||||
pub const EIP2930_TX_TYPE_ID: u8 = 1;
|
|
||||||
|
|
||||||
/// Identifier for [`TxEip1559`](alloy_consensus::TxEip1559) transaction.
|
|
||||||
pub const EIP1559_TX_TYPE_ID: u8 = 2;
|
|
||||||
|
|
||||||
/// Identifier for [`TxEip4844`](alloy_consensus::TxEip4844) transaction.
|
|
||||||
pub const EIP4844_TX_TYPE_ID: u8 = 3;
|
|
||||||
|
|
||||||
/// Identifier for [`TxEip7702`](alloy_consensus::TxEip7702) transaction.
|
|
||||||
pub const EIP7702_TX_TYPE_ID: u8 = 4;
|
|
||||||
|
|
||||||
/// Identifier for [`TxDeposit`](op_alloy_consensus::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;
|
||||||
|
|||||||
@ -2,11 +2,9 @@ use crate::{
|
|||||||
pool::{NEW_TX_LISTENER_BUFFER_SIZE, PENDING_TX_LISTENER_BUFFER_SIZE},
|
pool::{NEW_TX_LISTENER_BUFFER_SIZE, PENDING_TX_LISTENER_BUFFER_SIZE},
|
||||||
PoolSize, TransactionOrigin,
|
PoolSize, TransactionOrigin,
|
||||||
};
|
};
|
||||||
|
use alloy_consensus::constants::EIP4844_TX_TYPE_ID;
|
||||||
use alloy_primitives::Address;
|
use alloy_primitives::Address;
|
||||||
use reth_primitives::{
|
use reth_primitives::constants::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE};
|
||||||
constants::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE},
|
|
||||||
EIP4844_TX_TYPE_ID,
|
|
||||||
};
|
|
||||||
use std::{collections::HashSet, ops::Mul};
|
use std::{collections::HashSet, ops::Mul};
|
||||||
|
|
||||||
/// Guarantees max transactions for one sender, compatible with geth/erigon
|
/// Guarantees max transactions for one sender, compatible with geth/erigon
|
||||||
|
|||||||
@ -18,14 +18,14 @@ use crate::{
|
|||||||
PoolConfig, PoolResult, PoolTransaction, PriceBumpConfig, TransactionOrdering,
|
PoolConfig, PoolResult, PoolTransaction, PriceBumpConfig, TransactionOrdering,
|
||||||
ValidPoolTransaction, U256,
|
ValidPoolTransaction, U256,
|
||||||
};
|
};
|
||||||
use alloy_primitives::{Address, TxHash, B256};
|
use alloy_consensus::constants::{
|
||||||
use reth_primitives::{
|
|
||||||
constants::{
|
|
||||||
eip4844::BLOB_TX_MIN_BLOB_GASPRICE, ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE,
|
|
||||||
},
|
|
||||||
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||||
LEGACY_TX_TYPE_ID,
|
LEGACY_TX_TYPE_ID,
|
||||||
};
|
};
|
||||||
|
use alloy_primitives::{Address, TxHash, B256};
|
||||||
|
use reth_primitives::constants::{
|
||||||
|
eip4844::BLOB_TX_MIN_BLOB_GASPRICE, ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE,
|
||||||
|
};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::{
|
use std::{
|
||||||
|
|||||||
@ -7,7 +7,10 @@ use crate::{
|
|||||||
CoinbaseTipOrdering, EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
|
CoinbaseTipOrdering, EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
|
||||||
ValidPoolTransaction,
|
ValidPoolTransaction,
|
||||||
};
|
};
|
||||||
use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxLegacy};
|
use alloy_consensus::{
|
||||||
|
constants::{EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID},
|
||||||
|
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;
|
||||||
@ -20,7 +23,6 @@ use reth_primitives::{
|
|||||||
transaction::TryFromRecoveredTransactionError,
|
transaction::TryFromRecoveredTransactionError,
|
||||||
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
|
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
|
||||||
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||||
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_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};
|
||||||
|
|||||||
@ -7,7 +7,10 @@ use crate::{
|
|||||||
validate::ValidPoolTransaction,
|
validate::ValidPoolTransaction,
|
||||||
AllTransactionsEvents,
|
AllTransactionsEvents,
|
||||||
};
|
};
|
||||||
use alloy_consensus::Transaction as _;
|
use alloy_consensus::{
|
||||||
|
constants::{EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID},
|
||||||
|
Transaction as _,
|
||||||
|
};
|
||||||
use alloy_eips::{eip2718::Encodable2718, eip2930::AccessList, eip4844::BlobAndProofV1};
|
use alloy_eips::{eip2718::Encodable2718, eip2930::AccessList, eip4844::BlobAndProofV1};
|
||||||
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};
|
||||||
@ -17,7 +20,6 @@ use reth_primitives::{
|
|||||||
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
|
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
|
||||||
BlobTransactionValidationError, PooledTransactionsElement,
|
BlobTransactionValidationError, PooledTransactionsElement,
|
||||||
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
|
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
|
||||||
EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
|
||||||
};
|
};
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@ -11,11 +11,13 @@ use crate::{
|
|||||||
EthBlobTransactionSidecar, EthPoolTransaction, LocalTransactionConfig, PoolTransaction,
|
EthBlobTransactionSidecar, EthPoolTransaction, LocalTransactionConfig, PoolTransaction,
|
||||||
TransactionValidationOutcome, TransactionValidationTaskExecutor, TransactionValidator,
|
TransactionValidationOutcome, TransactionValidationTaskExecutor, TransactionValidator,
|
||||||
};
|
};
|
||||||
|
use alloy_consensus::constants::{
|
||||||
|
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||||
|
LEGACY_TX_TYPE_ID,
|
||||||
|
};
|
||||||
use reth_chainspec::{ChainSpec, EthereumHardforks};
|
use reth_chainspec::{ChainSpec, EthereumHardforks};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
constants::eip4844::MAX_BLOBS_PER_BLOCK, GotExpected, InvalidTransactionError, SealedBlock,
|
constants::eip4844::MAX_BLOBS_PER_BLOCK, GotExpected, InvalidTransactionError, SealedBlock,
|
||||||
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
|
||||||
LEGACY_TX_TYPE_ID,
|
|
||||||
};
|
};
|
||||||
use reth_storage_api::{AccountReader, StateProviderFactory};
|
use reth_storage_api::{AccountReader, StateProviderFactory};
|
||||||
use reth_tasks::TaskSpawner;
|
use reth_tasks::TaskSpawner;
|
||||||
|
|||||||
Reference in New Issue
Block a user