Skip to content

fix(proto): lock buf version - #6057

Merged
swift1337 merged 2 commits into
mainfrom
fix/proto-lock-buf
Sep 14, 2026
Merged

swift1337 merged 2 commits into
mainfrom
fix/proto-lock-buf

Conversation

@swift1337

Copy link
Copy Markdown
Member

Summary

  • Pin buf to v1.72.0 in the Makefile instead of @latest
  • v1.73.0 requires Go 1.26.7, which breaks make proto-gen in CI on Go 1.25

Test plan

  • make proto-gen succeeds locally
  • CI check-generated passes

@swift1337
swift1337 requested a review from a team as a code owner September 14, 2026 11:13
buf v1.73.0 requires Go 1.26.7, breaking proto-gen in CI which runs Go 1.25.
@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The Makefile now pins buf to v1.72.0 instead of downloading the latest release. This keeps protobuf commands compatible with Go 1.25 while still allowing callers to override the version.

  • Shares one buf version across protobuf commands.
  • Applies the pinned version to generation, linting, and breaking checks.

Confidence Score: 5/5

This PR appears safe to merge.

Every Buf call in the root Makefile now uses the same default version. The generated-code CI runs proto-gen, and no tracked caller overrides BUF_VERSION.

Important Files Changed

Filename Overview
Makefile Adds BUF_VERSION with a v1.72.0 default. All four changed Buf calls now use this version, while callers can override it.

Sequence Diagram

sequenceDiagram
    actor Caller
    participant Make as Makefile
    participant Go as go run
    participant Buf as Buf v1.72.0
    Caller->>Make: Run a protobuf target
    Make->>Make: Use BUF_VERSION or default v1.72.0
    alt proto-gen
        Make->>Go: Run buf generate
        Go->>Buf: Resolve pinned CLI
        Buf-->>Make: Generate protobuf files
        Make->>Make: Move and copy generated Go files
    else proto-lint
        Make->>Go: Run buf lint
        Go->>Buf: Resolve pinned CLI
        Buf-->>Caller: Return lint result
    else breaking check
        Make->>Go: Run buf breaking with comparison source
        Go->>Buf: Resolve pinned CLI
        Buf-->>Caller: Return compatibility result
    end
Loading

Reviews (1): Last reviewed commit: 791477e | Re-trigger Greptile

@swift1337
swift1337 added this pull request to the merge queue Sep 14, 2026
@mergify

mergify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

Merged via the queue into main with commit fd57dd4 Sep 14, 2026
34 checks passed
@swift1337
swift1337 deleted the fix/proto-lock-buf branch September 14, 2026 11:57
fridrik01 added a commit to berachain/cometbft that referenced this pull request Sep 23, 2026
JayT106 pushed a commit to crypto-org-chain/cometbft that referenced this pull request Oct 19, 2026
## Summary
- Pin `buf` to v1.72.0 in the Makefile instead of `@latest`
- v1.73.0 requires Go 1.26.7, which breaks `make proto-gen` in CI on Go
1.25

## Test plan
- [x] `make proto-gen` succeeds locally
- [ ] CI `check-generated` passes

Co-authored-by: dianab-cl <[email protected]>
(cherry picked from commit fd57dd4)
JayT106 pushed a commit to crypto-org-chain/cometbft that referenced this pull request Oct 30, 2026
## Summary
- Pin `buf` to v1.72.0 in the Makefile instead of `@latest`
- v1.73.0 requires Go 1.26.7, which breaks `make proto-gen` in CI on Go
1.25

## Test plan
- [x] `make proto-gen` succeeds locally
- [ ] CI `check-generated` passes

Co-authored-by: dianab-cl <[email protected]>
(cherry picked from commit fd57dd4)
JayT106 pushed a commit to crypto-org-chain/cometbft that referenced this pull request Oct 30, 2026
## Summary
- Pin `buf` to v1.72.0 in the Makefile instead of `@latest`
- v1.73.0 requires Go 1.26.7, which breaks `make proto-gen` in CI on Go
1.25

## Test plan
- [x] `make proto-gen` succeeds locally
- [ ] CI `check-generated` passes

