Skip to content

feat: support split L2 HTTP and WebSocket RPC - #2

Merged
davidtaikocha merged 4 commits into
masterfrom
codex/port-pr-988
Sep 1, 2026
Merged

feat: support split L2 HTTP and WebSocket RPC#2
davidtaikocha merged 4 commits into
masterfrom
codex/port-pr-988

Conversation

@davidtaikocha

@davidtaikocha davidtaikocha commented Sep 1, 2026

Copy link
Copy Markdown
Member

🚀 What’s this PR do?

Ports NethermindEth/Catalyst#988 onto the current taikoxyz/Catalyst master, with follow-up hardening from review.

  • Add optional L2_WS_RPC_URL for L2 block subscriptions.
  • Keep L2_RPC_URL for ordinary execution-layer JSON-RPC requests, allowing HTTP transport.
  • Preserve compatibility by reusing L2_RPC_URL when it already uses ws:// or wss:// and L2_WS_RPC_URL is unset or blank.
  • Validate both RPC URLs, select transport from the parsed scheme, and preserve canonical URLs through both provider and subscription connection paths.
  • Route the Shasta and Realtime chain monitors through l2_ws_rpc_url; Pacaya and execution-layer providers remain on l2_rpc_url.
  • Document the opt-in in .env.sample and CHANGELOG.md.

Deployment configuration must provide L2_WS_RPC_URL before switching L2_RPC_URL to HTTP.


📎 Related issues (optional)

🧠 Context

eth_subscribe requires 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. If L2_RPC_URL remains WS(S) and L2_WS_RPC_URL is 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 --verbose
  • cargo 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 warnings
  • cargo fmt --all -- --check
  • cargo sort --workspace --check
  • git diff --check

typos and cargo-deny were not installed locally; the PR CI runs both. This port does not modify dependencies or Cargo.lock.

✅ Checklist

  • I’ve tested this locally
  • I’ve added relevant docs or comments
  • I’ve updated or created tests if needed
  • The branch with the feature is named feature/<name>

@davidtaikocha
davidtaikocha merged commit ae2a680 into master Sep 1, 2026
9 checks passed
@davidtaikocha
davidtaikocha deleted the codex/port-pr-988 branch September 1, 2026 11:06
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.

1 participant