Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use execution-types instead of provider where possible #8971

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ reth-provider = { workspace = true }
reth-evm.workspace = true
reth-revm.workspace = true
reth-stages.workspace = true
reth-execution-types.workspace = true
reth-errors.workspace = true
reth-transaction-pool.workspace = true
reth-beacon-consensus.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use reth_consensus::Consensus;
use reth_db::DatabaseEnv;
use reth_errors::RethResult;
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
use reth_execution_types::ExecutionOutcome;
use reth_fs_util as fs;
use reth_node_api::PayloadBuilderAttributes;
use reth_payload_builder::database::CachedReads;
Expand All @@ -30,7 +31,7 @@ use reth_primitives::{
};
use reth_provider::{
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
ExecutionOutcome, ProviderFactory, StageCheckpointReader, StateProviderFactory,
ProviderFactory, StageCheckpointReader, StateProviderFactory,
};
use reth_revm::database::StateProviderDatabase;
use reth_rpc_types::engine::{BlobsBundleV1, PayloadAttributes};
Expand Down
7 changes: 4 additions & 3 deletions bin/reth/src/commands/debug_cmd/in_memory_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ use reth_config::Config;
use reth_db::DatabaseEnv;
use reth_errors::BlockValidationError;
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
use reth_execution_types::ExecutionOutcome;
use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_primitives::BlockHashOrNumber;
use reth_provider::{
AccountExtReader, ChainSpecProvider, ExecutionOutcome, HashingWriter, HeaderProvider,
LatestStateProviderRef, OriginalValuesKnown, ProviderFactory, StageCheckpointReader,
StateWriter, StaticFileProviderFactory, StorageReader,
AccountExtReader, ChainSpecProvider, HashingWriter, HeaderProvider, LatestStateProviderRef,
OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StateWriter,
StaticFileProviderFactory, StorageReader,
};
use reth_revm::database::StateProviderDatabase;
use reth_stages::StageId;
Expand Down
3 changes: 2 additions & 1 deletion bin/reth/src/commands/import_receipts_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ use reth_downloaders::{
file_client::{ChunkedFileReader, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
receipt_file_client::ReceiptFileClient,
};
use reth_execution_types::ExecutionOutcome;
use reth_node_core::version::SHORT_VERSION;
use reth_optimism_primitives::bedrock_import::is_dup_tx;
use reth_primitives::{Receipts, StaticFileSegment};
use reth_provider::{
ExecutionOutcome, OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StateWriter,
OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StateWriter,
StaticFileProviderFactory, StaticFileWriter, StatsReader,
};
use reth_stages::StageId;
Expand Down
1 change: 1 addition & 0 deletions crates/blockchain-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ reth-db-api.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-provider.workspace = true
reth-execution-types.workspace = true
reth-prune-types.workspace = true
reth-stages-api.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/blockchain-tree/src/block_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use super::state::BlockchainId;
use crate::canonical_chain::CanonicalChain;
use linked_hash_set::LinkedHashSet;
use reth_execution_types::Chain;
use reth_primitives::{BlockHash, BlockNumHash, BlockNumber, SealedBlockWithSenders};
use reth_provider::Chain;
use std::collections::{btree_map, hash_map, BTreeMap, BTreeSet, HashMap, HashSet};

/// Internal indices of the blocks and chains.
Expand Down
6 changes: 3 additions & 3 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ use reth_consensus::{Consensus, ConsensusError};
use reth_db_api::database::Database;
use reth_evm::execute::BlockExecutorProvider;
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{
BlockHash, BlockNumHash, BlockNumber, ForkBlock, GotExpected, Hardfork, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, StaticFileSegment, B256, U256,
};
use reth_provider::{
BlockExecutionWriter, BlockNumReader, BlockWriter, CanonStateNotification,
CanonStateNotificationSender, CanonStateNotifications, Chain, ChainSpecProvider, ChainSplit,
ChainSplitTarget, DisplayBlocksChain, ExecutionOutcome, HeaderProvider, ProviderError,
StaticFileProviderFactory,
CanonStateNotificationSender, CanonStateNotifications, ChainSpecProvider, ChainSplit,
ChainSplitTarget, DisplayBlocksChain, HeaderProvider, ProviderError, StaticFileProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages_api::{MetricEvent, MetricEventsSender};
Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
use reth_db_api::database::Database;
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
use reth_execution_errors::BlockExecutionError;
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{
BlockHash, BlockNumber, ForkBlock, GotExpected, SealedBlockWithSenders, SealedHeader, U256,
};
use reth_provider::{
providers::{BundleStateProvider, ConsistentDbView},
Chain, ExecutionOutcome, FullExecutionDataProvider, ProviderError, StateRootProvider,
FullExecutionDataProvider, ProviderError, StateRootProvider,
};
use reth_revm::database::StateProviderDatabase;
use reth_trie::updates::TrieUpdates;
Expand Down
1 change: 1 addition & 0 deletions crates/consensus/auto-seal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ reth-chainspec.workspace = true
reth-beacon-consensus.workspace = true
reth-primitives.workspace = true
reth-execution-errors.workspace = true
reth-execution-types.workspace = true
reth-network-p2p.workspace = true
reth-provider.workspace = true
reth-stages-api.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/auto-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ use reth_chainspec::ChainSpec;
use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
use reth_engine_primitives::EngineTypes;
use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
constants::ETHEREUM_BLOCK_GAS_LIMIT, eip4844::calculate_excess_blob_gas, proofs, Block,
BlockBody, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, Bloom, Header,
Requests, SealedBlock, SealedHeader, TransactionSigned, Withdrawals, B256, U256,
};
use reth_provider::{BlockReaderIdExt, ExecutionOutcome, StateProviderFactory, StateRootProvider};
use reth_provider::{BlockReaderIdExt, StateProviderFactory, StateRootProvider};
use reth_revm::database::StateProviderDatabase;
use reth_transaction_pool::TransactionPool;
use std::{
Expand Down
1 change: 1 addition & 0 deletions crates/ethereum/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reth-revm.workspace = true
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-payload-builder.workspace = true
reth-execution-types.workspace = true
reth-basic-payload-builder.workspace = true
reth-evm.workspace = true
reth-evm-ethereum.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/ethereum/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use reth_basic_payload_builder::{
use reth_errors::RethError;
use reth_evm::ConfigureEvm;
use reth_evm_ethereum::{eip6110::parse_deposits_from_receipts, EthEvmConfig};
use reth_execution_types::ExecutionOutcome;
use reth_payload_builder::{
error::PayloadBuilderError, EthBuiltPayload, EthPayloadBuilderAttributes,
};
Expand All @@ -29,7 +30,7 @@ use reth_primitives::{
revm::env::tx_env_with_recovered,
Block, Header, IntoRecoveredTransaction, Receipt, EMPTY_OMMER_ROOT_HASH, U256,
};
use reth_provider::{ExecutionOutcome, StateProviderFactory};
use reth_provider::StateProviderFactory;
use reth_revm::{database::StateProviderDatabase, state_change::apply_blockhashes_update};
use reth_transaction_pool::{BestTransactionsAttributes, TransactionPool};
use revm::{
Expand Down
1 change: 1 addition & 0 deletions crates/exex/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reth-consensus = { workspace = true, features = ["test-utils"] }
reth-db = { workspace = true, features = ["test-utils"] }
reth-db-common.workspace = true
reth-evm = { workspace = true, features = ["test-utils"] }
reth-execution-types.workspace = true
reth-exex.workspace = true
reth-network.workspace = true
reth-node-api.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/exex/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use reth_consensus::test_utils::TestConsensus;
use reth_db::{test_utils::TempDatabase, DatabaseEnv};
use reth_db_common::init::init_genesis;
use reth_evm::test_utils::MockExecutorProvider;
use reth_execution_types::Chain;
use reth_exex::{ExExContext, ExExEvent, ExExNotification};
use reth_network::{config::SecretKey, NetworkConfigBuilder, NetworkManager};
use reth_node_api::{FullNodeTypes, FullNodeTypesAdapter, NodeTypes};
Expand All @@ -34,7 +35,7 @@ use reth_payload_builder::noop::NoopPayloadBuilderService;
use reth_primitives::{Head, SealedBlockWithSenders};
use reth_provider::{
providers::BlockchainProvider, test_utils::create_test_provider_factory_with_chain_spec,
BlockReader, Chain, ProviderFactory,
BlockReader, ProviderFactory,
};
use reth_tasks::TaskManager;
use reth_transaction_pool::test_utils::{testing_pool, TestPool};
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ reth-evm.workspace = true
reth-primitives.workspace = true
reth-revm.workspace = true
reth-execution-errors.workspace = true
reth-provider.workspace = true
reth-execution-types.workspace = true
reth-prune-types.workspace = true
reth-consensus-common.workspace = true

Expand All @@ -38,7 +38,7 @@ reth-revm = { workspace = true, features = ["test-utils"] }
[features]
optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"reth-revm/optimism",
]
2 changes: 1 addition & 1 deletion crates/optimism/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use reth_evm::{
},
ConfigureEvm,
};
use reth_execution_types::ExecutionOutcome;
use reth_optimism_consensus::validate_block_post_execution;
use reth_primitives::{
BlockNumber, BlockWithSenders, Header, Receipt, Receipts, TxType, Withdrawals, U256,
};
use reth_provider::ExecutionOutcome;
use reth_prune_types::PruneModes;
use reth_revm::{
batch::{BlockBatchRecord, BlockExecutorStats},
Expand Down
1 change: 1 addition & 0 deletions crates/optimism/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-evm.workspace = true
reth-evm-optimism.workspace = true
reth-execution-types.workspace = true
reth-payload-builder.workspace = true
reth-payload-primitives.workspace = true
reth-basic-payload-builder.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/optimism/payload/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
use reth_basic_payload_builder::*;
use reth_chainspec::ChainSpec;
use reth_evm::ConfigureEvm;
use reth_execution_types::ExecutionOutcome;
use reth_payload_builder::error::PayloadBuilderError;
use reth_primitives::{
constants::{BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS},
Expand All @@ -16,7 +17,7 @@ use reth_primitives::{
Block, Hardfork, Header, IntoRecoveredTransaction, Receipt, TxType, EMPTY_OMMER_ROOT_HASH,
U256,
};
use reth_provider::{ExecutionOutcome, StateProviderFactory};
use reth_provider::StateProviderFactory;
use reth_revm::database::StateProviderDatabase;
use reth_transaction_pool::{BestTransactionsAttributes, TransactionPool};
use revm::{
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ reth-rpc-types-compat.workspace = true
revm-inspectors = { workspace = true, features = ["js-tracer"] }
reth-evm.workspace = true
reth-network-peers.workspace = true
reth-execution-types.workspace = true

reth-evm-optimism = { workspace = true, optional = true }

Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/rpc/src/eth/api/pending_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::eth::error::{EthApiError, EthResult};
use reth_chainspec::ChainSpec;
use reth_errors::ProviderError;
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
constants::{eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE, EMPTY_ROOT_HASH},
proofs,
Expand All @@ -13,7 +14,7 @@ use reth_primitives::{
Block, BlockId, BlockNumberOrTag, Header, IntoRecoveredTransaction, Receipt, Requests,
SealedBlockWithSenders, SealedHeader, B256, EMPTY_OMMER_ROOT_HASH, U256,
};
use reth_provider::{ChainSpecProvider, ExecutionOutcome, StateProviderFactory};
use reth_provider::{ChainSpecProvider, StateProviderFactory};
use reth_revm::{
database::StateProviderDatabase,
state_change::{
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc/src/eth/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
use futures::{future::Either, Stream, StreamExt};
use reth_errors::{ProviderError, ProviderResult};
use reth_evm::ConfigureEvm;
use reth_execution_types::Chain;
use reth_primitives::{
Block, BlockHashOrNumber, BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders,
TransactionSigned, TransactionSignedEcRecovered, B256,
};
use reth_provider::{
BlockReader, CanonStateNotification, Chain, EvmEnvProvider, StateProviderFactory,
TransactionVariant,
BlockReader, CanonStateNotification, EvmEnvProvider, StateProviderFactory, TransactionVariant,
};
use reth_tasks::{TaskSpawner, TokioTaskExecutor};
use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId};
Expand Down
Loading
Loading