near / near-indexer-for-explorer

Watch NEAR network and store all the data from NEAR blockchain to PostgreSQL database
https://near-indexers.io/docs/projects/near-indexer-for-explorer
GNU General Public License v3.0
124 stars 56 forks source link

Fix `--allow-missing-relations-in-first-blocks` #163

Closed khorolets closed 2 years ago

khorolets commented 3 years ago

Currently, account_changes constraints cast this feature to a useless one.

Plan to adjust the non-strict mode to:

This should allow us to start indexer from any block to speed up catching up or something similar in emergency situations.

khorolets commented 3 years ago

While working on this I've realized it's pointless and there is no way to fix it.

We don't be able to switch between non-strict and strict modes smoothly. In case of missing data, we've skipped in a non-strict mode at any point after switching to a strict mode can lead us to the situation where would try to store account_changes record and affecting an Account that was created during the non-strict mode. We miss the corresponding Receipt, we aren't able to save account_change related to that account.

We decided to drop --allow-missing-relations-in-first-blocks in favor to create --non-strict-mode which just makes the node to work in that mode unless stopped.