Currently epoch switching is querying all blocks within given epochs for events (getLogs).
Public forno api limits them to 1000. It would be amazing to have configurable block limit for querying.
Potential solution in EpochManager.ts:
// Public RPC nodes cap eth_getLogs to a 1000-block range; an unprocessed epoch
// can span a full day of blocks, so page the GroupProcessed query.
private static readonly GETLOGS_RANGE = 1000
private getGroupProcessedEvents = async (fromBlock: number): Promise<EventLog[]> => {
const latest = Number(await this.client.getBlockNumber())
const events: EventLog[] = []
for (let start = fromBlock; start <= latest; start += EpochManagerWrapper.GETLOGS_RANGE) {
const toBlock = Math.min(start + EpochManagerWrapper.GETLOGS_RANGE - 1, latest)
events.push(...(await this.getPastEvents('GroupProcessed', { fromBlock: start, toBlock })))
}
return events
}
// replace the call:
const fromBlock = (await this.getFirstBlockAtEpoch(await this.getCurrentEpochNumber())) + 1
const groupProcessedEvents = await this.getGroupProcessedEvents(fromBlock)
Currently epoch switching is querying all blocks within given epochs for events (getLogs).
Public forno api limits them to 1000. It would be amazing to have configurable block limit for querying.
Potential solution in
EpochManager.ts: