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

fix: limit batch rpc max count #3630

Merged
merged 1 commit into from
May 2, 2024
Merged

fix: limit batch rpc max count #3630

merged 1 commit into from
May 2, 2024

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Apr 30, 2024

What it solves

When safe apps request many RPC calls, the RPC batch limit of e.g. Infura gets reached on mainnet.

How this PR fixes it

  • Limits batch requests to max 10 requests

How to test it

  • Open a Safe app that does many RPC requests (e.g. Cow Swap)

Checklist

  • I've tested the branch on mobile πŸ“±
  • I've documented how it affects the analytics (if at all) πŸ“Š
  • I've written a unit/e2e test for it (if applicable) πŸ§‘β€πŸ’»

@schmanu schmanu requested a review from compojoom April 30, 2024 14:34
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: βœ… success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1006.32 KB (🟑 +22 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

Coverage report

St.❔
Category Percentage Covered / Total
🟑 Statements
79.07% (+0% πŸ”Ό)
11234/14207
πŸ”΄ Branches 58.55% 2658/4540
🟑 Functions 66.09% 1811/2740
🟒 Lines
80.34% (+0% πŸ”Ό)
10119/12596

Test suite run success

1422 tests passing in 198 suites.

Report generated by πŸ§ͺjest coverage report action from cc7392a

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!
Does it mean that there will be more batches sent?

@schmanu
Copy link
Member Author

schmanu commented Apr 30, 2024

Good find! Does it mean that there will be more batches sent?

Yes exactly. With some of my Safes I cannot use CoW Swap anymore as it can not load the balances due to too big batches and Infuras restrictions. This fixes the app for those Safes for me.

Ethers will manage the batch size internally. The BrowserProvider for the connected wallet uses a limit of 1 btw disabling batch requests.

@schmanu schmanu self-assigned this Apr 30, 2024
@schmanu schmanu merged commit 388b6ee into dev May 2, 2024
14 checks passed
@schmanu schmanu deleted the fix/limit-batch-rpc-calls branch May 2, 2024 07:25
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants