|
1 | | -# `config/` — service configuration |
| 1 | +# `config/` — test configuration |
2 | 2 |
|
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. |
6 | 5 |
|
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. |
13 | 12 |
|
14 | | -## Layout |
| 13 | +As a result, `config/` now holds only what the **test suite** needs: |
15 | 14 |
|
16 | 15 | ``` |
17 | 16 | 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) |
29 | 20 | ``` |
30 | 21 |
|
31 | | -Production `*-railway.yaml` configs live in `avs-infra` (`railway/configs/`), |
32 | | -not here — see the note above. |
| 22 | +## Running the test suite |
33 | 23 |
|
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: |
53 | 28 |
|
54 | 29 | ```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 |
57 | 32 | ``` |
58 | 33 |
|
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`. |
74 | 36 |
|
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. |
77 | 40 |
|
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 |
116 | 42 |
|
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