mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: use alloy TransactionMeta (#13632)
This commit is contained in:
@ -4,7 +4,7 @@ use crate::{
|
||||
CanonStateNotification, CanonStateNotificationSender, CanonStateNotifications,
|
||||
ChainInfoTracker, MemoryOverlayStateProvider,
|
||||
};
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
|
||||
use alloy_eips::{eip2718::Encodable2718, BlockHashOrNumber, BlockNumHash};
|
||||
use alloy_primitives::{map::HashMap, Address, TxHash, B256};
|
||||
use parking_lot::RwLock;
|
||||
@ -13,7 +13,7 @@ use reth_execution_types::{Chain, ExecutionOutcome};
|
||||
use reth_metrics::{metrics::Gauge, Metrics};
|
||||
use reth_primitives::{
|
||||
BlockWithSenders, EthPrimitives, NodePrimitives, Receipts, SealedBlock, SealedBlockFor,
|
||||
SealedBlockWithSenders, SealedHeader, TransactionMeta,
|
||||
SealedBlockWithSenders, SealedHeader,
|
||||
};
|
||||
use reth_primitives_traits::{Block, BlockBody as _, SignedTransaction};
|
||||
use reth_storage_api::StateProviderBox;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//! Loads and formats OP block RPC response.
|
||||
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
|
||||
use alloy_rpc_types_eth::BlockId;
|
||||
use op_alloy_network::Network;
|
||||
use op_alloy_rpc_types::OpTransactionReceipt;
|
||||
@ -8,7 +8,6 @@ use reth_chainspec::ChainSpecProvider;
|
||||
use reth_node_api::BlockBody;
|
||||
use reth_optimism_chainspec::OpChainSpec;
|
||||
use reth_optimism_primitives::{OpReceipt, OpTransactionSigned};
|
||||
use reth_primitives::TransactionMeta;
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_provider::{BlockReader, HeaderProvider};
|
||||
use reth_rpc_eth_api::{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
//! Loads and formats OP receipt RPC response.
|
||||
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use alloy_eips::eip2718::Encodable2718;
|
||||
use alloy_rpc_types_eth::{Log, TransactionReceipt};
|
||||
use op_alloy_consensus::{OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope};
|
||||
@ -9,7 +10,6 @@ use reth_optimism_chainspec::OpChainSpec;
|
||||
use reth_optimism_evm::RethL1BlockInfo;
|
||||
use reth_optimism_forks::OpHardforks;
|
||||
use reth_optimism_primitives::{OpReceipt, OpTransactionSigned};
|
||||
use reth_primitives::TransactionMeta;
|
||||
use reth_provider::{ChainSpecProvider, ReceiptProvider, TransactionsProvider};
|
||||
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcReceipt};
|
||||
use reth_rpc_eth_types::{receipt::build_receipt, EthApiError};
|
||||
|
||||
@ -6,6 +6,8 @@ pub mod signed;
|
||||
|
||||
pub mod error;
|
||||
|
||||
pub use alloy_consensus::transaction::{TransactionInfo, TransactionMeta};
|
||||
|
||||
use crate::{InMemorySize, MaybeCompact, MaybeSerde};
|
||||
use core::{fmt, hash::Hash};
|
||||
|
||||
|
||||
@ -43,11 +43,14 @@ pub use reth_primitives_traits::{
|
||||
};
|
||||
pub use static_file::StaticFileSegment;
|
||||
|
||||
pub use alloy_consensus::{transaction::PooledTransaction, ReceiptWithBloom};
|
||||
pub use alloy_consensus::{
|
||||
transaction::{PooledTransaction, TransactionMeta},
|
||||
ReceiptWithBloom,
|
||||
};
|
||||
pub use transaction::{
|
||||
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
|
||||
InvalidTransactionError, PooledTransactionsElementEcRecovered, RecoveredTx, Transaction,
|
||||
TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||
TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||
};
|
||||
|
||||
// Re-exports
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
use alloy_primitives::B256;
|
||||
|
||||
/// Additional fields in the context of a block that contains this transaction.
|
||||
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)]
|
||||
pub struct TransactionMeta {
|
||||
/// Hash of the transaction.
|
||||
pub tx_hash: B256,
|
||||
/// Index of the transaction in the block
|
||||
pub index: u64,
|
||||
/// Hash of the block.
|
||||
pub block_hash: B256,
|
||||
/// Number of the block.
|
||||
pub block_number: u64,
|
||||
/// Base fee of the block.
|
||||
pub base_fee: Option<u64>,
|
||||
/// The excess blob gas of the block.
|
||||
pub excess_blob_gas: Option<u64>,
|
||||
/// The block's timestamp.
|
||||
pub timestamp: u64,
|
||||
}
|
||||
@ -19,7 +19,6 @@ use alloy_primitives::{
|
||||
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header};
|
||||
use core::hash::{Hash, Hasher};
|
||||
use derive_more::{AsRef, Deref};
|
||||
pub use meta::TransactionMeta;
|
||||
use once_cell as _;
|
||||
#[cfg(not(feature = "std"))]
|
||||
use once_cell::sync::{Lazy as LazyLock, OnceCell as OnceLock};
|
||||
@ -49,7 +48,6 @@ pub mod signature;
|
||||
pub mod util;
|
||||
|
||||
pub(crate) mod access_list;
|
||||
mod meta;
|
||||
mod pooled;
|
||||
mod tx_type;
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
//! Loads a receipt from database. Helper trait for `eth_` block and transaction RPC methods, that
|
||||
//! loads receipt data w.r.t. network.
|
||||
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use futures::Future;
|
||||
use reth_primitives::TransactionMeta;
|
||||
use reth_provider::{ProviderReceipt, ProviderTx, ReceiptProvider, TransactionsProvider};
|
||||
|
||||
use crate::{EthApiTypes, RpcNodeCoreExt, RpcReceipt};
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
//! Database access for `eth_` transaction RPC methods. Loads transaction and receipt data w.r.t.
|
||||
//! network.
|
||||
|
||||
use alloy_consensus::{BlockHeader, Transaction};
|
||||
use super::{EthApiSpec, EthSigner, LoadBlock, LoadReceipt, LoadState, SpawnBlocking};
|
||||
use crate::{
|
||||
helpers::estimate::EstimateCall, FromEthApiError, FullEthApiTypes, IntoEthApiError,
|
||||
RpcNodeCore, RpcNodeCoreExt, RpcReceipt, RpcTransaction,
|
||||
};
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader, Transaction};
|
||||
use alloy_dyn_abi::TypedData;
|
||||
use alloy_eips::{eip2718::Encodable2718, BlockId};
|
||||
use alloy_network::TransactionBuilder;
|
||||
@ -9,9 +14,7 @@ use alloy_primitives::{Address, Bytes, TxHash, B256};
|
||||
use alloy_rpc_types_eth::{transaction::TransactionRequest, BlockNumberOrTag, TransactionInfo};
|
||||
use futures::Future;
|
||||
use reth_node_api::BlockBody;
|
||||
use reth_primitives::{
|
||||
transaction::SignedTransactionIntoRecoveredExt, SealedBlockWithSenders, TransactionMeta,
|
||||
};
|
||||
use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, SealedBlockWithSenders};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_provider::{
|
||||
BlockNumReader, BlockReaderIdExt, ProviderBlock, ProviderReceipt, ProviderTx, ReceiptProvider,
|
||||
@ -22,12 +25,6 @@ use reth_rpc_types_compat::transaction::{from_recovered, from_recovered_with_blo
|
||||
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::{EthApiSpec, EthSigner, LoadBlock, LoadReceipt, LoadState, SpawnBlocking};
|
||||
use crate::{
|
||||
helpers::estimate::EstimateCall, FromEthApiError, FullEthApiTypes, IntoEthApiError,
|
||||
RpcNodeCore, RpcNodeCoreExt, RpcReceipt, RpcTransaction,
|
||||
};
|
||||
|
||||
/// Transaction related functions for the [`EthApiServer`](crate::EthApiServer) trait in
|
||||
/// the `eth_` namespace.
|
||||
///
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
//! RPC receipt response builder, extends a layer one receipt with layer two data.
|
||||
|
||||
use super::{EthApiError, EthResult};
|
||||
use alloy_consensus::{ReceiptEnvelope, TxReceipt};
|
||||
use alloy_consensus::{transaction::TransactionMeta, ReceiptEnvelope, TxReceipt};
|
||||
use alloy_primitives::{Address, TxKind};
|
||||
use alloy_rpc_types_eth::{Log, ReceiptWithBloom, TransactionReceipt};
|
||||
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned, TxType};
|
||||
use reth_primitives::{Receipt, TransactionSigned, TxType};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
|
||||
/// Builds an [`TransactionReceipt`] obtaining the inner receipt envelope from the given closure.
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
//! Contains RPC handler implementations specific to blocks.
|
||||
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
|
||||
use alloy_rpc_types_eth::{BlockId, TransactionReceipt};
|
||||
use reth_primitives::TransactionMeta;
|
||||
use reth_primitives_traits::{BlockBody, SignedTransaction};
|
||||
use reth_provider::BlockReader;
|
||||
use reth_rpc_eth_api::{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
//! Builds an RPC receipt response w.r.t. data layout of network.
|
||||
|
||||
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned};
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use reth_primitives::{Receipt, TransactionSigned};
|
||||
use reth_provider::{BlockReader, ReceiptProvider, TransactionsProvider};
|
||||
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcNodeCoreExt, RpcReceipt};
|
||||
use reth_rpc_eth_types::{EthApiError, EthReceiptBuilder};
|
||||
|
||||
@ -9,7 +9,7 @@ use crate::{
|
||||
StageCheckpointReader, StateProviderBox, StateProviderFactory, StateReader,
|
||||
StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::Header;
|
||||
use alloy_consensus::{transaction::TransactionMeta, Header};
|
||||
use alloy_eips::{
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag,
|
||||
@ -28,8 +28,7 @@ use reth_execution_types::ExecutionOutcome;
|
||||
use reth_node_types::{BlockTy, HeaderTy, NodeTypesWithDB, ReceiptTy, TxTy};
|
||||
use reth_primitives::{
|
||||
Account, Block, BlockWithSenders, EthPrimitives, NodePrimitives, Receipt, SealedBlock,
|
||||
SealedBlockFor, SealedBlockWithSenders, SealedHeader, StorageEntry, TransactionMeta,
|
||||
TransactionSigned,
|
||||
SealedBlockFor, SealedBlockWithSenders, SealedHeader, StorageEntry, TransactionSigned,
|
||||
};
|
||||
use reth_primitives_traits::BlockBody as _;
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
|
||||
@ -6,7 +6,7 @@ use crate::{
|
||||
StageCheckpointReader, StateReader, StaticFileProviderFactory, TransactionVariant,
|
||||
TransactionsProvider, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
|
||||
use alloy_eips::{
|
||||
eip2718::Encodable2718,
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
@ -21,7 +21,6 @@ use reth_execution_types::{BundleStateInit, ExecutionOutcome, RevertsInit};
|
||||
use reth_node_types::{BlockTy, HeaderTy, ReceiptTy, TxTy};
|
||||
use reth_primitives::{
|
||||
Account, BlockWithSenders, SealedBlockFor, SealedBlockWithSenders, SealedHeader, StorageEntry,
|
||||
TransactionMeta,
|
||||
};
|
||||
use reth_primitives_traits::BlockBody;
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
|
||||
@ -7,6 +7,7 @@ use crate::{
|
||||
PruneCheckpointReader, StageCheckpointReader, StateProviderBox, StaticFileProviderFactory,
|
||||
TransactionVariant, TransactionsProvider, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use alloy_eips::{
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
BlockHashOrNumber,
|
||||
@ -20,7 +21,6 @@ use reth_errors::{RethError, RethResult};
|
||||
use reth_node_types::{BlockTy, HeaderTy, NodeTypesWithDB, ReceiptTy, TxTy};
|
||||
use reth_primitives::{
|
||||
BlockWithSenders, SealedBlockFor, SealedBlockWithSenders, SealedHeader, StaticFileSegment,
|
||||
TransactionMeta,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
|
||||
@ -19,7 +19,7 @@ use crate::{
|
||||
StorageReader, StorageTrieWriter, TransactionVariant, TransactionsProvider,
|
||||
TransactionsProviderExt, TrieWriter, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::{BlockHeader, Header};
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader, Header};
|
||||
use alloy_eips::{
|
||||
eip2718::Encodable2718,
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
@ -53,7 +53,6 @@ use reth_node_types::{BlockTy, BodyTy, HeaderTy, NodeTypes, ReceiptTy, TxTy};
|
||||
use reth_primitives::{
|
||||
Account, BlockExt, BlockWithSenders, Bytecode, GotExpected, NodePrimitives, SealedBlock,
|
||||
SealedBlockFor, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry,
|
||||
TransactionMeta,
|
||||
};
|
||||
use reth_primitives_traits::{Block as _, BlockBody as _, SignedTransaction};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment};
|
||||
|
||||
@ -9,7 +9,7 @@ use crate::{
|
||||
StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory,
|
||||
TransactionVariant, TransactionsProvider, TreeViewer, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::Header;
|
||||
use alloy_consensus::{transaction::TransactionMeta, Header};
|
||||
use alloy_eips::{
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag,
|
||||
@ -31,7 +31,7 @@ use reth_node_types::{
|
||||
};
|
||||
use reth_primitives::{
|
||||
Account, BlockWithSenders, EthPrimitives, Receipt, SealedBlock, SealedBlockFor,
|
||||
SealedBlockWithSenders, SealedHeader, TransactionMeta,
|
||||
SealedBlockWithSenders, SealedHeader,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
|
||||
@ -6,6 +6,7 @@ use crate::{
|
||||
to_range, BlockHashReader, BlockNumReader, HeaderProvider, ReceiptProvider,
|
||||
TransactionsProvider,
|
||||
};
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use alloy_eips::{eip2718::Encodable2718, BlockHashOrNumber};
|
||||
use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256};
|
||||
use reth_chainspec::ChainInfo;
|
||||
@ -17,7 +18,7 @@ use reth_db::{
|
||||
table::{Decompress, Value},
|
||||
};
|
||||
use reth_node_types::NodePrimitives;
|
||||
use reth_primitives::{transaction::recover_signers, SealedHeader, TransactionMeta};
|
||||
use reth_primitives::{transaction::recover_signers, SealedHeader};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_storage_errors::provider::{ProviderError, ProviderResult};
|
||||
use std::{
|
||||
|
||||
@ -7,7 +7,7 @@ use crate::{
|
||||
ReceiptProvider, StageCheckpointReader, StatsReader, TransactionVariant, TransactionsProvider,
|
||||
TransactionsProviderExt, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::Header;
|
||||
use alloy_consensus::{transaction::TransactionMeta, Header};
|
||||
use alloy_eips::{
|
||||
eip2718::Encodable2718,
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
@ -39,7 +39,7 @@ use reth_primitives::{
|
||||
},
|
||||
transaction::recover_signers,
|
||||
BlockWithSenders, Receipt, SealedBlockFor, SealedBlockWithSenders, SealedHeader,
|
||||
StaticFileSegment, TransactionMeta, TransactionSigned,
|
||||
StaticFileSegment, TransactionSigned,
|
||||
};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_stages_types::{PipelineTarget, StageId};
|
||||
|
||||
@ -5,7 +5,7 @@ use crate::{
|
||||
ReceiptProviderIdExt, StateProvider, StateProviderBox, StateProviderFactory, StateReader,
|
||||
StateRootProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::{constants::EMPTY_ROOT_HASH, Header};
|
||||
use alloy_consensus::{constants::EMPTY_ROOT_HASH, transaction::TransactionMeta, Header};
|
||||
use alloy_eips::{
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
BlockHashOrNumber, BlockId, BlockNumberOrTag,
|
||||
@ -23,7 +23,7 @@ use reth_execution_types::ExecutionOutcome;
|
||||
use reth_node_types::NodeTypes;
|
||||
use reth_primitives::{
|
||||
Account, Block, BlockWithSenders, Bytecode, EthPrimitives, GotExpected, Receipt, SealedBlock,
|
||||
SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned,
|
||||
SealedBlockWithSenders, SealedHeader, TransactionSigned,
|
||||
};
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
|
||||
@ -8,6 +8,7 @@ use crate::{
|
||||
StateProviderBox, StateProviderFactory, StateRootProvider, StorageRootProvider,
|
||||
TransactionVariant, TransactionsProvider, WithdrawalsProvider,
|
||||
};
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use alloy_eips::{
|
||||
eip4895::{Withdrawal, Withdrawals},
|
||||
BlockHashOrNumber, BlockId, BlockNumberOrTag,
|
||||
@ -18,9 +19,7 @@ use alloy_primitives::{
|
||||
};
|
||||
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthChainSpec, MAINNET};
|
||||
use reth_db_models::{AccountBeforeTx, StoredBlockBodyIndices};
|
||||
use reth_primitives::{
|
||||
BlockWithSenders, EthPrimitives, SealedBlockFor, SealedBlockWithSenders, TransactionMeta,
|
||||
};
|
||||
use reth_primitives::{BlockWithSenders, EthPrimitives, SealedBlockFor, SealedBlockWithSenders};
|
||||
use reth_primitives_traits::{Account, Bytecode, NodePrimitives, SealedHeader};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::{BlockNumReader, BlockReader};
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use alloy_eips::BlockHashOrNumber;
|
||||
use alloy_primitives::{Address, BlockNumber, TxHash, TxNumber};
|
||||
use reth_primitives::TransactionMeta;
|
||||
use reth_primitives_traits::SignedTransaction;
|
||||
use reth_storage_errors::provider::{ProviderError, ProviderResult};
|
||||
use std::ops::{Range, RangeBounds, RangeInclusive};
|
||||
|
||||
Reference in New Issue
Block a user