Skip to content

PoC to allow indexing unsealed finalized execution results #727

Closed
@peterargue

Description

@peterargue

Currently, EVM Gateways always use event streaming for the latest events, which are always for sealed blocks. There is work starting soon to add support for streaming data from unsealed finalized blocks, but that is still several months away. In the mean time, we'd like to create a gateway PoC that demonstrates indexing EVM execution data soon after execution (soft-finality).

It turns out this is possible today using the polling version of the Access API, specifically the GetEventsForBlockIDs. The general flow would be:

  1. Subscribe to new finalized blocks using the SubscribeBlockHeaders* endpoints.
  2. For each new finalized block, call GetEventsForBlockIDs using the block's ID for each of the EVM event types
  3. Index the events normally

Notes:

  • It's possible for an unsealed execution result to be incorrect and abandoned (execution fork). This is caused by a bug and is very rare, but there needs to be a way to handle it when it happens.
  • There currently isn't an easy way for the gateway to know if it got an incorrect result. This would require changes to the Access API, which we're not likely going to do for a PoC. Since there is a proper solution coming to ANs soon, we will accept this limitation and rely on operators to detect and handle these forks manually.
  • There is already a way to manually rollback a gateway to a past block that we can use. We will need to ensure this also works for the new state index as well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions