Skip to content

v0.40 #3164

@MarcoPolo

Description

@MarcoPolo

🗺 What's left for release

<List of items with remaining PRs and/or Issues to be considered for this release>

Candidate:

⚠ Breaking Change!

Introducing error codes mandated changing the error types returned by stream resets. All checks that depended on checking the error string or comparing equality with network.ErrReset, now need to use errors.Is(err, network.ErrReset). More details below in the error codes section.

🔦 Highlights

Error Codes

This releases introduces error codes for Stream Reset and Connection Close. This allows sending for more information to the peer about the error condition causing the abort. go-libp2p has already defined some error codes which are useful for many different use cases. You can find them in:
https://github.com/libp2p/go-libp2p/blob/master/core/network/mux.go#L46
and: https://github.com/libp2p/go-libp2p/blob/master/core/network/conn.go#L47
<TODO: Replace with pkg.go.dev link post release>

On streams, you can signal an error on reset by using:

str.ResetWithError(errCode)

On connections, you can signal an error on close by using:

conn.ResetWithError(errCode)

Not all transports support error codes. Most notably, WebTransport has no support for sending error codes at the moment. See the spec: libp2p/specs#623 for more details.

If you want to define custom error codes for your application protocol, you can reserve a block for your application by opening a PR in the specs repo. The above mentioned spec has details on reserving error codes for applications. Till the spec is merged, you open a PR targetting the spec's branch.

Breaking Change!

This introduces a breaking change for users who checked stream reset errors by testing for equality with network.ErrReset as err == network.ErrReset. These tests now need to use the errors.Is(err, network.ErrReset) test. Stream Resets now return either *network.StreamError if the stream was reset by remote, or *network.ConnError if the connection was closed by remote.

Changelog

< changelog generated by scripts/mkreleaselog >

✅ Release Checklist

  • Stage 0 - Finishing Touches
    • Go through relevant libp2p repos looking for unreleased changes that should make it into the release. If you find any, cut releases.
    • Run go get -u ./... to see if there are any out-of-date deps that look important. If there are, bubble them. Try to avoid directly updating indirect deps in go-libp2p's go.mod when possible.
  • Stage 1 - Release
    • Publish the release through the GitHub UI, adding the release notes. Some users rely on this to receive notifications of new releases.
    • Announce the release on the discuss.libp2p.io.
  • Stage 2 - Update Upstream
  • Make required changes to the release process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions