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

[WIP] Add limitation for RPC slow queries #4469

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented May 24, 2024

What problem does this PR solve?

Currently, we have some RPC API from indexer such as get_cells, get_transactions, get_cells_capacity which may cost a lot of computing resources, it may occupy all the tokio tasks, and ckb can not response to other RPC APIs.

What is changed and how it works?

This PR try to fix this issue by adding limitation on computing resources for slow queries

What's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@chenyukang chenyukang requested a review from a team as a code owner May 24, 2024 01:45
@chenyukang chenyukang requested review from quake and removed request for a team May 24, 2024 01:45
@driftluo
Copy link
Collaborator

driftluo commented Aug 7, 2024

I think there is something wrong with the modification of the iterator. When the user's request value exceeds the default value, it should be forced to change to the upper limit and return the result instead of returning an error directly. This is also the case in eth filter-related RPCs.

Just change the following

let limit = std::cmp::min(limit.value() as usize, iterator_next_limit);

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