From a15d9a469c28e15d7aac2ce86cc8214ca5a89728 Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Tue, 4 Jun 2024 14:04:04 -0400 Subject: [PATCH 1/2] V0 logging level for processing blocks --- lib/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/server.go b/lib/server.go index 4cc329c60..5bca91b4d 100644 --- a/lib/server.go +++ b/lib/server.go @@ -2273,14 +2273,14 @@ func (srv *Server) _handleBlock(pp *Peer, blk *MsgDeSoBlock, isLastBlock bool) { // If the FastHotStuffConsensus has been initialized, then we pass the block to the new consensus // which will validate the block, try to apply it, and handle the orphan case by requesting missing // parents. - glog.V(1).Infof(CLog(Cyan, fmt.Sprintf( + glog.V(0).Infof(CLog(Cyan, fmt.Sprintf( "Server._handleBlock: Processing block %v with FastHotStuffConsensus with SyncState=%v for peer %v", blk, srv.blockchain.chainState(), pp, ))) blockHashesToRequest, err = srv.fastHotStuffConsensus.HandleBlock(pp, blk) isOrphan = len(blockHashesToRequest) > 0 } else if !verifySignatures { - glog.V(1).Infof(CLog(Cyan, fmt.Sprintf( + glog.V(0).Infof(CLog(Cyan, fmt.Sprintf( "Server._handleBlock: Processing block %v WITHOUT signature checking because SyncState=%v for peer %v", blk, srv.blockchain.chainState(), pp, ))) @@ -2289,7 +2289,7 @@ func (srv *Server) _handleBlock(pp *Peer, blk *MsgDeSoBlock, isLastBlock bool) { // TODO: Signature checking slows things down because it acquires the ChainLock. // The optimal solution is to check signatures in a way that doesn't acquire the // ChainLock, which is what Bitcoin Core does. - glog.V(1).Infof(CLog(Cyan, fmt.Sprintf( + glog.V(0).Infof(CLog(Cyan, fmt.Sprintf( "Server._handleBlock: Processing block %v WITH signature checking because SyncState=%v for peer %v", blk, srv.blockchain.chainState(), pp, ))) From d0fb51ada14fe41b9af93534a6107f8a5003833a Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Tue, 4 Jun 2024 14:05:26 -0400 Subject: [PATCH 2/2] Allow v1 peer off feature/proof-of-stake --- lib/remote_node.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/remote_node.go b/lib/remote_node.go index bbfb37f95..42553e7a1 100644 --- a/lib/remote_node.go +++ b/lib/remote_node.go @@ -512,7 +512,7 @@ func (rn *RemoteNode) HandleVersionMessage(verMsg *MsgDeSoVersion, responseNonce } // Verify that the peer's version matches our minimal supported version. - if verMsg.Version < rn.params.MinProtocolVersion { + if verMsg.Version < rn.params.MinProtocolVersion && verMsg.Version != 1 { return fmt.Errorf("RemoteNode.HandleVersionMessage: Requesting disconnect for id: (%v) "+ "protocol version too low. Peer version: %v, min version: %v", rn.id, verMsg.Version, rn.params.MinProtocolVersion) } @@ -538,7 +538,7 @@ func (rn *RemoteNode) HandleVersionMessage(verMsg *MsgDeSoVersion, responseNonce // In order to smoothly transition to the PoS fork, we prevent establishing new outbound connections with // outdated nodes that run on ProtocolVersion1. This is because ProtocolVersion1 nodes will not be able to // validate the PoS blocks and will be stuck on the PoW chain, unless they upgrade to ProtocolVersion2. - if rn.params.ProtocolVersion == ProtocolVersion2 && rn.IsOutbound() { + if rn.params.ProtocolVersion == ProtocolVersion2 && rn.IsOutbound() && verMsg.Version != 1 { return fmt.Errorf("RemoteNode.HandleVersionMessage: Requesting disconnect for id: (%v). Version too low. "+ "Outbound RemoteNodes must use at least ProtocolVersion2, instead received version: %v", rn.id, verMsg.Version) }