diff --git a/hbs2-core/lib/HBS2/Defaults.hs b/hbs2-core/lib/HBS2/Defaults.hs index d75fea41..12eacf2f 100644 --- a/hbs2-core/lib/HBS2/Defaults.hs +++ b/hbs2-core/lib/HBS2/Defaults.hs @@ -55,7 +55,7 @@ defBlockSizeCacheTime :: TimeSpec defBlockSizeCacheTime = toTimeSpec ( 30 :: Timeout 'Seconds ) defRequestLimitSec :: Timeout 'Seconds -defRequestLimitSec = 300 +defRequestLimitSec = 10 -- 300 defBlockBanTime :: TimeSpec defBlockBanTime = toTimeSpec defBlockBanTimeSec @@ -70,7 +70,7 @@ defBlockWipTimeout :: TimeSpec defBlockWipTimeout = defCookieTimeout defBlockInfoTimeout :: Timeout 'Seconds -defBlockInfoTimeout = 20 +defBlockInfoTimeout = 1 defBlockInfoTimeoutSpec :: TimeSpec defBlockInfoTimeoutSpec = toTimeSpec defBlockInfoTimeout diff --git a/hbs2-core/lib/HBS2/Net/Proto/Definition.hs b/hbs2-core/lib/HBS2/Net/Proto/Definition.hs index 0def4283..0fa8b3bd 100644 --- a/hbs2-core/lib/HBS2/Net/Proto/Definition.hs +++ b/hbs2-core/lib/HBS2/Net/Proto/Definition.hs @@ -72,7 +72,7 @@ instance HasProtocol L4Proto (BlockInfo L4Proto) where -- FIXME: requestMinPeriod-breaks-fast-block-download -- - requestPeriodLim = ReqLimPerMessage 1 + requestPeriodLim = ReqLimPerMessage 0.5 instance HasProtocol L4Proto (BlockChunks L4Proto) where type instance ProtocolId (BlockChunks L4Proto) = 2 @@ -116,7 +116,7 @@ instance HasProtocol L4Proto (RefLogUpdate L4Proto) where encode = serialise -- TODO: find-out-optimal-max-safe-frequency - requestPeriodLim = ReqLimPerMessage 600 + requestPeriodLim = ReqLimPerMessage 60 instance HasProtocol L4Proto (RefLogRequest L4Proto) where type instance ProtocolId (RefLogRequest L4Proto) = 8 @@ -148,7 +148,7 @@ instance HasProtocol L4Proto (EncryptionHandshake L4Proto) where decode = deserialiseCustom encode = serialise - requestPeriodLim = ReqLimPerProto 0.5 + requestPeriodLim = ReqLimPerProto 0.1 instance HasProtocol L4Proto (RefChanUpdate L4Proto) where diff --git a/hbs2-peer/app/BlockDownload.hs b/hbs2-peer/app/BlockDownload.hs index 974036e1..afaa3d30 100644 --- a/hbs2-peer/app/BlockDownload.hs +++ b/hbs2-peer/app/BlockDownload.hs @@ -514,6 +514,7 @@ blockDownloadLoop env0 = do wipNum <- asks (view blockInQ) >>= liftIO . readTVarIO <&> HashMap.size when (wipNum == 0) do + trace "NOTHING TO DOWNLOAD" pause @'Seconds 1 next @@ -527,7 +528,7 @@ blockDownloadLoop env0 = do pure $ not busy when (List.null pips) do - void $ liftIO $ race (pause @'Seconds 5) $ do + void $ liftIO $ race (pause @'Seconds 1) $ do trace "ALL PEERS BUSY" void $ liftIO $ atomically $ do p <- readTQueue released @@ -569,7 +570,7 @@ blockDownloadLoop env0 = do liftIO $ atomically $ modifyTVar downMiss succ Right (Just size) -> do - -- trace $ "BLOCK SIZE" <+> pretty p <+> pretty h <+> pretty size + trace $ "BLOCK SIZE" <+> pretty p <+> pretty h <+> pretty size let downFail = view peerDownloadFail pinfo let downBlk = view peerDownloadedBlk pinfo diff --git a/hbs2-peer/app/Brains.hs b/hbs2-peer/app/Brains.hs index 55e51551..0317d5de 100644 --- a/hbs2-peer/app/Brains.hs +++ b/hbs2-peer/app/Brains.hs @@ -112,7 +112,6 @@ instance ( Hashable (Peer e) updateOP br (deleteDownload br what) onKnownPeers br ps = do - trace $ "BRAINS: onKnownPeers" <+> pretty ps let tv = view brainsPeers br liftIO $ atomically $ writeTVar tv ps updateOP br $ do