🗺 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
🗺 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 useerrors.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:
On connections, you can signal an error on close by using:
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.ErrResetaserr == network.ErrReset. These tests now need to use theerrors.Is(err, network.ErrReset)test. Stream Resets now return either*network.StreamErrorif the stream was reset by remote, or*network.ConnErrorif the connection was closed by remote.Changelog
< changelog generated by scripts/mkreleaselog >
✅ Release Checklist
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'sgo.modwhen possible.