rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

fix(gossipsub): send iwant messages immediately

Open zghh opened this issue 2 years ago • 4 comments

Description

After receiving an IHVE message from another peer, we sometimes need to wait for a heartbeat interval before sending an IWANT message. As a result, the other peer may have cleared the message from the cache, resulting in reducing the other peer's score.

In the implementation of go-libp2p, the IWANT message will be sent in time after receiving the IHAVE message. Therefore this PR will no longer put the message into the control pool but will be sent immediately.

Notes & open questions

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

zghh avatar Nov 16 '23 14:11 zghh

@jxs What do you prefer? Would you be okay with incorporating the move away from the ControlPool to immediately sending them in your PR?

Alternatively, we could redirect this PR to remove the ControlPool entirely and merge that separately.

thomaseizinger avatar Nov 19 '23 21:11 thomaseizinger

thanks for the ping @thomaseizinger! @zghh with https://github.com/libp2p/rust-libp2p/pull/4811 merged do you want to refactor this one to remove the control_pool?

jxs avatar Nov 22 '23 12:11 jxs

friendly ping @zghh, if you want I can go ahead and submit a PR to address this

update: waiting on https://github.com/libp2p/rust-libp2p/pull/4914 first

jxs avatar Nov 27 '23 15:11 jxs

@jxs Great!

zghh avatar Nov 27 '23 16:11 zghh