Closed poplexity closed 2 years ago
From the docs: topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options.
We don't handle this nested array in the topics array well... topic.startsWith is not a function (when it's a nested array)
Also, topics handling is not currently accurate. Note here what order-dependent means:
Topics is an ordered array of data. Notice how the first item in the topics field above matches the event signature of our Transfer(address,address,uint256) event in the previous section. This means we are specifically querying for a Transfer event between address 0xb46c2526e227482e2ebb8f4c69e4674d262e75 and 0x54a2d42a40f51259dedd1978f6c118a0f0eff078 (the second and third topics).
A note on specifying topic filters:
A transaction with a log with topics [A, B] will be matched by the following topic filters:
This was closed because I fixed the address as an array issue... we still are getting reports that getLogs doesn't return what's expected.
From Meter.io, running on testnet:
Xiaohan, [Nov 13, 2021 at 11:29:20 AM]: we watch the transactions on our contract address for transactions
and not getting the expected events
================================================================ Url: https://testnet.telos.net/evm Deployer: 0x0205c2D862cA051010698b69b54278cbAf945C0b Gas Limit: 8000000 Gas Price: 500000000000 Deploy Cost: 3.606724644825338368
Chain Id: 10 Threshold: 1 Relayers: 0x1AdC3db00957F3DB089CAc6fc60B2fa0d37F4d43 Bridge Fee: 0 Expiry: 200
================================================================
I believe I may have fixed this issue... or I have fixed other issues. Will leave this open in case we get reports that the getLogs issues are still happening.
2021-11-09T14:12:51: RPCERROR: 2021-11-09T14:12:51.974Z - {} | Method: eth_getLogs | REQ: [ { "fromBlock": "0x1", "toBlock": "0xae9f50d", "topics": [ [ "0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9" ] ] } ]