Skip to content
Open
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
15 changes: 10 additions & 5 deletions evm/evm-rpc/src/data-source/finalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ class Finalizer {

if (info.hash === ref.hash) {
this.unshift(probes.slice(i + 1))
// Record the finalized head only. Emitting it as its own batch
// would share the `output` queue with head blocks and stall
// ingestion; `visit()` attaches `current` to the next head batch
// instead.
this.current = ref
return this.output.put({
blocks: [],
finalizedHead: ref
})
return
} else {
probes.splice(i, 1)
}
Expand Down Expand Up @@ -97,7 +98,11 @@ class Finalizer {
}
this.checks.forcePut(null)
return {
blocks: batch.blocks
blocks: batch.blocks,
// Attach the latest finalized head to the head batch (see
// `probe()`). Deferring it to the next head batch is safe:
// finality lags the head by minutes, and the consumer max-guards it.
finalizedHead: this.current
}
}
}
Expand Down
Loading