feat: support split L2 HTTP and WebSocket RPC - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What’s this PR do?
Ports NethermindEth/Catalyst#988 onto the current
taikoxyz/Catalystmaster, with follow-up hardening from review.L2_WS_RPC_URLfor L2 block subscriptions.L2_RPC_URLfor ordinary execution-layer JSON-RPC requests, allowing HTTP transport.L2_RPC_URLwhen it already usesws://orwss://andL2_WS_RPC_URLis unset or blank.l2_ws_rpc_url; Pacaya and execution-layer providers remain onl2_rpc_url..env.sampleandCHANGELOG.md.Deployment configuration must provide
L2_WS_RPC_URLbefore switchingL2_RPC_URLto HTTP.📎 Related issues (optional)
🧠 Context
eth_subscriberequires WebSocket, but ordinary L2 execution requests do not. When operators configure distinct HTTP(S) and WS(S) endpoints, subscription reconnect failures no longer share the ordinary request transport. IfL2_RPC_URLremains WS(S) andL2_WS_RPC_URLis unset, both paths intentionally continue to use the same endpoint for backwards compatibility.The initial implementation ports upstream commit
b8d555315e5e9a99c9d5dbad91935bf364d0a308; follow-up commits handle blank environment values, validate the ordinary L2 RPC URL, centralize parsed-scheme transport selection, preserve canonical WebSocket URLs through the direct subscription path, and add documentation and regression tests.🧪 Validation
cargo test --workspace --locked --verbosecargo test -p common config::tests -- --nocapture(15 passed)cargo test -p common --lib(56 passed)cargo clippy --workspace --all-features --exclude p2p-boot-node --locked -- -D warningscargo fmt --all -- --checkcargo sort --workspace --checkgit diff --checktyposandcargo-denywere not installed locally; the PR CI runs both. This port does not modify dependencies orCargo.lock.✅ Checklist
feature/<name>