Closed jpitts closed 4 years ago
Adding my 2 wei:
As the wallet uses --syncmode fast
, having only currentBlock
and highestBlock
is not enough. As the >50M state entries take significant time to sync, this API method could also return some data about state entry download progress — or an overall sync %.
:family_man_man_girl_boy::bikini::mother_christmas:
Adding error message doesn't really make sense, geth continuously connects/disconects with peers, and if a problem occur it will reinitiate sync with other peers. Differentiating between the modes "doing fast-sync" and "caught up to head, now doing block-by-block import" (which is what full-sync does from genesis) is already possible: when fast-sync is still catching up, it will also output the number of states downloaded.
As the >50M state entries take significant time to sync, this API method could also return some data about state entry download progress — or an overall sync %.
It's closer to 300M
now. The problem is that it's not really possible to know in advance how many state entries there are :( . Hardcoding it will become wrong. It might be possible to guesstimate it based on trie density, but it's flaky
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have more relevant information or answers to our questions so that we can investigate further.
Background
geth CLI users as well as dapp browsers depending on geth may wish to get more feedback during the initial download / synchronization.
Enhancement
Add the ability to determine the current type or mode of synchronization to the Management or JSON-RPC API.
Additionally, add a synchronization status code and message. Status codes could include 'syncing' or 'error'. The status code and message would act as a pair. This pair should be expected to change once the underlying condition has changed.
Possible approach using the Management API:
Result:
Possible approach using JSON-RPC:
Result:
References
Management APIs
JSON-RPC API: eth_syncing
Ethereum_Wallet_Syncing_Problems