Co-authored-by: dianab-cl <[email protected]>
(cherry picked from commit fd57dd4)
JayT106 added a commit to crypto-org-chain/cometbft that referenced this pull request Nov 2, 2026
* fix(proto): lock buf version (cometbft#6057)

## Summary
- Pin `buf` to v1.72.0 in the Makefile instead of `@latest`
- v1.73.0 requires Go 1.26.7, which breaks `make proto-gen` in CI on Go
1.25

## Test plan
- [x] `make proto-gen` succeeds locally
- [ ] CI `check-generated` passes

Co-authored-by: dianab-cl <[email protected]>
(cherry picked from commit fd57dd4)

* feat: bump go to 1.26.6 (cometbft#6060)

Signed-off-by: Dmitry S <[email protected]>
(cherry picked from commit 4bf15c0)

* chore: Upgrade go 1.26.10 (cometbft#6114)

Bumps Go to 1.26.10 in go.mod, CI (`go-version.env`), and the Docker and
e2e images. Go 1.26.10 adds the `crypto/x509` denylist for the
compromised eMudhra intermediate CAs (CVE-2026-111943), so binaries
built from here reject certificates chaining to them.

#### PR checklist

- [x] Tests written/updated (n/a, toolchain bump)
- [x] Changelog entry added in `CHANGELOG.md`
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: aljo242 <[email protected]>
(cherry picked from commit 6aef1e1)

* chore: align Go bump changelog entry and README table with fork conventions

---------

Signed-off-by: Dmitry S <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: dianab-cl <[email protected]>
Co-authored-by: aljo242 <[email protected]>
JayT106 added a commit to crypto-org-chain/cometbft that referenced this pull request Nov 2, 2026
* fix(consensus): release cs.mtx before sending to statsMsgQueue (backport cometbft#5813) (cometbft#5999)

## Problem

`handleMsg` sent to `cs.statsMsgQueue` while holding `cs.mtx`. If the
buffer fills, the send blocks indefinitely — stalling the entire
consensus state machine.

## Fix

Hoist the `statsMsgQueue` send outside the `switch`, release `cs.mtx`
before the send and re-acquire after.

This also removes the duplicated `added` checks inside each `case`
block, replacing them with a single check at the bottom.

## Testing

- `TestHandleMsgReleasesLockBeforeStatsMsgQueueSend`: verifies
`GetRoundState()` is not blocked while `handleMsg` is blocked on the
send.

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `CHANGELOG.md`
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments<hr>This is an automatic backport of pull request cometbft#5813 done by
[Mergify](https://mergify.com).

Co-authored-by: songgaoye <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Dmitry S <[email protected]>
(cherry picked from commit 4f1535b)

* fix(consensus): correct loop condition in checkDoubleSigningRisk for height=1 (backport cometbft#5668) (cometbft#6000)

Fixes: cometbft#5435

When `double_sign_check_height` is set to `1`, the loop condition `i :=
int64(1); i < 1` is never satisfied, resulting in zero iterations and no
double sign checks being performed. This makes the setting functionally
equivalent to `0` (disabled), silently giving validators false
confidence in their double-sign protection.

Changed the loop condition from `i < doubleSignCheckHeight` to `i <=
doubleSignCheckHeight` so that a value of `1` correctly checks `height -
1`, matching the documented intent of the configuration parameter. The
existing guard `if doubleSignCheckHeight > height` already prevents
out-of-bounds lookups on short chains, so no additional bounds
protection is needed.

- [x] Tests written/updated
- [x] Changelog entry added in `CHANGELOG.md`
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments<hr>This is an automatic backport of pull request cometbft#5668 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Aditya Mishra <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 222949a)

* fix(blocksync): tolerate late BlockResponse from honest peers after switching to consensus (backport cometbft#5959) (cometbft#6002)

`FilterMsgBytes` returned an error for any `BlockResponse` once the
block pool had stopped (`!r.pool.IsRunning()`). That error panicked
inside `p2p/peer.go`'s `onReceive` and was recovered into
`StopPeerForError` — a hard disconnect. Because requests for the last
blocks are typically still in-flight when the catch-up ticker fires and
`pool.Stop()` is called, both request targets (primary and secondary
peer) were disconnected on every normal sync completion, exactly when
the node needs them for consensus gossip.

Root cause introduced by cometbft#5860 (`FilterMsgBytes`). Not covered by cometbft#5950,
which handles the second-peer race while the pool is still running.

Split the single `||` guard into two branches:

- `!r.enabled.Load()` — node never ran blocksync; any `BlockResponse` is
genuinely unsolicited → reject (unchanged behaviour)
- `!r.pool.IsRunning()` — pool stopped for consensus switch; requests we
sent before the transition are still in-flight; the peers are honest →
allow, but still run `validateMaxVotes` on the response

The `AddBlock` call that follows returns `"already committed block"` and
logs it; no peer state is mutated and no disconnect occurs.

`pool.sendError` is already a no-op once the pool is stopped (it guards
on `!pool.IsRunning()`), so the pre-fix punishment for genuinely
out-of-window responses in this window was already silently dropped the
moment `poolEventsRoutine` exited.

The post-stop branch skips the `HasPendingRequestFrom` peer-identity
check (any peer, not just the one we solicited, may legitimately answer
a stale request) but still enforces `validateMaxVotes` — once the pool
stops, any connected peer can reach this path, and the commit-signature
cap exists to prevent a heap-amplification DoS regardless of sender.
Caught by review on this PR; added a dedicated regression test (`rejects
oversized BlockResponse after pool stops for consensus switch`) so an
oversized response is still rejected in this window.

---

- [x] Tests written/updated
- [x] Changelog entry added in `CHANGELOG.md`
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
<hr>This is an automatic backport of pull request cometbft#5959 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: JayT106 <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
(cherry picked from commit 6ed1d96)

* ci: run e2e-test on ubuntu-latest, not unavailable Depot runner

Fork has no Depot runner registered, so depot-ubuntu-24.04-4 jobs
queue indefinitely and get cancelled at the 24h timeout.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: songgaoye <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: Aditya Mishra <[email protected]>
Co-authored-by: jay.tseng <[email protected]>

Port note (v0.40.0): only the e2e runner change applies; the upstream
commits are already in v0.40.0. Also pins buf to v1.72.0 (upstream
cometbft#6057; buf@latest needs Go 1.26.7 and broke check-proto)
and fixes the flaky TestPEXReactorSeedModeFlushStop.

(cherry picked from commit 14b7b93)
@aljo242 aljo242 added the backport-to-v0.40.x Tell Mergify to backport the PR to v0.40.x label Nov 20, 2026
@mergify mergify Bot mentioned this pull request Nov 20, 2026
1 of 2 tasks
aljo242 pushed a commit that referenced this pull request Nov 24, 2026
## Summary
- Pin `buf` to v1.72.0 in the Makefile instead of `@latest`
- v1.73.0 requires Go 1.26.7, which breaks `make proto-gen` in CI on Go
1.25

## Test plan
- [x] `make proto-gen` succeeds locally
- [ ] CI `check-generated` passes<hr>This is an automatic backport of
pull request #6057 done by [Mergify](https://mergify.com).

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: dianab-cl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v0.40.x Tell Mergify to backport the PR to v0.40.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants