Skip to content

Commit b9bcc7c

Browse files
gisk0chapati23
authored andcommitted
fix: singleton SecretManagerServiceClient + governor address guard + docs cleanup
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). 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. - 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 - 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 - 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 tests
1 parent 166a670 commit b9bcc7c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/utils/is-valid-quicknode-payload.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ export default function isValidQuicknodePayload(
1212
"result" in requestBody &&
1313
Array.isArray((requestBody as QuicknodePayload).result) &&
1414
(requestBody as QuicknodePayload).result.every((event) => {
15+
const e = event as unknown as Record<string, unknown>;
1516
return (
1617
typeof event === "object" &&
17-
typeof (event as Record<string, unknown>).address === "string" &&
18-
typeof (event as Record<string, unknown>).blockHash === "string" &&
19-
typeof (event as Record<string, unknown>).blockNumber === "string" &&
20-
typeof (event as Record<string, unknown>).logIndex === "string" &&
21-
typeof (event as Record<string, unknown>).name === "string" &&
22-
typeof (event as Record<string, unknown>).transactionHash === "string"
18+
typeof e.address === "string" &&
19+
typeof e.blockHash === "string" &&
20+
typeof e.blockNumber === "string" &&
21+
typeof e.logIndex === "string" &&
22+
typeof e.name === "string" &&
23+
typeof e.transactionHash === "string"
2324
);
2425
})
2526
);

0 commit comments

Comments
 (0)