Skip to content

Conversation

barnabasbusa
Copy link
Collaborator

@barnabasbusa barnabasbusa commented Oct 13, 2025

Summary

Add support for the mempool-bridge service to bridge mempool transactions between execution layer nodes in the network.

Changes

  • New module: src/mempool_bridge/mempool_bridge_launcher.star

    • Implements service launcher following ethereum-package patterns
    • Uses Docker image: ethpandaops/mempool-bridge:latest
    • Exposes HTTP API on port 9090
    • Automatically connects to all execution layer nodes
  • Configuration template: static_files/mempool-bridge-config/config.yaml.tmpl

    • Dynamically generates configuration based on EL contexts
    • Lists all execution nodes for bridging
  • Integration: Updated main.star and src/static_files/static_files.star

    • Added mempool-bridge to additional_services workflow
    • Follows existing patterns from services like tracoor and broadcaster

Usage

Add mempool_bridge to the additional_services list in your network configuration:

additional_services:
  - mempool_bridge

The service will automatically:

  • Connect to all execution layer nodes in the network
  • Bridge mempool transactions between nodes
  • Expose metrics/API on port 9090

Test plan

  • Syntax validation (dry-run passes)
  • Code follows ethereum-package patterns
  • Configuration template uses correct syntax
  • Runtime testing with actual network deployment

🤖 Generated with Claude Code

barnabasbusa and others added 20 commits October 13, 2025 11:10
Add support for mempool-bridge service to bridge mempool transactions
between execution layer nodes.

Changes:
- Created mempool_bridge_launcher.star module
- Added config template for dynamic node configuration
- Integrated service into additional_services workflow
- Exposes HTTP API on port 9090

Usage:
Add 'mempool_bridge' to additional_services list to enable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Fix config template to use source/target nodeRecords structure
- Add mempool_bridge to allowed additional services
- Add test configuration for mempool-bridge with 3 node setup
- Verified service starts successfully with corrected config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add mempool_bridge_params configuration:
- Auto-detects shadowfork networks and sets source URL
- Uses ethpandaops RPC endpoint for shadowforks (e.g. rpc.hoodi.ethpandaops.io)
- Allows custom source_url override via params
- Updates config template to conditionally include source section

Changes:
- Added mempool_bridge_params to input_parser with get_default_mempool_bridge_params()
- Updated launcher to accept and use mempool_bridge_params
- Modified config template to support optional source endpoints
- Added sanity check validation for mempool_bridge_params
- Updated test config to demonstrate shadowfork usage

Example shadowfork usage:
```yaml
network_params:
  network: hoodi-shadowfork
additional_services:
  - mempool_bridge
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Critical fix: mempool-bridge uses devp2p protocol (ENR/enode), not HTTP RPC.

Changes:
- Updated launcher to extract enode/enr from EL contexts instead of HTTP URLs
- Added fallback: uses first node as source if no source_url specified
- Updated config template to match mempool-bridge example format
- Added logging and metricsAddr fields
- Added retryInterval to source/target sections
- Fixed source_url param comments to clarify ENR/enode requirement

For shadowforks, users must provide enode/enr of source network:
```yaml
mempool_bridge_params:
  source_url: "enode://[email protected]:30303"
```

Resolves connection issues where peers were disconnected due to
incorrect HTTP URL format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Change mempool_bridge_params from single source_url to source_enodes list
to support multiple bootnode enodes for shadowfork networks.

Changes:
- Renamed source_url to source_enodes (list of enode strings)
- Updated launcher to iterate over source_enodes list
- Added example hoodi shadowfork test config with enodes from eth-clients repo
- Updated sanity check and struct definitions

Usage for shadowforks:
```yaml
network_params:
  network: hoodi-shadowfork

mempool_bridge_params:
  source_enodes:
    - "enode://pubkey1@ip1:30303"
    - "enode://pubkey2@ip2:30303"
```

Enode sources:
- mainnet: https://github.com/eth-clients/mainnet/blob/main/metadata/enodes.yaml
- sepolia: https://github.com/eth-clients/sepolia/blob/main/metadata/enodes.yaml
- hoodi: https://github.com/eth-clients/hoodi/blob/main/metadata/enodes.yaml
- holesky: https://github.com/eth-clients/holesky/blob/main/metadata/enodes.yaml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Remove get_default_mempool_bridge_params function and initialize
params with empty list by default. This avoids unnecessary processing
when mempool_bridge service is not enabled.

Changes:
- Initialize mempool_bridge_params as {"source_enodes": []} directly
- Remove unused get_default_mempool_bridge_params function
- Add documentation comment pointing to eth-clients repos
- No functional changes, params work same as before

This ensures we only process mempool bridge configuration when the
service is actually requested by the user.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Automatically fetch source enodes from eth-clients GitHub repos at runtime
when launching mempool-bridge for shadowfork networks. No hardcoding needed.

Changes:
- Added fetch_enodes_from_url() function that uses curl to fetch YAML
- Auto-detects shadowfork network and fetches from appropriate repo:
  * mainnet, sepolia, hoodi, holesky supported
- Uses first EL service to run curl command
- Parses YAML to extract enode lines and strip comments
- Falls back to first local node if fetch fails or not shadowfork
- Updated test config to rely on auto-fetch (no hardcoded enodes)

Usage for shadowforks:
```yaml
network_params:
  network: hoodi-shadowfork

additional_services:
  - mempool_bridge
```

Enodes are fetched fresh each time from:
https://github.com/eth-clients/{network}/blob/main/metadata/enodes.yaml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Simplified fetch_enodes_from_url to trust the shell command output
and use list comprehension for cleaner parsing.

The shell command (curl | grep | sed) does all the heavy lifting:
- Fetches YAML from URL
- Extracts lines starting with '- enode:'
- Strips '- ' prefix and '# comment' suffix

No need for extra validation loops - just split and filter empty lines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Barnabas Busa <[email protected]>
@barnabasbusa barnabasbusa enabled auto-merge (squash) October 17, 2025 10:52
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