Add proxyd support for routing transactions to ingress RPC#334
Add proxyd support for routing transactions to ingress RPC#334niran wants to merge 8 commits intoflashbots:mainfrom
Conversation
|
Thank you for the contribution. Could you write the proxyd config in the component itself? This is something I am iterating on to avoid having to go through the artifacts for specific per component configurations. This is an example. |
Add support for the proxyd component from Base's infra-routing repository, enabling transparent routing of transaction submission methods to an ingress RPC endpoint while routing all other RPC methods to the standard execution layer. Key changes: - Add Proxyd component that uses Base's proxyd Docker image - Generate proxyd TOML configuration with method-based routing - Add --proxyd and --ingress-rpc flags to OpStack recipe - Route transaction submission methods to ingress endpoint - Route all other methods to standard EL (op-geth or rollup-boost) - Expose proxyd on port 8545 (mapped to dynamic host port) - Update documentation with new flags The proxyd configuration routes the following methods to ingress: - eth_sendRawTransaction (standard transaction submission) - eth_sendBundle (bundle submission) - eth_sendBackrunBundle (backrun bundle submission) - eth_cancelBundle (bundle cancellation) - eth_sendUserOperation (ERC-4337 user operation submission) All other RPC methods are routed to the standard execution layer node.
Use us-docker.pkg.dev/oplabs-tools-artifacts/images/proxyd which is the publicly available proxyd image from OP Labs, instead of the non-existent docker.io/base/proxyd image.
proxyd requires explicit method mappings - there is no default fallback. Add mappings for all standard Ethereum JSON-RPC methods to route them to the standard backend, while keeping transaction submission methods routed to ingress: - Transaction submission to ingress: eth_sendRawTransaction, eth_sendBundle, eth_sendBackrunBundle, eth_cancelBundle, eth_sendUserOperation - All other methods to standard: eth_chainId, eth_call, eth_getBalance, eth_blockNumber, and all other standard Ethereum RPC methods
When --flashblocks is enabled, use flashblocks-rpc as standard backend (handles both standard RPC methods and base_meter* methods). Add --proxyd-ingress-methods and --proxyd-standard-methods flags for custom method routing.
Add unit and integration tests covering: - Proxyd TOML config generation with correct backend routing - Flashblocks-rpc as standard backend when enabled - Custom method routing via CLI flags - Recipe integration with various flag combinations - Proxyd service in manifest and output Tests verify: - Transaction submission methods route to ingress - Standard Ethereum methods route to standard backend - Base-specific methods (base_meter*) route correctly - Custom methods can be added via flags - Proxyd endpoint is accessible and functional All unit tests pass without requiring INTEGRATION_TESTS=true.
The flag was wrapping the value with http:// and :8080, causing malformed URLs when users passed a full URL. Now mirrors --external-builder behavior.
Add comments documenting that proxyd and websocket-proxy images are amd64-only, with instructions for building from source on other architectures and using --override flags.
|
Hey @niran, thanks a lot for the contribution! With a recently added feature, playground lets you take control of recipes and build your own on top of the base ones by using a base: opstack
description: Running OP Stack with Proxyd
recipe:
proxyd:
services:
proxyd:
image: "us-docker.pkg.dev/oplabs-tools-artifacts/images/proxyd"
tag: "latest"
args:
- "/bin/proxyd"
- "/config/proxyd.toml"
artifact: "/config/proxyd.toml"
files:
/config/proxyd.toml: proxyd.toml
ports:
http: 8545I took the proxyd config template from this PR, picked the endpoint defaults noted down to one of the structs, created a We also now have If you try this, please let me know how it goes - thanks! |
Summary
Add support for proxyd from OP Labs to enable transparent routing of RPC methods:
Key Features
us-docker.pkg.dev/oplabs-tools-artifacts/images/proxydimage--flashblocksflagUsage
Implementation Details
Two-Backend Architecture
Ingress backend: Routes transaction submission methods
Standard backend: Routes everything else
--flashblocksdisabled: op-geth--flashblocksenabled: flashblocks-rpc (handles standard methods + base_meter*)Default Method Mappings
Includes all standard Ethereum RPC methods (eth_call, eth_blockNumber, etc.) and Base-specific methods (base_transactionStatus, base_meterBundle, etc.)
Custom Method Routing
--proxyd-ingress-methods: Route additional methods to ingress--proxyd-standard-methods: Route additional methods to standard backendTesting
Tested with: