Skip to content
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
2 changes: 1 addition & 1 deletion crates/optimism/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ reth-provider.workspace = true

# op-reth
# proofs exex handles `TrieUpdates` in notifications
reth-optimism-trie = { workspace = true, features = ["serde-bincode-compat"] }
reth-optimism-trie = { workspace = true, features = ["serde-bincode-compat", "metrics"] }

# alloy
alloy-consensus.workspace = true
Expand Down
17 changes: 12 additions & 5 deletions crates/optimism/exex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,18 @@ where
/// Main execution loop for the ExEx
pub async fn run(mut self) -> eyre::Result<()> {
// Check if proofs storage is initialized
if self.storage.get_earliest_block_number().await?.is_none() {
return Err(eyre::eyre!(
"Proofs storage not initialized. Please run 'op-reth initialize-op-proofs --proofs-history.storage-path <PATH>' first."
));
}
let earliest_block_number = match self.storage.get_earliest_block_number().await? {
Some((n, _)) => n,
None => {
return Err(eyre::eyre!(
"Proofs storage not initialized. Please run 'op-reth initialize-op-proofs --proofs-history.storage-path <PATH>' first."
));
}
};

// Need to update the earliest block metric on startup as this is not called frequently and
// can show outdated info. When metrics are disabled, this is a no-op.
self.storage.metrics().block_metrics().earliest_number.set(earliest_block_number as f64);

let collector = LiveTrieCollector::new(
self.ctx.evm_config().clone(),
Expand Down
Loading