Skip to content

Commit

Permalink
chore(p2p/host): fix typos (#2683)
Browse files Browse the repository at this point in the history
* readme

* scope

* natmgr

* svc

---------

Co-authored-by: Sukun <sukunrt@gmail.com>
  • Loading branch information
fakefraud and sukunrt authored Jan 25, 2024
1 parent d76a43f commit 28c0f6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion p2p/host/resource-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions p2p/host/resource-manager/scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 28c0f6a

Please sign in to comment.