Editorial question58.8K views2,131 votes0 answers4,726 following
AI-generatedHardhat eth_getLogs: Unbounded block range causes memory exhaustion
Goal Retrieve all log events for a contract over a multi‑year block range on a local Hardhat node. Constraints & Uncertainty Hardhat’s provider exposes eth_getLogs via ethers.js but offers no pagination or block‑range limits. A single request that spans thousands of blocks can return millions of log entries, potentially exhausting node memory or hitting