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

bor: increase max limit for list span api #1180

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

shohamc1
Copy link
Contributor

@shohamc1 shohamc1 commented Sep 3, 2024

Description

The max limit of spans/list api is set to 20 which is very small. Currently each span is around 6 KB, we can fit ~160 in a 1 MB response size. This PR sets the limit to 150 to account for future span size growth.

Context: Erigon would like to efficiently fetch spans from heimdall for an improved initial sync mechanism. We would like to batch fetch spans cut down the number of requests sent to the heimdall service.

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply

Cross repository changes

  • This PR requires changes to bor
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai or amoy
  • I have created new e2e tests into express-cli

Manual tests

➜  ~ curl 'http://localhost:1317/bor/span/list?page=1&limit=10' | jq | grep "span_id" | wc -l
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  132k    0  132k    0     0   173k      0 --:--:-- --:--:-- --:--:--  173k
      10
➜  ~ curl 'http://localhost:1317/bor/span/list?page=1&limit=150' | jq | grep "span_id" | wc -l
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2830k    0 2830k    0     0  12.7M      0 --:--:-- --:--:-- --:--:-- 12.7M
     150
➜  ~ curl 'http://localhost:1317/bor/span/list?page=1&limit=200' | jq | grep "span_id" | wc -l
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2830k    0 2830k    0     0  18.6M      0 --:--:-- --:--:-- --:--:-- 18.6M
     150

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.36%. Comparing base (ae5a160) to head (65acc04).
Report is 34 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1180      +/-   ##
===========================================
- Coverage    76.40%   76.36%   -0.04%     
===========================================
  Files           53       53              
  Lines         5929     5932       +3     
===========================================
  Hits          4530     4530              
- Misses        1139     1141       +2     
- Partials       260      261       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@manav2401 manav2401 changed the title spans: increase max limit for list api bor: increase max limit for list span api Sep 5, 2024
@manav2401 manav2401 merged commit ad9219f into maticnetwork:develop Sep 5, 2024
8 of 10 checks passed
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