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

API: Introduce init flags for klay_getLogs and klay_getFilterLogs APIs #903

Merged
merged 7 commits into from
Feb 26, 2021

Conversation

aidan-kwon
Copy link
Member

Proposed changes

Introduce init flags for klay_getLogs and klay_getFilterLogs APIs

  • api.filter.getLogs.deadline: Execution deadline for log collecting filter APIs (Default: 10s)
  • api.filter.getLogs.maxitems: Maximum allowed number of return items for log collecting filter API (Default: 10000)

Test result

# curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"klay_getLogs","params":[{"fromBlock":"0x3210300","toBlock":"0x3210400"}],"id":1}' http://localhost:8551
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"query returned more than 10000 results"}}
# curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"klay_getLogs","params":[{"fromBlock":"0x3210300","toBlock":"0x3210400"}],"id":1}' http://localhost:8551
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"query timeout exceeded"}}

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

node/cn/filters/api.go Outdated Show resolved Hide resolved
node/cn/filters/filter.go Outdated Show resolved Hide resolved
cmd/utils/flags.go Outdated Show resolved Hide resolved
ehnuje
ehnuje previously approved these changes Feb 25, 2021
KimKyungup
KimKyungup previously approved these changes Feb 25, 2021
yoomee1313
yoomee1313 previously approved these changes Feb 25, 2021
@aidan-kwon aidan-kwon merged commit d3de9b3 into klaytn:dev Feb 26, 2021
@aidan-kwon aidan-kwon deleted the 210224-getLogs branch February 26, 2021 06:18
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.

None yet

5 participants