graph-node: Encountering a consistent indexing error on Matic "Found no transaction for event"
- This is a bug report
- I’m trying to deploy my subgraph. It used the ABI of the USDT contract, and is supposed to index an entity whenever the
toin theTransferevent is the address of our contract (i.e. whenever someone staked USDT in the contract).
This works well on Ethereum. On Matic (Polygon), we get the following fatal error:
"failed to process trigger: block #15167232 (0x7b2a…0d6b), transaction 4641fb604c8b6b9d515f57f364e8039fb600ed0471a7dcb7f16f2bd1314501f1: Found no transaction for event"
This is consistent, and reproducible. I tried adding a function that leaves the handler in case: the block number is 15167232, the block number is between 15167200 and 15167240 (thought a range would help), if event.transaction is empty - to no avail, this error still happens. My guess is this happens before my handler code, and therefore, not under my control.
My workaround is to add a higher startBlock number to the yaml, but the we lose tons of events.
My expected behavior is either a resolution that allows me to index the graph, or a way to bypass whatever problem triggers the fatal error.
More details:
- The subgraph can be found at: https://thegraph.com/explorer/subgraph/travelingtechguy/cvipolygon
- I can provide a link to the code, if needed. It has other entities that index well.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 76 (34 by maintainers)
Hey @miguelmota and others here: We cleaned our db and apparently the new Bor version should fix our problem. Your subgraph is syncing. We hope that we now finally have a stable situation. Let us know if there are any problems.
Sync error -
block #16797184@tilacog
Sync error -
block #16785216@tilacog
Sync error -
block #16776192@tilacog
Sync error -
block: #16766208@tilacog
Hypothesis that this is caused by a race condition relating to use of block number instead of block hash for Bor transactions, which should be fixed in this PR: https://github.com/maticnetwork/bor/pull/160
Still experiencing this issue with zkSync Era mainnet:
@tilacog : which table are you referring to?
Currently, to resync a faulty block you must delete the block record from its database table and restart graph-node afterwards.
@tilacog could you please help us out with https://thegraph.com/legacy-explorer/subgraph/lemonadesocial/lemonade-marketplace?version=pending
failed to process trigger: block #18223680 (0xd0aa…7fee), transaction 7651a8dca5c6ece8758e46aabf29daddc3fdd504dded7d6cde0f0c9f29ff5d26: Found no transaction for eventThank you
Sync error -
block #16800192@tilacog
Hey @tilacog
Messages on Polygon that are sent from L1 appear as events that are emitted from the
0x0address. For example, here is a “transaction” that has an event from one of our users that sent a message from L1 -> L2. This message emitted an event (topic0x320958176930804eb66c2343c7343fc0367dc16249590c0f195783bee199d094) on L2 that you can see in this transaction.On any other chain, I would expect this event to be emitted on the transaction that actually updated state. However, on Polygon, the transaction that emits the event is not the transaction that updates state. Might this be the issue that the indexer is running into?
@shanefontaine this will definitely work consistently in the future.
It is still unclear why blocks appear without those transactions at ingestion time, but that error is being actively studied by our and our providers’ teams.
I’ve refetched that block for your subgraph, so It should get back to sync soon.
Sync error -
block #16735872@tilacog It seems to fail to sync the block every few thousand blocks and the subgraph still has 1-2M blocks to index to catch up to head.
Any way to automate the re-sync of the block?
We’ve been trying to fully sync this subgraph for some time now 😅
@tilacog it was making good progress but just got stuck again recently, if you don’t mind taking a look. Thanks!
@tilacog another block sync failure on subgraph. Thanks!
Hey @miguelmota, I’m following that subgraph closely and re-fetching faulty blocks from our storage. As of now, it has resumed syncing, but I’ll keep an eye on it.
Unfortunately, we’ll have to do this manually until this issue persists.
@nachomazzara the issue seems pretty specifically tied to 0x000 -> 0x000 transactions, rather than a more general re-org issue (if it was as you described, I think we would see it for other transactions, unless I have misunderstood your suggestion?)
Thanks for flagging @miguelmota, @tilacog can you take a look?
@nachomazzara we get this also for reasonably old blocks, so I don’t think so.
We cleared the cache, which has resolved this issue for the subgraph we were testing with - @TravelingTechGuy you should be able to restart this subgraph before the problematic block (15167232), and it should index successfully. I will close this issue, but please do re-open if you see a recurrence!
We have identified the issue, which relates to our Matic RPC not including all transactions in
eth_getBlockByHashat some point, which was then cached in the database, resulting in the ongoing issue. This may relate to the new Bor requirement to specifically return bor logs. We are planning to clear the cache which should resolve the issue, as Matic RPCs are now returning the correct number of transactions for these blocks cc @leoyvens @tilacog