fix(server): properly disable kademlia record storage#5987
fix(server): properly disable kademlia record storage#5987VolodymyrBg wants to merge 14 commits intolibp2p:masterfrom
Conversation
elenaf9
left a comment
There was a problem hiding this comment.
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))) |
jxs
left a comment
There was a problem hiding this comment.
You also need to update Cargo.lock, you can do it with
cargo metadata
Done |
jxs
left a comment
There was a problem hiding this comment.
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.rswhere 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::FilterBothoption, 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::DurationThese changes make the code cleaner and more maintainable by using the proper API rather than a workaround.
Notes & open questions
None
Change checklist