Skip to content

Add support for VM HTTP2 handlers#3294

Merged
StephenButtolph merged 71 commits intomasterfrom
cmux
Jun 6, 2025
Merged

Add support for VM HTTP2 handlers#3294
StephenButtolph merged 71 commits intomasterfrom
cmux

Conversation

@joshua-kim
Copy link
Copy Markdown
Contributor

@joshua-kim joshua-kim commented Aug 14, 2024

Why this should be merged

Adds native support for GRPC services being registered over the avalanchego http server. This adds support for streaming via grpc as an alternative to websockets.

How this works

  1. Uses h2c's http handler to support plaintext http2
  2. Makes a change to rpcchainvm to fix a bug where headers that are updated in the plugin process are not reflected on avalanchego's side by returning a response at the end of the Handle rpc that includes headers
  3. Introduces a new rpc for the http request request.Body so that the plugin process can stream the body instead of the current behavior which uses io.ReadAll which may not be possible in the case of a streaming rpc.

How this was tested

Added a e2e test for unary + streaming rpcs over rpcchainvm

@joshua-kim joshua-kim force-pushed the cmux branch 5 times, most recently from 56ba07f to a67b617 Compare August 22, 2024 18:38
@joshua-kim joshua-kim changed the title wip Add support for VM gRPC services Sep 3, 2024
Comment thread proto/http/http.proto
Comment thread proto/platform/platform.proto Outdated
@joshua-kim joshua-kim force-pushed the cmux branch 2 times, most recently from e59b451 to e0a43d2 Compare September 4, 2024 14:41
Comment thread vms/rpcchainvm/ghttp/http_client.go Outdated
@joshua-kim joshua-kim self-assigned this Sep 4, 2024
@joshua-kim joshua-kim added the enhancement New feature or request label Sep 4, 2024
@joshua-kim joshua-kim marked this pull request as ready for review September 4, 2024 15:09
Comment thread api/server/grpc_router.go Outdated
Copy link
Copy Markdown
Contributor

@marun marun left a comment

Choose a reason for hiding this comment

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

Would it be possible to elaborate as to the motivation for this addition? The current 'why this should be merged' in the description seems more like 'what'.

Comment thread snow/engine/enginetest/vm.go
Comment thread vms/example/xsvm/grpc_service.go Outdated
Comment thread vms/rpcchainvm/ghttp/http_client.go Outdated
Comment thread vms/rpcchainvm/vm_client.go Outdated
Comment thread vms/rpcchainvm/vm_server.go Outdated
Comment thread tests/e2e/vms/xsvm.go Outdated
Comment thread tests/e2e/vms/xsvm.go
@joshua-kim
Copy link
Copy Markdown
Contributor Author

Would it be possible to elaborate as to the motivation for this addition? The current 'why this should be merged' in the description seems more like 'what'.

Added

@marun
Copy link
Copy Markdown
Contributor

marun commented Sep 4, 2024

The upgrade failure is legit - I'm guessing you might need to rebase?

From the logs:

[09-04|15:26:54.904] FATAL chains/manager.go:392 error creating required chain {"subnetID": "11111111111111111111111111111111LpoYY", "chainID": "2BhsWVwQzJL67dSHQfkJ9hEgv79RPURVGeAzmmyeRkkX4tyn8A", "vmID": "mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6", "error": "error while creating new snowman vm database contains incompatible genesis (have ed752c73b66a9c010be62b2cec0088e9e120e6bdd7680fcec50bf880a0b13a87, new 751020f3cac7bf223d5754fef14810191c6669f758a2eb10be17dd31d43e81f2)"}

@joshua-kim
Copy link
Copy Markdown
Contributor Author

joshua-kim commented Sep 4, 2024

The upgrade failure is legit - I'm guessing you might need to rebase?

I think my coreth branch fell behind master. Gonna rebase my coreth branch again.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 6, 2024

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

@github-actions github-actions bot added the lifecycle/stale Inactive for 60 days label Oct 6, 2024
@joshua-kim joshua-kim added lifecycle/frozen and removed lifecycle/stale Inactive for 60 days labels Oct 9, 2024
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
@joshua-kim joshua-kim changed the title Add support for VM gRPC services Add support for VM HTTP2 handlers Jun 6, 2025
@joshua-kim joshua-kim changed the title Add support for VM HTTP2 handlers Add support for VM Http2 handlers Jun 6, 2025
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Comment thread vms/example/xsvm/api/ping.go Outdated
Comment thread api/server/http2_router.go Outdated
Comment thread api/server/http2_router.go Outdated
Comment thread api/server/http2_router.go Outdated
Comment thread api/server/http2_router_test.go Outdated
Comment thread api/server/http2_router_test.go Outdated
Comment thread api/server/server.go
Comment thread api/server/server.go Outdated
Comment thread vms/example/xsvm/vm.go Outdated
Comment thread vms/rpcchainvm/vm_server.go Outdated
joshua-kim and others added 9 commits June 6, 2025 11:28
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
@StephenButtolph StephenButtolph added this pull request to the merge queue Jun 6, 2025
@StephenButtolph StephenButtolph removed this pull request from the merge queue due to a manual request Jun 6, 2025
@StephenButtolph StephenButtolph changed the title Add support for VM Http2 handlers Add support for VM HTTP2 handlers Jun 6, 2025
@joshua-kim
Copy link
Copy Markdown
Contributor Author

Related coreth pr ava-labs/coreth#1006

Signed-off-by: Joshua Kim <[email protected]>
@StephenButtolph StephenButtolph added this pull request to the merge queue Jun 6, 2025
Merged via the queue into master with commit 3ee09b9 Jun 6, 2025
28 checks passed
@StephenButtolph StephenButtolph deleted the cmux branch June 6, 2025 18:08
@github-project-automation github-project-automation bot moved this from Ready 🚦 to Done 🎉 in avalanchego Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants