goimports staged stream sync

pull/4465/head
“GheisMohammadi” 1 year ago
parent 6f3aa67b88
commit e11b6ef122
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 34
      api/service/stagedstreamsync/staged_stream_sync.go
  2. 6
      api/service/stagedstreamsync/state_download_manager.go

@ -59,23 +59,23 @@ func (ib *InvalidBlock) addBadStream(bsID sttypes.StreamID) {
}
type StagedStreamSync struct {
bc core.BlockChain
consensus *consensus.Consensus
isBeacon bool
isExplorer bool
db kv.RwDB
protocol syncProtocol
isBeaconNode bool
gbm *blockDownloadManager // initialized when finished get block number
lastMileBlocks []*types.Block // last mile blocks to catch up with the consensus
lastMileMux sync.Mutex
inserted int
config Config
logger zerolog.Logger
status *status //TODO: merge this with currentSyncCycle
initSync bool // if sets to true, node start long range syncing
UseMemDB bool
bc core.BlockChain
consensus *consensus.Consensus
isBeacon bool
isExplorer bool
db kv.RwDB
protocol syncProtocol
isBeaconNode bool
gbm *blockDownloadManager // initialized when finished get block number
rdm *receiptDownloadManager
lastMileBlocks []*types.Block // last mile blocks to catch up with the consensus
lastMileMux sync.Mutex
inserted int
config Config
logger zerolog.Logger
status *status //TODO: merge this with currentSyncCycle
initSync bool // if sets to true, node start long range syncing
UseMemDB bool
revertPoint *uint64 // used to run stages
prevRevertPoint *uint64 // used to get value from outside of staged sync after cycle (for example to notify RPCDaemon)
invalidBlock InvalidBlock

@ -229,13 +229,13 @@ func (s *StateDownloadManager) HandleRequestError(codeHashes []common.Hash, trie
// add requested code hashes to retries
for _, h := range codeHashes {
s.retries.addCodeTask(h,s.requesting.codeTasks[h])
s.retries.addCodeTask(h, s.requesting.codeTasks[h])
delete(s.requesting.codeTasks, h)
}
// add requested trie paths to retries
for _, path := range triePaths {
s.retries.addTrieTask(path,s.requesting.trieTasks[path])
s.retries.addTrieTask(path, s.requesting.trieTasks[path])
delete(s.requesting.trieTasks, path)
}
}
@ -282,7 +282,7 @@ func (s *StateDownloadManager) HandleRequestResult(codeHashes []common.Hash, tri
}
for _, hash := range codeHashes {
task:= s.requesting.getCodeTask(hash)
task := s.requesting.getCodeTask(hash)
// If the node did deliver something, missing items may be due to a protocol
// limit or a previous timeout + delayed delivery. Both cases should permit
// the node to retry the missing items (to avoid single-peer stalls).

Loading…
Cancel
Save