Replies: 1 comment
-
In a polling provider, there is no way to ensure correct order across different events; the polling uses getLogs on each block, so it is subject to the order the HTTP requests resolve. In v6, the filter-based provides will honour whatever order the node guarantees (except during reconnection, during which time the getLogs method is used to sync the events that occurred during disconnect). If you require ordered events, in general, it is safe to subscribe to all necessary events in the same filter and then process them manually. In v6 this will also be possible, but they will be processed automatically. Does that make sense? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
5.7.1
Search Terms
No response
Describe the Problem
I am using the Avalanche testnet for my project. There are two events fired in one of the methods in the smart contract. When I check the transaction logs, events are in same order in which they are emitted. When I am listening for these events with ethers, the order when they arrive is sometimes reversed. For my use case the order should be same as they emitted in the smart contract. Is it related to the ethers.js or Avalanche and how do I fix it?
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
node.js (v12 or newer)
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions