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

Fix client get_program_accounts_with_config calls with context #28772

Merged

Conversation

CriesofCarrots
Copy link
Contributor

Problem

As per #25869, RpcClient::get_program_accounts_with_config() cannot deserialize the responses from all current clusters when with_context is set to true. #17399 added the OptionalContext wrapper to the response from the getProgramAccounts RPC endpoint, but didn't add any handling to client methods. This has been broken in practice since whenever that change was released to public clusters, which unfortunately means all current branches.

Summary of Changes

Add support for OptionalContext to nonblocking::RpcClient::get_program_accounts_with_config()

Fixes #25869

@CriesofCarrots
Copy link
Contributor Author

@jstarry , I picked you because you had assigned the original issue to yourself, but let me know if you want to pass on review. Thx!

Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

Can you add test coverage to the rpc client for with/without context?

@CriesofCarrots
Copy link
Contributor Author

Can you add test coverage to the rpc client for with/without context?

Done in eb7c89f

@CriesofCarrots CriesofCarrots merged commit b18ef88 into solana-labs:master Nov 16, 2022
mergify bot pushed a commit that referenced this pull request Nov 16, 2022
* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config

(cherry picked from commit b18ef88)

# Conflicts:
#	client/src/nonblocking/rpc_client.rs
#	client/src/rpc_client.rs
#	rpc/src/rpc.rs
mergify bot pushed a commit that referenced this pull request Nov 16, 2022
* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config

(cherry picked from commit b18ef88)

# Conflicts:
#	rpc/src/rpc.rs
mergify bot added a commit that referenced this pull request Nov 16, 2022
…ort #28772) (#28846)

* Fix client get_program_accounts_with_config calls with context (#28772)

* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config

(cherry picked from commit b18ef88)

# Conflicts:
#	client/src/nonblocking/rpc_client.rs
#	client/src/rpc_client.rs
#	rpc/src/rpc.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <tyera@solana.com>
mergify bot added a commit that referenced this pull request Nov 17, 2022
…ort #28772) (#28847)

* Fix client get_program_accounts_with_config calls with context (#28772)

* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config

(cherry picked from commit b18ef88)

# Conflicts:
#	rpc/src/rpc.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <tyera@solana.com>
gnapoli23 pushed a commit to gnapoli23/solana that referenced this pull request Dec 16, 2022
…a-labs#28772)

* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config
nickfrosty pushed a commit to nickfrosty/solana that referenced this pull request Jan 4, 2023
…a-labs#28772)

* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config
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.

get_program_accounts_with_config fails to deserialize when with_context is true
2 participants