Skip to content

Commit aae7714

Browse files
authored
AA-650 invalid block while reading logs (#260)
with latest geth (15.9 to be exact) eth_getLogs aborts if "from block" is a future block. This is a perfectly valid state, if we processed all events from the latest block.
1 parent c70c909 commit aae7714

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

packages/bundler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@account-abstraction/bundler",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"license": "MIT",
55
"private": true,
66
"files": [

packages/bundler/src/modules/EventsManager.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,16 @@ export class EventsManager {
3939
if (this.lastBlock === undefined) {
4040
this.lastBlock = Math.max(1, await this.entryPoint.provider.getBlockNumber() - 1000)
4141
}
42-
const events = await this.entryPoint.queryFilter({ address: this.entryPoint.address }, this.lastBlock)
43-
for (const ev of events) {
44-
this.handleEvent(ev)
42+
try {
43+
const events = await this.entryPoint.queryFilter({ address: this.entryPoint.address }, this.lastBlock)
44+
for (const ev of events) {
45+
this.handleEvent(ev)
46+
}
47+
} catch (e) {
48+
// if we processed latest block, then "lastBlock" is set to one above, so the new geth 15.9 error can safely be ignored.
49+
if (!(e as Error).message.includes('invalid block range params')) {
50+
throw e
51+
}
4552
}
4653
}
4754

0 commit comments

Comments
 (0)