Browse Source

chore(p2p/host): fix typos (#2683)

* readme

* scope

* natmgr

* svc

---------

Co-authored-by: Sukun <sukunrt@gmail.com>
pull/2690/head
Vehorny 10 months ago
committed by GitHub
parent
commit
28c0f6ab32
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      p2p/host/resource-manager/README.md
  2. 4
      p2p/host/resource-manager/scope_test.go

2
p2p/host/resource-manager/README.md

@ -161,7 +161,7 @@ belong to some service in the system. Hence, this suggests that apart
from global limits, we can constrain stream usage at finer
granularity, at the protocol and service level.
Once again, we disinguish between inbound and outbound streams.
Once again, we distinguish between inbound and outbound streams.
Inbound streams are initiated by remote peers and consume resources in
response to network events; controlling inbound stream usage is again
paramount for protecting the system from overload or attack.

4
p2p/host/resource-manager/scope_test.go

@ -74,7 +74,7 @@ func TestCheckMemory(t *testing.T) {
limit = 1024
}
currentMem = (currentMem % limit) // We can't have reserved more than our limit
res = (res >> 14) // We won't resonably ever have a reservation > 2^50
res = (res >> 14) // We won't reasonably ever have a reservation > 2^50
rc := resources{limit: &BaseLimit{
Memory: int64(limit),
StreamsInbound: 1,
@ -88,7 +88,7 @@ func TestCheckMemory(t *testing.T) {
rc.memory = int64(currentMem)
priShift = (priShift % 9)
// Check different priorties at 2^0, 2^1,...2^8. This lets our math be correct in the check below (and avoid overflows).
// Check different priorities at 2^0, 2^1,...2^8. This lets our math be correct in the check below (and avoid overflows).
pri := uint8((1 << priShift) - 1)
err := rc.checkMemory(int64(res), pri)

Loading…
Cancel
Save