Skip to content

Get events issue for latest on 0.20.3 and above #3035

@Larkooo

Description

@Larkooo

We seem to observe some weird inconsistency on our indexers when using pathfinders with version 0.20.3 and above.

Not sure if it was happening before 0.20.3. Since there was quite a big change in that version regarding preconfirmed blocks.

What I'm aware of though is that when our indexer sometiems queries events for a block, from 2647215 and to 2647215 (which should return all events in that block), it instead returns 0 events. Even though we assert that the pathfinder has correctly synced up to that block by using a BlockHash tag for both the from and to params.

Our event filter looks like this. It should absolutely return all events up to the latest block which is 2647215 then we assert it using a blockhash tag
Image

2025-10-03T18:58:43.179796Z DEBUG torii::indexer::fetcher: Starting event fetch for 1 contracts contracts_count=1 latest_block=2647215
2025-10-03T18:58:43.179846Z DEBUG torii::indexer::fetcher: Preparing to fetch events for contract contract="0x2d26295d6c541d64740e1ae56abc079b82b22c35ab83985ef8bd15dc0f9edfb" from_block=2647215 to_block=2647215
2025-10-03T18:58:43.179882Z DEBUG torii::indexer::fetcher: Retrieving events for 1 contracts batch_size=1
2025-10-03T18:58:43.284060Z DEBUG torii::indexer::fetcher: Retrieved events for 1 contracts duration=104.163221ms batch_size=1
2025-10-03T18:58:43.284137Z DEBUG torii::indexer::fetcher: Processing events page for contract contract="0x2d26295d6c541d64740e1ae56abc079b82b22c35ab83985ef8bd15dc0f9edfb" from_block=2647215 to_block=2647215
2025-10-03T18:58:43.284158Z DEBUG torii::indexer::fetcher: Received events page for contract contract="0x2d26295d6c541d64740e1ae56abc079b82b22c35ab83985ef8bd15dc0f9edfb" raw_events_count=0 has_continuation=false

Got 0 events here.

curl -X POST https://api.cartridge.gg/x/starknet/mainnet \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "starknet_getEvents",
    "params": [{
      "from_block": { "block_number": 2647215 },
      "to_block": { "block_number": 2647215 },
      "address": "0x2d26295d6c541d64740e1ae56abc079b82b22c35ab83985ef8bd15dc0f9edfb",
      "keys": [],
      "chunk_size": 1024
    }]
  }' | jq '.result.events | length'

This returns 16 events.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions