Highlights
- Async exception tracking - Procedures marked
{.async.}
are annotated with the list of exceptions they might raise - Self-signed TLS certificates can be generated. These will be used with Quic and WebTransport
Breaking change
- Python3 and pip are introduced as a dependency due to mbedtls requiring them to generate some of its source code. In a subsequent release, we will attempt to remove this dependency on Python.
- The
LPProtoHandler
type has changed and now specifies raised exceptions in theasync
pragma, namelyasync: (raises: [CancelledError])
. Consequently, all protocol handlers must also specifyasync: (raises: [CancelledError])
.
Example, code constructs like:
proc handler(conn: Connection, proto: string) {.async.} =
try:
...
except CancelledError:
trace "Unexpected cancellation in handler"
should be changed to:
proc handler(conn: Connection, proto: string) {.async: (raises: [CancelledError]).} =
try:
...
except CancelledError as exc:
trace "Unexpected cancellation in handler"
raise exc
Note:
async
pragma addsraises: [CancelledError]
CancelledError
is propagate up the chain
What's Changed
- chore: add isClosedRemotely public bool attribute in lpstream by @Ivansete-status in #1242
- refactor(pubsub): do not raise exceptions on publish by @richard-ramos in #1244
- style: fix code style with nph by @vladopajic in #1246
- chore: list raised exceptions in
utils
module by @vladopajic in #1252 - chore: specify raising exceptions in
daemon
module by @vladopajic in #1249 - chore: add description of public pragma by @vladopajic in #1262
- chore: refactors to remove
.closure.
,.gcsafe
for.async.
procs, and added callback compatibility todaemonapi
by @richard-ramos in #1240 - chore(connmanager): specify raised exceptions by @vladopajic in #1263
- chore: add trace log to analyse remote stream reset by @Ivansete-status in #1253
- chore: list raised exceptions in
switch
services by @vladopajic in #1251 - chore(transports): list raised exceptions by @vladopajic in #1255
- chore(dialer): list raised exceptions by @vladopajic in #1264
- chore(protocol): list raised exceptions by @vladopajic in #1260
- chore(transports): specify raised exceptions by @vladopajic in #1266
- chore(protocols): specify raised exceptions (part 2) by @vladopajic in #1268
- chore: specify raised exceptions in miscellaneous places by @vladopajic in #1269
- chore(relay): specify raised exceptions by @vladopajic in #1274
- feat(tls-certificate): generate and parse libp2p tls certificate by @diegomrsantos in #1209
- chore(protocol): handler to propagate CancelledError by @vladopajic in #1275
- chore(connmanager): propagate CancelledError by @vladopajic in #1276
New Contributors
- @vladopajic made their first contribution in #1246
Full Changelog: v1.8.0...v1.9.0