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/rpc header #1799

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Fix/rpc header #1799

merged 15 commits into from
Dec 20, 2024

Conversation

elizabethengelman
Copy link
Contributor

@elizabethengelman elizabethengelman commented Dec 16, 2024

What

This PR makes sure to use the Network.rpc_client function when getting an rpc client, instead of creating one with Client::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:

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 on new_with_headers instead? This would be a change made to the rpc client repo.

Copy link
Member

@willemneal willemneal left a 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!

@leighmcculloch
Copy link
Member

While having the flexibility is nice, does it make sense to deprecate this function and rely on new_with_headers instead? This would be a change made to the rpc client repo.

👍🏻. 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.

@leighmcculloch
Copy link
Member

@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?

@leighmcculloch
Copy link
Member

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.

@leighmcculloch
Copy link
Member

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.

Copy link
Member

@leighmcculloch leighmcculloch left a 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.

Copy link
Member

@leighmcculloch leighmcculloch left a 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
@elizabethengelman
Copy link
Contributor Author

@leighmcculloch cargo-deny bans have been fixed - was able to move httpmock to dev-dependencies to fix this, which it probably should have been anyways.

@elizabethengelman elizabethengelman merged commit 1c0d4e6 into main Dec 20, 2024
28 of 31 checks passed
@elizabethengelman elizabethengelman deleted the fix/rpc-header branch December 20, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Unable to connect to RPC Endpoint that requires API key
4 participants