You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current sync logic of explorer is very inefficient for importing various informations via different web3 calls.
So I would like to propose and adopt a new db import logic for explorer.
Current method:
Checks latest block number
Sync starts from latest block number to genesis block in "descending" order.
Fetch new blocks while on initial sync
Account list & BlockStats should be run on different process
New method:
Checks if the node is on sync
Checks latest block number on node
Sync starts from genesis block to latest "detected" block number in "ascending" order.
Fetch account list and blockstats in parallel with block & tx collection. ( Use listAccounts method and rescan option if it is a first sync or db document not exists on db )
If the initial sync is finished then fetch new blocks and transactions via web3.eth.subscribe method.
eth.subscribe will report multiple blocks in a single call if the reorg happens, then update the document and move reorged blocks in different collection.
Current sync logic of explorer is very inefficient for importing various informations via different web3 calls.
So I would like to propose and adopt a new db import logic for explorer.
Current method:
Checks latest block number
Sync starts from latest block number to genesis block in "descending" order.
Fetch new blocks while on initial sync
Account list & BlockStats should be run on different process
New method:
Checks if the node is on sync
Checks latest block number on node
Sync starts from genesis block to latest "detected" block number in "ascending" order.
Fetch account list and blockstats in parallel with block & tx collection. ( Use listAccounts method and rescan option if it is a first sync or db document not exists on db )
If the initial sync is finished then fetch new blocks and transactions via web3.eth.subscribe method.
eth.subscribe will report multiple blocks in a single call if the reorg happens, then update the document and move reorged blocks in different collection.
cc @hackmod @realcodywburns
The text was updated successfully, but these errors were encountered: