Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions configs/offline/baseline.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
chain-id = "31337" # Anvil local chain
base-tokens = [
"0x5FbDB2315678afecb367f032d93F642f64180aa3", # WETH
"0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", # DAI
"0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", # USDC
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
]
max-hops = 2
max-partial-attempts = 5
Expand Down
26 changes: 13 additions & 13 deletions configs/offline/driver.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ app-data-fetching-enabled = true
orderbook-url = "http://orderbook"
tx-gas-limit = "45000000"

[contracts]
gp-v2-settlement = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
weth = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
balances = "0x65f63a74B9900c7DFE26aC0cf171A536b7509f56"
signatures = "0x7377795aa7b4a8fca5e4e194f54eaff667db45f0"

[[solver]]
name = "baseline" # Arbitrary name given to this solver, must be unique
endpoint = "http://baseline"
absolute-slippage = "40000000000000000" # Denominated in wei, optional
relative-slippage = "0.1" # Percentage in the [0, 1] range
# Anvil account #0 private key (from test mnemonic) - this is the authorized solver
# Anvil account #0 private key (from test mnemonic)
account = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

[submission]
Expand All @@ -22,14 +16,20 @@ gas-price-cap = "1000000000000"
[[submission.mempool]]
mempool = "public"

[contracts]
gp-v2-settlement = "0xb7f8bc63bbcad18155201308c8f3540b07f84f5e"
weth = "0x5fbdb2315678afecb367f032d93f642f64180aa3"
balances = "0xbd5a6618df333f8f66702daadc9a953e2b52a65d"
signatures = "0x7377795aa7b4a8fca5e4e194f54eaff667db45f0"

[liquidity]
base-tokens = [
"0x5FbDB2315678afecb367f032d93F642f64180aa3", # WETH
"0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", # DAI
"0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", # USDC
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
]

[[liquidity.uniswap-v2]] # Uniswap V2 configuration
router = "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
pool-code = "b6912aa8f91da604bdd903b3484a9f6bb569baa993085fc590133487ff27f91e" # Foundry deployed Uniswap V2 init code hash
[[liquidity.uniswap-v2]] # Uniswap V2 configuration (auto-generated from deployment)
router = "0x5fc8d32690cc91d4c39d9d3abcbd16989f875707"
pool-code = "0xb6912aa8f91da604bdd903b3484a9f6bb569baa993085fc590133487ff27f91e" # Uniswap V2 init code hash
missing-pool-cache-time = "1h"
6 changes: 3 additions & 3 deletions playground/.env.offline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto-generated by deploy-all.sh
# Generated at: 1762967066
# Generated at: 1763647692

# Network Configuration
CHAIN_ID=31337
Expand All @@ -19,7 +19,7 @@ UNISWAP_V2_ROUTER_ADDRESS=0x5fc8d32690cc91d4c39d9d3abcbd16989f875707
# CoW Protocol Addresses (from deployment)
SETTLEMENT_CONTRACT_ADDRESS=0xb7f8bc63bbcad18155201308c8f3540b07f84f5e
AUTHENTICATOR_ADDRESS=0x610178da211fef7d417bc0e6fed39f05609ad788
VAULT_RELAYER_ADDRESS=8daf17a20c9dba35f005b6324f493785d239719d
VAULT_RELAYER_ADDRESS=0x8daf17a20c9dba35f005b6324f493785d239719d
BALANCER_VAULT_ADDRESS=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
BALANCES_CONTRACT_ADDRESS=0x65f63a74b9900c7dfe26ac0cf171a536b7509f56
BALANCES_CONTRACT_ADDRESS=0xbd5a6618df333f8f66702daadc9a953e2b52a65d
SIGNATURES_CONTRACT_ADDRESS=0x7377795aa7b4a8fca5e4e194f54eaff667db45f0
56 changes: 52 additions & 4 deletions playground/docker-compose.offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ services:
- |
if [ -f /state/poc-state.json ]; then
echo "📂 Loading existing blockchain state..."
anvil --load-state ./state/poc-state.json --dump-state ./state/poc-state.json --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1 --gas-limit 30000000 --code-size-limit 50000 --accounts 10
anvil --load-state ./state/poc-state.json --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1 --gas-limit 30000000 --code-size-limit 50000 --accounts 10
else
echo "🆕 Starting fresh Anvil node (no state file found)..."
anvil --dump-state /state/poc-state.json --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1 --gas-limit 30000000 --code-size-limit 50000 --accounts 10
echo "Error: No state file found at /state/poc-state.json. Please run locally with start-anvil.sh and deploy-all.sh scripts to create the state first."
exit 1
fi
environment:
- ANVIL_IP_ADDR=0.0.0.0
Expand Down Expand Up @@ -119,6 +119,12 @@ services:
- 8080:80 # API
- 9586:9586 # metrics
- 6669:6669 # tokio console
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80/api/v1/version || exit 1"]
interval: 5s
timeout: 3s
retries: 12
start_period: 30s

autopilot:
build:
Expand Down Expand Up @@ -171,7 +177,7 @@ services:
- ../:/src
depends_on:
orderbook:
condition: service_started
condition: service_healthy
chain:
condition: service_healthy
ports:
Expand Down Expand Up @@ -297,6 +303,10 @@ services:
- GF_AUTH_DISABLE_LOGIN_FORM=true
volumes:
- ./grafana-prometheus.yml:/etc/grafana/provisioning/datasources/prometheus.yml
- ./performance-test-suite/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./performance-test-suite/grafana/dashboards:/var/lib/grafana/dashboards
depends_on:
- prometheus

prometheus:
image: prom/prometheus:latest
Expand All @@ -306,6 +316,44 @@ services:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--web.enable-lifecycle"
- "--web.enable-remote-write-receiver"
- "--enable-feature=native-histograms"
- "--storage.tsdb.retention.time=6h" # Keep data for 6 hours only
- "--storage.tsdb.retention.size=5GB" # Maximum 5GB storage
k6:
image: grafana/k6:latest
profiles: ["perf-test"]
volumes:
- ./performance-test-suite/dist:/scripts
- ./performance-test-suite/results:/results
- ./performance-test-suite/signed-orders.json:/signed-orders.json:ro
environment:
- BASE_URL=http://orderbook
- K6_PROMETHEUS_RW_SERVER_URL=http://prometheus:9090/api/v1/write
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true
- SCENARIO=stress
command: >
run
--out json=/results/summary.json
--out experimental-prometheus-rw
/scripts/load-test.js
depends_on:
orderbook:
condition: service_healthy
driver:
condition: service_started
prometheus:
condition: service_started
networks:
- default

volumes:
postgres:
prometheus-data:
36 changes: 36 additions & 0 deletions playground/performance-test-suite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Dependencies
node_modules/
package-lock.json
yarn.lock

# Build output
dist/

# Test results
results/
*.json
!package.json
!tsconfig.json
!config.example.json

# Logs
*.log
npm-debug.log*

# Environment variables
.env
.env.local

# IDE
.vscode/
.idea/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Docker volumes
prometheus-data/
grafana-data/
Loading