mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
consensus: replace reth-primitive imports (#10768)
This commit is contained in:
committed by
GitHub
parent
9a541c9853
commit
cb0625c391
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -6184,6 +6184,7 @@ dependencies = [
|
||||
name = "reth-auto-seal-consensus"
|
||||
version = "1.0.6"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"futures-util",
|
||||
"reth-beacon-consensus",
|
||||
"reth-chainspec",
|
||||
@ -6234,6 +6235,7 @@ name = "reth-beacon-consensus"
|
||||
version = "1.0.6"
|
||||
dependencies = [
|
||||
"alloy-genesis",
|
||||
"alloy-primitives",
|
||||
"assert_matches",
|
||||
"futures",
|
||||
"itertools 0.13.0",
|
||||
@ -6556,6 +6558,7 @@ dependencies = [
|
||||
name = "reth-consensus"
|
||||
version = "1.0.6"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"auto_impl",
|
||||
"derive_more 1.0.0",
|
||||
"reth-primitives",
|
||||
@ -6565,6 +6568,7 @@ dependencies = [
|
||||
name = "reth-consensus-common"
|
||||
version = "1.0.6"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"mockall",
|
||||
"rand 0.8.5",
|
||||
"reth-chainspec",
|
||||
|
||||
@ -31,6 +31,9 @@ reth-network-peers.workspace = true
|
||||
reth-tokio-util.workspace = true
|
||||
reth-trie.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
# async
|
||||
futures-util.workspace = true
|
||||
tokio = { workspace = true, features = ["sync", "time"] }
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
//! This includes download client implementations for auto sealing miners.
|
||||
|
||||
use crate::Storage;
|
||||
use alloy_primitives::B256;
|
||||
use reth_network_p2p::{
|
||||
bodies::client::{BodiesClient, BodiesFut},
|
||||
download::DownloadClient,
|
||||
@ -8,7 +9,7 @@ use reth_network_p2p::{
|
||||
priority::Priority,
|
||||
};
|
||||
use reth_network_peers::{PeerId, WithPeerId};
|
||||
use reth_primitives::{BlockBody, BlockHashOrNumber, Header, B256};
|
||||
use reth_primitives::{BlockBody, BlockHashOrNumber, Header};
|
||||
use std::fmt::Debug;
|
||||
use tracing::{trace, warn};
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256, U256};
|
||||
use reth_beacon_consensus::BeaconEngineMessage;
|
||||
use reth_chainspec::{ChainSpec, EthereumHardforks};
|
||||
use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
|
||||
@ -24,9 +25,8 @@ use reth_execution_errors::{
|
||||
};
|
||||
use reth_execution_types::ExecutionOutcome;
|
||||
use reth_primitives::{
|
||||
eip4844::calculate_excess_blob_gas, proofs, Block, BlockBody, BlockHash, BlockHashOrNumber,
|
||||
BlockNumber, BlockWithSenders, Bloom, Header, Requests, SealedBlock, SealedHeader,
|
||||
TransactionSigned, Withdrawals, B256, U256,
|
||||
eip4844::calculate_excess_blob_gas, proofs, Block, BlockBody, BlockHashOrNumber,
|
||||
BlockWithSenders, Header, Requests, SealedBlock, SealedHeader, TransactionSigned, Withdrawals,
|
||||
};
|
||||
use reth_provider::{BlockReaderIdExt, StateProviderFactory, StateRootProvider};
|
||||
use reth_revm::database::StateProviderDatabase;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//! The mode the auto seal miner is operating in.
|
||||
|
||||
use alloy_primitives::TxHash;
|
||||
use futures_util::{stream::Fuse, StreamExt};
|
||||
use reth_primitives::TxHash;
|
||||
use reth_transaction_pool::{TransactionPool, ValidPoolTransaction};
|
||||
use std::{
|
||||
fmt,
|
||||
|
||||
@ -30,6 +30,9 @@ reth-engine-primitives.workspace = true
|
||||
reth-network-p2p.workspace = true
|
||||
reth-node-types.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
# async
|
||||
tokio = { workspace = true, features = ["sync"] }
|
||||
tokio-stream.workspace = true
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use crate::engine::forkchoice::ForkchoiceStatus;
|
||||
use reth_primitives::{SealedBlock, SealedHeader, B256};
|
||||
use alloy_primitives::B256;
|
||||
use reth_primitives::{SealedBlock, SealedHeader};
|
||||
use reth_rpc_types::engine::ForkchoiceState;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_rpc_types::engine::{ForkchoiceState, PayloadStatusEnum};
|
||||
|
||||
/// The struct that keeps track of the received forkchoice state and their status.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use alloy_primitives::BlockNumber;
|
||||
use reth_errors::{RethError, RethResult};
|
||||
use reth_primitives::BlockNumber;
|
||||
use std::{
|
||||
fmt,
|
||||
task::{Context, Poll},
|
||||
|
||||
@ -4,11 +4,11 @@ use crate::{
|
||||
engine::hooks::{EngineHook, EngineHookContext, EngineHookError, EngineHookEvent},
|
||||
hooks::EngineHookDBAccessLevel,
|
||||
};
|
||||
use alloy_primitives::BlockNumber;
|
||||
use futures::FutureExt;
|
||||
use metrics::Counter;
|
||||
use reth_errors::{RethError, RethResult};
|
||||
use reth_node_types::NodeTypesWithDB;
|
||||
use reth_primitives::BlockNumber;
|
||||
use reth_provider::{providers::ProviderNodeTypes, ProviderFactory};
|
||||
use reth_prune::{Pruner, PrunerError, PrunerWithResult};
|
||||
use reth_tasks::TaskSpawner;
|
||||
|
||||
@ -4,10 +4,11 @@ use crate::{
|
||||
engine::hooks::{EngineHook, EngineHookContext, EngineHookError, EngineHookEvent},
|
||||
hooks::EngineHookDBAccessLevel,
|
||||
};
|
||||
use alloy_primitives::BlockNumber;
|
||||
use futures::FutureExt;
|
||||
use reth_errors::RethResult;
|
||||
use reth_node_types::NodeTypesWithDB;
|
||||
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber};
|
||||
use reth_primitives::static_file::HighestStaticFiles;
|
||||
use reth_provider::providers::ProviderNodeTypes;
|
||||
use reth_static_file::{StaticFileProducer, StaticFileProducerWithResult};
|
||||
use reth_tasks::TaskSpawner;
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use alloy_primitives::B256;
|
||||
use reth_metrics::{
|
||||
metrics::{Counter, Gauge},
|
||||
Metrics,
|
||||
};
|
||||
use reth_primitives::{Header, SealedHeader, B256};
|
||||
use reth_primitives::{Header, SealedHeader};
|
||||
use schnellru::{ByLength, LruMap};
|
||||
use std::sync::Arc;
|
||||
use tracing::warn;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
use alloy_primitives::{BlockNumber, B256};
|
||||
use futures::{stream::BoxStream, Future, StreamExt};
|
||||
use itertools::Either;
|
||||
use reth_blockchain_tree_api::{
|
||||
@ -15,8 +16,7 @@ use reth_payload_builder::PayloadBuilderHandle;
|
||||
use reth_payload_primitives::{PayloadAttributes, PayloadBuilderAttributes};
|
||||
use reth_payload_validator::ExecutionPayloadValidator;
|
||||
use reth_primitives::{
|
||||
constants::EPOCH_SLOTS, BlockNumHash, BlockNumber, Head, Header, SealedBlock, SealedHeader,
|
||||
B256,
|
||||
constants::EPOCH_SLOTS, BlockNumHash, Head, Header, SealedBlock, SealedHeader,
|
||||
};
|
||||
use reth_provider::{
|
||||
providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker,
|
||||
@ -2177,10 +2177,10 @@ mod tests {
|
||||
|
||||
mod fork_choice_updated {
|
||||
use super::*;
|
||||
use alloy_primitives::U256;
|
||||
use generators::BlockParams;
|
||||
use reth_db::{tables, test_utils::create_test_static_files_dir, Database};
|
||||
use reth_db_api::transaction::DbTxMut;
|
||||
use reth_primitives::U256;
|
||||
use reth_provider::{providers::StaticFileProvider, test_utils::MockNodeTypesWithDB};
|
||||
use reth_rpc_types::engine::ForkchoiceUpdateError;
|
||||
use reth_testing_utils::generators::random_block;
|
||||
@ -2578,9 +2578,10 @@ mod tests {
|
||||
mod new_payload {
|
||||
use super::*;
|
||||
use alloy_genesis::Genesis;
|
||||
use alloy_primitives::U256;
|
||||
use generators::BlockParams;
|
||||
use reth_db::test_utils::create_test_static_files_dir;
|
||||
use reth_primitives::{EthereumHardfork, U256};
|
||||
use reth_primitives::EthereumHardfork;
|
||||
use reth_provider::{
|
||||
providers::StaticFileProvider,
|
||||
test_utils::{blocks::BlockchainTestData, MockNodeTypesWithDB},
|
||||
|
||||
@ -4,13 +4,14 @@ use crate::{
|
||||
engine::metrics::EngineSyncMetrics, BeaconConsensusEngineEvent,
|
||||
ConsensusEngineLiveSyncProgress, EthBeaconConsensus,
|
||||
};
|
||||
use alloy_primitives::{BlockNumber, B256};
|
||||
use futures::FutureExt;
|
||||
use reth_network_p2p::{
|
||||
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
|
||||
BlockClient,
|
||||
};
|
||||
use reth_node_types::NodeTypesWithDB;
|
||||
use reth_primitives::{BlockNumber, SealedBlock, B256};
|
||||
use reth_primitives::SealedBlock;
|
||||
use reth_provider::providers::ProviderNodeTypes;
|
||||
use reth_stages_api::{ControlFlow, Pipeline, PipelineError, PipelineTarget, PipelineWithResult};
|
||||
use reth_tasks::TaskSpawner;
|
||||
|
||||
@ -3,6 +3,7 @@ use crate::{
|
||||
BeaconConsensusEngineError, BeaconConsensusEngineHandle, BeaconForkChoiceUpdateError,
|
||||
BeaconOnNewPayloadError, EthBeaconConsensus, MIN_BLOCKS_FOR_PIPELINE_RUN,
|
||||
};
|
||||
use alloy_primitives::{BlockNumber, B256};
|
||||
use reth_blockchain_tree::{
|
||||
config::BlockchainTreeConfig, externals::TreeExternals, BlockchainTree, ShareableBlockchainTree,
|
||||
};
|
||||
@ -20,7 +21,6 @@ use reth_evm_ethereum::execute::EthExecutorProvider;
|
||||
use reth_exex_types::FinishedExExHeight;
|
||||
use reth_network_p2p::{sync::NoopSyncStateUpdater, test_utils::NoopFullBlockClient, BlockClient};
|
||||
use reth_payload_builder::test_utils::spawn_test_payload_service;
|
||||
use reth_primitives::{BlockNumber, B256};
|
||||
use reth_provider::{
|
||||
providers::BlockchainProvider,
|
||||
test_utils::{create_test_provider_factory_with_chain_spec, MockNodeTypesWithDB},
|
||||
|
||||
@ -16,6 +16,9 @@ reth-chainspec.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-consensus.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
reth-storage-api.workspace = true
|
||||
rand.workspace = true
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use alloy_primitives::{BlockNumber, U256};
|
||||
use reth_chainspec::{ChainSpec, EthereumHardfork};
|
||||
use reth_primitives::{constants::ETH_TO_WEI, BlockNumber, U256};
|
||||
use reth_primitives::constants::ETH_TO_WEI;
|
||||
|
||||
/// Calculates the base block reward.
|
||||
///
|
||||
@ -57,7 +58,7 @@ pub fn base_block_reward_pre_merge(chain_spec: &ChainSpec, block_number: BlockNu
|
||||
/// # use reth_chainspec::MAINNET;
|
||||
/// # use reth_consensus_common::calc::{base_block_reward, block_reward};
|
||||
/// # use reth_primitives::constants::ETH_TO_WEI;
|
||||
/// # use reth_primitives::U256;
|
||||
/// # use alloy_primitives::U256;
|
||||
/// #
|
||||
/// // This is block 126 on mainnet.
|
||||
/// let block_number = 126;
|
||||
|
||||
@ -300,13 +300,13 @@ pub fn validate_against_parent_4844(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use alloy_primitives::{hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, U256};
|
||||
use mockall::mock;
|
||||
use rand::Rng;
|
||||
use reth_chainspec::ChainSpecBuilder;
|
||||
use reth_primitives::{
|
||||
hex_literal::hex, proofs, Account, Address, BlockBody, BlockHash, BlockHashOrNumber,
|
||||
BlockNumber, Bytes, Signature, Transaction, TransactionSigned, TxEip4844, Withdrawal,
|
||||
Withdrawals, U256,
|
||||
proofs, Account, BlockBody, BlockHashOrNumber, Signature, Transaction, TransactionSigned,
|
||||
TxEip4844, Withdrawal, Withdrawals,
|
||||
};
|
||||
use reth_storage_api::{
|
||||
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
|
||||
|
||||
@ -14,6 +14,9 @@ workspace = true
|
||||
# reth
|
||||
reth-primitives.workspace = true
|
||||
|
||||
# ethereum
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
# misc
|
||||
auto_impl.workspace = true
|
||||
derive_more.workspace = true
|
||||
|
||||
@ -9,10 +9,10 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256, U256};
|
||||
use reth_primitives::{
|
||||
constants::MINIMUM_GAS_LIMIT, BlockHash, BlockNumber, BlockWithSenders, Bloom, GotExpected,
|
||||
GotExpectedBoxed, Header, InvalidTransactionError, Receipt, Request, SealedBlock, SealedHeader,
|
||||
B256, U256,
|
||||
constants::MINIMUM_GAS_LIMIT, BlockWithSenders, GotExpected, GotExpectedBoxed, Header,
|
||||
InvalidTransactionError, Receipt, Request, SealedBlock, SealedHeader,
|
||||
};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use crate::{Consensus, ConsensusError, PostExecutionInput};
|
||||
use reth_primitives::{BlockWithSenders, Header, SealedBlock, SealedHeader, U256};
|
||||
use alloy_primitives::U256;
|
||||
use reth_primitives::{BlockWithSenders, Header, SealedBlock, SealedHeader};
|
||||
|
||||
/// A Consensus implementation that does nothing.
|
||||
#[derive(Debug, Copy, Clone, Default)]
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use crate::{Consensus, ConsensusError, PostExecutionInput};
|
||||
use alloy_primitives::U256;
|
||||
use core::sync::atomic::{AtomicBool, Ordering};
|
||||
use reth_primitives::{BlockWithSenders, Header, SealedBlock, SealedHeader, U256};
|
||||
use reth_primitives::{BlockWithSenders, Header, SealedBlock, SealedHeader};
|
||||
|
||||
/// Consensus engine implementation for testing
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user