Implement fetch and save of filtered event logs and required blocks (#445)

* Fix async block size caching for missing blocks in historical processing

* Start historical block processing only if filter logs is set to true

* Fetch filtered logs by topics and save required blocks

* Fix realtime processing start block after historical processing

* Avoid publishing events and blocks in historical processing

* Add new method to graph-node test indexer

* Get full block data for subgraph block handler only if configured

* Add useBlockRanges flag for switching between historical and realtime processing
This commit is contained in:
2023-11-01 19:07:06 +05:30
committed by GitHub
parent 1b6ca6edeb
commit 9fb51e89f6
14 changed files with 211 additions and 130 deletions
+7 -6
View File
@@ -93,12 +93,6 @@ export class Indexer implements IndexerInterface {
return [];
}
async getLatestProcessedBlockProgress (isPruned: boolean): Promise<BlockProgressInterface | undefined> {
assert(isPruned);
return undefined;
}
async getBlockEvents (blockHash: string): Promise<Array<EventInterface>> {
assert(blockHash);
@@ -118,6 +112,13 @@ export class Indexer implements IndexerInterface {
return [];
}
async fetchAndSaveFilteredEventsAndBlocks (startBlock: number, endBlock: number): Promise<{ blockProgress: BlockProgressInterface, events: DeepPartial<EventInterface>[] }[]> {
assert(startBlock);
assert(endBlock);
return [];
}
async saveBlockAndFetchEvents (block: BlockProgressInterface): Promise<[BlockProgressInterface, DeepPartial<EventInterface>[]]> {
return [block, []];
}