Commit 85c7e5e
authored
fix: Ensure we always have a minimum number of connected peers (#2462)
## Why is this change needed?
In case the db didn't already have sufficient peers we wouldn't connect
to enough peers because the autodial was disabled.
## Merge Checklist
_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_
- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on enhancing the peer-to-peer connection management in
the `hubble` application by ensuring a minimum number of connected peers
and adding functionality to manage denied peers.
### Detailed summary
- Updated `minConnections` from `0` to `7` in `connectionManager` for
better connection stability.
- Introduced `addDeniedPeer(peerId: string)` method in
`connectionFilter.ts` to manage denied peers.
- Added logic to prevent autodial reconnections for denied peers in
`removePeerFromAddressBook`.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`
<!-- end pr-codex -->1 parent 6bbfcca commit 85c7e5e
3 files changed
Lines changed: 14 additions & 1 deletion
File tree
- .changeset
- apps/hubble/src/network/p2p
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
423 | 425 | | |
424 | 426 | | |
425 | 427 | | |
| 428 | + | |
| 429 | + | |
426 | 430 | | |
427 | 431 | | |
428 | 432 | | |
| |||
0 commit comments