ethereumclassic / ethereumclassic/explorer
Sync logic change proposal
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 263
- Forks
- 249
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the explorer's current sync logic and its web3 calls, including the node-sync and latest-block checks, listAccounts, and eth.subscribe. Compare the existing flow with the proposed ascending initial import, parallel account and blockstats work, subscription-based updates, and reorg handling; done means those behaviors are specified and implemented consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100