core, core/rawdb, eth/sync: no tx indexing during snap sync (#28703)
This change simplifies the logic for indexing transactions and enhances the UX when transaction is not found by returning more information to users. Transaction indexing is now considered as a part of the initial sync, and `eth.syncing` will thus be `true` if transaction indexing is not yet finished. API consumers can use the syncing status to determine if the node is ready to serve users.
This commit is contained in:
@@ -792,7 +792,7 @@ func (s *Service) reportStats(conn *connWrapper) error {
|
||||
}
|
||||
|
||||
sync := fullBackend.SyncProgress()
|
||||
syncing = fullBackend.CurrentHeader().Number.Uint64() >= sync.HighestBlock
|
||||
syncing = !sync.Done()
|
||||
|
||||
price, _ := fullBackend.SuggestGasTipCap(context.Background())
|
||||
gasprice = int(price.Uint64())
|
||||
@@ -801,7 +801,7 @@ func (s *Service) reportStats(conn *connWrapper) error {
|
||||
}
|
||||
} else {
|
||||
sync := s.backend.SyncProgress()
|
||||
syncing = s.backend.CurrentHeader().Number.Uint64() >= sync.HighestBlock
|
||||
syncing = !sync.Done()
|
||||
}
|
||||
// Assemble the node stats and send it to the server
|
||||
log.Trace("Sending node details to ethstats")
|
||||
|
||||
Reference in New Issue
Block a user