Describe the feature
currently we always use the latest state
|
pub fn execute(&mut self) -> eyre::Result<PendingBlock<N>> { |
|
let latest = self |
|
.provider |
|
.latest_header()? |
|
.ok_or(EthApiError::HeaderNotFound(BlockNumberOrTag::Latest.into()))?; |
however this might not be
|
/// The parent hash of the block. |
|
pub parent_hash: B256, |
so we should not build the block if parent_hash != latest
we also must clear the block when a new block was mined,
for this we can install a Canonstatesubscription via the provider and remove the pending block on tick
Additional context
Checklist:
Describe the feature
currently we always use the latest state
reth/crates/optimism/flashblocks/src/service.rs
Lines 112 to 116 in 615bd4a
however this might not be
reth/crates/optimism/flashblocks/src/payload.rs
Lines 50 to 51 in 615bd4a
so we should not build the block if parent_hash != latest
we also must clear the block when a new block was mined,
for this we can install a Canonstatesubscription via the provider and remove the pending block on tick
Additional context
Checklist: