|
1 | | -# `config/` — service configuration |
| 1 | +# `config/` — service & 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 | +The `ap` binary runs as one of three roles depending on its subcommand: |
| 4 | +**gateway**, **worker**, or **operator**. Each role needs a YAML config passed |
| 5 | +via `--config=<path>`. This directory holds the **local-dev** templates for |
| 6 | +those roles plus the **Go test-suite** fixture. |
6 | 7 |
|
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. |
| 8 | +> **Production configs live in `avs-infra`.** The prod `*-railway.yaml` configs |
| 9 | +> are maintained in the `avs-infra` repo and delivered to each service via the |
| 10 | +> `AP_CONFIG_YAML` env var (the image entrypoint writes it to |
| 11 | +> `config/runtime.yaml` at boot). They are not kept in this repo. |
13 | 12 |
|
14 | 13 | ## Layout |
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) |
| 17 | +├── README.md — this file |
21 | 18 | │ |
22 | | -├── gateway-dev.example.yaml — local-dev gateway template |
23 | | -├── gateway-dev.yaml — local-dev gateway, real (gitignored) |
| 19 | +├── test.example.yaml — Go test-suite fixture template |
| 20 | +├── test.yaml — real fixture, gitignored |
24 | 21 | │ |
25 | | -├── worker-<chain>-dev.example.yaml — per-chain local-dev worker template |
26 | | -├── worker-<chain>-dev.yaml — per-chain local-dev worker, real (gitignored) |
| 22 | +├── gateway.example.yaml — local-dev gateway template |
| 23 | +├── gateway.yaml — real, gitignored |
27 | 24 | │ |
28 | | -└── operator-<chain>.yaml — local operator configs (gitignored symlinks) |
| 25 | +├── worker-<chain>.example.yaml — per-chain local-dev worker template |
| 26 | +├── worker-<chain>.yaml — real, gitignored |
| 27 | +│ |
| 28 | +├── operator-<chain>.example.yaml — per-chain local-dev operator template |
| 29 | +└── operator-<chain>.yaml — real, gitignored |
29 | 30 | ``` |
30 | 31 |
|
31 | | -Production `*-railway.yaml` configs live in `avs-infra` (`railway/configs/`), |
32 | | -not here — see the note above. |
| 32 | +Naming is uniform across the three roles: `<role>[-<chain>].yaml` for the local |
| 33 | +config, `<role>[-<chain>].example.yaml` for the checked-in template. Production |
| 34 | +counterparts are `<role>[-<chain>]-railway.yaml` over in `avs-infra`. |
33 | 35 |
|
34 | 36 | ## When to use which |
35 | 37 |
|
36 | 38 | | Scenario | Config file | |
37 | 39 | |---|---| |
38 | | -| Production (any role) on Railway | `avs-infra` → `railway/configs/<svc>-railway.yaml`, delivered via `AP_CONFIG_YAML` | |
| 40 | +| Production (any role) | `avs-infra` → `railway/configs/<svc>-railway.yaml`, delivered via `AP_CONFIG_YAML` | |
39 | 41 | | 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. |
| 42 | +| Local dev gateway | `gateway.yaml` (copy from `gateway.example.yaml`) — `make gateway` | |
| 43 | +| Local dev worker for chain N | `worker-<chain>.yaml` (copy from the template) | |
| 44 | +| Local dev operator for chain N | `operator-<chain>.yaml` (copy from the template) | |
46 | 45 |
|
47 | 46 | ## `.example` template convention |
48 | 47 |
|
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: |
| 48 | +Templates checked into git carry the `.example.yaml` suffix. The real file |
| 49 | +(same name, no `.example.`) is gitignored because it carries secrets — |
| 50 | +controller keys, JWT signing keys, key-store paths. Copy template → real: |
53 | 51 |
|
54 | 52 | ```bash |
55 | | -cp config/gateway-dev.example.yaml config/gateway-dev.yaml |
56 | | -$EDITOR config/gateway-dev.yaml # fill in <placeholder> values |
| 53 | +cp config/gateway.example.yaml config/gateway.yaml |
| 54 | +$EDITOR config/gateway.yaml # fill in <placeholder> values |
57 | 55 | ``` |
58 | 56 |
|
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) |
74 | | - |
75 | | -**Phase 1** (this PR's first commit): documentation + `archived/` |
76 | | -templates + deleted the stale `_legacy/` snapshot. |
77 | | - |
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. |
116 | | - |
117 | | -Neither is in scope for this cleanup. |
| 57 | +`.gitignore` ignores every `config/*.yaml` and keeps `config/*.example.yaml`, |
| 58 | +so the real configs stay untracked while the templates are versioned. |
0 commit comments