-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat: grpc header forwarding #508
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Heimdall Review Status
|
potterbm-cb
force-pushed
the
bryan/chore-header-forwarding-grpc
branch
2 times, most recently
from
November 7, 2024 01:37
88d549e
to
33200e7
Compare
potterbm-cb
force-pushed
the
bryan/chore-header-forwarding-grpc
branch
from
November 7, 2024 16:37
33200e7
to
1eaae78
Compare
potterbm-cb
force-pushed
the
bryan/chore-header-forwarding-grpc
branch
from
November 7, 2024 18:02
931ef14
to
4529b27
Compare
potterbm-cb
force-pushed
the
bryan/chore-header-forwarding-grpc
branch
from
November 7, 2024 18:04
4529b27
to
6b03e8b
Compare
marklandgrebe-cb
approved these changes
Nov 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Some blockchain networks (looking at you, cosmos) use grpc to communicate with the blockchain node.
This PR makes updates to the
headerforwarder
package to make it easy to use with grpc clientsAdditional Improvements: Outgoing header forwarding
This PR also introduces functionality to set outgoing headers on both grpc and http requests. Previously this was accomplished by individual clients (actually only mesh-geth-sdk was modified so far) defining context-creation behavior. Unfortunately, the request context plumbing was pretty ungainly and required each caller of this SDK to implement their own code for it.
Now the outgoing headers will be captured in the server middleware, stored by request ID, and set on outgoing http and grpc requests via the
http.RoundTripper
andgrpc.UnaryClientInterceptor
respectivelyUpgrade go version to 1.19
In order to get a version of
grpc
with a metadata bugfix this PR upgrades the go version of this moduleNotes to reviewers
All of the substantive changes here happen in the
headerforwarder/
package.Other changes fall into two categories:
contextFromRequest
changes from v0.8.6templates/
,client/
, andserver/
directoriesgrpc
uses theatomic
package which isn't available in 1.18ioutil
as it was deprecated and thus failing linting