Skip to content

Commit

Permalink
feat(blocksync): sort peers by download rate & multiple requests for …
Browse files Browse the repository at this point in the history
…closer blocks (backport #2475) (#2576)

This is an automatic backport of pull request #2475 done by
[Mergify](https://mergify.com).
Cherry-pick of f8366fc has failed:
```
On branch mergify/bp/v0.38.x/pr-2475
Your branch is up to date with 'origin/v0.38.x'.

You are currently cherry-picking commit f8366fc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .changelog/unreleased/improvements/2475-blocksync-2nd-request.md
	new file:   .changelog/unreleased/improvements/2475-blocksync-no-block-response.md
	new file:   .changelog/unreleased/improvements/2475-blocksync-sort-peers.md
	modified:   blocksync/reactor.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   blocksync/pool.go

```


To fix up this pull request, you can check it out locally. See
documentation:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the
[documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on
`<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com) you
can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
  • Loading branch information
mergify[bot] and melekes committed Mar 12, 2024
1 parent 6d606ce commit 6cf6978
Show file tree
Hide file tree
Showing 5 changed files with 307 additions and 119 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `[blocksync]` Request a block from peer B if we are approaching pool's height
(less than 50 blocks) and the current peer A is slow in sending us the
block [\#2475](https://github.com/cometbft/cometbft/pull/2475)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `[blocksync]` Request the block N from peer B immediately after getting
`NoBlockResponse` from peer A
[\#2475](https://github.com/cometbft/cometbft/pull/2475)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `[blocksync]` Sort peers by download rate (the fastest peer is picked first)
[\#2475](https://github.com/cometbft/cometbft/pull/2475)
Loading

0 comments on commit 6cf6978

Please sign in to comment.