diff --git a/genesis/mainnet.json b/genesis/mainnet.json index 13ffb4ae01..af7a471bca 100644 --- a/genesis/mainnet.json +++ b/genesis/mainnet.json @@ -22,11 +22,16 @@ "consortiumV2Contracts": { "roninValidatorSet": "0x617c5d73662282EA7FfD231E020eCa6D2B0D552f", "slashIndicator": "0xEBFFF2b32fA0dF9C5C8C5d5AAa7e8b51d5207bA3", - "stakingContract": "0x545edb750eB8769C868429BE9586F5857A768758" + "stakingContract": "0x545edb750eB8769C868429BE9586F5857A768758", + "profileContract": "0x840EBf1CA767CB690029E91856A357a43B85d035", + "finalityTracking": "0xA30B2932CD8b8A89E34551Cdfa13810af38dA576" }, "puffyBlock": 0, "bubaBlock": 0, - "olekBlock": 24935500 + "olekBlock": 24935500, + "shillinBlock": 28825400, + "antennaBlock": 28825400, + "whiteListDeployerContractV2Address": "0xc1876d5C4BFAF0eE325E4226B2bdf216D9896AE1" }, "alloc": { "0x0000000000000000000000000000000000000011": { diff --git a/p2p/peer.go b/p2p/peer.go index 0751900588..99c92d27cd 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -112,6 +112,7 @@ type Peer struct { wg sync.WaitGroup protoErr chan error closed chan struct{} + pingRecv chan struct{} disc chan DiscReason // events receives message send / receive events if set @@ -244,6 +245,7 @@ func newPeer(log log.Logger, conn *conn, protocols []Protocol) *Peer { disc: make(chan DiscReason), protoErr: make(chan error, len(protomap)+1), // protocols + pingLoop closed: make(chan struct{}), + pingRecv: make(chan struct{}, 16), log: log.New("id", conn.node.ID(), "conn", conn.flags), } return p @@ -304,9 +306,11 @@ loop: } func (p *Peer) pingLoop() { - ping := time.NewTimer(pingInterval) defer p.wg.Done() + + ping := time.NewTimer(pingInterval) defer ping.Stop() + for { select { case <-ping.C: @@ -315,6 +319,10 @@ func (p *Peer) pingLoop() { return } ping.Reset(pingInterval) + + case <-p.pingRecv: + SendItems(p.rw, pongMsg) + case <-p.closed: return } @@ -341,7 +349,10 @@ func (p *Peer) handle(msg Msg) error { switch { case msg.Code == pingMsg: msg.Discard() - go SendItems(p.rw, pongMsg) + select { + case p.pingRecv <- struct{}{}: + case <-p.closed: + } case msg.Code == discMsg: // This is the last message. We don't need to discard or // check errors because, the connection will be closed after it. diff --git a/params/version.go b/params/version.go index 11339aab4d..8d44b19d40 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 2 // Major version component of the current release VersionMinor = 6 // Minor version component of the current release - VersionPatch = 0 // Patch version component of the current release + VersionPatch = 2 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )