Log Filter performance too slow in 2mi blocks chain

Description

(from Rocket.Chat)

Hi everyone, I am trying to filter events from Besu(v.1.2.4) in a private chain which currently have 2 200 000 blocks; the problem is the response time is TOO LONG; that is, to make a search on those blocks the response time is aproximately 369 seconds, I have made other test where I confirmed it approximately takes 1 second per 5000 blocks. I am using web3@0.20.6. Please can you suggest how can I deal with this issue? Thanks!

_Here is part of the code I am using: _

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 const web3filter = web3.eth.filter({ fromBlock: 1, toBlock: 'latest', topics:[[web3.sha3('NewOwner(bytes32,bytes32,address)')]] }) //measure time: const tPrevious=Date.now() let tFinal //executing the function web3filter.get((error, logs)=> { if (error){ console.log(error); } else { let newLogs = LogParser(logs, abi); console.log(newLogs); } tFinal=Date.now() console.log("response time",(tFinal-tPrevious)/1000, "seconds") })

Environment

None

Status

Assignee

Unassigned

Reporter

Lucas Corte Real Saldanha

Labels

None

Scrum Team

None

Refinement State

Not Started

Affects versions

PAN 1.2

Priority

P3
Configure