Skip to content
Merged
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
6 changes: 5 additions & 1 deletion crates/optimism/flashblocks/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{ExecutionPayloadBaseV1, FlashBlock};
use alloy_eips::{eip2718::WithEncoded, BlockNumberOrTag, Decodable2718};
use eyre::OptionExt;
use eyre::{eyre, OptionExt};
use futures_util::{FutureExt, Stream, StreamExt};
use reth_chain_state::{CanonStateNotifications, CanonStateSubscriptions, ExecutedBlock};
use reth_errors::RethError;
Expand Down Expand Up @@ -129,6 +129,10 @@ impl<
.find_map(|v| v.base.clone())
.ok_or_eyre("Missing base flashblock")?;

if attrs.parent_hash != latest.hash() {
return Err(eyre!("The base flashblock is old"));
}

let state_provider = self.provider.history_by_block_hash(latest.hash())?;
let state = StateProviderDatabase::new(&state_provider);
let mut db = State::builder().with_database(state).with_bundle_update().build();
Expand Down