Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes the _get_last_event method in the ContractWrapper class by introducing concurrent batch processing of block ranges. The optimization changes from a sequential scan through block ranges to a concurrent batch-based approach that can fetch multiple chunks in parallel, significantly speeding up the operation when events are sparse or located in older blocks.
Changes:
- Added
itertoolsimport to support batch processing - Refactored
_get_last_eventto build all chunk ranges upfront and process them in concurrent batches - Introduced a nested
fetch_chunkasync function to encapsulate the event fetching logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Issues attributed to commits in this pull requestThis pull request was merged and Sentry observed the following issues:
|
No description provided.