From de370186d1ff3181c2807a972557111f1d88f638 Mon Sep 17 00:00:00 2001 From: KONFeature Date: Tue, 7 Jan 2025 12:50:21 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Add=20rate=20limit=20for?= =?UTF-8?q?=20ponder=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/erpc/src/index.ts | 3 +++ packages/erpc/src/rateLimits.ts | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/erpc/src/index.ts b/packages/erpc/src/index.ts index a1218af..bcc75bc 100644 --- a/packages/erpc/src/index.ts +++ b/packages/erpc/src/index.ts @@ -8,6 +8,7 @@ import { envioRateRules, llamaFreeRateRules, pimlicoRateRules, + ponderDevRateRules, tenderlyFreeRateRules, } from "./rateLimits"; import { cacheConfig } from "./storage"; @@ -43,6 +44,7 @@ export default initErpcConfig({ drpc: drpcRateRules, llamaFree: llamaFreeRateRules, tenderlyFree: tenderlyFreeRateRules, + ponderDev: ponderDevRateRules, }) // Add networks to the config .decorate("networks", { @@ -89,6 +91,7 @@ export default initErpcConfig({ upstreams.drpc, upstreams.tenderlyFreeArbSepolia, ], + rateLimitBudget: "ponderDev", auth: { strategies: [ { diff --git a/packages/erpc/src/rateLimits.ts b/packages/erpc/src/rateLimits.ts index 7ef7d48..8f309c0 100644 --- a/packages/erpc/src/rateLimits.ts +++ b/packages/erpc/src/rateLimits.ts @@ -55,3 +55,19 @@ export const drpcRateRules: RuleExport = [genericRateLimitsRules(100)]; export const llamaFreeRateRules: RuleExport = [genericRateLimitsRules(30)]; export const tenderlyFreeRateRules: RuleExport = [genericRateLimitsRules(10)]; + +export const ponderDevRateRules: RuleExport = [ + genericRateLimitsRules(200), + { + method: "eth_getLogs", + maxCount: 30, + period: "1s", + waitTime: "1s", + }, + { + method: "eth_getBlockByNumber", + maxCount: 10, + period: "1s", + waitTime: "1s", + }, +];