Skip to content

Event-polling across consecutive blocks is broken #4119

Open
@therealjmj

Description

@therealjmj

Ethers Version

6.4.0

Search Terms

No response

Describe the Problem

It's patched in my local version and working to scan my "Shield" event which occurs across 2 consecutive blocks during automated tests. The event was completely lost - it took me about 6 hours today to track it down.

I believe this is a logical off-by-one bug - the fix is below. Hope it helps :)

Code Snippet

inside PollingEventSubscriber.#poll:

-        filter.fromBlock = this.#blockNumber + 1;
+        filter.fromBlock = this.#blockNumber; // Updated to fix a bug in polling scans for the same filtered events across consecutive blocks (ie. during automated tests).

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

fixed/completeThis Bug is fixed or Enhancement is complete and published.on-deckThis Enhancement or Bug is currently being worked on.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions