Skip to content

Rebase with new changes#1

Merged
Prabhat1308 merged 7 commits intoPrabhat1308:fix/return-limit-to-dialerfrom
libp2p:master
Jul 11, 2024
Merged

Rebase with new changes#1
Prabhat1308 merged 7 commits intoPrabhat1308:fix/return-limit-to-dialerfrom
libp2p:master

Conversation

@Prabhat1308
Copy link
Copy Markdown
Owner

Description

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

jxs and others added 7 commits July 4, 2024 10:49
and fix ci, by using `tomlq` new binary name, `tq`

Pull-Request: #5481.
As discussed in the last maintainer call, some improvements are probably necessary for the automatic bootstrap feature (introduced by #4838). Indeed, like @drHuangMHT mentioned in #5341 and like @guillaumemichel has agreed, triggering a bootstrap every time an update happens inside the routing table consumes a lot more resources.

The idea behind the automatic bootstrap feature it that, when a peer is starting, if a routing table update happens we probably don't want to wait for the periodic bootstrap to trigger and we want to trigger it right now. However, like @guillaumemichel said, this is something we want to do at startup or when a network connectivity problem happens, we don't want to do that all the time.

This PR is a proposal to trigger automatically a bootstrap on routing table update but only when we have less that `K_VALUE` peers in it (meaning that we are starting up or something went wrong and the fact that a new peer is inserted is probably a sign that the network connectivity issue is resolved).

I have also added a new triggering condition like mentioned in the maintainer call. When discovering a new listen address and if we have no connected peers, we trigger a bootstrap. This condition is based on our own experience at Stormshield : some peers were starting before the network interfaces were up, doing so, the automatic and periodic bootstrap failed, but when the network interfaces were finally up, we were waiting X minutes for the periodic bootstrap to actually trigger a bootstrap and join the p2p network.

Pull-Request: #5474.
This PR adds `#[track_caller]` on all `spawn` wrappers.

Pull-Request: #5465.
Code keeps the API while eliminating repetitive protocol cloning when protocols did not change, If protocol changes occur, only then the protocols are cloned to a reused buffer from which they are borrowed for iteration. Following are benchmark results:

|behaviour count|iterations|protocols|timings|change*|
|-|-|-|-|-|
|1|1000|10|27.798 µs 28.134 µs 28.493 µs|-15.771% -14.523% -13.269%|
|1|1000|100|55.171 µs 55.578 µs 56.009 µs|-51.831% -50.162% -48.437%|
|1|1000|1000|289.24 µs 290.99 µs 293.00 µs|-61.748% -60.895% -60.054%|
|5|1000|2|34.000 µs 34.216 µs 34.457 µs|-18.538% -16.231% -14.011%|
|5|1000|20|70.962 µs 71.428 µs 72.005 µs|-40.501% -38.944% -37.309%|
|5|1000|200|426.17 µs 433.27 µs 442.60 µs|-44.824% -42.663% -40.262%|
|10|1000|1|42.993 µs 44.382 µs 45.655 µs|-18.839% -16.292% -13.584%|
|10|1000|10|94.022 µs 96.787 µs 99.321 µs|-25.469% -23.572% -21.562%|
|10|1000|100|543.13 µs 554.91 µs 569.06 µs|-43.781% -42.189% -40.568%|
|20|500|1|63.150 µs 64.846 µs 66.860 µs|-9.5693% -6.1722% -2.6400%|
|20|500|10|212.21 µs 217.48 µs 222.64 µs|-16.525% -14.234% -11.925%|
|20|500|100|1.6651 ms 1.7083 ms 1.7490 ms|-27.704% -25.683% -23.618%|

change*: 3da7d91 is the baseline

Pull-Request: #5026.
`libp2p-swarm` `0.45.0` hasn't been released.

Pull-Request: #5483.
@Prabhat1308 Prabhat1308 merged commit eadfca3 into Prabhat1308:fix/return-limit-to-dialer Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants