-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added : TimedCache module #518
base: main
Are you sure you want to change the base?
Conversation
@mystical-prog : Excellent, Vraj :) Thank you for sharing the pull request. Looking forward to integrating and testing it with py-libp2p soon. Wish to share some key features expected in the pull request for Gossipsub in py-libp2p as discussed in the specification meeting focused on Gossipsub across libp2p modules: ✅ Gossipsub Core Implementation – Implements the core message propagation and peer scoring mechanisms. |
Hey @seetadev I am creating a TODO list and will keep on updating it as I find gaps, currently I have found these two gaps and I am looking forward to close before Monday! |
@mystical-prog : That sounds like a great plan! 🚀 Thanks for proactively identifying and tracking these gaps. Keeping an updated TODO list will definitely help streamline the process and ensure we cover all the missing pieces efficiently. I appreciate your initiative in closing these gaps before Monday—that will be super helpful in keeping the momentum going! Looking forward to seeing the updates!🔥
|
@seetadev |
932a06b
to
70412d7
Compare
@mystical-prog : Hi Vraj. This looks great. Kindly share a small demo video (upto 2-4 mins ) explaining the PR, integration with libp2p and also a walkthrough on the code. This will also help other devs to extend on your work. I will wait for @pacrob 's and @dhuseby 's feedback. Will merge once I hear the feedback from them. |
Sure, I will try to share the video ASAP |
This looks good, @mystical-prog, thanks! Just a thought:
Also, I see you've tested the changes via |
@@ -0,0 +1,51 @@ | |||
import threading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think renaming the file to base_timed_cache.py
fits better.
import time | ||
|
||
|
||
class TimedCache: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a good place to use ABC
, like:
from abc import ABC
class BaseTimedCache(ABC)
You can then decorate the add
and has
methods with @abstractmethod
and you don't have to worry about raising anything, it's handled by the ABC
.
Hey @pacrob I will look into the changes suggested by you and get back to you ASAP |
I have made the suggested changes @pacrob |
What was wrong?
There was a gap in Pubsub implementation wherein there was a simple LRU based cache, instead we now have a built-in
timed_cache
python module which will now handle theseen_messages
cache in Pubsub and it's derived protocols.ref: https://github.com/libp2p/go-libp2p-pubsub/tree/master/timecache