Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 800ec03

Browse files
minh-bqfjl
andauthored
chainconfig: add Shillin and Antenna hardfork on mainnet (#365)
* chainconfig: add Shillin and Antenna hardfork on mainnet * p2p: move ping handling into pingLoop goroutine (#27887) Moving the response sending there allows tracking all peer goroutines in the peer WaitGroup. * params/version: bump Ronin to version 2.6.2 --------- Co-authored-by: Felix Lange <[email protected]>
1 parent fa1dc18 commit 800ec03

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

genesis/mainnet.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
"consortiumV2Contracts": {
2323
"roninValidatorSet": "0x617c5d73662282EA7FfD231E020eCa6D2B0D552f",
2424
"slashIndicator": "0xEBFFF2b32fA0dF9C5C8C5d5AAa7e8b51d5207bA3",
25-
"stakingContract": "0x545edb750eB8769C868429BE9586F5857A768758"
25+
"stakingContract": "0x545edb750eB8769C868429BE9586F5857A768758",
26+
"profileContract": "0x840EBf1CA767CB690029E91856A357a43B85d035",
27+
"finalityTracking": "0xA30B2932CD8b8A89E34551Cdfa13810af38dA576"
2628
},
2729
"puffyBlock": 0,
2830
"bubaBlock": 0,
29-
"olekBlock": 24935500
31+
"olekBlock": 24935500,
32+
"shillinBlock": 28825400,
33+
"antennaBlock": 28825400,
34+
"whiteListDeployerContractV2Address": "0xc1876d5C4BFAF0eE325E4226B2bdf216D9896AE1"
3035
},
3136
"alloc": {
3237
"0x0000000000000000000000000000000000000011": {

p2p/peer.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ type Peer struct {
112112
wg sync.WaitGroup
113113
protoErr chan error
114114
closed chan struct{}
115+
pingRecv chan struct{}
115116
disc chan DiscReason
116117

117118
// events receives message send / receive events if set
@@ -244,6 +245,7 @@ func newPeer(log log.Logger, conn *conn, protocols []Protocol) *Peer {
244245
disc: make(chan DiscReason),
245246
protoErr: make(chan error, len(protomap)+1), // protocols + pingLoop
246247
closed: make(chan struct{}),
248+
pingRecv: make(chan struct{}, 16),
247249
log: log.New("id", conn.node.ID(), "conn", conn.flags),
248250
}
249251
return p
@@ -304,9 +306,11 @@ loop:
304306
}
305307

306308
func (p *Peer) pingLoop() {
307-
ping := time.NewTimer(pingInterval)
308309
defer p.wg.Done()
310+
311+
ping := time.NewTimer(pingInterval)
309312
defer ping.Stop()
313+
310314
for {
311315
select {
312316
case <-ping.C:
@@ -315,6 +319,10 @@ func (p *Peer) pingLoop() {
315319
return
316320
}
317321
ping.Reset(pingInterval)
322+
323+
case <-p.pingRecv:
324+
SendItems(p.rw, pongMsg)
325+
318326
case <-p.closed:
319327
return
320328
}
@@ -341,7 +349,10 @@ func (p *Peer) handle(msg Msg) error {
341349
switch {
342350
case msg.Code == pingMsg:
343351
msg.Discard()
344-
go SendItems(p.rw, pongMsg)
352+
select {
353+
case p.pingRecv <- struct{}{}:
354+
case <-p.closed:
355+
}
345356
case msg.Code == discMsg:
346357
// This is the last message. We don't need to discard or
347358
// check errors because, the connection will be closed after it.

params/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
const (
2424
VersionMajor = 2 // Major version component of the current release
2525
VersionMinor = 6 // Minor version component of the current release
26-
VersionPatch = 0 // Patch version component of the current release
26+
VersionPatch = 2 // Patch version component of the current release
2727
VersionMeta = "" // Version metadata to append to the version string
2828
)
2929

0 commit comments

Comments
 (0)