3c01c03e4e
incorporated import changes as suggested
2025-03-17 09:27:13 -06:00
c86f3d0467
added dedicated test file and moved timed_cache to tools
2025-03-17 09:27:13 -06:00
e5f3e88134
added : timed_cache sub-module
2025-03-17 09:27:13 -06:00
0fa8711ca7
updated : seen message map type to bool from int
2025-03-17 09:27:13 -06:00
d7eab27564
refactored and moved all interfaces to abc.py ( #504 )
...
* refactored : host_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored : network_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored : notifee_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored : net_connection_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored: raw_connection_interface, secure_conn_interface and stream_muxer abc.py
* refactored: addrbook_interface
* refactored :peerdata_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :peermetadata_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :multiselect_client_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :multiselect_communicator_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :multiselect_muxer_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :interfaces
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :security_transport_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* refactored :listener_interface
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* moved all interfaces and typing files
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
* fixed documentation and moved pubsub abc.py
Co-authored-by: Khwahish Patel <khwahish.p1@ahduni.edu.in >
* added exclude-members in custom_types docs
* added : newsfragment for moving all interfaces to libp2p.abc
---------
Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com >
Co-authored-by: Mystical <125946525+mystical-prog@users.noreply.github.com >
2025-02-21 16:01:45 -07:00
e7a9ee78a8
rename typing.py to custom_types.py for clarity
2025-02-02 07:18:52 -07:00
8787613e91
run lint with pyupgrade at py39-plus
2025-01-25 15:48:39 -07:00
e768682ab9
reject messages claiming to be from ourselves but not locally published
2024-11-15 15:16:19 +07:00
c5cc0ee969
run mypy locally, bump mypy to 1.10.0, fix new errors
2024-07-04 13:19:00 -06:00
d9b92635c1
drop async-service dep and copy relevant code into a local async_service
...
tool, updated for modern handling of ExceptionGroup
2024-05-27 12:14:36 -06:00
94483714a3
run lint and fix errors, except mypy
2024-02-19 16:05:58 -07:00
857cc29d27
add content-addressed message id utility
2020-02-28 08:25:03 -08:00
ef666267bd
Allow Pubsub creator to supply a custom msg_id
2020-02-28 08:25:03 -08:00
f1dbd52d67
Merge branch 'master' into feature/trio
2020-02-06 10:39:54 +08:00
ddbedc6c15
Pubsub: handle_talk
...
- Change from async function to sync
- Change the name to `notify_subscriptions`, which is clearer.
2020-02-05 21:44:33 +08:00
7f8c0f11f6
Pubsub: change channel size
...
To `32` to conform to the go implementation.
2020-02-05 21:30:26 +08:00
1588be2be9
Change the channel size of peer queue
...
Back to `0`, to avoid unlimited buffer size.
2020-01-31 17:42:47 +08:00
095a848f30
Add clean-up logics into TrioSubscriptionAPI
...
Register an `unsubscribe_fn` when initializing the TrioSubscriptionAPI.
`unsubscribe_fn` is called when subscription is unsubscribed.
2020-01-28 00:29:05 +08:00
c3ba67ea87
Remove locks in PubsubNotifee
...
- Change `open_memory_channel(0)` to `open_memory_channel(math.inf)`, to
avoid `peer_queue.send` and `dead_peer_queue.send` blocking. This allows
us to remove the locks.
- Only catch `trio.BrokenResourceError`, which is caused by Pubsub when
it's closing.
2020-01-27 14:30:44 +08:00
92ea35e147
Fix IPubsub and add IPubsub.wait_until_ready
2020-01-27 00:10:33 +08:00
e3a1dd62e4
Use new type hinting for trio channel
2020-01-26 23:56:19 +08:00
6c7aa30191
Add events in Pubsub
...
To ensure `handle_peer_queue` and `handle_dead_peer_queue` are indeed
run before the tests finish. Previously, we get errors when performing
`iter_dag` after cancellation. This is because `handle_peer_queue` or
`handle_dead_peer_queue` is not actually run before the Service is
cancelled.
2020-01-18 00:17:30 +08:00
94f0fcb6ad
Iterate dead_peer_receive_channel with async for
2019-12-26 20:44:32 +08:00
ce5663705f
Merge branch 'master' into feature/porting-to-trio
2019-12-24 02:19:43 +08:00
adae81ca01
fix logging bug
2019-12-23 09:15:56 +01:00
96f6b80e51
Merge remote-tracking branch 'origin/master' into f-string_clean
...
# Conflicts:
# libp2p/network/swarm.py
2019-12-23 09:14:15 +01:00
0827d0d9ef
add 2 more instances of formatting violations
2019-12-19 18:09:47 +01:00
19ce8a2140
Fix mypy
2019-12-17 21:56:02 +08:00
47d10e186f
Add SubscriptionAPI
...
And `TrioSubscriptionAPI`, to make subscription io-agnostic.
2019-12-17 18:17:28 +08:00
f10e3099cb
Change type of peers in pubsub from list to set
2019-12-17 17:55:13 +08:00
7d6daa8e10
Minor cleanup:
...
- remove outdated comment
- add new peer at the end
- turn peers to send from list to set
2019-12-17 17:17:03 +08:00
fb0519129d
Refine Mplex.close and SwarmConn.close
...
Ensure `close` cleans up things and cancel the service finally.
2019-12-17 15:50:55 +08:00
733b1d08b6
Merge pull request #372 from ralexstokes/add-py36-compatibility
...
Add py36 compatibility
2019-12-10 17:28:49 -08:00
1929f307fb
Fix all modules except for security
2019-12-06 17:06:37 +08:00
c08b2375e1
Fix: should not remove topic if no peers
2019-12-03 23:10:47 +08:00
e9ab0646e3
Fix Pubsub
2019-12-03 17:27:49 +08:00
63fd531ed0
Fixes to add python 3.6 compatibility
2019-12-02 16:33:32 -08:00
920cf646ef
Fix lint and add check in fanout heartbeat
2019-12-02 22:49:27 +08:00
0a52a05375
Del entry if no more peers subscribe to the topic
2019-11-30 20:02:11 +08:00
e59ac6a250
Cleanup TODOs in pubsub
2019-11-30 17:12:37 +08:00
658a0ae156
Apply PR feedback:
...
move signature validation logic into signature validator
2019-11-29 19:37:48 +08:00
1c54c38ca7
Fix lint and add signing_strict to interop tests
2019-11-29 17:24:40 +08:00
a262b94836
Apply PR feedback:
...
check if signing key and ID match
2019-11-29 14:12:42 +08:00
064c109b64
Fix signature validator:
...
Add prefix and return verify result
2019-11-28 18:45:00 +08:00
d5d6962dce
Update Pubsub fixture and test
2019-11-27 17:15:24 +08:00
0fd400fdf8
Sign and verify in Pubsub
2019-11-27 17:15:24 +08:00
683710573e
Add strict_signing: bool and sign_key to Pubsub
2019-11-27 17:15:23 +08:00
e355cb2600
Apply PR feedback:
...
Only use pop method if error handling is in place
2019-11-23 16:04:22 +08:00
501eef59de
Apply PR feedback:
...
Only use pop method if graceful failure handling is desired
2019-11-21 14:48:03 +08:00
19907e18ec
Replace (check and) del pattern with pop method
2019-11-20 23:06:37 +08:00