Skip to content

Commit

Permalink
Potential improvement to CL timeouts (#5378)
Browse files Browse the repository at this point in the history
* Strengthen early return when PoS syncing

* Be less aggressive about new payloads

* Less scary log message

* Clean up LVH in EngineStatus_SYNCING

* Slightly more correct message

* Try to fix Hive tests
  • Loading branch information
yperbasis authored Sep 16, 2022
1 parent b8e81f9 commit e5afa72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions eth/stagedsync/stage_headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func startHandlingForkChoice(
}

if header == nil {
log.Info(fmt.Sprintf("[%s] Fork choice downloading missing header with hash %x", s.LogPrefix(), headerHash))
log.Info(fmt.Sprintf("[%s] Fork choice: need to download missing header with hash %x", s.LogPrefix(), headerHash))
if test {
cfg.hd.BeaconRequestList.Remove(requestId)
} else {
Expand Down Expand Up @@ -434,7 +434,7 @@ func handleNewPayload(
return nil, err
}
if parent == nil {
log.Info(fmt.Sprintf("[%s] New payload missing parent", s.LogPrefix()), "height", headerNumber, "hash", headerHash, "parentHash", header.ParentHash)
log.Info(fmt.Sprintf("[%s] New payload: need to download missing parent", s.LogPrefix()), "height", headerNumber, "hash", headerHash, "parentHash", header.ParentHash)
if test {
cfg.hd.BeaconRequestList.Remove(requestId)
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
Expand Down
13 changes: 6 additions & 7 deletions ethdb/privateapi/ethbackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func (s *EthBackendServer) getQuickPayloadStatusIfPossible(blockHash common.Hash

if !s.hd.POSSync() {
log.Debug(fmt.Sprintf("[%s] Still in PoW sync", prefix), "hash", blockHash)
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING, LatestValidHash: common.Hash{}}, nil
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
}

var canonicalHash common.Hash
Expand Down Expand Up @@ -459,15 +459,14 @@ func (s *EthBackendServer) getQuickPayloadStatusIfPossible(blockHash common.Hash
return &engineapi.PayloadStatus{Status: remote.EngineStatus_VALID, LatestValidHash: blockHash}, nil
}

if parent == nil && s.hd.PosStatus() == headerdownload.Syncing {
if parent == nil && s.hd.PosStatus() != headerdownload.Idle {
log.Debug(fmt.Sprintf("[%s] Downloading some other PoS blocks", prefix), "hash", blockHash)
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
}
} else {
if header == nil {
if s.hd.PosStatus() == headerdownload.Syncing {
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
}
return nil, nil
if header == nil && s.hd.PosStatus() != headerdownload.Idle {
log.Debug(fmt.Sprintf("[%s] Downloading some other PoS stuff", prefix), "hash", blockHash)
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
}

headHash := rawdb.ReadHeadBlockHash(tx)
Expand Down

0 comments on commit e5afa72

Please sign in to comment.