Skip to content

proxyd: Fix concurrent WS write panic#2711

Merged
mergify[bot] merged 1 commit intoethereum-optimism:developfrom
mslipper:bugfix/proxyd-panic
Jun 8, 2022
Merged

proxyd: Fix concurrent WS write panic#2711
mergify[bot] merged 1 commit intoethereum-optimism:developfrom
mslipper:bugfix/proxyd-panic

Conversation

@mslipper
Copy link
Collaborator

@mslipper mslipper commented Jun 8, 2022

Fixes a panic in the websocket proxyd logic. Normally, the clientPump and backendPump methods in WSProxier send data in one direction. However, when the client sends an invalid RPC, the clientPump will send a response directly to the client in order to avoid unnecessary roundtrips to the backend. This could be interleaved with concurrent writes to the client's WS in backendPump, and would cause a panic in the WS library.

To test this, this PR includes a dedicated integration test that reliably triggers the issue. In addition, this PR adds additional testing for WS functionality.

@changeset-bot
Copy link

changeset-bot bot commented Jun 8, 2022

🦋 Changeset detected

Latest commit: 37ebb69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/proxyd Patch

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

@mslipper mslipper requested a review from Inphi June 8, 2022 03:43
@mergify mergify bot requested a review from tuxcanfly June 8, 2022 03:43
@mergify
Copy link
Contributor

mergify bot commented Jun 8, 2022

This PR changes implementation code, but doesn't include a changeset. Did you forget to add one?

@mslipper mslipper force-pushed the bugfix/proxyd-panic branch 2 times, most recently from e6e7c22 to 62b4e9f Compare June 8, 2022 03:46
Copy link
Contributor

@Inphi Inphi left a comment

Choose a reason for hiding this comment

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

the fix looks good. i left a couple comments on unit testing.

@mergify mergify bot requested a review from Inphi June 8, 2022 05:33
@mslipper mslipper force-pushed the bugfix/proxyd-panic branch from 62b4e9f to 1c385a8 Compare June 8, 2022 05:43
@mergify mergify bot requested a review from Inphi June 8, 2022 05:51
@mslipper mslipper force-pushed the bugfix/proxyd-panic branch 2 times, most recently from 1d4b20f to d6a6c8e Compare June 8, 2022 14:55
Fixes a panic in the websocket proxyd logic. Normally, the `clientPump` and `backendPump` methods in `WSProxier` send data in one direction. However, when the client sends an invalid RPC, the `clientPump` will send a response _directly to the client_ in order to avoid unnecessary roundtrips to the backend. This could be interleaved with concurrent writes to the client's WS in `backendPump`, and would cause a panic in the WS library.

To test this, this PR includes a dedicated integration test that reliably triggers the issue. In addition, this PR adds additional testing for WS functionality.
@mslipper mslipper force-pushed the bugfix/proxyd-panic branch from d6a6c8e to 37ebb69 Compare June 8, 2022 14:58
@mergify
Copy link
Contributor

mergify bot commented Jun 8, 2022

This PR has been added to the merge queue, and will be merged soon.

@mergify mergify bot merged commit 552cd64 into ethereum-optimism:develop Jun 8, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 8, 2022

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot removed the on-merge-train label Jun 8, 2022
This was referenced Jun 8, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
## Overview

Adds a CI job to run `kona-client` on `cannon64`.

Also upgrades the dep of `nybbles`; There was a bug that I introduced
recently for big-endian targets, fix included in
alloy-rs/nybbles#35.

---------

Co-authored-by: refcell <abigger87@gmail.com>
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