Commit b0f1a7f
committed
fix: singleton SecretManagerServiceClient + governor address guard + docs cleanup
## Root cause fix
Every call to getSecret() instantiated a new SecretManagerServiceClient,
opening a gRPC channel that was never closed. ~169 requests over 28 minutes
→ 488 MiB OOM. Fix: singleton client at module level.
Secret values are NOT cached (would break rotation on warm instances).
## Governor address guard
QuickNode evmAbiFilter ignores the 'contracts' field in templateArgs
(silently, empirically confirmed). Added MENTO_GOVERNOR_ADDRESS guard in
process-event.ts so events from other OZ Governor contracts on Celo don't
produce false notifications.
## Deploy script fixes
- Global TMP_FILES array + single EXIT trap (fixes trap overwrite on
multiple deploy_webhook calls)
- Code comment explaining why templateArgs uses 'abiJson' not 'abi'
(spec says 'abi', live evmAbiFilterGo endpoint requires 'abiJson')
- Comment explaining hardcoded webhook UUIDs and how to update them
- Updated Terraform filter_function blobs to current trimmed ABIs
## Docs & cleanup
- Delete bin/update-quicknode-filter.js (zombie script, never worked)
- Remove dead dev:webhook:* npm scripts
- Consolidate quicknode.tf comment: UPDATE=script, RECREATE=Terraform
- Rewrite README + ADDING_EVENTS.md to reflect actual deploy workflow
## Tests
- 5 unit tests for get-secret.ts (singleton behavior, no caching, errors)
- 7 unit tests for process-event.ts governor address guard
(canonical address, wrong address, all 4 event types, mixed-case, MedianUpdated)
- npm test now runs vitest before integration tests1 parent 7e63af8 commit b0f1a7f
File tree
16 files changed
+1889
-270
lines changed- bin
- infra
- src
- events
- __tests__
- utils
- __tests__
16 files changed
+1889
-270
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | | - | |
65 | | - | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | | - | |
| 110 | + | |
108 | 111 | | |
109 | | - | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 114 | + | |
119 | 115 | | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 124 | + | |
127 | 125 | | |
128 | | - | |
| 126 | + | |
129 | 127 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
135 | 131 | | |
136 | | - | |
| 132 | + | |
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 220 | + | |
230 | 221 | | |
231 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
232 | 229 | | |
233 | | - | |
| 230 | + | |
234 | 231 | | |
235 | 232 | | |
236 | | - | |
237 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 238 | + | |
248 | 239 | | |
249 | | - | |
| 240 | + | |
250 | 241 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
255 | 245 | | |
256 | 246 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | 247 | | |
262 | 248 | | |
263 | 249 | | |
| |||
267 | 253 | | |
268 | 254 | | |
269 | 255 | | |
| 256 | + | |
| 257 | + | |
270 | 258 | | |
271 | 259 | | |
272 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 113 | + | |
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
| |||
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
131 | | - | |
132 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
133 | 151 | | |
134 | 152 | | |
135 | 153 | | |
| |||
This file was deleted.
0 commit comments