Skip to content

Commit

Permalink
docs: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
criadoperez authored Sep 22, 2023
1 parent 5c0508b commit cc3c224
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ only for backward compatibility when a legacy CIDv0 is required (--format=v0).
cidCodec, _ := req.Options[blockCidCodecOptionName].(string)
format, _ := req.Options[blockFormatOptionName].(string) // deprecated

// use of legacy 'format' needs to supress 'cid-codec'
// use of legacy 'format' needs to suppress 'cid-codec'
if format != "" {
if cidCodec != "" && cidCodec != "raw" {
return fmt.Errorf("unable to use %q (deprecated) and a custom %q at the same time", blockFormatOptionName, blockCidCodecOptionName)
Expand Down
2 changes: 1 addition & 1 deletion core/node/libp2p/rcmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func LimitConfig(cfg config.SwarmConfig, userResourceOverrides rcmgr.PartialLimi

// This effectively overrides the computed default LimitConfig with any non-"useDefault" values from the userResourceOverrides file.
// Because of how how Build works, any rcmgr.Default value in userResourceOverrides
// will be overriden with a computed default value.
// will be overridden with a computed default value.
limitConfig = userResourceOverrides.Build(limitConfig)

return limitConfig, msg, nil
Expand Down
6 changes: 3 additions & 3 deletions core/node/libp2p/rcmgr_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func createDefaultLimitConfig(cfg config.SwarmConfig) (limitConfig rcmgr.Concret
// At least as of 2023-01-25, it's possible to open a connection that
// doesn't ask for any memory usage with the libp2p Resource Manager/Accountant
// (see https://github.com/libp2p/go-libp2p/issues/2010#issuecomment-1404280736).
// As a result, we can't curretly rely on Memory limits to full protect us.
// As a result, we can't currently rely on Memory limits to full protect us.
// Until https://github.com/libp2p/go-libp2p/issues/2010 is addressed,
// we take a proxy now of restricting to 1 inbound connection per MB.
// Note: this is more generous than go-libp2p's default autoscaled limits which do
Expand Down Expand Up @@ -114,7 +114,7 @@ func createDefaultLimitConfig(cfg config.SwarmConfig) (limitConfig rcmgr.Concret
// Anything in scalingLimitConfig that wasn't defined in partialLimits above will be added (e.g., libp2p's default service limits).
partialLimits = partialLimits.Build(scalingLimitConfig.Scale(int64(maxMemory), maxFD)).ToPartialLimitConfig()

// Simple checks to overide autoscaling ensuring limits make sense versus the connmgr values.
// Simple checks to override autoscaling ensuring limits make sense versus the connmgr values.
// There are ways to break this, but this should catch most problems already.
// We might improve this in the future.
// See: https://github.com/ipfs/kubo/issues/9545
Expand All @@ -140,7 +140,7 @@ Computed default go-libp2p Resource Manager limits based on:
- 'Swarm.ResourceMgr.MaxMemory': %q
- 'Swarm.ResourceMgr.MaxFileDescriptors': %d
Theses can be inspected with 'ipfs swarm resources'.
These can be inspected with 'ipfs swarm resources'.
`, maxMemoryString, maxFD)

Expand Down
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ However the latency of individual read/write operations should be ~10x faster
and the provide throughput up to 6 million times faster on larger datasets!

This is not compatible with `Routing.Type` `custom`. If you are using composable routers
you can configure this individualy on each router.
you can configure this individually on each router.

When it is enabled:
- Client DHT operations (reads and writes) should complete much faster
Expand Down Expand Up @@ -2146,7 +2146,7 @@ Type: `priority`
Mplex is deprecated, this is because it is unreliable and
randomly drop streams when sending data *too fast*.

New pieces of code rely on backpressure, that means the stream will dynamicaly
New pieces of code rely on backpressure, that means the stream will dynamically
slow down the sending rate if data is getting backed up.
Backpressure is provided by **Yamux** and **QUIC**.

Expand Down
6 changes: 3 additions & 3 deletions docs/libp2p-resource-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ since we assume libp2p knows best here.
Source: [core/node/libp2p/rcmgr_defaults.go](https://github.com/ipfs/kubo/blob/master/core/node/libp2p/rcmgr_defaults.go)

### User Supplied Override Limits
A user who wants fine control over the limits used by the go-libp2p resoure manager can specify overrides to the [computed default limits](#computed-default-limits).
A user who wants fine control over the limits used by the go-libp2p resource manager can specify overrides to the [computed default limits](#computed-default-limits).
This is done by defining limits in ``$IPFS_PATH/libp2p-resource-limit-overrides.json``.
These values trump anything else and are parsed directly by go-libp2p.
(See the [go-libp2p Resource Manager README](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/README.md) for formatting.)
Expand All @@ -98,7 +98,7 @@ As an example:
> Protected from exceeding resource limits 2 times: "system: cannot reserve inbound connection: resource limit exceeded"
This means that there were 2 recent occurrences where the libp2p resource manager prevented an inbound connection at the "system" [scope](https://github.com/libp2p/go-libp2p/tree/master/p2p/host/resource-manager#resource-scopes).
Specificaly the ``System.ConnsInbound`` limit was hit.
Specifically the ``System.ConnsInbound`` limit was hit.

This can be analyzed by viewing the limit and current usage with `ipfs swarm resources`.
`System.ConnsInbound` is likely close or at the limit value.
Expand Down Expand Up @@ -136,7 +136,7 @@ If `Swarm.ConnMgr.HighWater` is greater than resource manager's `System.ConnsInb
existing low priority idle connections can prevent new high priority connections from being established.
The ResourceMgr doesn't know that the new connection is high priority and simply blocks it because of the limit its enforcing.

To ensure the ConnMgr and ResourceMgr are congruent, the ResourceMgr [computed default limts](#computed-default-limits) are adjusted such that:
To ensure the ConnMgr and ResourceMgr are congruent, the ResourceMgr [computed default limits](#computed-default-limits) are adjusted such that:
1. `System.ConnsInbound` >= `max(Swarm.ConnMgr.HighWater * 2, DefaultResourceMgrMinInboundConns)` AND
2. `System.StreamsInbound` is greater than any new/adjusted `Swarm.ResourceMgr.Limits.System.ConnsInbound` value so that there's enough streams per connection.

Expand Down
2 changes: 1 addition & 1 deletion peering/peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (s State) String() string {
case StateStopped:
return "stopped"
default:
return "unkown peering state: " + strconv.FormatUint(uint64(s), 10)
return "unknown peering state: " + strconv.FormatUint(uint64(s), 10)
}
}

Expand Down

0 comments on commit cc3c224

Please sign in to comment.