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: 4 additions & 2 deletions crates/optimism/flashblocks/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ where
if fut.poll_unpin(cx).is_ready() {
// if we have a new canonical message, we know the currently tracked flashblock is
// invalidated
if this.current.take().is_some() {
trace!("Clearing current flashblock on new canonical block");
if let Some(current) = this.current.take() {
trace!(parent_hash=%current.block().parent_hash(), block_number=current.block().number(), "Clearing current flashblock on new canonical block");
return Poll::Ready(Some(Ok(None)))
}
}
Expand All @@ -217,12 +217,14 @@ where
return Poll::Pending;
}

let now = Instant::now();
// try to build a block on top of latest
match this.execute() {
Ok(Some(new_pending)) => {
// built a new pending block
this.current = Some(new_pending.clone());
this.rebuild = false;
trace!(parent_hash=%new_pending.block().parent_hash(), block_number=new_pending.block().number(), flash_blocks=this.blocks.count(), elapsed=?now.elapsed(), "Built new block with flashblocks");
return Poll::Ready(Some(Ok(Some(new_pending))));
}
Ok(None) => {
Expand Down