diff --git a/AllTests-mainnet.md b/AllTests-mainnet.md index ba4708a5e..221b2142c 100644 --- a/AllTests-mainnet.md +++ b/AllTests-mainnet.md @@ -201,14 +201,13 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 + PeerGroup tests OK + PeerSlot tests OK + SyncManager failure test OK -+ SyncManager group-recovery test OK + SyncManager one-peer test OK + SyncManager one-peer-group test OK + SyncManager one-peer-slot test OK + SyncQueue async tests OK + SyncQueue non-async tests OK ``` -OK: 9/9 Fail: 0/9 Skip: 0/9 +OK: 8/8 Fail: 0/8 Skip: 0/8 ## Zero signature sanity checks ```diff + SSZ serialization roundtrip of SignedBeaconBlockHeader OK @@ -242,4 +241,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4 OK: 8/8 Fail: 0/8 Skip: 0/8 ---TOTAL--- -OK: 149/152 Fail: 3/152 Skip: 0/152 +OK: 148/151 Fail: 3/151 Skip: 0/151 diff --git a/AllTests-minimal.md b/AllTests-minimal.md index 77498f7cf..31dda8448 100644 --- a/AllTests-minimal.md +++ b/AllTests-minimal.md @@ -228,14 +228,13 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 + PeerGroup tests OK + PeerSlot tests OK + SyncManager failure test OK -+ SyncManager group-recovery test OK + SyncManager one-peer test OK + SyncManager one-peer-group test OK + SyncManager one-peer-slot test OK + SyncQueue async tests OK + SyncQueue non-async tests OK ``` -OK: 9/9 Fail: 0/9 Skip: 0/9 +OK: 8/8 Fail: 0/8 Skip: 0/8 ## Zero signature sanity checks ```diff + SSZ serialization roundtrip of SignedBeaconBlockHeader OK @@ -269,4 +268,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4 OK: 8/8 Fail: 0/8 Skip: 0/8 ---TOTAL--- -OK: 164/167 Fail: 3/167 Skip: 0/167 +OK: 163/166 Fail: 3/166 Skip: 0/166 diff --git a/beacon_chain/sync_manager.nim b/beacon_chain/sync_manager.nim index b006316f1..71d01d2a0 100644 --- a/beacon_chain/sync_manager.nim +++ b/beacon_chain/sync_manager.nim @@ -397,7 +397,7 @@ proc isEmpty*[A, B](peerslot: PeerSlot[A, B]): bool {.inline.} = proc fillPeers*[A, B](slot: PeerSlot[A, B]) {.async.} = doAssert(slot.man.peersInSlot > 0 and (slot.man.peersInSlot mod 2 == 1)) - doAssert(len(slot.peers) == 0 or (len(slot.peers) mod 2 == 0)) + doAssert(len(slot.peers) mod 2 == 0) doAssert(len(slot.peers) <= slot.man.peersInSlot) if len(slot.peers) == 0: # This is new slot diff --git a/tests/test_sync_manager.nim b/tests/test_sync_manager.nim index 6c42ba5f7..a7e3d79cd 100644 --- a/tests/test_sync_manager.nim +++ b/tests/test_sync_manager.nim @@ -785,78 +785,6 @@ proc syncManagerOneGroupTest(): Future[bool] {.async.} = result = true -proc syncManagerGroupRecoveryTest(): Future[bool] {.async.} = - # Syncing with two groups of peers (n peer slots), when one groups is failed - # to deliver request, and this request is bigger then other group. - var pool = newPeerPool[SimplePeer, SimplePeerKey]() - var peers = newSeq[SimplePeer](6 + 3) - for i in 0 ..< len(peers): - peers[i] = SimplePeer.init("id" & $(i + 1), weight = 9 - i) - - var srcChain = newTempChain(100, Slot(10000)) - var dstChain = newSeq[SignedBeaconBlock]() - - for i in 0 ..< 6: - peers[i].update(srcChain, failure = true, disconnect = true) - for i in 6 ..< len(peers): - peers[i].update(srcChain) - - proc lastLocalSlot(): Slot = - if len(dstChain) == 0: - result = Slot(9999) - else: - result = dstChain[^1].message.slot - - proc updateBlocks(list: openarray[SignedBeaconBlock]): bool = - for item in list: - dstChain.add(item) - result = true - - for i in 0 ..< len(peers): - if i mod 2 == 0: - doAssert(pool.addIncomingPeerNoWait(peers[i]) == true) - else: - doAssert(pool.addOutgoingPeerNoWait(peers[i]) == true) - - var sman = newSyncManager[SimplePeer, - SimplePeerKey](pool, lastLocalSlot, updateBlocks, - peersInSlot = 3, - peerSlotTimeout = 1.seconds, - slotsInGroup = 2) - await sman.synchronize() - for i in 0 ..< len(peers): - if i in {0, 1, 2}: - doAssert(checkRequest(peers[i], 0, 10020, 20, 2) == true) - elif i in {3, 4, 5}: - doAssert(checkRequest(peers[i], 0, 10021, 20, 2) == true) - elif i in {6, 7, 8}: - doAssert(checkRequest(peers[i], 0, 10000, 20, 1, - 10000, 10001, 10002, 10003, 10004, - 10005, 10006, 10007, 10008, 10009, - 10010, 10011, 10012, 10013, 10014, - 10015, 10016, 10017, 10018, 10019) == true) - doAssert(checkRequest(peers[i], 1, 10020, 20, 1, - 10020, 10021, 10022, 10023, 10024, - 10025, 10026, 10027, 10028, 10029, - 10030, 10031, 10032, 10033, 10034, - 10035, 10036, 10037, 10038, 10039) == true) - doAssert(checkRequest(peers[i], 2, 10040, 20, 1, - 10040, 10041, 10042, 10043, 10044, - 10045, 10046, 10047, 10048, 10049, - 10050, 10051, 10052, 10053, 10054, - 10055, 10056, 10057, 10058, 10059) == true) - doAssert(checkRequest(peers[i], 3, 10060, 20, 1, - 10060, 10061, 10062, 10063, 10064, - 10065, 10066, 10067, 10068, 10069, - 10070, 10071, 10072, 10073, 10074, - 10075, 10076, 10077, 10078, 10079) == true) - doAssert(checkRequest(peers[i], 4, 10080, 20, 1, - 10080, 10081, 10082, 10083, 10084, - 10085, 10086, 10087, 10088, 10089, - 10090, 10091, 10092, 10093, 10094, - 10095, 10096, 10097, 10098, 10099) == true) - result = true - proc syncManagerFailureTest(): Future[bool] {.async.} = # Failure test const FailuresCount = 3 @@ -909,7 +837,5 @@ suiteReport "SyncManager test suite": check waitFor(syncManagerOneSlotTest()) == true timedTest "SyncManager one-peer-group test": check waitFor(syncManagerOneGroupTest()) == true - timedTest "SyncManager group-recovery test": - check waitFor(syncManagerGroupRecoveryTest()) == true timedTest "SyncManager failure test": check waitFor(syncManagerFailureTest()) == true diff --git a/vendor/nim-chronos b/vendor/nim-chronos index cbd8e0382..9ea1017a0 160000 --- a/vendor/nim-chronos +++ b/vendor/nim-chronos @@ -1 +1 @@ -Subproject commit cbd8e03823c00dd230e48a4613c0f594b77616eb +Subproject commit 9ea1017a06e9b09996075c2b385fa8ea8aefa0b7 diff --git a/vendor/nim-eth b/vendor/nim-eth index 6a513ae02..99c68d40f 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 6a513ae02e9287322b1f48bd17b45cadacb95dc8 +Subproject commit 99c68d40f71a3bbb6b3e4024390cc7fde7c31ecb diff --git a/vendor/nim-json-serialization b/vendor/nim-json-serialization index c108ba90e..f52683b2e 160000 --- a/vendor/nim-json-serialization +++ b/vendor/nim-json-serialization @@ -1 +1 @@ -Subproject commit c108ba90e6b304515f08fdcff62f428f3f8fbe53 +Subproject commit f52683b2ee92501915ef062528c9e3ecd253d412 diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index 2b823bde6..eaa73ae6e 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 2b823bde68cfb5efbe145945e8c17593f44eda5a +Subproject commit eaa73ae6e82f9b1c1f720f47617424469b6db2a6 diff --git a/vendor/nim-serialization b/vendor/nim-serialization index 0eab8cfee..68e9ef790 160000 --- a/vendor/nim-serialization +++ b/vendor/nim-serialization @@ -1 +1 @@ -Subproject commit 0eab8cfeee55cfa3bb893ec31137d3c25b83a1ae +Subproject commit 68e9ef790138b6644a87229afdd2e217bd801ad5