-
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
Add Binary64 option for account data #11474
Conversation
We'll need an update to |
Allowing the user to optionally supply an "offset"/"length" seems pretty nice too, for when they know they only need a slice of a large account |
ae10f23
to
7d79eb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach looks fine to me. I haven't examined to see why the cli/deploy test is unhappy yet.
I like the idea of an offset/length specification, and could help with that in a follow-up
rpc_client was trying to decode as Binary instead of Binary64. After I fixed that it seems to be ok, although my fix is a bit hacky. |
2cfc1ff
to
2d98e4c
Compare
Ah, serde_json must go with the first enum variant that matches type 😕 Looks like you just need to update this line to Binary64 to fix the CI failure: solana/cli/src/offline/blockhash_query.rs Line 353 in a527021
|
a527021
to
77c46db
Compare
@CriesofCarrots - sure, can you queue this up for next week. We now do have a real use case where it would be more efficient for the client (and the node) if they were able to only request partial account data |
77c46db
to
b15d108
Compare
base64 does seem quite a bit faster. |
Codecov Report
@@ Coverage Diff @@
## master #11474 +/- ##
=========================================
- Coverage 81.8% 81.7% -0.1%
=========================================
Files 323 323
Lines 74965 74982 +17
=========================================
- Hits 61325 61307 -18
- Misses 13640 13675 +35 |
Definitely faster. I did a I wonder if we could do even better with just hex encoding (as an alternative for when increase in encoding size doesn't matter, like small partial account reads) , would that be quick to bench @sakridge? |
Hex seems worse:
That's 8k of random data which with base58 is all I can stand to wait for. It really falls apart with random data. |
Hex is worse 🤯. |
yep @mvines any blockers for merging this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
Problem
bs58 encoding of large data is slow
Summary of Changes
Add base64 option and limit bs58 requests to account data less that 128 bytes.
Fixes #10140