Skip to content

feat(blocksync): sort peers by download rate & multiple requests for closer blocks (backport #2475)#2577

Merged
melekes merged 2 commits intov0.37.xfrom
mergify/bp/v0.37.x/pr-2475
Mar 12, 2024
Merged

feat(blocksync): sort peers by download rate & multiple requests for closer blocks (backport #2475)#2577
melekes merged 2 commits intov0.37.xfrom
mergify/bp/v0.37.x/pr-2475

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Mar 11, 2024

This is an automatic backport of pull request #2475 done by Mergify.
Cherry-pick of f8366fc has failed:

On branch mergify/bp/v0.37.x/pr-2475
Your branch is up to date with 'origin/v0.37.x'.

You are currently cherry-picking commit f8366fc42.
  (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

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   blocksync/pool.go
	both modified:   blocksync/reactor.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


Mergify commands and options

More conditions and actions can be found in the documentation.

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 you can:

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

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

…closer blocks (#2475)

It can be reviewed commit by commit.

1. Request the block N from peer B immediately after getting
`NoBlockResponse` from peer A
a718fb4
2. Sort peers by download rate (the fastest peer is picked first)
cf19851
3. 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
e06ebfe
e97007f

Closes #2379

### Benchmarks

Osmosis:

without this PR (baseline): 11.45m
with this PR: 7.29m
~ 36% decrease

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

(cherry picked from commit f8366fc)

# Conflicts:
#	blocksync/pool.go
#	blocksync/reactor.go
@mergify mergify bot requested a review from a team as a code owner March 11, 2024 12:53
@mergify mergify bot added the conflicts label Mar 11, 2024
@mergify
Copy link
Contributor Author

mergify bot commented Mar 11, 2024

Cherry-pick of f8366fc has failed:

On branch mergify/bp/v0.37.x/pr-2475
Your branch is up to date with 'origin/v0.37.x'.

You are currently cherry-picking commit f8366fc42.
  (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

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   blocksync/pool.go
	both modified:   blocksync/reactor.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

@melekes
Copy link
Collaborator

melekes commented Mar 11, 2024

BLOCKER: #2574

@andynog
Copy link
Collaborator

andynog commented Mar 11, 2024

BLOCKER: #2574

I've reviewed that

@czarcas7ic
Copy link
Contributor

Looking forward to seeing how you all fix CI, I am still blocked on getting CI to pass with this change osmosis-labs#18

@czarcas7ic
Copy link
Contributor

czarcas7ic commented Mar 11, 2024

Ah finally figured it out, I was missing this logic osmosis-labs@c777f62

@melekes
Copy link
Collaborator

melekes commented Mar 12, 2024

@Mergifyio refresh

@mergify
Copy link
Contributor Author

mergify bot commented Mar 12, 2024

refresh

✅ Pull request refreshed

@melekes melekes merged commit 15d4d91 into v0.37.x Mar 12, 2024
@melekes melekes deleted the mergify/bp/v0.37.x/pr-2475 branch March 12, 2024 06:28
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.

4 participants