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

feat: grpc header forwarding #508

Merged
merged 10 commits into from
Nov 8, 2024
Merged

Conversation

potterbm-cb
Copy link
Contributor

@potterbm-cb potterbm-cb commented Oct 29, 2024

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 clients

Additional 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 and grpc.UnaryClientInterceptor respectively

Upgrade 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 module


Notes to reviewers

All of the substantive changes here happen in the headerforwarder/ package.

Other changes fall into two categories:

  • revert contextFromRequest changes from v0.8.6
    • these changes are concentrated in the templates/, client/, and server/ directories
  • upgrade golang to 1.19
    • this is necessary because grpc uses the atomic package which isn't available in 1.18
    • this upgrade required removing all references to ioutil as it was deprecated and thus failing linting

@cb-heimdall
Copy link

cb-heimdall commented Oct 29, 2024

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@potterbm-cb potterbm-cb force-pushed the bryan/chore-header-forwarding-grpc branch 2 times, most recently from 88d549e to 33200e7 Compare November 7, 2024 01:37
@potterbm-cb potterbm-cb force-pushed the bryan/chore-header-forwarding-grpc branch from 33200e7 to 1eaae78 Compare November 7, 2024 16:37
@potterbm-cb potterbm-cb force-pushed the bryan/chore-header-forwarding-grpc branch from 931ef14 to 4529b27 Compare November 7, 2024 18:02
@potterbm-cb potterbm-cb force-pushed the bryan/chore-header-forwarding-grpc branch from 4529b27 to 6b03e8b Compare November 7, 2024 18:04
@potterbm-cb potterbm-cb marked this pull request as ready for review November 7, 2024 19:45
@coinbase coinbase deleted a comment from wallkd Nov 7, 2024
@potterbm-cb potterbm-cb merged commit dab4a57 into master Nov 8, 2024
11 checks passed
@potterbm-cb potterbm-cb deleted the bryan/chore-header-forwarding-grpc branch November 8, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants