Skip to content

Conversation

@NicoMolinaOZ
Copy link
Contributor

@NicoMolinaOZ NicoMolinaOZ commented Dec 17, 2025

Summary

Three Testing Modes

  1. Docker + Anvil (Default) - Zero-config automated testing
  • Fully containerized environment (Redis + Anvil + Relayer + Tests)
  • No testnet funds required
  • One-command test execution: ./scripts/run-integration-docker.sh
  1. Standalone Mode - Fast local development iteration
  • Direct cargo run and cargo test support
  • Instant feedback loop for development
  • Uses local Anvil node via helper script: ./scripts/anvil-local.sh
  1. Testnet Mode - Production-like validation
  • Test against real testnets (Sepolia, Base Sepolia, BSC Testnet, etc.)
  • Validate against actual network conditions
  • Optional mode: MODE=testnet ./scripts/run-integration-docker.sh

🏗️ Infrastructure Components

  • Anvil Integration: Local Ethereum node with automated lifecycle management (scripts/anvil-local.sh)
  • Contract Deployment: Automated deployment of test contracts to local network (scripts/deploy-local-contracts.sh)
  • Docker Orchestration: Multi-service setup with health checks and proper dependency ordering
  • Network Configs: Pre-configured network settings for both local and testnet modes

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive local testing capabilities using Anvil, eliminating the need for testnet funds and enabling three distinct testing modes: Docker + Anvil (default), Standalone, and Testnet. The key architectural change is that tests now discover relayers dynamically via the API rather than reading from static config files, creating a single source of truth.

Key changes:

  • Anvil Integration: Automated local Ethereum node with contract deployment and lifecycle management scripts
  • API-based Discovery: Tests query the running relayer service for available relayers instead of parsing config files
  • Mode-based Configuration: Separate config directories for local and testnet modes with environment-driven selection

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/integration/tests/relayer_api.rs Updated CRUD tests to dynamically select network from enabled options, preferring "sepolia" for backward compatibility; simplified delete test to single relayer instead of bulk deletion
tests/integration/tests/evm/contract_interaction.rs Changed type from custom RelayerInfo to standard RelayerResponse for API-based discovery
tests/integration/tests/evm/basic_transfer.rs Changed type from custom RelayerInfo to standard RelayerResponse for API-based discovery
tests/integration/config/local/registry.json Added local network configuration for Anvil with contract address for localhost-integration network
tests/integration/config/local/keys/.gitkeep Placeholder for local Anvil keystore directory
tests/integration/config/local/config.json Configuration for local Anvil relayer and signer using test keystore
tests/integration/common/registry.rs Replaced file-based relayer discovery with API-based discovery; updated registry to support environment-based path selection
tests/integration/common/evm_helpers.rs Updated type signatures from RelayerInfo to RelayerResponse to match API responses
tests/integration/common/context.rs Made relayer discovery async to support API calls; updated type references
tests/integration/common/confirmation.rs Added directory check to skip non-files when loading network timing configurations
tests/integration/common/client.rs Removed unused delete_all_relayers_by_network method as tests now use individual deletion
tests/integration/README.md Comprehensive documentation update covering all three testing modes with detailed setup instructions and architecture explanation
scripts/run-integration-docker.sh Added MODE support (local/testnet) with profile-based service orchestration, Anvil health checks, and contract deployment integration
scripts/deploy-local-contracts.sh New script to deploy test contracts to Anvil and update registry with deployed addresses
scripts/anvil-local.sh New script for standalone Anvil lifecycle management with automated contract deployment
docker-compose.integration.yml Added Anvil service with local profile, updated relayer to use dynamic config source, added health checks and dependencies
config/networks/local-anvil.json Network configuration for standalone localhost Anvil (port 8545)
config/networks/local-anvil-integration.json Network configuration for Docker Compose Anvil using service name (anvil:8545)
Dockerfile.integration Simplified dependency caching by using cargo fetch instead of dummy build
.gitignore Added patterns for local/testnet config directories and standalone auto-generated configs
.github/workflows/integration-tests.yaml Updated CI to use testnet mode with proper config paths and KMS flag
.env.integration.example Added MODE configuration and enhanced comments for local vs testnet usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@zeljkoX zeljkoX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Added few comments.

Trying to test it.

Copy link
Collaborator

@zeljkoX zeljkoX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for you work.

Added few nit comments.

Was able to run it locally

@NicoMolinaOZ NicoMolinaOZ merged commit 4716987 into main Dec 22, 2025
26 checks passed
@NicoMolinaOZ NicoMolinaOZ deleted the local-node-anvil branch December 22, 2025 21:07
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants