Open dnwiebe opened 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
.
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
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 setstart_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
start_block
will be initialized tonull
in the database and treated asnone
until the first Accountant receivables scan and will be updated to the latest block.