Download Latest Version v1.12.0 source code.tar.gz (553.0 kB)
Email in envelope

Get an email when there's a new version of libp2p

Home / v1.9.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-03-14 3.9 kB
v1.9.0 source code.tar.gz 2025-03-14 465.0 kB
v1.9.0 source code.zip 2025-03-14 600.0 kB
Totals: 3 Items   1.1 MB 0

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 the async pragma, namely async: (raises: [CancelledError]). Consequently, all protocol handlers must also specify async: (raises: [CancelledError]).

Example, code constructs like:

:::nim
proc handler(conn: Connection, proto: string) {.async.} = 
  try:
    ...
  except CancelledError:
    trace "Unexpected cancellation in handler"

should be changed to:

:::nim
proc handler(conn: Connection, proto: string) {.async: (raises: [CancelledError]).} =
  try:
    ...
  except CancelledError as exc:
    trace "Unexpected cancellation in handler"
    raise exc

Note: - async pragma adds raises: [CancelledError] - CancelledError is propagate up the chain

What's Changed

New Contributors

Full Changelog: https://github.com/vacp2p/nim-libp2p/compare/v1.8.0...v1.9.0

Source: README.md, updated 2025-03-14