Repository navigation
feat(config): add EventBusBufferCapacity setting - #5849
Merged
Merged
Conversation
Expose the EventBus pubsub buffer capacity via a new `event_bus_buffer_capacity` BaseConfig field. Defaults to 0 (unbuffered) to preserve current behavior. Wires through node.createAndStartEventBus to call types.NewEventBusWithBufferCapacity.
Contributor
|
PR author is not in the allowed authors list. |
Contributor
Author
|
If the PR approved, please backport to v0.38.x/v0.39.x, thanks. ref #5578 |
aljo242
approved these changes
May 19, 2026
aljo242
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and validated locally:
go test ./config ./node -run TestNodeStartStop -count=1
LGTM. Config plumbing and event bus construction changes are straightforward and preserve default behavior (0 remains unbuffered).
aljo242
reviewed
May 21, 2026
JayT106
added a commit
to JayT106/cometbft
that referenced
this pull request
May 21, 2026
Verify NewEventBus defaults to an unbuffered (cap=0) bus and that NewEventBusWithBufferCapacity propagates the capacity to the underlying pubsub server. Also demonstrate the buffering limit by publishing to an unstarted bus: publishes up to the cap succeed while the next one blocks and times out via the context deadline. Adds an EventBus.BufferCapacity getter that proxies to the pubsub server so external callers and tests can inspect the configured value. Addresses review feedback on cometbft#5849.
Verify NewEventBus defaults to an unbuffered (cap=0) bus and that NewEventBusWithBufferCapacity propagates the capacity to the underlying pubsub server. Also demonstrate the buffering limit by publishing to an unstarted bus: publishes up to the cap succeed while the next one blocks and times out via the context deadline. Adds an EventBus.BufferCapacity getter that proxies to the pubsub server so external callers and tests can inspect the configured value. Addresses review feedback on cometbft#5849.
JayT106
force-pushed
the
feat/event-bus-buffer-capacity
branch
from
May 21, 2026 14:25
46bd381 to
5795da4
Compare
Contributor
Author
Done! |
Collaborator
|
one gap - no validation on negative values. |
JayT106
added a commit
to JayT106/cometbft
that referenced
this pull request
May 22, 2026
Adds a `>= 0` check in BaseConfig.ValidateBasic so that a negative event_bus_buffer_capacity is rejected at config-load time rather than panicking at node startup via `make(chan T, -1)`. Addresses review feedback on cometbft#5849.
Adds a `>= 0` check in BaseConfig.ValidateBasic so that a negative event_bus_buffer_capacity is rejected at config-load time rather than panicking at node startup via `make(chan T, -1)`. Addresses review feedback on cometbft#5849.
Contributor
Author
Updated. |
aljo242
pushed a commit
that referenced
this pull request
May 26, 2026
Adds a `>= 0` check in BaseConfig.ValidateBasic so that a negative event_bus_buffer_capacity is rejected at config-load time rather than panicking at node startup via `make(chan T, -1)`. Addresses review feedback on #5849.
aljo242
approved these changes
Jun 1, 2026
swift1337
enabled auto-merge
June 5, 2026 11:28
swift1337
added this pull request to the merge queue
Jun 5, 2026
This was referenced Jun 5, 2026
mergify Bot
added a commit
that referenced
this pull request
Jun 11, 2026
) ## Summary Currently it's noway to turn on a buffered eventbus in cometBFT, this PR add new config settings to let downstream projects to be able to turn on without fork/patch cometBFT repo. - Add `event_bus_buffer_capacity` field to `BaseConfig` (default `0`, preserves existing unbuffered behavior). - Wire the value through `node.createAndStartEventBus` to `types.NewEventBusWithBufferCapacity`. - Surface the new field in the generated `config.toml` template. <hr>This is an automatic backport of pull request #5849 done by [Mergify](https://mergify.com). --------- Co-authored-by: JayT106 <[email protected]> Co-authored-by: Alex | Cosmos Labs <[email protected]>
aljo242
added a commit
that referenced
this pull request
Jun 12, 2026
) ## Summary Currently it's noway to turn on a buffered eventbus in cometBFT, this PR add new config settings to let downstream projects to be able to turn on without fork/patch cometBFT repo. - Add `event_bus_buffer_capacity` field to `BaseConfig` (default `0`, preserves existing unbuffered behavior). - Wire the value through `node.createAndStartEventBus` to `types.NewEventBusWithBufferCapacity`. - Surface the new field in the generated `config.toml` template. <hr>This is an automatic backport of pull request #5849 done by [Mergify](https://mergify.com). --------- Co-authored-by: JayT106 <[email protected]> Co-authored-by: Alex | Cosmos Labs <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
kevindharmawan
pushed a commit
to SeeMoReLab/cometbft
that referenced
this pull request
Jul 30, 2026
## Summary Currently it's noway to turn on a buffered eventbus in cometBFT, this PR add new config settings to let downstream projects to be able to turn on without fork/patch cometBFT repo. - Add `event_bus_buffer_capacity` field to `BaseConfig` (default `0`, preserves existing unbuffered behavior). - Wire the value through `node.createAndStartEventBus` to `types.NewEventBusWithBufferCapacity`. - Surface the new field in the generated `config.toml` template. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dmitry S <[email protected]>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently it's noway to turn on a buffered eventbus in cometBFT, this PR add new config settings to let downstream projects to be able to turn on without fork/patch cometBFT repo.
event_bus_buffer_capacityfield toBaseConfig(default0, preserves existing unbuffered behavior).node.createAndStartEventBustotypes.NewEventBusWithBufferCapacity.config.tomltemplate.