From f064c15d0e84dd58fe063602f2294797a9ee8d14 Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Tue, 14 Jan 2025 12:24:56 +0100 Subject: [PATCH 1/5] chore: improve error log --- api/_errors.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/_errors.ts b/api/_errors.ts index b48ac2651..8cdef3e83 100644 --- a/api/_errors.ts +++ b/api/_errors.ts @@ -267,6 +267,7 @@ export function handleErrorCondition( at: endpoint, code: acrossApiError.code, message: `Status ${acrossApiError.status} - ${acrossApiError.message}`, + cause: acrossApiError.cause, }); return response.status(acrossApiError.status).json(acrossApiError); From b547f9a3892328c1e9e4c35ba3411096834ba310 Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Tue, 14 Jan 2025 12:35:35 +0100 Subject: [PATCH 2/5] fixup --- api/_errors.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/_errors.ts b/api/_errors.ts index 8cdef3e83..ee8c77afd 100644 --- a/api/_errors.ts +++ b/api/_errors.ts @@ -210,11 +210,14 @@ export function handleErrorCondition( const { type, path } = error; // Sanitize the error message that will be sent to client const message = `Invalid parameter at path '${path}'. Expected type '${type}'`; - acrossApiError = new InputError({ - message, - code: AcrossErrorCode.INVALID_PARAM, - param: path.join("."), - }); + acrossApiError = new InputError( + { + message, + code: AcrossErrorCode.INVALID_PARAM, + param: path.join("."), + }, + { cause: error } + ); } // Handle axios errors else if (error instanceof AxiosError) { From 729235965fe8849fabc3ba74cb3e499f3acf9acc Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Tue, 14 Jan 2025 12:55:33 +0100 Subject: [PATCH 3/5] fix: pin block tag --- api/limits.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/limits.ts b/api/limits.ts index d9dd4f06c..7d7de5176 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -3,7 +3,7 @@ import { VercelResponse } from "@vercel/node"; import { BigNumber, ethers } from "ethers"; import { CHAIN_IDs, DEFAULT_SIMULATED_RECIPIENT_ADDRESS } from "./_constants"; import { TokenInfo, TypedVercelRequest } from "./_types"; -import { object, assert, Infer, optional, string } from "superstruct"; +import { assert, Infer, optional, string, type } from "superstruct"; import { ENABLED_ROUTES, @@ -38,7 +38,7 @@ import { } from "./_utils"; import { MissingParamError } from "./_errors"; -const LimitsQueryParamsSchema = object({ +const LimitsQueryParamsSchema = type({ token: optional(validAddress()), inputToken: optional(validAddress()), outputToken: optional(validAddress()), @@ -209,7 +209,8 @@ const handler = async ( }).get() : undefined, callViaMulticall3(provider, multiCalls, { - blockTag: latestBlock.number, + // blockTag: latestBlock.number, + blockTag: 21622164, // temp override before malformed config }), Promise.all( fullRelayers.map((relayer) => From 76a0768d9ae9e0df147bd8c5f03a6c9ff0d190f4 Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Tue, 14 Jan 2025 12:58:05 +0100 Subject: [PATCH 4/5] fixup --- api/limits.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/limits.ts b/api/limits.ts index 7d7de5176..433fc39ec 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -210,7 +210,7 @@ const handler = async ( : undefined, callViaMulticall3(provider, multiCalls, { // blockTag: latestBlock.number, - blockTag: 21622164, // temp override before malformed config + blockTag: 21622160, // temp override before malformed config }), Promise.all( fullRelayers.map((relayer) => From b697d76c43f21e5dda9173358109ddff20a1ebee Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Tue, 14 Jan 2025 13:09:24 +0100 Subject: [PATCH 5/5] fixup --- api/limits.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/limits.ts b/api/limits.ts index 433fc39ec..ac122fd4a 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -209,8 +209,7 @@ const handler = async ( }).get() : undefined, callViaMulticall3(provider, multiCalls, { - // blockTag: latestBlock.number, - blockTag: 21622160, // temp override before malformed config + blockTag: latestBlock.number, }), Promise.all( fullRelayers.map((relayer) =>