Skip to content

Commit

Permalink
Maintain P2P connections active during sync (#1417)
Browse files Browse the repository at this point in the history
* maintain P2P connections active during sync (instead of dropping them when getting the Stopped Engine error)

* change log statement for ignoring stopped engine errors from warn to debug (such errors occur during node sync since mining is automatically disabled)
  • Loading branch information
nicolae-leonte-go committed Jun 1, 2022
1 parent 796a31a commit 41118d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/clique"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/consensus/istanbul"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/forkid"
"github.com/ethereum/go-ethereum/core/types"
Expand Down Expand Up @@ -755,6 +756,12 @@ func (h *handler) handleConsensusLoop(p *eth.Peer, protoRW p2p.MsgReadWriter, fa
// Handle incoming messages until the connection is torn down
for {
if err := h.handleConsensus(p, protoRW, fallThroughBackend); err != nil {
// allow the P2P connection to remain active during sync (when the engine is stopped)
if errors.Is(err, istanbul.ErrStoppedEngine) && h.downloader.Synchronising() {
// should this be warn or debug
p.Log().Debug("Ignoring `stopped engine` consensus error due to active sync.")
continue
}
p.Log().Debug("Ethereum quorum message handling failed", "err", err)
return err
}
Expand Down

0 comments on commit 41118d0

Please sign in to comment.