enviodev / hyperindex

📖 Blazing-fast multi-chain indexer
https://envio.dev
76 stars 5 forks source link

Event Skip on handler in Velodrome Indexer #289

Open jfarid27 opened 2 weeks ago

jfarid27 commented 2 weeks ago

Describe the bug

In the Reproduce section there is a state that reproduces a bug, where an event is not being captured at a specific block on Base. The details:

  1. In this setup in the config.yaml, the Base indexer's start block is 14192630.

  2. The exact block we are trying to capture is located 14192634. The on chain event is Pool Created located here: https://basescan.org/tx/0x8060b54a0cab5cf1710521a29dc31354b08a1c450832d7141b417cc801da0742#eventlog.

  3. Later in block 14192694, a PoolSwap event is emitted, and in the loader it looks for the PoolCreated event. Strangely, it cannot find the entity, and it causes the indexer to fail. This shouldn't happen since the PoolCreated event should have fired and stored the data.

To Reproduce

  1. Download enviodev/velodrome-indexer#157 this PR sets up the bug.
  2. Run the PR. It is expected that the Pool Created event fires.
  3. The event will fail during a pool swap, after looking for the Pool Created event. Console.logs will be dumped, but the PoolCreated event will not show console.log or context.debug events, showing the handler doesn't fire. This is causing the bug in the swap event as it cannot find the pool during the loader call.

Expected behavior

PoolCreated should fire on block 14192634.

Screenshots

The Linked PR should be enough to test, please download enviodev/velodrome-indexer#157 and run the indexer.

Local (please complete the following information):

Hosted Service (please complete the following information):

Additional context Chatted with @moose-code on the issue. Will end up pushing a bugfix in the velodrome-indexer just to get the indexer running again which will just log the error, but the goal will probably be to get the event firing.

chrisais9 commented 2 weeks ago

May related to #286

jfarid27 commented 2 weeks ago

May related to #286

Yeah Jon Jon did exactly mention that. He said to make this issue at least to document the error scenario.

JonoPrest commented 2 weeks ago

@jfarid27, there have been a few fixes in the last two days that could have contributed to this. I haven't rerun your indexer at the branch you shared yet and the linked deployment is gone from the hosted service.

If the issue is persisting with 2.6.1 then I will look into this on Monday 🙏🏼

moose-code commented 1 week ago

I've just deployed another version on v2.6.1 on the hosted service so we can validate thanks @JonoPrest https://envio.dev/app/enviodev/velodrome-indexer/866f822

cc @jfarid27

moose-code commented 1 week ago

Sorry just realized I bumped main and haven't deployed the erroneous branch. Will do that too now