Skip to content

Commit a762df6

Browse files
authored
Merge branch 'main' into feat/619-store-pubkey-peerid-peerstore
2 parents 7e377ed + d2825af commit a762df6

15 files changed

+52
-25
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ validate-newsfragments:
9090
check-docs: build-docs validate-newsfragments
9191

9292
build-docs:
93-
sphinx-apidoc -o docs/ . setup.py "*conftest*" tests/
93+
sphinx-apidoc -o docs/ . "*conftest*" tests/
9494
$(MAKE) -C docs clean
9595
$(MAKE) -C docs html
9696
$(MAKE) -C docs doctest

docs/release_notes.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,51 @@ Release Notes
33

44
.. towncrier release notes start
55
6+
py-libp2p v0.2.8 (2025-06-10)
7+
-----------------------------
8+
9+
Breaking Changes
10+
~~~~~~~~~~~~~~~~
11+
12+
- The `NetStream.state` property is now async and requires `await`. Update any direct state access to use `await stream.state`. (`#300 <https://github.com/libp2p/py-libp2p/issues/300>`__)
13+
14+
15+
Bugfixes
16+
~~~~~~~~
17+
18+
- Added proper state management and resource cleanup to `NetStream`, fixing memory leaks and improved error handling. (`#300 <https://github.com/libp2p/py-libp2p/issues/300>`__)
19+
20+
21+
Improved Documentation
22+
~~~~~~~~~~~~~~~~~~~~~~
23+
24+
- Updated examples to automatically use random port, when `-p` flag is not given (`#661 <https://github.com/libp2p/py-libp2p/issues/661>`__)
25+
26+
27+
Features
28+
~~~~~~~~
29+
30+
- Allow passing `listen_addrs` to `new_swarm` to customize swarm listening behavior. (`#616 <https://github.com/libp2p/py-libp2p/issues/616>`__)
31+
- Feature: Support for sending `ls` command over `multistream-select` to list supported protocols from remote peer.
32+
This allows inspecting which protocol handlers a peer supports at runtime. (`#622 <https://github.com/libp2p/py-libp2p/issues/622>`__)
33+
- implement AsyncContextManager for IMuxedStream to support async with (`#629 <https://github.com/libp2p/py-libp2p/issues/629>`__)
34+
- feat: add method to compute time since last message published by a peer and remove fanout peers based on ttl. (`#636 <https://github.com/libp2p/py-libp2p/issues/636>`__)
35+
- implement blacklist management for `pubsub.Pubsub` with methods to get, add, remove, check, and clear blacklisted peer IDs. (`#641 <https://github.com/libp2p/py-libp2p/issues/641>`__)
36+
- fix: remove expired peers from peerstore based on TTL (`#650 <https://github.com/libp2p/py-libp2p/issues/650>`__)
37+
38+
39+
Internal Changes - for py-libp2p Contributors
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
42+
- Modernizes several aspects of the project, notably using ``pyproject.toml`` for project info instead of ``setup.py``, using ``ruff`` to replace several separate linting tools, and ``pyrefly`` in addition to ``mypy`` for typing. Also includes changes across the codebase to conform to new linting and typing rules. (`#618 <https://github.com/libp2p/py-libp2p/issues/618>`__)
43+
44+
45+
Removals
46+
~~~~~~~~
47+
48+
- Removes support for python 3.9 and updates some code conventions, notably using ``|`` operator in typing instead of ``Optional`` or ``Union`` (`#618 <https://github.com/libp2p/py-libp2p/issues/618>`__)
49+
50+
651
py-libp2p v0.2.7 (2025-05-22)
752
-----------------------------
853

examples/echo/echo.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
)
2121

2222
PROTOCOL_ID = TProtocol("/echo/1.0.0")
23+
MAX_READ_LEN = 2**32 - 1
2324

2425

2526
async def _echo_stream_handler(stream: INetStream) -> None:
2627
# Wait until EOF
27-
msg = await stream.read()
28+
msg = await stream.read(MAX_READ_LEN)
2829
await stream.write(msg)
2930
await stream.close()
3031

@@ -72,10 +73,8 @@ async def run(port: int, destination: str, seed: int | None = None) -> None:
7273
msg = b"hi, there!\n"
7374

7475
await stream.write(msg)
75-
# TODO: check why the stream is closed after the first write ???
76-
# Notify the other side about EOF
77-
await stream.close()
7876
response = await stream.read()
77+
await stream.close()
7978

8079
print(f"Sent: {msg.decode('utf-8')}")
8180
print(f"Got: {response.decode('utf-8')}")

newsfragments/300.breaking.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/300.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/616.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/618.internal.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/618.removal.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/622.feature.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

newsfragments/629.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)