feat: send CanonStateNotifications from execution stage (#7578)

This commit is contained in:
Oliver Nordbjerg
2024-04-19 16:39:52 +02:00
committed by GitHub
parent 6646a329ad
commit 49c02c3b8e
21 changed files with 246 additions and 194 deletions

View File

@ -17,6 +17,7 @@ workspace = true
reth-config.workspace = true
reth-primitives = { workspace = true, features = ["arbitrary", "clap"] }
reth-db = { workspace = true, features = ["mdbx"] }
reth-exex.workspace = true
reth-provider = { workspace = true }
reth-revm.workspace = true
reth-stages.workspace = true
@ -49,7 +50,9 @@ reth-trie = { workspace = true, features = ["metrics"] }
reth-nippy-jar.workspace = true
reth-node-api.workspace = true
reth-node-ethereum.workspace = true
reth-node-optimism = { workspace = true, optional = true, features = ["optimism"] }
reth-node-optimism = { workspace = true, optional = true, features = [
"optimism",
] }
reth-node-core.workspace = true
reth-node-builder.workspace = true
reth-node-events.workspace = true
@ -81,7 +84,12 @@ ratatui = "0.25.0"
human_bytes = "0.4.1"
# async
tokio = { workspace = true, features = ["sync", "macros", "time", "rt-multi-thread"] }
tokio = { workspace = true, features = [
"sync",
"macros",
"time",
"rt-multi-thread",
] }
futures.workspace = true
# misc

View File

@ -19,6 +19,7 @@ use reth_downloaders::{
bodies::bodies::BodiesDownloaderBuilder,
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
};
use reth_exex::ExExManagerHandle;
use reth_interfaces::{
consensus::Consensus,
p2p::{bodies::client::BodiesClient, headers::client::HeadersClient},
@ -142,6 +143,7 @@ impl Command {
.max(stage_conf.account_hashing.clean_threshold)
.max(stage_conf.storage_hashing.clean_threshold),
config.prune.clone().map(|prune| prune.segments).unwrap_or_default(),
ExExManagerHandle::empty(),
)),
)
.build(provider_factory, static_file_producer);

View File

@ -15,6 +15,7 @@ use reth_beacon_consensus::BeaconConsensus;
use reth_cli_runner::CliContext;
use reth_config::Config;
use reth_db::{cursor::DbCursorRO, init_db, tables, transaction::DbTx, DatabaseEnv};
use reth_exex::ExExManagerHandle;
use reth_interfaces::{consensus::Consensus, p2p::full_block::FullBlockClient};
use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
@ -211,6 +212,7 @@ impl Command {
},
MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
PruneModes::all(),
ExExManagerHandle::empty(),
);
let mut account_hashing_stage = AccountHashingStage::default();

View File

@ -19,6 +19,7 @@ use reth_downloaders::{
file_client::{ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
};
use reth_exex::ExExManagerHandle;
use reth_interfaces::{
consensus::Consensus,
p2p::{
@ -272,7 +273,8 @@ impl ImportCommand {
.clean_threshold
.max(config.stages.account_hashing.clean_threshold)
.max(config.stages.storage_hashing.clean_threshold),
config.prune.clone().map(|prune| prune.segments).unwrap_or_default(),
config.prune.as_ref().map(|prune| prune.segments.clone()).unwrap_or_default(),
ExExManagerHandle::empty(),
))
.disable_all_if(STATE_STAGES, || no_state),
)

View File

@ -3,6 +3,7 @@ use crate::utils::DbTool;
use eyre::Result;
use reth_config::config::EtlConfig;
use reth_db::{database::Database, table::TableImporter, tables, DatabaseEnv};
use reth_exex::ExExManagerHandle;
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_node_ethereum::EthEvmConfig;
use reth_primitives::{stage::StageCheckpoint, BlockNumber, PruneModes};
@ -95,6 +96,7 @@ async fn unwind_and_copy<DB: Database>(
},
MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
PruneModes::all(),
ExExManagerHandle::empty(),
);
exec_stage.unwind(

View File

@ -17,6 +17,7 @@ use reth_beacon_consensus::BeaconConsensus;
use reth_config::{config::EtlConfig, Config};
use reth_db::init_db;
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
use reth_exex::ExExManagerHandle;
use reth_node_ethereum::EthEvmConfig;
use reth_primitives::ChainSpec;
use reth_provider::{ProviderFactory, StageCheckpointReader, StageCheckpointWriter};
@ -239,6 +240,7 @@ impl Command {
},
config.stages.merkle.clean_threshold,
config.prune.map(|prune| prune.segments).unwrap_or_default(),
ExExManagerHandle::empty(),
)),
None,
)

View File

@ -15,6 +15,7 @@ use reth_downloaders::{
bodies::bodies::BodiesDownloaderBuilder,
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
};
use reth_exex::ExExManagerHandle;
use reth_interfaces::consensus::Consensus;
use reth_node_core::{
args::{get_secret_key, NetworkArgs},
@ -211,6 +212,7 @@ impl Command {
.max(stage_conf.account_hashing.clean_threshold)
.max(stage_conf.storage_hashing.clean_threshold),
config.prune.clone().map(|prune| prune.segments).unwrap_or_default(),
ExExManagerHandle::empty(),
))
.set(AccountHashingStage::default())
.set(StorageHashingStage::default())