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

Max cap search results for ots API by default + cli flag to override it #7924

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

wmitsuda
Copy link
Member

Otterscan API search methods allow the user to inform the page size.

This PR adds an internal max (default == 25 results) to cap the page size, regardless of what the user asks.

It also adds a --ots.search.max.pagesize CLI args to override this max (either in erigon and rpcdaemon binaries).

@wmitsuda
Copy link
Member Author

Example JSON-RPC response for ots_searchTransactionsBefore method if user asks a pagesize > than allowed:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "max allowed page size: 100"
  }
}

@AskAlexSharov
Copy link
Collaborator

I like it. We need same for grpc pagination.

@wmitsuda
Copy link
Member Author

fixed the broken tests :)

I think it's now good to be merged, pls @AskAlexSharov

@AskAlexSharov AskAlexSharov merged commit d3f8b58 into erigontech:devel Jul 28, 2023
4 checks passed
@wmitsuda wmitsuda deleted the ots_maxcap branch July 28, 2023 10:59
AskAlexSharov pushed a commit that referenced this pull request Sep 6, 2023
…it (#7924)

Otterscan API search methods allow the user to inform the page size.

This PR adds an internal max (default == 25 results) to cap the page
size, regardless of what the user asks.

It also adds a `--ots.search.max.pagesize` CLI args to override this max
(either in erigon and rpcdaemon binaries).
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.

2 participants