-
Notifications
You must be signed in to change notification settings - Fork 75
feat: improve event utils #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ve-event-utils' of github.com:across-protocol/contracts into chrismaree/improve-event-utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
| return events; | ||
|
|
||
| // Fetch events for all signatures in parallel | ||
| const eventsWithSlots = await Promise.all( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be resource intensive if there are many signatures. Should we consider batching the Promise.all calls with a configurable batch size to improve efficiency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same net efficiency, right? it's the same number of requests. the bigger issue could be the RPC provider blocking this or having an issue with the number of requests but for now we can leave it like this and improve when we get there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I meant splitting in chunks and run them sequentially. Similarly to how we do it here:
https://github.com/UMAprotocol/protocol/blob/e526e5a1caf68ae7be706f6ef9c996660429282a/packages/common/src/EventUtils.ts#L36-L38
But it's ok for now I think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a performance observation but overall looks good!
simple PR to improve the events utils used on SVM. measurably improves performance and enables us to handle more than 1000 event limt.