Skip to content

Commit

Permalink
chore(exex): replace reth-primitives with alloy
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishekkochar <[email protected]>
  • Loading branch information
Abhishekkochar committed Sep 22, 2024
1 parent 884c74d commit 698712d
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions crates/exex/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ reth-stages-api.workspace = true
reth-tasks.workspace = true
reth-tracing.workspace = true

# alloy
alloy-primitives.workspace = true
alloy-eips.workspace = true

## async
futures.workspace = true
tokio-util.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/exex/src/backfill/factory.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::BackfillJob;
use std::ops::RangeInclusive;

use alloy_primitives::BlockNumber;
use reth_node_api::FullNodeComponents;
use reth_primitives::BlockNumber;
use reth_prune_types::PruneModes;
use reth_stages_api::ExecutionStageThresholds;

Expand Down
3 changes: 2 additions & 1 deletion crates/exex/exex/src/backfill/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use std::{
time::{Duration, Instant},
};

use alloy_primitives::BlockNumber;
use reth_evm::execute::{
BatchExecutor, BlockExecutionError, BlockExecutionOutput, BlockExecutorProvider, Executor,
};
use reth_primitives::{Block, BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{Block, BlockWithSenders, Receipt};
use reth_primitives_traits::format_gas_throughput;
use reth_provider::{
BlockReader, Chain, HeaderProvider, ProviderError, StateProviderFactory, TransactionVariant,
Expand Down
3 changes: 2 additions & 1 deletion crates/exex/exex/src/backfill/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ use std::{
task::{ready, Context, Poll},
};

use alloy_primitives::BlockNumber;
use futures::{
stream::{FuturesOrdered, Stream},
StreamExt,
};
use reth_evm::execute::{BlockExecutionError, BlockExecutionOutput, BlockExecutorProvider};
use reth_primitives::{BlockNumber, BlockWithSenders, Receipt};
use reth_primitives::{BlockWithSenders, Receipt};
use reth_provider::{BlockReader, Chain, HeaderProvider, StateProviderFactory};
use reth_prune_types::PruneModes;
use reth_stages_api::ExecutionStageThresholds;
Expand Down
5 changes: 3 additions & 2 deletions crates/exex/exex/src/backfill/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use std::sync::Arc;

use alloy_primitives::{b256, Address, TxKind, U256};
use eyre::OptionExt;
use reth_chainspec::{ChainSpec, ChainSpecBuilder, EthereumHardfork, MAINNET, MIN_TRANSACTION_GAS};
use reth_evm::execute::{
BatchExecutor, BlockExecutionInput, BlockExecutionOutput, BlockExecutorProvider, Executor,
};
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_primitives::{
b256, constants::ETH_TO_WEI, Address, Block, BlockWithSenders, Genesis, GenesisAccount, Header,
Receipt, Requests, SealedBlockWithSenders, Transaction, TxEip2930, TxKind, U256,
constants::ETH_TO_WEI, Block, BlockWithSenders, Genesis, GenesisAccount, Header, Receipt,
Requests, SealedBlockWithSenders, Transaction, TxEip2930,
};
use reth_provider::{
providers::ProviderNodeTypes, BlockWriter as _, ExecutionOutcome, LatestStateProviderRef,
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/exex/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reth_primitives::BlockNumber;
use alloy_primitives::BlockNumber;

/// Events emitted by an `ExEx`.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down
6 changes: 4 additions & 2 deletions crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::{
BackfillJobFactory, ExExEvent, ExExNotification, FinishedExExHeight, StreamBackfillJob,
};
use alloy_primitives::{BlockNumber, U256};
use eyre::OptionExt;
use futures::{Stream, StreamExt};
use metrics::Gauge;
use reth_chainspec::Head;
use reth_evm::execute::BlockExecutorProvider;
use reth_exex_types::ExExHead;
use reth_metrics::{metrics::Counter, Metrics};
use reth_primitives::{BlockNumber, U256};
use reth_provider::{BlockReader, Chain, HeaderProvider, StateProviderFactory};
use reth_tracing::tracing::debug;
use std::{
Expand Down Expand Up @@ -809,10 +809,12 @@ impl Clone for ExExManagerHandle {
#[cfg(test)]
mod tests {
use super::*;
use alloy_eips::BlockNumHash;
use alloy_primitives::B256;
use futures::StreamExt;
use reth_db_common::init::init_genesis;
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_primitives::{Block, BlockNumHash, Header, SealedBlockWithSenders, B256};
use reth_primitives::{Block, Header, SealedBlockWithSenders};
use reth_provider::{
providers::BlockchainProvider2, test_utils::create_test_provider_factory, BlockReader,
BlockWriter, Chain,
Expand Down
1 change: 1 addition & 0 deletions crates/exex/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reth-provider.workspace = true

# reth
alloy-primitives.workspace = true
alloy-eips.workspace = true

# misc
serde = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/types/src/head.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reth_primitives::BlockNumHash;
use alloy_eips::BlockNumHash;

/// A head of the ExEx. It determines the highest block committed to the internal ExEx state.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down

0 comments on commit 698712d

Please sign in to comment.