MASQ-Project / MASQ-Node-issues

This repo contains the issues that are used for planning MASQ Node product work. It has no code in it, only GitHub issue tickets
https://masq.ai/
31 stars 12 forks source link

For newly created database - Make `start_block` dynamic instead of static #606

Open dnwiebe opened 2 years ago

dnwiebe commented 2 years ago

When a database is created, initialize start_block to zero.

When the start_block is detected to be zero, do an early blockchain transaction to determine the block number of the head of the blockchain, and set start_block to that.

Blocked by #600

COMMENT - the start_block will likely not ever be zero (perhaps null as empty), since it would be populated by the blockheight of the token contract creation.

Test Plan

utkarshg6 commented 2 years ago

@dnwiebe I believe this might be helpful - https://docs.rs/web3/0.8.0/web3/types/struct.SyncInfo.html

We can use either of these two fields current_block or highest_block.

kauri-hero commented 6 months ago

One test to consider too, is if the very first RPC call to find the current blockheight fails, does Node panic or provide an error?

Bert - if this occurs in a scan, the scan may just abort and Node will continue running. Will likely run on the next interval. You would have to differentiate which scan is the one failing