-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
RPC uses base58 for large binary leading to slow response #10140
Comments
This would likely reduce the load on our RPC servers significantly. |
If a new API endpoint because we want a new encoding, why base64 and not unicode via |
For this endpoint, how about we return an error for large accounts, and perhaps that error includes a hash of the account data? |
I was thinking of allowing the caller to supply their preferred encoding as an option to some of the existing RPC methods |
Umm, so caller has the option to DOS? |
Imposing a max response length for base58 at the same time would solve that and allow for a smooth migration. Large base58 responses already take forever or time out already. Run |
Got it, yeah, perfect |
Priority here should be on adding an optional user-provided encoding to |
Problem
RPC responses encodes
account.data
with base58:solana/client/src/rpc_response.rs
Line 78 in ad7b113
base58 isn't suited for large arbitrary-sized binary blobs. it's only for hash: #9490 (comment)
And it's very easy to attack dos. Also, viewing program account data (which tends to be large by definition) takes long time to retrieve via RPC.
As predicted theoretically, this is quadratic time increase to the size of account.data:
Proposed Solution
Use base64? But compat... ;)
FYI: @CriesofCarrots
Discovered via #9490.
The text was updated successfully, but these errors were encountered: