go/proxyd: Make endpoints match Geth, better logging#1730
go/proxyd: Make endpoints match Geth, better logging#1730tynes merged 1 commit intoethereum-optimism:developfrom
Conversation
🦋 Changeset detectedLatest commit: abe231b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1cb5b1c to
d36e6be
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1730 +/- ##
========================================
Coverage 76.52% 76.52%
========================================
Files 82 82
Lines 3041 3041
Branches 466 466
========================================
Hits 2327 2327
Misses 714 714
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
go/proxyd/proxyd.go
Outdated
There was a problem hiding this comment.
Yea - I ran make fmt on it.
d36e6be to
e61de1e
Compare
e61de1e to
abe231b
Compare
optimisticben
left a comment
There was a problem hiding this comment.
Amazing, fantastic work! 🚀 🚀
This PR makes the following changes:
Makes the RPC/WS endpoints match Geth
Rather than use custom paths for RPC/WS endpoints, Geth has the RPC and WS servers listen on different ports. This PR makes proxyd match that behavior. To configure Proxyd in this mode, use the following configuration:
Better logging
This PR adds logging to all incoming requests, attempted WS connections, and exchanged WS messages. Additionally, it adds a randomly-generated
req_idfield to log output that will allow us to trace requests as they go from the web server, to the proxied backend, and back.Example WS logs:
RPC:
Change to how websocket backend groups are defined
Only one backend group can be websocket-enabled. Previously, this was done by defining a
ws_enabledproperty on the backend group to proxy websockets to. To make this simpler, you can now define a singlews_backend_groupconfig property at the top of the file. Example:Note that all backends in the websocket backend group need a websocket URL.
The WS backend group is explicitly defined in the config rather than populated from the backends that have
ws_urls because we may want the flexibility to create a custom group just for websocket-enabled endpoints in the future.