Performance improvements for IPLDBlocks in eden watcher (#80)

* Avoid fetching contracts while creating a checkpoint

* Use enum for state kind and cache ipld status

* Avoid fetching block twice while finalizing a staged diff IPLDBlock

* Create checkpoints at fixed block numbers and refactor checkpointing code

* Avoid calling block handler until start block is reached

* Use delete while finalizing staged diff IPLDBlocks

* Add a check to ensure hooks job is created only once

* Avoid check for initial state while creating a checkpoint
This commit is contained in:
prathamesh0
2021-12-28 16:08:05 +05:30
committed by nabarun
parent 952f68ee58
commit 560df57ac7
21 changed files with 380 additions and 184 deletions
+2 -2
View File
@@ -172,8 +172,8 @@ export class GraphWatcher {
// Call block handler(s) for each contract.
for (const dataSource of this._dataSources) {
// Check if block handler(s) are configured.
if (!dataSource.mapping.blockHandlers) {
// Check if block handler(s) are configured and start block has been reached.
if (!dataSource.mapping.blockHandlers || blockData.blockNumber < dataSource.source.startBlock) {
continue;
}