Skip to content

Conversation

@jfrank-summit
Copy link
Member

@jfrank-summit jfrank-summit commented Dec 3, 2025

Summary

Adds Ethereum JSON-RPC support to EVM domain nodes built via domain-test-service, enabling the farmerless dev node to expose both Substrate and Ethereum RPC endpoints when running with --domain.

Motivation

The farmerless dev node successfully starts an EVM domain when using the --domain flag, but it only exposed Substrate RPC endpoints. Ethereum-specific endpoints (eth_call, eth_sendTransaction, eth_chainId, etc.) were missing because the domain node was built with DefaultProvider instead of EthProvider.

This prevented developers from testing Ethereum-compatible dApps and smart contracts against the dev node.

Implementation Details

Changes

  1. Made DomainNode::build generic over Provider (private internal function)

    • Added type parameter with appropriate trait bounds
    • Allows passing either DefaultProvider or EthProvider
  2. EVM domains now use EthProvider

    • build_evm_node() and build_evm_node_with() create an EthProvider
    • Configures Frontier (Ethereum compatibility layer) with sensible defaults
    • Enables dev signer for easy transaction testing

Configuration Values

The EthConfiguration uses CLI defaults from domain-eth-service, with one intentional change:

  • enable_dev_signer: true — Exposes pre-funded dev accounts via eth_accounts RPC

Dependencies

Added to domain-test-service:

  • domain-eth-service — Core dependency providing EthProvider
  • domain-block-preprocessor — Required for Provider trait bounds
  • sc-transaction-pool — Required for Provider trait bounds

All dependencies already exist in the workspace.

Testing

# Start farmerless dev node with EVM domain
cargo run -p subspace-farmerless-dev-node -- --domain --domain-rpc-port 9945

# Test Ethereum RPC (new functionality)
curl -X POST http://127.0.0.1:9945 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'

# Should return chain ID instead of "method not found"

Code contributor checklist:

@immunefi-magnus
Copy link

🛡️ Immunefi PR Reviews

We noticed that your project isn't set up for automatic code reviews. If you'd like this PR reviewed by the Immunefi team, you can request it manually using the link below:

🔗 Send this PR in for review

Once submitted, we'll take care of assigning a reviewer and follow up here.

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.

2 participants