Skip to content

Commit e8a13a7

Browse files
committed
chore: remove in-repo gateway/worker/operator run configs and tooling
The gateway/worker/operator runtime configs and the tooling to launch them are maintained in the avs-infra repo (delivered to each service via AP_CONFIG_YAML). Keeping a parallel set of server run configs + make targets here intertwined the source repo with the infra host. This repo is the ap source code plus the Go test suite, so config/ now holds only the test fixture. Removed: - config/gateway-dev.example.yaml, config/worker-{sepolia,base-sepolia}-dev.example.yaml - scripts/start-gateway-dev.sh - Makefile run targets: gateway-dev, the aggregator-* redirect stubs, operator / operator-*, dev-gateway, dev-worker-*, dev-operator-sepolia, dev-stack, dev-live (build/test/docker/storage targets stay) Docs updated to point running-the-services at avs-infra: - config/README.md rewritten around the test fixture - docs/Development.md, docs/ARCHITECTURE.md, CLAUDE.md The ap binary's gateway/worker/operator source roles (cmd/) are unchanged; only the in-repo run configs and convenience targets are gone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWr2N3kZQZ1miN66TNPwqU
1 parent 62b05ce commit e8a13a7

9 files changed

Lines changed: 54 additions & 657 deletions

CLAUDE.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ Ava Protocol Automation AVS (Actively Validated Service) on EigenLayer - a task
66

77
## Development Commands
88

9-
### Building and Running
9+
### Building
1010

1111
```bash
12-
make build # Build main binary
13-
make dev-build # Build development version
14-
make dev-agg # Run aggregator locally
15-
make dev-op # Run operator locally
16-
make up # Start docker compose stack
17-
make dev-live # Live reload during development
12+
make build # Build the ap binary
1813
```
1914

15+
> Running the services (gateway / worker / operator) is configured and
16+
> hosted from the `avs-infra` repo, not here. This repo is source code +
17+
> the Go test suite; it carries no server run configs or `make` run targets.
18+
2019
### Testing
2120

