diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ab14c177..f005becb52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ We also added new metrics to the swarm Grafana dashboard, showing: This feature should be safe to enable for nodes running in data centers and for most nodes in home networks. However, there are some (mostly home and corporate networks) that block all UDP traffic. If enabled, the current implementation -of the smart dialing logic will lead to a regression, since it preferes QUIC addresses over TCP addresses. Nodes would still be +of the smart dialing logic will lead to a regression, since it prefers QUIC addresses over TCP addresses. Nodes would still be able to connect, but connection establishment of the TCP connection would be delayed by 250ms. In a future release (see #1605 for details), we will introduce a feature called blackhole detection. By observing the outcome of diff --git a/core/network/network.go b/core/network/network.go index 7c0ad949e2..bc061de7a8 100644 --- a/core/network/network.go +++ b/core/network/network.go @@ -163,7 +163,7 @@ type Network interface { type MultiaddrDNSResolver interface { // ResolveDNSAddr resolves the first /dnsaddr component in a multiaddr. - // Recurisvely resolves DNSADDRs up to the recursion limit + // Recursively resolves DNSADDRs up to the recursion limit ResolveDNSAddr(ctx context.Context, expectedPeerID peer.ID, maddr ma.Multiaddr, recursionLimit, outputLimit int) ([]ma.Multiaddr, error) // ResolveDNSComponent resolves the first /{dns,dns4,dns6} component in a multiaddr. ResolveDNSComponent(ctx context.Context, maddr ma.Multiaddr, outputLimit int) ([]ma.Multiaddr, error) diff --git a/dashboards/resource-manager/resource-manager.json b/dashboards/resource-manager/resource-manager.json index 9b4ff68314..4a5e36fe74 100644 --- a/dashboards/resource-manager/resource-manager.json +++ b/dashboards/resource-manager/resource-manager.json @@ -379,7 +379,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "description": "How many streams does each protocol have open.\n\nA protocol is similiar to a service except there may be many protocols for a single service. A service may have \nmultiple protocols for backwards compatibility. For example, bitswap the service is a single entity, but it supports bitswap protocols v1.1 and v1.2.\n\nA service is attached to a stream manually by the protocol developer. A service may be missing if there is no `StreamScope.SetService` call.", + "description": "How many streams does each protocol have open.\n\nA protocol is similar to a service except there may be many protocols for a single service. A service may have \nmultiple protocols for backwards compatibility. For example, bitswap the service is a single entity, but it supports bitswap protocols v1.1 and v1.2.\n\nA service is attached to a stream manually by the protocol developer. A service may be missing if there is no `StreamScope.SetService` call.", "fieldConfig": { "defaults": { "color": { @@ -751,7 +751,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "# Libp2p Connections\n\nBroken down by [Resource Scope](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/README.md#resource-scopes). \nScopes represent what is imposing limits on this resource. For connections, we have three main scopes:\n\n1. System. The total number of connections owned by the process. Includes both application usable connections + the number of transient connections.\n2. Transient. The total number of connections that are being upgraded into usable connections in the process.\n3. Peer. The total number of connections associated with this peer. When a connection has this scope it is usable by the application.\n\nAn example of a System connection is a connection you can open a libp2p stream on and send data.\nA transient connection is not yet usable for application data since it may be negotiating \na security handshake or a multiplexer.\n\nConnections start in the transient scope and move over to the System and Peer scopes once they are ready to be used.\n\nIt would be unusual to see a lot of transient connections. It would also be unusal to see a peer with a lot of connections.", + "content": "# Libp2p Connections\n\nBroken down by [Resource Scope](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/README.md#resource-scopes). \nScopes represent what is imposing limits on this resource. For connections, we have three main scopes:\n\n1. System. The total number of connections owned by the process. Includes both application usable connections + the number of transient connections.\n2. Transient. The total number of connections that are being upgraded into usable connections in the process.\n3. Peer. The total number of connections associated with this peer. When a connection has this scope it is usable by the application.\n\nAn example of a System connection is a connection you can open a libp2p stream on and send data.\nA transient connection is not yet usable for application data since it may be negotiating \na security handshake or a multiplexer.\n\nConnections start in the transient scope and move over to the System and Peer scopes once they are ready to be used.\n\nIt would be unusual to see a lot of transient connections. It would also be unusual to see a peer with a lot of connections.", "mode": "markdown" }, "pluginVersion": "9.3.6", @@ -1217,7 +1217,7 @@ "refId": "A" } ], - "title": "Curent outbound connections per peer histogram. Across all instances", + "title": "Current outbound connections per peer histogram. Across all instances", "type": "bargauge" }, { diff --git a/options.go b/options.go index 0329b7e60b..9bb68775c9 100644 --- a/options.go +++ b/options.go @@ -355,7 +355,7 @@ func ForceReachabilityPublic() Option { } // ForceReachabilityPrivate overrides automatic reachability detection in the AutoNAT subsystem, -// forceing the local node to believe it is behind a NAT and not reachable externally. +// forcing the local node to believe it is behind a NAT and not reachable externally. func ForceReachabilityPrivate() Option { return func(cfg *Config) error { private := network.ReachabilityPrivate @@ -511,8 +511,8 @@ func MultiaddrResolver(rslv network.MultiaddrDNSResolver) Option { // This subsystem performs two functions: // // 1. On receiving an inbound Relay connection, it attempts to create a direct connection with the remote peer -// by initiating and co-ordinating a hole punch over the Relayed connection. -// 2. If a peer sees a request to co-ordinate a hole punch on an outbound Relay connection, +// by initiating and coordinating a hole punch over the Relayed connection. +// 2. If a peer sees a request to coordinate a hole punch on an outbound Relay connection, // it will participate in the hole-punch to create a direct connection with the remote peer. // // If the hole punch is successful, all new streams will thereafter be created on the hole-punched connection. @@ -523,7 +523,7 @@ func MultiaddrResolver(rslv network.MultiaddrDNSResolver) Option { // // It is not mandatory but nice to also enable the `AutoRelay` option (See `EnableAutoRelay`) // so the peer can discover and connect to Relay servers if it discovers that it is NATT'd and has private reachability via AutoNAT. -// This will then enable it to advertise Relay addresses which can be used to accept inbound Relay connections to then co-ordinate +// This will then enable it to advertise Relay addresses which can be used to accept inbound Relay connections to then coordinate // a hole punch. // // If `EnableAutoRelay` is configured and the user is confident that the peer has private reachability/is NATT'd, @@ -600,7 +600,7 @@ func SwarmOpts(opts ...swarm.Option) Option { // DisableIdentifyAddressDiscovery disables address discovery using peer provided observed addresses // in identify. If you know your public addresses upfront, the recommended way is to use -// AddressFactory to provide the external adddress to the host and use this option to disable +// AddressFactory to provide the external address to the host and use this option to disable // discovery from identify. func DisableIdentifyAddressDiscovery() Option { return func(cfg *Config) error { diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index b1a36264e7..e4ffb927ac 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -383,7 +383,7 @@ func TestHostProtoMismatch(t *testing.T) { defer h2.Close() h1.SetStreamHandler("/super", func(s network.Stream) { - t.Error("shouldnt get here") + t.Error("shouldn't get here") s.Reset() }) @@ -902,7 +902,7 @@ func TestTrimHostAddrList(t *testing.T) { out: []ma.Multiaddr{tcpPublic}, }, { - name: "Public and private preffered over local", + name: "Public and private preferred over local", in: []ma.Multiaddr{tcpPublic, tcpPrivate, quicLocal}, threshold: len(tcpPublic.Bytes()) + len(tcpPrivate.Bytes()), out: []ma.Multiaddr{tcpPublic, tcpPrivate}, diff --git a/p2p/host/peerstore/pstoremem/addr_book.go b/p2p/host/peerstore/pstoremem/addr_book.go index 32758f2ab9..78c55d60cc 100644 --- a/p2p/host/peerstore/pstoremem/addr_book.go +++ b/p2p/host/peerstore/pstoremem/addr_book.go @@ -498,7 +498,7 @@ func (mab *memoryAddrBook) GetPeerRecord(p peer.ID) *record.Envelope { if _, ok := mab.addrs.Addrs[p]; !ok { return nil } - // The record may have expired, but not gargage collected. + // The record may have expired, but not garbage collected. if len(validAddrs(mab.clock.Now(), mab.addrs.Addrs[p])) == 0 { return nil } diff --git a/p2p/host/resource-manager/scope_test.go b/p2p/host/resource-manager/scope_test.go index 7bf7ff721b..d5af5f9e53 100644 --- a/p2p/host/resource-manager/scope_test.go +++ b/p2p/host/resource-manager/scope_test.go @@ -744,13 +744,13 @@ func TestResourceScopeDAG(t *testing.T) { checkResources(t, &s1.rc, network.ScopeStat{Memory: 3072}) if err := s4.ReserveMemory(1024, network.ReservationPriorityAlways); err == nil { - t.Fatal("expcted ReserveMemory to fail") + t.Fatal("expected ReserveMemory to fail") } if err := s5.ReserveMemory(1024, network.ReservationPriorityAlways); err == nil { - t.Fatal("expcted ReserveMemory to fail") + t.Fatal("expected ReserveMemory to fail") } if err := s6.ReserveMemory(1024, network.ReservationPriorityAlways); err == nil { - t.Fatal("expcted ReserveMemory to fail") + t.Fatal("expected ReserveMemory to fail") } checkResources(t, &s6.rc, network.ScopeStat{Memory: 1024}) diff --git a/p2p/net/connmgr/connmgr_test.go b/p2p/net/connmgr/connmgr_test.go index e8e61914dd..6ac72a2b53 100644 --- a/p2p/net/connmgr/connmgr_test.go +++ b/p2p/net/connmgr/connmgr_test.go @@ -168,7 +168,7 @@ func TestConnTrimming(t *testing.T) { for i := 0; i < 100; i++ { c := conns[i] if c.(*tconn).isClosed() { - t.Fatal("these shouldnt be closed") + t.Fatal("these shouldn't be closed") } } @@ -911,7 +911,7 @@ func TestPeerInfoSorting(t *testing.T) { pis := peerInfos{p1, p2, p3, p4} pis.SortByValueAndStreams(makeSegmentsWithPeerInfos(pis), true) // p3 is first because it is inactive (no streams). - // p4 is second because it has the most streams and we priortize killing + // p4 is second because it has the most streams and we prioritize killing // connections with the higher number of streams. require.Equal(t, peerInfos{p3, p4, p2, p1}, pis) }) diff --git a/p2p/net/mock/mock_peernet.go b/p2p/net/mock/mock_peernet.go index e84140946f..34d90fffee 100644 --- a/p2p/net/mock/mock_peernet.go +++ b/p2p/net/mock/mock_peernet.go @@ -254,13 +254,13 @@ func (pn *peernet) removeConn(c *conn) { pn.Lock() cs, found := pn.connsByLink[c.link] if !found || len(cs) < 1 { - panic(fmt.Sprintf("attempting to remove a conn that doesnt exist %p", c.link)) + panic(fmt.Sprintf("attempting to remove a conn that doesn't exist %p", c.link)) } delete(cs, c) cs, found = pn.connsByPeer[c.remote] if !found { - panic(fmt.Sprintf("attempting to remove a conn that doesnt exist %v", c.remote)) + panic(fmt.Sprintf("attempting to remove a conn that doesn't exist %v", c.remote)) } delete(cs, c) pn.Unlock() diff --git a/p2p/net/mock/mock_test.go b/p2p/net/mock/mock_test.go index aed12548db..e0cf2562e7 100644 --- a/p2p/net/mock/mock_test.go +++ b/p2p/net/mock/mock_test.go @@ -226,13 +226,13 @@ func TestNetworkSetup(t *testing.T) { t.Errorf("should have 1 conn on initiator. Got: %d)", len(n2.Conns())) } - // wait for reciever to see the conn. + // wait for receiver to see the conn. for i := 0; i < 10 && len(n3.Conns()) == 0; i++ { time.Sleep(time.Duration(10*i) * time.Millisecond) } if len(n3.Conns()) != 1 { - t.Errorf("should have 1 conn on reciever. Got: %d", len(n3.Conns())) + t.Errorf("should have 1 conn on receiver. Got: %d", len(n3.Conns())) } // p := PrinterTo(os.Stdout) diff --git a/p2p/net/nat/internal/nat/upnp.go b/p2p/net/nat/internal/nat/upnp.go index 13d898e58d..260c9349df 100644 --- a/p2p/net/nat/internal/nat/upnp.go +++ b/p2p/net/nat/internal/nat/upnp.go @@ -44,7 +44,7 @@ func discoverSearchTarget(ctx context.Context, target string) (nats []NAT, errs } // discoverUPNP_GenIGDev is a fallback for routers that fail to respond to our -// targetted SSDP queries. It will query all devices and try to find any +// targeted SSDP queries. It will query all devices and try to find any // InternetGatewayDevice. func discoverUPNP_GenIGDev(ctx context.Context) (nats []NAT, errs []error) { DeviceList, err := ssdp.Search(ssdp.All, 5, "") @@ -84,7 +84,7 @@ func discoverUPNP_GenIGDev(ctx context.Context) (nats []NAT, errs []error) { return } -// serviceVisitor is a vistor function that visits all services of a root +// serviceVisitor is a visitor function that visits all services of a root // device and collects NATs. // // It works on InternetGateway V1 and V2 devices. For V1 devices, V2 services should not be encountered, and the visitor will collect an error in that case. diff --git a/p2p/net/reuseport/reuseport_plan9.go b/p2p/net/reuseport/reuseport_plan9.go index c40eb2e8be..6b60be13f6 100644 --- a/p2p/net/reuseport/reuseport_plan9.go +++ b/p2p/net/reuseport/reuseport_plan9.go @@ -12,7 +12,7 @@ const ( // reuseErrShouldRetry diagnoses whether to retry after a reuse error. // if we failed to bind, we should retry. if bind worked and this is a -// real dial error (remote end didnt answer) then we should not retry. +// real dial error (remote end didn't answer) then we should not retry. func reuseErrShouldRetry(err error) bool { if err == nil { return false // hey, it worked! no need to retry. diff --git a/p2p/net/reuseport/reuseport_posix.go b/p2p/net/reuseport/reuseport_posix.go index 0b5771bb7d..ffd6749c59 100644 --- a/p2p/net/reuseport/reuseport_posix.go +++ b/p2p/net/reuseport/reuseport_posix.go @@ -9,7 +9,7 @@ import ( // reuseErrShouldRetry diagnoses whether to retry after a reuse error. // if we failed to bind, we should retry. if bind worked and this is a -// real dial error (remote end didnt answer) then we should not retry. +// real dial error (remote end didn't answer) then we should not retry. func reuseErrShouldRetry(err error) bool { if err == nil { return false // hey, it worked! no need to retry. diff --git a/p2p/net/swarm/connectedness_event_emitter.go b/p2p/net/swarm/connectedness_event_emitter.go index 07db583fc9..843f581fe3 100644 --- a/p2p/net/swarm/connectedness_event_emitter.go +++ b/p2p/net/swarm/connectedness_event_emitter.go @@ -10,7 +10,7 @@ import ( ) // connectednessEventEmitter emits PeerConnectednessChanged events. -// We ensure that for any peer we connected to we always sent atleast 1 NotConnected Event after +// We ensure that for any peer we connected to we always sent at least 1 NotConnected Event after // the peer disconnects. This is because peers can observe a connection before they are notified // of the connection by a peer connectedness changed event. type connectednessEventEmitter struct { diff --git a/p2p/net/swarm/dial_test.go b/p2p/net/swarm/dial_test.go index feb9f49174..2f0ba5b426 100644 --- a/p2p/net/swarm/dial_test.go +++ b/p2p/net/swarm/dial_test.go @@ -58,7 +58,7 @@ func TestBasicDialPeerWithResolver(t *testing.T) { s2 := swarms[1] // Change the multiaddr from /ip4/127.0.0.1/... to /dns4/example.com/... so - // that the resovler has to resolve this + // that the resolver has to resolve this var s2Addrs []ma.Multiaddr for _, a := range s2.ListenAddresses() { _, rest := ma.SplitFunc(a, func(c ma.Component) bool { diff --git a/p2p/net/swarm/swarm_addr.go b/p2p/net/swarm/swarm_addr.go index b2e3e4e8aa..410deb1bcb 100644 --- a/p2p/net/swarm/swarm_addr.go +++ b/p2p/net/swarm/swarm_addr.go @@ -41,7 +41,7 @@ func (s *Swarm) InterfaceListenAddresses() ([]ma.Multiaddr, error) { } // Cache is not valid - // Perfrom double checked locking + // Perform double checked locking s.listeners.Lock() // Lock start diff --git a/p2p/net/swarm/swarm_dial.go b/p2p/net/swarm/swarm_dial.go index b7cf8b2582..0b1123faa0 100644 --- a/p2p/net/swarm/swarm_dial.go +++ b/p2p/net/swarm/swarm_dial.go @@ -221,7 +221,7 @@ func (db *DialBackoff) cleanup() { // direct connection. // // The idea is that the client of Swarm does not need to know what network -// the connection will happen over. Swarm can use whichever it choses. +// the connection will happen over. Swarm can use whichever it chooses. // This allows us to use various transport protocols, do NAT traversal/relay, // etc. to achieve connection. func (s *Swarm) DialPeer(ctx context.Context, p peer.ID) (network.Conn, error) { @@ -383,7 +383,7 @@ func chainResolvers(ctx context.Context, addrs []ma.Multiaddr, outputLimit int, } // resolveAddrs resolves DNS/DNSADDR components in the given peer's addresses. -// We want to resolve the DNS components to IP addresses becase we want the +// We want to resolve the DNS components to IP addresses because we want the // swarm to manage ranking and dialing multiple connections, and a single DNS // address can resolve to multiple IP addresses. func (s *Swarm) resolveAddrs(ctx context.Context, pi peer.AddrInfo) []ma.Multiaddr { diff --git a/p2p/net/swarm/swarm_listen.go b/p2p/net/swarm/swarm_listen.go index e94db44a42..46187a7e77 100644 --- a/p2p/net/swarm/swarm_listen.go +++ b/p2p/net/swarm/swarm_listen.go @@ -71,7 +71,7 @@ func (s *Swarm) Listen(addrs ...ma.Multiaddr) error { } // ListenClose stop and delete listeners for all of the given addresses. If an -// any address belongs to one of the addreses a Listener provides, then the +// any address belongs to one of the addresses a Listener provides, then the // Listener will close for *all* addresses it provides. For example if you close // and address with `/quic`, then the QUIC listener will close and also close // any `/quic-v1` address. diff --git a/p2p/protocol/autonatv2/autonat.go b/p2p/protocol/autonatv2/autonat.go index bec135f689..ad231d9d67 100644 --- a/p2p/protocol/autonatv2/autonat.go +++ b/p2p/protocol/autonatv2/autonat.go @@ -230,7 +230,7 @@ func (an *AutoNAT) updatePeer(p peer.ID) { an.mx.Lock() defer an.mx.Unlock() - // There are no ordering gurantees between identify and swarm events. Check peerstore + // There are no ordering guarantees between identify and swarm events. Check peerstore // and swarm for the current state protos, err := an.host.Peerstore().SupportsProtocols(p, DialProtocol) connectedness := an.host.Network().Connectedness(p) diff --git a/p2p/protocol/autonatv2/client.go b/p2p/protocol/autonatv2/client.go index d0cb02e681..31a25386f3 100644 --- a/p2p/protocol/autonatv2/client.go +++ b/p2p/protocol/autonatv2/client.go @@ -146,7 +146,7 @@ func (ac *client) getReachability(ctx context.Context, p peer.ID, reqs []Request resp := msg.GetDialResponse() if resp.GetStatus() != pb.DialResponse_OK { - // E_DIAL_REFUSED has implication for deciding future address verificiation priorities + // E_DIAL_REFUSED has implication for deciding future address verification priorities // wrap a distinct error for convenient errors.Is usage if resp.GetStatus() == pb.DialResponse_E_DIAL_REFUSED { return Result{AllAddrsRefused: true}, nil diff --git a/p2p/protocol/holepunch/tracer.go b/p2p/protocol/holepunch/tracer.go index 3ba06f653d..cce20d0f8c 100644 --- a/p2p/protocol/holepunch/tracer.go +++ b/p2p/protocol/holepunch/tracer.go @@ -96,9 +96,9 @@ const ( // Event Objects type DirectDialEvt struct { - Success bool - EllapsedTime time.Duration - Error string `json:",omitempty"` + Success bool + ElapsedTime time.Duration `json:"EllapsedTime,omitempty"` + Error string `json:",omitempty"` } type ProtocolErrorEvt struct { @@ -111,9 +111,9 @@ type StartHolePunchEvt struct { } type EndHolePunchEvt struct { - Success bool - EllapsedTime time.Duration - Error string `json:",omitempty"` + Success bool + ElapsedTime time.Duration `json:"EllapsedTime,omitempty"` + Error string `json:",omitempty"` } type HolePunchAttemptEvt struct { @@ -133,8 +133,8 @@ func (t *tracer) DirectDialSuccessful(p peer.ID, dt time.Duration) { Remote: p, Type: DirectDialEvtT, Evt: &DirectDialEvt{ - Success: true, - EllapsedTime: dt, + Success: true, + ElapsedTime: dt, }, }) } @@ -156,9 +156,9 @@ func (t *tracer) DirectDialFailed(p peer.ID, dt time.Duration, err error) { Remote: p, Type: DirectDialEvtT, Evt: &DirectDialEvt{ - Success: false, - EllapsedTime: dt, - Error: err.Error(), + Success: false, + ElapsedTime: dt, + Error: err.Error(), }, }) } @@ -205,8 +205,8 @@ func (t *tracer) StartHolePunch(p peer.ID, obsAddrs []ma.Multiaddr, rtt time.Dur func (t *tracer) EndHolePunch(p peer.ID, dt time.Duration, err error) { if t != nil && t.et != nil { evt := &EndHolePunchEvt{ - Success: err == nil, - EllapsedTime: dt, + Success: err == nil, + ElapsedTime: dt, } if err != nil { evt.Error = err.Error() diff --git a/p2p/security/noise/handshake.go b/p2p/security/noise/handshake.go index d81aa72fb4..a2d7df21c3 100644 --- a/p2p/security/noise/handshake.go +++ b/p2p/security/noise/handshake.go @@ -63,7 +63,7 @@ func (s *secureSession) runHandshake(ctx context.Context) (err error) { } } - // We can re-use this buffer for all handshake messages. + // We can reuse this buffer for all handshake messages. hbuf := pool.Get(2 << 10) defer pool.Put(hbuf) diff --git a/p2p/security/noise/rw.go b/p2p/security/noise/rw.go index d52768f485..d93f31d717 100644 --- a/p2p/security/noise/rw.go +++ b/p2p/security/noise/rw.go @@ -54,7 +54,7 @@ func (s *secureSession) Read(buf []byte) (int, error) { return 0, err } - // If the buffer is atleast as big as the encrypted message size, + // If the buffer is at least as big as the encrypted message size, // we can read AND decrypt in place. if len(buf) >= nextMsgLen { if err := s.readNextMsgInsecure(buf[:nextMsgLen]); err != nil { diff --git a/p2p/security/noise/session.go b/p2p/security/noise/session.go index fa32ab8fa4..ebd8c649bf 100644 --- a/p2p/security/noise/session.go +++ b/p2p/security/noise/session.go @@ -43,7 +43,7 @@ type secureSession struct { initiatorEarlyDataHandler, responderEarlyDataHandler EarlyDataHandler - // ConnectionState holds state information releated to the secureSession entity. + // ConnectionState holds state information related to the secureSession entity. connectionState network.ConnectionState } diff --git a/p2p/security/tls/transport.go b/p2p/security/tls/transport.go index 0c494a7fdc..71de29a78d 100644 --- a/p2p/security/tls/transport.go +++ b/p2p/security/tls/transport.go @@ -157,7 +157,7 @@ func (t *Transport) setupConn(tlsConn *tls.Conn, remotePubKey ci.PubKey) (sec.Se nextProto := tlsConn.ConnectionState().NegotiatedProtocol // The special ALPN extension value "libp2p" is used by libp2p versions - // that don't support early muxer negotiation. If we see this sepcial + // that don't support early muxer negotiation. If we see this special // value selected, that means we are handshaking with a version that does // not support early muxer negotiation. In this case return empty nextProto // to indicate no muxer is selected. diff --git a/p2p/transport/quicreuse/tracer_test.go b/p2p/transport/quicreuse/tracer_test.go index bea6b91dbf..21a4aa8610 100644 --- a/p2p/transport/quicreuse/tracer_test.go +++ b/p2p/transport/quicreuse/tracer_test.go @@ -42,7 +42,7 @@ func TestQlogBuffering(t *testing.T) { logger := newQlogger(qlogDir, logging.PerspectiveServer, quic.ConnectionIDFromBytes([]byte("connid"))) initialSize := getFile(t, qlogDir).Size() // Do a small write. - // Since the writter is buffered, this should not be written to disk yet. + // Since the writer is buffered, this should not be written to disk yet. logger.Write([]byte("foobar")) require.Equal(t, getFile(t, qlogDir).Size(), initialSize) // Close the logger. This should flush the buffer to disk. diff --git a/p2p/transport/webrtc/sdp.go b/p2p/transport/webrtc/sdp.go index 878b668a18..5230454053 100644 --- a/p2p/transport/webrtc/sdp.go +++ b/p2p/transport/webrtc/sdp.go @@ -123,7 +123,7 @@ func getSupportedSDPHash(code uint64) (crypto.Hash, bool) { // to a string format recognised by pion for fingerprint // algorithms func getSupportedSDPString(code uint64) (string, error) { - // values based on (cryto.Hash).String() + // values based on (crypto.Hash).String() switch code { case multihash.MD5: return "md5", nil diff --git a/p2p/transport/webrtc/stream.go b/p2p/transport/webrtc/stream.go index c92457ccb0..25a884698b 100644 --- a/p2p/transport/webrtc/stream.go +++ b/p2p/transport/webrtc/stream.go @@ -241,7 +241,7 @@ func (s *stream) spawnControlMessageReader() { s.mx.Lock() defer s.mx.Unlock() // From this point onwards only this goroutine will do reader.ReadMsg. - // We just wanted to ensure any exising readers have exited. + // We just wanted to ensure any existing readers have exited. // Read calls from this point onwards will exit immediately on checking // s.readState s.readerMx.Unlock() diff --git a/p2p/transport/webrtc/transport_test.go b/p2p/transport/webrtc/transport_test.go index 4f38dc5933..1d0571552e 100644 --- a/p2p/transport/webrtc/transport_test.go +++ b/p2p/transport/webrtc/transport_test.go @@ -974,7 +974,7 @@ func TestManyConnections(t *testing.T) { for i := 0; i < dialersPerListener*connsPerDialer; i++ { conn, err := ln.Accept() if err != nil { - t.Errorf("listener failed to accept conneciton: %s", err) + t.Errorf("listener failed to accept connection: %s", err) return } go runListenConn(conn) diff --git a/p2p/transport/webtransport/crypto.go b/p2p/transport/webtransport/crypto.go index 90504ead01..605bf093c5 100644 --- a/p2p/transport/webtransport/crypto.go +++ b/p2p/transport/webtransport/crypto.go @@ -23,7 +23,7 @@ import ( "github.com/quic-go/quic-go/http3" ) -const deterministicCertInfo = "determinisitic cert" +const deterministicCertInfo = "deterministic cert" func getTLSConf(key ic.PrivKey, start, end time.Time) (*tls.Config, error) { cert, priv, err := generateCert(key, start, end) diff --git a/x/rate/limiter.go b/x/rate/limiter.go index 42522e11e9..fc9e4f7938 100644 --- a/x/rate/limiter.go +++ b/x/rate/limiter.go @@ -15,7 +15,7 @@ import ( // Limit is the configuration for a token bucket rate limiter. // The bucket has a capacity of Burst, and is refilled at a rate of RPS tokens per second. -// Initially, buckets are completley full, i.e. tokens in the bucket is equal to `Burst`. +// Initially, buckets are completely full, i.e. tokens in the bucket is equal to `Burst`. // In any given time interval T seconds, maximum events allowed will be `T*RPS + Burst`. type Limit struct { // RPS is the rate of requests per second in steady state.