rust-libp2p
rust-libp2p copied to clipboard
refactor(kad): Add `Key` to `InboundRequest::{AddProvider, PutRecord}`.
Description
This PR introduces Key to InboundRequest::AddProvider and InboundRequest::PutRecord to provide the record key when it is inserted into the RecordStore.
Resolves #6048.
Notes & open questions
While one could just enable filtering, check the record for the key and then insert it into the store, I do feel this would provide information without requiring one to enable filtering and be responsible for inserting into the store.
Question:
- Should we instead have it as
Option<Key>so when if filtering is enabled, the field would returnNoneand with it being . disabled, it would returnSome(_)?
Change checklist
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] A changelog entry has been made in the appropriate crates
This pull request has merge conflicts. Could you please resolve them @dariusc93? 🙏