forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 10
Move proofs bootstrap to reth-optimism-node #612
Copy link
Copy link
Closed
Labels
A-sdkArea: node builder SDKArea: node builder SDKK-debtKind: debtKind: debtW-historical-proofsWorkstream: historical-proofsWorkstream: historical-proofs
Description
Describe the feature
Move this code into reth-optimism-node, probably as a method on OpNode.
op-reth/crates/optimism/bin/op-reth/src/main.rs
Lines 114 to 162 in 5abe287
| if proofs_history_enabled { | |
| let path = args | |
| .proofs_history_storage_path | |
| .clone() | |
| .expect("Path must be provided if not using in-memory storage"); | |
| info!(target: "reth::cli", "Using on-disk storage for proofs history"); | |
| let mdbx = Arc::new( | |
| MdbxProofsStorage::new(&path) | |
| .map_err(|e| eyre::eyre!("Failed to create MdbxProofsStorage: {e}"))?, | |
| ); | |
| let storage: OpProofsStorage<_> = mdbx.clone().into(); | |
| let storage_exec = storage.clone(); | |
| node_builder = node_builder | |
| .on_node_started(move |node| { | |
| spawn_proofs_db_metrics( | |
| node.task_executor, | |
| mdbx, | |
| node.config.metrics.push_gateway_interval, | |
| ); | |
| Ok(()) | |
| }) | |
| .install_exex("proofs-history", async move |exex_context| { | |
| Ok(OpProofsExEx::new( | |
| exex_context, | |
| storage_exec, | |
| proofs_history_window, | |
| proofs_history_prune_interval, | |
| proofs_history_verification_interval, | |
| ) | |
| .run() | |
| .boxed()) | |
| }) | |
| .extend_rpc_modules(move |ctx| { | |
| let api_ext = EthApiExt::new(ctx.registry.eth_api().clone(), storage.clone()); | |
| let debug_ext = DebugApiExt::new( | |
| ctx.node().provider().clone(), | |
| ctx.registry.eth_api().clone(), | |
| storage, | |
| Box::new(ctx.node().task_executor().clone()), | |
| ctx.node().evm_config().clone(), | |
| ); | |
| ctx.modules.replace_configured(api_ext.into_rpc())?; | |
| ctx.modules.replace_configured(debug_ext.into_rpc())?; | |
| Ok(()) | |
| }); | |
| } |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sdkArea: node builder SDKArea: node builder SDKK-debtKind: debtKind: debtW-historical-proofsWorkstream: historical-proofsWorkstream: historical-proofs
Type
Projects
Status
Done