-
Notifications
You must be signed in to change notification settings - Fork 77
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/rpc header #1799
Fix/rpc header #1799
Conversation
this will make sure that we're adding the necessary rpc provider headers, if they are required for the given provider
eb10727
to
e417f10
Compare
2aee7d9
to
dd83fc2
Compare
49ff29c
to
a7929c5
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.
Looks good to me!
👍🏻. It's breaking so we'd need to delay the actual removal until the next major release, but you could add a deprecated attribute now. |
@elizabethengelman Can you fix the cargo-deny bans issues, try to align on not duplicate deps or if it's not possible, then add a line in the deny toml to allow the dupe deps? |
This PR is blocked on a legal sign off because the http-mock uses a license we don't currently have approved. I expect it'll just be a formality in this case. |
Unblocked and I pushed a modification to deny.toml for the license approval. |
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.
I think this is good to go, except for the bans need updating.
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.
I think this is good to go, except for the bans need updating.
also - move soroban-test httpmock dep to dev-dependencies - use workspace dep for stellar-ledger test
@leighmcculloch cargo-deny bans have been fixed - was able to move |
What
This PR makes sure to use the
Network.rpc_client
function when getting an rpc client, instead of creating one withClient::new. It's important to do use
rpc_client` because it makes sure to pass in additional headers to the rpc client, including adding auth headers which are needed for some rpc providers.This change was made in:
Network.helper_url
get_remote_contract_spec
: This was the main reason for the bug reported in Unable to connect to RPC Endpoint that requires API key #1728, becauseinvoke
callsget_remote_contract_spec
.Fixes #1728.
Why
As part of supporting third-party rpc providers, we need to pass in the authentication as a header for some providers. This was done in #1618 , but must have missed making the update to other scenarios that were creating a new rpc client with
Client::new
.Known limitations
Curious to hear what others think, but as the rpc client is currently written, it is still possible to create an rpc client with required headers using
Client::new
. While having the flexibility is nice, does it make sense to deprecate this function and rely onnew_with_headers
instead? This would be a change made to the rpc client repo.