2221
```bash
@@ -140,7 +139,5 @@ The `getWorkflow` output is the ground truth — it shows the trigger's `topics`
140139
## Environment Setup
141140

142141
- Go 1.22+, Node.js, Docker/Docker Compose, Foundry
143-
- `config/operator_sample.yaml` - Operator config template
144-
- `config/gateway-dev.yaml` - Local-dev gateway config (copy from `gateway-dev.example.yaml`)
145-
- `config/test.yaml` - Go test-suite fixture (copy from `test.example.yaml`); loaded as `testutil.DefaultConfigPath`, not a server config
142+
- `config/test.yaml` - Go test-suite fixture (copy from `test.example.yaml`); loaded as `testutil.DefaultConfigPath`. This repo carries no server configs — gateway/worker/operator runtime configs live in `avs-infra`.
146143
- Contract addresses in README.md (Ethereum Mainnet, Sepolia Testnet)

Makefile

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,6 @@ unstable-build:
185185
docker push avaprotocol/avs-dev:unstable
186186

187187

188-
## dev/live: run the application with reloading on file changes
189-
.PHONY: dev-live
190-
dev-live:
191-
go run github.com/air-verse/air@v1.61.1 \
192-
--build.cmd "make build" --build.bin "./out/${BINARY_NAME}" --build.args_bin "aggregator" --build.delay "100" \
193-
--build.exclude_dir "certs,client-sdk,contracts,examples,out,docs,tmp, migrations" \
194-
--build.include_ext "go, tpl, tmpl, html, css, scss, js, ts, sql, jpeg, jpg, gif, png, bmp, svg, webp, ico" \
195-
--misc.clean_on_exit "true"
196-
197188
## build: build the application for local development
198189
.PHONY: build
199190
build:
@@ -202,132 +193,6 @@ build:
202193
-o ./out/ap \
203194
-ldflags "$(VERSION_LDFLAGS)"
204195

205-
## gateway-dev: start the local-dev gateway (replaces the legacy per-chain aggregator targets)
206-
##
207-
## The pre-Railway "one aggregator per chain" Makefile targets
208-
## (aggregator-sepolia / aggregator-ethereum / aggregator-base /
209-
## aggregator-base-sepolia) have been consolidated into this single
210-
## gateway target. The gateway-dev.yaml config carries the per-chain
211-
## blocks (Sepolia + Base Sepolia by default; add more under
212-
## `chains:` to fan out further). See config/README.md for the
213-
## current layout.
214-
.PHONY: gateway-dev
215-
gateway-dev: build
216-
@echo "🚀 Starting local-dev gateway (config/gateway-dev.yaml)..."
217-
@echo "📝 Logs will be written to gateway-dev.log"
218-
./out/ap aggregator --config=config/gateway-dev.yaml 2>&1 | tee gateway-dev.log
219-
220-
# Legacy per-chain aggregator targets retained as redirects so muscle
221-
# memory and old runbooks still work. They print a deprecation notice
222-
# pointing at `make gateway-dev`, then fail rather than silently doing
223-
# something different from what the caller meant.
224-
.PHONY: aggregator aggregator-sepolia aggregator-ethereum aggregator-base aggregator-base-sepolia
225-
aggregator aggregator-sepolia aggregator-ethereum aggregator-base aggregator-base-sepolia:
226-
@echo "⚠️ '$@' has been removed."
227-
@echo " The pre-Railway per-chain aggregator pattern has been"
228-
@echo " consolidated into the multi-chain gateway. Use:"
229-
@echo ""
230-
@echo " make gateway-dev"
231-
@echo ""
232-
@echo " to start the local-dev gateway. The chains it serves are"
233-
@echo " listed under \`chains:\` in config/gateway-dev.yaml."
234-
@exit 1
235-
## operator: show usage for operator commands
236-
.PHONY: operator operator-sepolia operator-ethereum operator-base operator-base-sepolia
237-
operator:
238-
@echo "Usage: make operator-<chain>"
239-
@echo ""
240-
@echo "Available commands:"
241-
@echo " make operator-sepolia - Start operator with Sepolia config"
242-
@echo " make operator-ethereum - Start operator with Ethereum config"
243-
@echo " make operator-base - Start operator with Base config"
244-
@echo " make operator-base-sepolia - Start operator with Base Sepolia config"
245-
@echo " make operator-default - Start operator with default config"
246-
247-
operator-sepolia: build
248-
@echo "🔧 Starting operator with Sepolia configuration..."
249-
@echo "📝 Logs will be written to operator-sepolia.log"
250-
./out/ap operator --config=config/operator-sepolia.yaml 2>&1 | tee operator-sepolia.log
251-
252-
operator-ethereum: build
253-
@echo "🔧 Starting operator with Ethereum configuration..."
254-
@echo "📝 Logs will be written to operator-ethereum.log"
255-
./out/ap operator --config=config/operator-ethereum.yaml 2>&1 | tee operator-ethereum.log
256-
257-
operator-base: build
258-
@echo "🔧 Starting operator with Base configuration..."
259-
@echo "📝 Logs will be written to operator-base.log"
260-
./out/ap operator --config=config/operator-base.yaml 2>&1 | tee operator-base.log
261-
262-
operator-base-sepolia: build
263-
@echo "🔧 Starting operator with Base Sepolia configuration..."
264-
@echo "📝 Logs will be written to operator-base-sepolia.log"
265-
./out/ap operator --config=config/operator-base-sepolia.yaml 2>&1 | tee operator-base-sepolia.log
266-
267-
operator-default: build
268-
@echo "🔧 Starting operator with default configuration..."
269-
@echo "📝 Logs will be written to operator-default.log"
270-
./out/ap operator --config=config/operator.yaml 2>&1 | tee operator-default.log
271-
272-
273-
## dev-gateway: run the dev gateway (REST 8080, gRPC 2206)
274-
.PHONY: dev-gateway dev-worker-sepolia dev-worker-base-sepolia dev-operator-sepolia
275-
dev-gateway: build
276-
@mkdir -p logs
277-
@echo "🚀 Starting gateway (dev) — REST :8080, gRPC :2206"
278-
@echo "📝 Logs: logs/gateway.log"
279-
./out/ap aggregator --config=config/gateway-dev.yaml 2>&1 | tee logs/gateway.log
280-
281-
## dev-worker-sepolia: run the sepolia chain worker (gRPC 50051)
282-
dev-worker-sepolia: build
283-
@mkdir -p logs
284-
@echo "🛠 Starting worker:sepolia (dev) — gRPC :50051"
285-
@echo "📝 Logs: logs/worker-sepolia.log"
286-
./out/ap worker --config=config/worker-sepolia-dev.yaml 2>&1 | tee logs/worker-sepolia.log
287-
288-
## dev-worker-base-sepolia: run the base-sepolia chain worker (gRPC 50052)
289-
dev-worker-base-sepolia: build
290-
@mkdir -p logs
291-
@echo "🛠 Starting worker:base-sepolia (dev) — gRPC :50052"
292-
@echo "📝 Logs: logs/worker-base-sepolia.log"
293-
./out/ap worker --config=config/worker-base-sepolia-dev.yaml 2>&1 | tee logs/worker-base-sepolia.log
294-
295-
## dev-operator-sepolia: run the sepolia operator pointed at the dev gateway
296-
dev-operator-sepolia: build
297-
@mkdir -p logs
298-
@echo "🔧 Starting operator:sepolia (dev) — aggregator: 127.0.0.1:2206"
299-
@echo "📝 Logs: logs/operator-sepolia.log"
300-
./out/ap operator --config=config/operator-sepolia.yaml 2>&1 | tee logs/operator-sepolia.log
301-
302-
## dev-stack: run gateway + sepolia worker + base-sepolia worker + sepolia operator together (Ctrl-C stops all)
303-
##
304-
## All four processes run as background children of this make recipe.
305-
## Logs stream to logs/<service>.log. SIGINT (Ctrl-C) propagates to the
306-
## whole process group via `kill 0`, so the entire stack tears down
307-
## cleanly on exit. Use `tail -f logs/*.log` in a second terminal to
308-
## watch everything live.
309-
.PHONY: dev-stack
310-
dev-stack: build
311-
@mkdir -p logs
312-
@echo "🚀 Starting dev stack: gateway + 2 workers + operator"
313-
@echo " gateway → REST :8080, gRPC :2206 (logs/gateway.log)"
314-
@echo " worker:sep → gRPC :50051 (logs/worker-sepolia.log)"
315-
@echo " worker:bsep → gRPC :50052 (logs/worker-base-sepolia.log)"
316-
@echo " operator:sep → 127.0.0.1:2206 (logs/operator-sepolia.log)"
317-
@echo ""
318-
@echo " Tail with: tail -f logs/*.log"
319-
@echo " Stop with: Ctrl-C (kills the whole stack)"
320-
@echo ""
321-
@set -m; \
322-
trap 'echo; echo "🛑 Stopping dev stack..."; kill 0 2>/dev/null; exit 0' INT TERM; \
323-
./out/ap worker --config=config/worker-sepolia-dev.yaml > logs/worker-sepolia.log 2>&1 & \
324-
./out/ap worker --config=config/worker-base-sepolia-dev.yaml > logs/worker-base-sepolia.log 2>&1 & \
325-
sleep 1; \
326-
./out/ap aggregator --config=config/gateway-dev.yaml > logs/gateway.log 2>&1 & \
327-
sleep 3; \
328-
./out/ap operator --config=config/operator-sepolia.yaml > logs/operator-sepolia.log 2>&1 & \
329-
wait
330-
331196
## clean: cleanup storage data
332197
clean:
333198
rm -rf /tmp/ap-avs /tmp/ap.sock

config/README.md

Lines changed: 29 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,45 @@
1-
# `config/`service configuration
1+
# `config/`test configuration
22

3-
The aggregator binary (`ap`) runs as one of three roles depending on its
4-
subcommand: **gateway**, **worker**, or **operator**. Each role needs a
5-
YAML config passed via `--config=<path>`.
3+
This repository is the **source code** for the `ap` binary and its Go test
4+
suite. It is **not** where the running services are configured or hosted.
65

7-
> **Production Railway configs moved.** The prod `*-railway.yaml` configs now
8-
> live in the `avs-infra` repo (`railway/configs/`) and are delivered to each
9-
> Railway service via the `AP_CONFIG_YAML` env var (the image entrypoint writes
10-
> it to `config/runtime.yaml` at boot). They are no longer in this repo or baked
11-
> into the public image. This directory now holds only **local-dev and sample**
12-
> configs.
6+
> **Server & deployment configs live in `avs-infra`.** The gateway, worker,
7+
> and operator runtime configs — for production (Railway) *and* local dev —
8+
> are maintained in the `avs-infra` repo and delivered to each service via the
9+
> `AP_CONFIG_YAML` env var (the image entrypoint writes it to
10+
> `config/runtime.yaml` at boot). They are intentionally not kept here so the
11+
> infra host stays decoupled from the source code.
1312
14-
## Layout
13+
As a result, `config/` now holds only what the **test suite** needs:
1514

1615
```
1716
config/
18-
├── README.md — this file
19-
├── test.example.yaml — Go test-suite fixture template
20-
├── test.yaml — Go test-suite fixture, real (gitignored)
21-
22-
├── gateway-dev.example.yaml — local-dev gateway template
23-
├── gateway-dev.yaml — local-dev gateway, real (gitignored)
24-
25-
├── worker-<chain>-dev.example.yaml — per-chain local-dev worker template
26-
├── worker-<chain>-dev.yaml — per-chain local-dev worker, real (gitignored)
27-
28-
└── operator-<chain>.yaml — local operator configs (gitignored symlinks)
17+
├── README.md — this file
18+
├── test.example.yaml — Go test-suite fixture template (checked in)
19+
└── test.yaml — real fixture, gitignored (copy from the template)
2920
```
3021

31-
Production `*-railway.yaml` configs live in `avs-infra` (`railway/configs/`),
32-
not here — see the note above.
22+
## Running the test suite
3323

34-
## When to use which
35-
36-
| Scenario | Config file |
37-
|---|---|
38-
| Production (any role) on Railway | `avs-infra``railway/configs/<svc>-railway.yaml`, delivered via `AP_CONFIG_YAML` |
39-
| Running the Go test suite | `test.yaml` (copy from `test.example.yaml`, fill in RPC + Tenderly). Loaded as `testutil.DefaultConfigPath`; **not** a server config. |
40-
| Local dev gateway | `gateway-dev.yaml` (copy from `gateway-dev.example.yaml`, fill in secrets) |
41-
| Local dev worker for chain N | `worker-<chain>-dev.yaml` (same copy pattern) |
42-
43-
`scripts/start.sh` in the studio repo wires up the local-dev gateway +
44-
all workers + operator pane via these config files. See that script
45-
for the exact `--config=` invocations.
46-
47-
## `.example` template convention
48-
49-
Templates checked into git carry the `.example.yaml` suffix. The real
50-
file (same name, no `.example.`) is gitignored and carries actual
51-
secrets — controller keys, JWT signing keys, paymaster ownership keys.
52-
Copy template → real:
24+
Pure unit tests need no configuration. Integration / simulation tests
25+
(Tenderly contract-write sims, on-chain reads) load `config/test.yaml`,
26+
which is `testutil.DefaultConfigPath`. **Nothing is started from it** — it is
27+
a test fixture, not a server config. Create it once:
5328

5429
```bash
55-
cp config/gateway-dev.example.yaml config/gateway-dev.yaml
56-
$EDITOR config/gateway-dev.yaml # fill in <placeholder> values
30+
cp config/test.example.yaml config/test.yaml
31+
$EDITOR config/test.yaml # fill in: eth_rpc_url (Sepolia) + tenderly_* creds
5732
```
5833

59-
The `.gitignore` excludes any `config/*-dev.yaml` and a few specific
60-
names (`gateway-dev.yaml`, `aggregator.yaml`, `operator.yaml`) — see
61-
the top-level `.gitignore` for the full list.
62-
63-
## Pre-Railway bare-metal templates (moved)
64-
65-
The pre-Railway deployment model (one aggregator per chain + a single
66-
operator binary) and its config templates moved to **avs-infra**
67-
(`terraform/docs/archived-baremetal-templates/`), next to the terraform
68-
that deployed that bare-metal stack — which is now being decommissioned.
69-
Per-chain aggregator configs that may still exist locally as gitignored
70-
symlinks to a secrets-sync directory are no longer referenced by any
71-
in-repo code path, except the one documented exception below.
72-
73-
## Migration history (Option C — multi-phase config cleanup, all phases now done)
34+
A test that can't find it either `t.Skip`s or panics with
35+
`testConfig is nil - test.yaml config must be loaded`.
7436

75-
**Phase 1** (this PR's first commit): documentation + `archived/`
76-
templates + deleted the stale `_legacy/` snapshot.
37+
CI generates this same file in the "Setup test configuration" step of
38+
`.github/workflows/run-test-on-pr.yml`. See the repo `README.md` ("Testing")
39+
for more.
7740

78-
**Phase 2** (this PR): migrated `core/testutil/utils.go` and the
79-
integration tests under `core/taskengine/*_test.go` +
80-
`integration_test/` off the per-chain `aggregator-<chain>.yaml`
81-
pattern onto a single shared fixture.
82-
83-
**Phase 3**: split the **test fixture** out from the gateway server
84-
config so the name stops being overloaded. `testutil.DefaultConfigPath`
85-
now points at `test.yaml` (copied from `test.example.yaml`); the CI
86-
bootstrap script (`.github/scripts/generate-test-config.sh`) generates
87-
`config/test.yaml`. The gateway server still uses `gateway-dev.yaml`.
88-
89-
**Phase 3** (this PR): replaced the Makefile
90-
`aggregator-{sepolia,ethereum,base,base-sepolia}` targets with a
91-
single `make gateway-dev`. The old targets remain as redirect stubs
92-
that print a deprecation notice and exit non-zero, so old runbooks
93-
fail loudly rather than silently doing the wrong thing. Updated
94-
`scripts/aa-wallet-toolkit.sh`, the backfill-tool docstrings, and
95-
`docs/Development.md` at the same time.
96-
97-
**Phase 4** (this PR): with no live callers left, the per-chain
98-
`aggregator-<chain>.yaml` symlinks (pointing at gitignored configs
99-
in a separate env repo) are no longer referenced by any in-repo code
100-
path. They can be deleted from local dev environments at any time;
101-
nothing in the repo tracks them.
102-
103-
### Known exception
104-
105-
`core/taskengine/userops_withdraw_test.go:30` still loads
106-
`config/aggregator-base.yaml` — but the test is gated by
107-
`TEST_CHAIN=base` and gracefully skips when the config is missing.
108-
Base mainnet (chain ID 8453) isn't in `gateway-dev.yaml`'s default
109-
`chains:` block (which covers Sepolia + Base Sepolia for local dev),
110-
so this developer-only opt-in test keeps its own per-chain fixture
111-
until either:
112-
113-
- Base mainnet is added to `gateway-dev.yaml`'s `chains:` and the
114-
test is refactored to select that block, or
115-
- The test is removed as obsolete.
41+
## `.example` template convention
11642

117-
Neither is in scope for this cleanup.
43+
The checked-in template carries the `.example.yaml` suffix; the real file
44+
(`test.yaml`) is gitignored because it carries credentials. `.gitignore`
45+
ignores `config/*.yaml` and keeps `config/*.example.yaml`.

0 commit comments

Comments
 (0)