You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GossipRouter should be smarter when handling IHAVEs from its peers: it should rate limit corresponding IWANT requests across all peers.
In the below test iwantsSent == 100, i.e. the router requested the same message from all peers
@Test
fun`router should limit IWANTs for the same message ID to different peers`() {
val test =ManyRoutersTest(mockRouterCount =100)
test.connectAll()
test.gossipRouter.subscribe("topic1")
test.routers.forEach { it.router.subscribe("topic1") }
test.fuzz.timeController.addTime(2.seconds)
val unknownMessageId ="0000000000000000000000000000000000000000".toWBytes()
val partsQueue =DefaultGossipRpcPartsQueue(test.gossipRouter.params)
partsQueue.addIHave(unknownMessageId, "topic1")
val rpc = partsQueue.takeMerged().first()
test.mockRouters.forEach { it.sendToSingle(rpc) }
test.fuzz.timeController.addTime(1.seconds)
val iwantsSent = test.mockRouters.sumOf {
val iwants = it.inboundMessages.sumOf {
it.control.iwantList.count {
it.messageIDsList.contains(
unknownMessageId.toProtobuf()
)
}
}
assertTrue(iwants <=1)
iwants
}
assertTrue(iwantsSent <10)
}
Expected behavior
The router should request the same message just from few peers, but probably remember others and retry if initial requests fail
Actual behavior
Router just emits IWANT when handling IHAVE if a message ID is not known. Thus it may requests a lot in case when IHAVEs arrived in the same time period. It may have amplification effect with a larger messages: the more router sends IWANTs the slower it may receive the first message
Would you like to work on fixing this bug ?
Maybe
The text was updated successfully, but these errors were encountered:
Summary
The GossipRouter should be smarter when handling
IHAVE
s from its peers: it should rate limit correspondingIWANT
requests across all peers.In the below test
iwantsSent == 100
, i.e. the router requested the same message from all peersExpected behavior
The router should request the same message just from few peers, but probably remember others and retry if initial requests fail
Actual behavior
Router just emits
IWANT
when handlingIHAVE
if a message ID is not known. Thus it may requests a lot in case whenIHAVE
s arrived in the same time period. It may have amplification effect with a larger messages: the more router sendsIWANT
s the slower it may receive the first messageWould you like to work on fixing this bug ?
Maybe
The text was updated successfully, but these errors were encountered: