I'm trying to understand how .getPastEvents function works. When given block range to search is {fromBlock:0, toBlock: 'latest'}
it finds my events almost instantaneously. Shouldn't filtering all 7M blocks (using Ropsten testnet) take more than a second? Code snippet if it's of any use.
myContract.getPastEvents("EventName", {fromBlock:0, toBlock: 'latest'}).then(
function(event) {
event.forEach(element => {
//doing some logic here
});
}
);