Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
feat(exex): backfill executor (paradigmxyz#9123)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Jun 28, 2024
1 parent 9a2cfe5 commit 9129b97
Show file tree
Hide file tree
Showing 25 changed files with 633 additions and 140 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions bin/reth/src/commands/debug_cmd/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ use reth_provider::{
};
use reth_prune::PruneModes;
use reth_stages::{
sets::DefaultStages,
stages::{ExecutionStage, ExecutionStageThresholds},
Pipeline, StageId, StageSet,
sets::DefaultStages, stages::ExecutionStage, ExecutionStageThresholds, Pipeline, StageId,
StageSet,
};
use reth_static_file::StaticFileProducer;
use reth_tasks::TaskExecutor;
Expand Down
6 changes: 3 additions & 3 deletions bin/reth/src/commands/stage/dump/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use reth_provider::{providers::StaticFileProvider, ProviderFactory};
use reth_prune::PruneModes;
use reth_stages::{
stages::{
AccountHashingStage, ExecutionStage, ExecutionStageThresholds, MerkleStage,
StorageHashingStage, MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
AccountHashingStage, ExecutionStage, MerkleStage, StorageHashingStage,
MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
},
Stage, StageCheckpoint, UnwindInput,
ExecutionStageThresholds, Stage, StageCheckpoint, UnwindInput,
};
use tracing::info;

Expand Down
8 changes: 4 additions & 4 deletions bin/reth/src/commands/stage/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use reth_provider::{
};
use reth_stages::{
stages::{
AccountHashingStage, BodyStage, ExecutionStage, ExecutionStageThresholds,
IndexAccountHistoryStage, IndexStorageHistoryStage, MerkleStage, SenderRecoveryStage,
StorageHashingStage, TransactionLookupStage,
AccountHashingStage, BodyStage, ExecutionStage, IndexAccountHistoryStage,
IndexStorageHistoryStage, MerkleStage, SenderRecoveryStage, StorageHashingStage,
TransactionLookupStage,
},
ExecInput, ExecOutput, Stage, StageExt, UnwindInput, UnwindOutput,
ExecInput, ExecOutput, ExecutionStageThresholds, Stage, StageExt, UnwindInput, UnwindOutput,
};
use std::{any::Any, net::SocketAddr, sync::Arc, time::Instant};
use tracing::*;
Expand Down
4 changes: 2 additions & 2 deletions bin/reth/src/commands/stage/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use reth_provider::{
use reth_prune::PruneModes;
use reth_stages::{
sets::{DefaultStages, OfflineStages},
stages::{ExecutionStage, ExecutionStageThresholds},
Pipeline, StageSet,
stages::ExecutionStage,
ExecutionStageThresholds, Pipeline, StageSet,
};
use reth_static_file::StaticFileProducer;
use std::{ops::RangeInclusive, sync::Arc};
Expand Down
1 change: 1 addition & 0 deletions crates/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
# reth
reth-network-types = { workspace = true, features = ["serde"] }
reth-prune-types.workspace = true
reth-stages-types.workspace = true

# serde
serde.workspace = true
Expand Down
12 changes: 12 additions & 0 deletions crates/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use reth_network_types::{PeersConfig, SessionsConfig};
use reth_prune_types::PruneModes;
use reth_stages_types::ExecutionStageThresholds;
use serde::{Deserialize, Deserializer, Serialize};
use std::{
ffi::OsStr,
Expand Down Expand Up @@ -216,6 +217,17 @@ impl Default for ExecutionConfig {
}
}

impl From<ExecutionConfig> for ExecutionStageThresholds {
fn from(config: ExecutionConfig) -> Self {
Self {
max_blocks: config.max_blocks,
max_changes: config.max_changes,
max_cumulative_gas: config.max_cumulative_gas,
max_duration: config.max_duration,
}
}
}

/// Hashing stage configuration.
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
Expand Down
5 changes: 5 additions & 0 deletions crates/evm/execution-types/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ impl Chain {
&self.execution_outcome
}

/// Get mutable execution outcome of this chain
pub fn execution_outcome_mut(&mut self) -> &mut ExecutionOutcome {
&mut self.execution_outcome
}

/// Prepends the given state to the current state.
pub fn prepend_state(&mut self, state: BundleState) {
self.execution_outcome.prepend_state(state);
Expand Down
16 changes: 16 additions & 0 deletions crates/exex/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ reth-tasks.workspace = true
reth-tracing.workspace = true
reth-network.workspace = true
reth-payload-builder.workspace = true
reth-evm.workspace = true
reth-prune-types.workspace = true
reth-revm.workspace = true
reth-stages-api.workspace = true
reth-db-api.workspace = true

## async
tokio.workspace = true
Expand All @@ -34,6 +39,17 @@ eyre.workspace = true
metrics.workspace = true
serde = { workspace = true, optional = true }

[dev-dependencies]
reth-chainspec.workspace = true
reth-evm-ethereum.workspace = true
reth-testing-utils.workspace = true
reth-blockchain-tree.workspace = true
reth-db-common.workspace = true
reth-node-api.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] }

secp256k1.workspace = true

[features]
default = []
serde = ["dep:serde", "reth-provider/serde"]
Loading

0 comments on commit 9129b97

Please sign in to comment.