-
Notifications
You must be signed in to change notification settings - Fork 911
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
Premature close error when fetching 25 or more accounts at once with getAccountInfo #1255
Comments
Not true! When you use http2 pipelining you only open one connection to the server and you allow the RPC to load balance in a way that makes sense for their cluster. Also, you get the incredible benefit of being able to stream the results in and be able to recover the rest of the results when some of them fail (if you use |
I just tried the repro above and it went off without a hitch. Are you still experiencing this? |
Did you try it in my repository? git clone [email protected]:peroxy/solana-web3.js-premature-close-bug.git
yarn install
yarn start I've just tried and reproduced the issue with the commands above. I've also tried updating to the latest web3.js version and it still did not work. |
OK, update. It looks like this started with |
|
OK. Something is up with the Triton RPCs. I'll follow up. If I replace the RPC with one from Helius, it works. cc/ @linuskendall. |
Interesting. I recall trying this out with Triton + Lido RPCs and it did not work with both of them, but maybe I just got unlucky. |
From the release notes for
So yeah, that's almost certainly what's happening here. Triton RPCs don't supply |
Triton is now aware of this. I'm going to close this issue since there's nothing we can do from the library, other than to try to lock to an old version of |
Interestingly this does not fail with Node 16. Does fail with Node 18 or 20. |
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up. |
Overview
Using the Connection class' method getAccountInfo with Promise.all and at least 25 requests will fail with:
I understand this is inefficient; ideally, I should use getMultipleAccounts instead, but that is not always possible. I am using multiple SDKs from different protocols that do not use getMutlipleAccounts method and I have to rely on fetching multiple accounts with Promise.all concurrency to make it faster. We use a non-rate-limited RPC in our backend applications so it should not be an issue.
I have also tried to fetch different account sizes, the one I used in this example has 4064 bytes, but I could reproduce the same error with 250/650/2000 byte account sizes.
Steps to reproduce
Using
"@solana/web3.js": "1.75.0"
version (also fails on 1.73.0, haven't tested on others):To reproduce the error you can clone this repo: https://github.com/peroxy/solana-web3.js-premature-close-bug
and run commands:
Description of bug
I would expect this to work correctly and return all the account infos instead of failing with a very cryptic error.
The text was updated successfully, but these errors were encountered: