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

RPC: Return the data length for get account requests #28421

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Oct 17, 2022

Problem

Clients have no way to fetch the size of an account without fetching the entire data buffer of an account.

Summary of Changes

Add a space field to the account response type so that even if a data slice config of length 0 is used, the size of the account can still be known

Fixes #

Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Cool

@jstarry jstarry merged commit 438d96e into solana-labs:master Oct 17, 2022
@jstarry jstarry deleted the rpc/account-space branch October 17, 2022 17:56
@steveluscher
Copy link
Contributor

This busted some web3.js tests. I'll fix 'em!

@steveluscher
Copy link
Contributor

I didn't look too closely; this is written in such a way that you'll also get this value through account subscriptions right?

@jstarry
Copy link
Member Author

jstarry commented Oct 21, 2022

I didn't look too closely; this is written in such a way that you'll also get this value through account subscriptions right?

That's correct, thanks for fixing the tests!

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