-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(server): properly disable kademlia record storage #5987
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks!
This needs a patch version bump and changelog entry.
Done |
This pull request has merge conflicts. Could you please resolve them @VolodymyrBg? 🙏 |
thanks bot, I resolved it))) |
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.
You also need to update Cargo.lock
, you can do it with
cargo metadata
Done |
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.
CI is still failing:
Version of 'libp2p-server' has been bumped more than once since last release v0.12.6.
0.12.7
hasn't been released no need to bump the Cargo.toml
and a new changelog entry on the CHANGELOG.md
only an entry with the change under the 0.12.7
release
Description
Replace the hack using zero-second TTL with proper record filtering in Kademlia configuration.
This PR addresses a TODO comment in
misc/server/src/behaviour.rs
where we were previouslyusing a workaround to disable storing records and provider records in Kademlia by setting
their TTL to zero seconds. The proper approach is to use the
StoreInserts::FilterBoth
option, which is specifically designed for this purpose.
The changes:
set_record_ttl(Some(Duration::from_secs(0)))
andset_provider_record_ttl(Some(Duration::from_secs(0)))
withset_record_filtering(kad::StoreInserts::FilterBoth)
time::Duration
These changes make the code cleaner and more maintainable by using the proper API rather than a workaround.
Notes & open questions
None
Change checklist