Skip to content

Conversation

@zy0n
Copy link
Contributor

@zy0n zy0n commented Jan 14, 2026

This pull request introduces a new batched event polling mechanism and integrates it into the PollingJsonRpcProvider to improve efficiency and control over event polling. The main changes include the addition of the BatchedPollingEventSubscriber class, modification of the provider to use this new subscriber, and new controls for pausing and resuming event polling.

Event polling improvements:

  • Added the BatchedPollingEventSubscriber class in src/provider/batched-polling-event-subscriber.ts, which polls for events at fixed intervals instead of every block, reducing the number of eth_getLogs calls.
  • Modified the _getSubscriber method in PollingJsonRpcProvider to use BatchedPollingEventSubscriber for event subscriptions, enabling interval-based polling.

Provider control enhancements:

  • Added pause and resume methods to PollingJsonRpcProvider, allowing pausing and resuming of all event subscribers.

@zy0n zy0n force-pushed the zy0n/rpc-polling-fix branch from 203153d to 12ec9f8 Compare January 15, 2026 03:49
Copy link
Contributor

@bhflm bhflm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :)

@zy0n zy0n merged commit 54359fe into main Jan 16, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants