libp2p / libp2p/rust-libp2p

kad: Add `Key` to InboundRequest::{PutRecord, AddProvider}

Open
#6,048 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Description

Add the record Key to InboundRequest::PutRecord and InboundRequest::AddProvider event so the node can know the Key of the record that it has received.

Motivation

Currently, it the behaviour informs the node that they received a record InboundRequest::{PutRecord, AddProvider} event, unless StoreInserts::FilterBoth is enabled via Config::set_record_filtering in which case the record is included in its respected event. However, if the node wishes to know the key of the record it has received, it would have to enable filtering, which would then need to be explicitly stored in RecordStore through its respected functions. This seems a bit redundant since the record key can be included in the event to be more informational to the node in understanding what record has been stored without needing to store the record manually.

Current Implementation

Does not provide the key in InboundRequest::{PutRecord, AddProvider}

Are you planning to do it yourself in a pull request?

Maybe

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the InboundRequest::{PutRecord, AddProvider} event definitions and how Config::set_record_filtering enables StoreInserts::FilterBoth. Compare the existing filtered and unfiltered event behavior. Done means both events expose the received record's Key without requiring the record to be explicitly stored in RecordStore.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.