Skip to content

test(blocksync): increase capacity of errorsCh#4125

Merged
melekes merged 6 commits intomainfrom
TestBlockPoolMaliciousNode
Sep 20, 2024
Merged

test(blocksync): increase capacity of errorsCh#4125
melekes merged 6 commits intomainfrom
TestBlockPoolMaliciousNode

Conversation

@melekes
Copy link
Collaborator

@melekes melekes commented Sep 19, 2024

similar to how we set capacity to 1000 in production to avoid locking.

const capacity = 1000                      // must be bigger than peers count
errorsCh := make(chan peerError, capacity) // so we don't block in #Receive#pool.AddBlock

https://github.com/cometbft/cometbft/blob/main/internal/blocksync/reactor.go#L99C1-L100C91

similar to how we set capacity to 1000 in production
to avoid locking.

```go
const capacity = 1000                      // must be bigger than peers count
errorsCh := make(chan peerError, capacity) // so we don't block in #Receive#pool.AddBlock
```
https://github.com/cometbft/cometbft/blob/main/internal/blocksync/reactor.go#L99C1-L100C91
@melekes melekes requested a review from a team as a code owner September 19, 2024 13:52
@melekes melekes requested a review from a team September 19, 2024 13:52
@melekes melekes changed the title tests(blocksync): increase capacity of errorsCh test(blocksync): increase capacity of errorsCh Sep 19, 2024
@melekes melekes self-assigned this Sep 19, 2024
Copy link
Collaborator

@andynog andynog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@melekes melekes added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@melekes melekes added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@melekes

This comment was marked as resolved.

@melekes melekes enabled auto-merge September 20, 2024 07:46
@melekes melekes added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit 8a7a640 Sep 20, 2024
@melekes melekes deleted the TestBlockPoolMaliciousNode branch September 20, 2024 08:03
mergify bot added a commit that referenced this pull request Sep 20, 2024
similar to how we set capacity to 1000 in production to avoid locking.

```go
const capacity = 1000                      // must be bigger than peers count
errorsCh := make(chan peerError, capacity) // so we don't block in #Receive#pool.AddBlock
```

https://github.com/cometbft/cometbft/blob/main/internal/blocksync/reactor.go#L99C1-L100C91

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 8a7a640)
melekes added a commit that referenced this pull request Sep 20, 2024
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants