Skip to content

greenlucid/vea-validator

Repository files navigation

VEA Validator

Rust validator for the VEA cross-chain messaging protocol. Monitors claims, challenges fraud, advances verification, relays L2→L1 messages, and withdraws deposits.

Supports routes:

  • Arbitrum → Ethereum
  • Arbitrum → Gnosis

Running with Docker

docker build -t vea-validator .
docker run --rm --env-file .env -v $(pwd)/data:/app/data vea-validator

Environment variables (including PRIVATE_KEY) are passed at runtime via --env-file. They are NOT baked into the image. The -v flag persists sync state and scheduled tasks between runs.

If your .env file uses export prefixes (for compatibility with source), strip them with sed:

sed 's/^export //' .env | docker run --rm -v $(pwd)/data:/app/data --env-file /dev/stdin vea-validator

Development

Prerequisites:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl -L https://foundry.paradigm.xyz | bash && foundryup

Fetch VEA contracts:

./scripts/fetch-vea-contracts.sh

Local Devnet

Start the local devnet (L1 + L2 anvil chains with deployed contracts):

./scripts/full-devnet.sh

Leave it running. This will automatically create a .env.local for you to run the tests.

Run tests on a different terminal:

source .env.local && cargo test

Testnet

Funding requirements:

  • Arbitrum Sepolia: ETH for gas
  • Sepolia: ETH for gas + deposits
  • Chiado: xDAI for gas + WXDAI for deposits
cp .env.example .env.test

Edit .env.test and add your private key, then:

source .env.test && cargo run

Configuration

MAKE_CLAIMS

export MAKE_CLAIMS=false  # (default) Only monitor and challenge fraud
export MAKE_CLAIMS=true   # Also claim epochs (locks deposit until verified)

RPC Redundancy

RPC URLs support comma-separated values for failover:

export ETHEREUM_RPC_URL=https://rpc1.example.com,https://rpc2.example.com,https://rpc3.example.com

The validator will automatically try the next RPC if one fails. All RPC calls have a 30s timeout to prevent hanging on unresponsive endpoints.

Logging

JSON structured logs to stdout. Control log level with RUST_LOG:

export RUST_LOG=info   # default
export RUST_LOG=debug  # verbose

Learn More

See DESIGN_AND_RATIONALE.md for architecture details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors