-
Notifications
You must be signed in to change notification settings - Fork 168
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
Extract account-decoder-client-types #2872
base: master
Are you sure you want to change the base?
Extract account-decoder-client-types #2872
Conversation
If this PR represents a change to the public RPC API:
Thank you for keeping the RPC clients in sync with the server API @kevinheavey. |
0cdc2c5
to
ae56935
Compare
e120ff4
to
489e4de
Compare
83516f1
to
ff5fac0
Compare
… a free func encode_ui_account
5abb9dc
to
d059ead
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.
Lgtm @kevinheavey, just the question on decode
!
all-features = true | ||
rustdoc-args = ["--cfg=docsrs"] |
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.
Are these extra keys necessary here? I don't see them used anywhere else in the monorepo.
|
||
impl UiAccountData { | ||
/// Returns decoded account data in binary format if possible | ||
pub fn decode(&self) -> Option<Vec<u8>> { |
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.
Why not also make this one a free function, like its encode
counterpart? Then you can drop the bs_58
dependency from this crate, possibly more.
Problem
rpc_client
needs only a small subset ofaccount_decoder
. It brings in some very heavy dependencies such asspl-token-2022
, which we can avoidSummary of Changes
rpc_client
andrpc_client_api
fromacocunt_decoder
into a newaccount_decoder_client_types
crate.UiAccount::encode
to a free funcencode_ui_account
From
impls with free functions to avoid pulling in dependencies. These impls do not fall under the supported APIs outlined here: https://docs.solanalabs.com/backwards-compatibility#rust-cratesOn my machine this improves release build time for
rpc_client_api
by 36%.This PR branches off #2870 so either that should be merged first, or we merge this as one big PR and close #2870