Skip to content

Commit

Permalink
net/litep2p: Propagate ValuePut events to the network backend (#5018)
Browse files Browse the repository at this point in the history
The `DhtEvent::ValuePut` was not propagated back to the higher levels.

This PR ensures we'll send the ValuePut event similarly to
`DhtEvent::ValuePutFailed`

### Next Steps
- [ ] A bit more testing

Thanks @alexggh for catching this 🙏 

cc @paritytech/networking

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv authored Jul 16, 2024
1 parent 926c1b6 commit 8d39271
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions substrate/client/network/src/litep2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,10 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
"`PUT_VALUE` for {key:?} ({query_id:?}) succeeded",
);

self.event_streams.send(Event::Dht(
DhtEvent::ValuePut(libp2p::kad::RecordKey::new(&key))
));

if let Some(ref metrics) = self.metrics {
metrics
.kademlia_query_duration
Expand Down

0 comments on commit 8d39271

Please sign in to comment.