delvtech / council-kit

A monorepo of apps and packages for the Council governance protocol.
https://council.delv.tech
GNU Affero General Public License v3.0
27 stars 22 forks source link

Add method for safely fetching large event queries #265

Closed ryangoree closed 1 year ago

ryangoree commented 1 year ago

Alchemy was returning errors when fetching VoteChange events due to their query limit which requires a block range of 2k or log limit of 10k. This PR adds a new method on the ContractDataSource called getEvents which will recursively split the block range in half if the request fails until all events in the range are fetched.

image