Skip to content

Commit 913d81a

Browse files
codybornclaude
andauthored
fix(lambda): bump PostOrder/PostLimitOrder memorySize 512→1024 MB (#658)
Both handlers iterate SUPPORTED_CHAINS at module load to build StaticJsonRpcProvider + OrderValidator (+ V4 for PostOrder) maps. With the V3 multi-chain rollout taking the list from ~4 to 18 chains, cold- start blew past 512 MB: INIT_REPORT Init Duration: 3609.31 ms Phase: init Status: error Error Type: Runtime.OutOfMemory Surfaced as 2-second axios timeouts from param-api → x-service. Other handlers with the same pattern (check-order-status, get-orders) are already at 1024 MB. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 17949e8 commit 913d81a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

bin/stacks/lambda-stack.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ export class LambdaStack extends cdk.NestedStack {
221221
entry: path.join(__dirname, '../../lib/handlers/post-order/index.ts'),
222222
handler: 'postOrderHandler',
223223
timeout: Duration.seconds(29),
224-
memorySize: 512,
224+
// Module-load builds StaticJsonRpcProvider + OrderValidator (+ V4) maps
225+
// for every SUPPORTED_CHAIN; 512 MB OOMs at cold-start past ~16 chains.
226+
memorySize: 1024,
225227
bundling: {
226228
minify: true,
227229
sourceMap: true,
@@ -237,7 +239,9 @@ export class LambdaStack extends cdk.NestedStack {
237239
entry: path.join(__dirname, '../../lib/handlers/post-limit-order/index.ts'),
238240
handler: 'postLimitOrderHandler',
239241
timeout: Duration.seconds(29),
240-
memorySize: 512,
242+
// Same per-chain map construction as PostOrder above — bumped to avoid
243+
// cold-start OOM as the supported-chain list grew.
244+
memorySize: 1024,
241245
bundling: {
242246
minify: true,
243247
sourceMap: true,

0 commit comments

Comments
 (0)