Skip to content
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

perf(get events) #378

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

perf(get events) #378

wants to merge 10 commits into from

Conversation

Trantorian1
Copy link
Collaborator

Pull Request type

  • Refactoring (no functional changes, no API changes)

What is the current behavior?

The current implementation of starknet_getEvents in Madara suffers from very poor performance compared to other nodes. This pr's goal is to improve this (will benchmark this again before un-drafting the pull request).

image
starknet_getEvents performance across nodes, bench measured with sync from a local fgw

What is the new behavior?

  • Refactored block event retrieval to avoid unnecessary allocations, clones and key checks
  • Better handling of StarknetRpcApiError::BlockNotFound edge cases.
  • Added tests to starknet_getEvents to ensure proper functionality

Note

Further new behavior will be documented as this PR is developed

Does this introduce a breaking change?

Yes. Calls to starknet_getEvent would previously return Ok() if from_block or to_block were higher than the latest block. This has been changed to return StarknetRpcApiError::BlockNotFound.

@Trantorian1 Trantorian1 added bug Something isn't working perf labels Nov 6, 2024
@Trantorian1 Trantorian1 self-assigned this Nov 6, 2024
@Trantorian1 Trantorian1 mentioned this pull request Dec 10, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working perf
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant