Skip to content

core/validatorapi: fix SSE proxying#4495

Merged
KaloyanTanev merged 3 commits intomainfrom
kalo/fix-sse-proxying
Apr 24, 2026
Merged

core/validatorapi: fix SSE proxying#4495
KaloyanTanev merged 3 commits intomainfrom
kalo/fix-sse-proxying

Conversation

@KaloyanTanev
Copy link
Copy Markdown
Collaborator

VC was receiving 502s on SSE

category: bug
ticket: none

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes SSE reverse-proxying in core/validatorapi that was causing validator clients to receive 502s by correcting httputil.ReverseProxy configuration for streaming requests.

Changes:

  • Clear ReverseProxy.Director before setting ReverseProxy.Rewrite to avoid ServeHTTP rejecting the proxy configuration.
  • Use ProxyRequest.SetURL(targetURL) in the rewrite function to correctly apply the upstream target URL for SSE requests.
  • Add an internal test that spins up an upstream SSE server and verifies the /eth/v1/events stream is proxied end-to-end.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
core/validatorapi/router.go Fixes SSE reverse proxy setup by switching cleanly to Rewrite mode and applying SetURL for correct upstream targeting.
core/validatorapi/router_internal_test.go Adds an end-to-end SSE proxy test to ensure streaming responses work and don’t regress.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/validatorapi/router_internal_test.go Outdated
Comment thread core/validatorapi/router_internal_test.go
@KaloyanTanev KaloyanTanev requested a review from Copilot April 24, 2026 16:15
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.09%. Comparing base (97959c4) to head (954219b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4495      +/-   ##
==========================================
+ Coverage   56.56%   57.09%   +0.52%     
==========================================
  Files         245      245              
  Lines       32817    32826       +9     
==========================================
+ Hits        18564    18741     +177     
+ Misses      11895    11721     -174     
- Partials     2358     2364       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaloyanTanev KaloyanTanev merged commit 709efcd into main Apr 24, 2026
14 of 16 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/fix-sse-proxying branch April 24, 2026 16:32
@KaloyanTanev KaloyanTanev mentioned this pull request Apr 24, 2026
KaloyanTanev added a commit that referenced this pull request Apr 24, 2026
* Fix SSE proxying (#4495)

* cmd: surface remote state in list (#4497)

* cmd: surface remote state in list

* addressed copilot finding

* dump available pubkeys

* fixed tests to satisfy copilot

---------

Co-authored-by: Andrei Smirnov <andrei@obol.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants