Skip to content

fix(mempool): allow CheckTx retries - #5802

Merged
swift1337 merged 9 commits into
mainfrom
fix/check-tx-unguard
Apr 22, 2026
Merged

swift1337 merged 9 commits into
mainfrom
fix/check-tx-unguard

Conversation

@swift1337

@swift1337 swift1337 commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

Fixed a UX hiccup: RPC.BroadcastTxSync() calls appMempool.CheckTx() that limited retries. With Krakatoa's mempool that meant you couldn't resubmit a cosmos tx if your balance was low, for example.

This PR drops the tx hash from the "seen cache" after a delay, letting you resubmit while still protecting the node from DoS.

Closes STACK-2402


PR checklist

  • Tests written/updated
  • Changelog entry added in CHANGELOG.md
  • Updated relevant documentation (docs/ or spec/) and code comments

@swift1337 swift1337 self-assigned this Apr 21, 2026
@swift1337
swift1337 marked this pull request as ready for review April 21, 2026 14:57
@swift1337
swift1337 requested a review from a team as a code owner April 21, 2026 14:57
@linear

linear Bot commented Apr 21, 2026

Copy link
Copy Markdown

@greptile-apps

greptile-apps Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the simple TxCache in AppMempool with a new guard.Guard — a thread-safe LRU cache with TTL-based expiry — and uses it to schedule delayed removal of failed txs from the seen cache after CheckTx, allowing BroadcastTxSync callers to retry the same tx after a configurable delay (default 5 s for non-retryable errors, 500 ms for retryable ones).

  • P1 gap in retry coverage: When m.app.CheckTx returns a transport-level err != nil, the goroutine returns early without calling forgetTx, so the tx stays in the guard indefinitely — the exact retry-blocking behaviour this PR aims to fix.
  • P2 config validation: CheckTxRetryDelay is not checked in MempoolConfig.ValidateBasic() (unlike ReapInterval), so a misconfigured value of 0s passes validation and only surfaces as a panic inside NewAppMempool.

Confidence Score: 4/5

PR is nearly complete but the err != nil path in the CheckTx goroutine leaves txs permanently stuck in the guard, defeating the retry goal for transient ABCI errors.

One P1 defect remains: the transport-error early-return in the CheckTx goroutine skips forgetTx, which is the core mechanism this PR introduces. The fix is a one-liner. The guard.Guard implementation itself is correct and well-tested. The config validation gap is a P2 quality issue, not a blocker.

mempool/app_mempool.go — the err != nil early-return in CheckTx goroutine; config/config.go — missing ValidateBasic check for CheckTxRetryDelay.

Important Files Changed

Filename Overview
mempool/app_mempool.go Replaces TxCache with guard.Guard; adds forgetTx scheduling TTL expiry after CheckTx errors — but the err != nil path in the CheckTx goroutine skips forgetTx, leaving the tx permanently stuck in the guard.
internal/guard/guard.go New thread-safe LRU dedup cache with TTL-based eviction via ForgetAfter; background goroutine cleans expired entries; Close() properly stops it via doneCh.
internal/guard/guard_test.go Comprehensive tests for all Guard methods; t.Cleanup(g.Close) prevents goroutine leaks in tests.
mempool/app_mempool_test.go Tests updated for retryable/non-retryable cases; uses require.Eventually for TTL assertions.
config/config.go Adds CheckTxRetryDelay field with 5s default; not validated in MempoolConfig.ValidateBasic() unlike ReapInterval.
config/toml.go TOML template updated to include check_tx_retry_delay; straightforward change.
CHANGELOG.md Changelog entry added for the mempool retry fix.

Sequence Diagram

sequenceDiagram
    participant Client as RPC Client
    participant CM as CheckTx goroutine
    participant G as guard.Guard
    participant App as ABCI App

    Client->>CM: BroadcastTxSync -> CheckTx(tx)
    CM->>G: Guard(tx.Key())
    G-->>CM: added=true
    CM->>App: app.CheckTx(tx)
    alt transport error (err != nil)
        App-->>CM: err
        CM->>CM: log error, return early
        Note over G: tx stays in guard forever (bug)
    else non-OK code
        App-->>CM: res Code != OK
        CM->>Client: callback(res)
        CM->>G: ForgetAfter(tx.Key(), delay)
        Note over G: TTL set; background goroutine removes after delay
        Client->>CM: retry after delay
        CM->>G: Guard(tx.Key()) re-added after expiry
    else OK
        App-->>CM: res Code = OK
        CM->>Client: callback(res)
        Note over G: tx stays guarded for dedup
    end
Loading

Comments Outside Diff (1)

  1. mempool/app_mempool.go, line 263-268 (link)

    P1 ABCI transport error leaves tx stuck in guard permanently

    When m.app.CheckTx returns a non-nil err, the goroutine logs and returns without ever calling forgetTx. The tx stays in the guard indefinitely, so any subsequent BroadcastTxSync for that tx will get ErrSeenTx — exactly the retry scenario this PR aims to fix. The callback also goes uncalled, which could leave the RPC caller hanging.

    This should call forgetTx (or at minimum clear the tx from the guard immediately) before returning:

    res, err := m.app.CheckTx(ctx, req)
    if err != nil {
        m.logger.Error("AppMempool.CheckTx: error inserting tx", "error", err, "tx", txHash(tx))
        m.forgetTx(tx, true) // allow retry after a short delay on transient errors
        return
    }
    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: mempool/app_mempool.go
    Line: 263-268
    
    Comment:
    **ABCI transport error leaves tx stuck in guard permanently**
    
    When `m.app.CheckTx` returns a non-nil `err`, the goroutine logs and returns without ever calling `forgetTx`. The tx stays in the guard indefinitely, so any subsequent `BroadcastTxSync` for that tx will get `ErrSeenTx` — exactly the retry scenario this PR aims to fix. The callback also goes uncalled, which could leave the RPC caller hanging.
    
    This should call `forgetTx` (or at minimum clear the tx from the guard immediately) before returning:
    
    ```go
    res, err := m.app.CheckTx(ctx, req)
    if err != nil {
        m.logger.Error("AppMempool.CheckTx: error inserting tx", "error", err, "tx", txHash(tx))
        m.forgetTx(tx, true) // allow retry after a short delay on transient errors
        return
    }
    ```
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: mempool/app_mempool.go
Line: 263-268

Comment:
**ABCI transport error leaves tx stuck in guard permanently**

When `m.app.CheckTx` returns a non-nil `err`, the goroutine logs and returns without ever calling `forgetTx`. The tx stays in the guard indefinitely, so any subsequent `BroadcastTxSync` for that tx will get `ErrSeenTx` — exactly the retry scenario this PR aims to fix. The callback also goes uncalled, which could leave the RPC caller hanging.

This should call `forgetTx` (or at minimum clear the tx from the guard immediately) before returning:

```go
res, err := m.app.CheckTx(ctx, req)
if err != nil {
    m.logger.Error("AppMempool.CheckTx: error inserting tx", "error", err, "tx", txHash(tx))
    m.forgetTx(tx, true) // allow retry after a short delay on transient errors
    return
}
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: config/config.go
Line: 1082-1090

Comment:
**`CheckTxRetryDelay` not validated in `ValidateBasic`**

`ReapInterval` is validated here with a proper error, but the new `CheckTxRetryDelay` is only guarded by a `panic` inside `NewAppMempool`. A bad config value (e.g., `check_tx_retry_delay = "0s"`) passes `ValidateBasic` cleanly and only causes a crash at runtime. This is inconsistent with how other app-mempool fields are validated.

```go
if cfg.CheckTxRetryDelay <= 0 {
    return errors.New("check_tx_retry_delay must be positive when mempool type is \"app\"")
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (6): Last reviewed commit: "remove unused code" | Re-trigger Greptile

Comment thread mempool/app_mempool.go Resolved
Comment thread mempool/app_mempool.go Resolved
Comment thread mempool/app_mempool_test.go Resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Comment thread mempool/app_mempool.go Resolved
Comment thread mempool/app_mempool.go Resolved
Comment thread mempool/app_mempool.go Resolved
@swift1337

Copy link
Copy Markdown
Member Author

@greptile review

Comment thread mempool/app_mempool.go Resolved
Comment thread internal/guard/guard.go Resolved
Comment thread mempool/app_mempool.go Resolved
Comment thread internal/guard/guard.go Resolved
Comment thread internal/guard/guard.go Resolved
@swift1337
swift1337 enabled auto-merge April 22, 2026 21:16
@swift1337
swift1337 added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit b523a65 Apr 22, 2026
34 checks passed
@swift1337
swift1337 deleted the fix/check-tx-unguard branch April 22, 2026 21:33
@mattac21

mattac21 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

@mergify backport to v0.39.x

@mergify

mergify Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

backport to v0.39.x

❌ No backport have been created

Details
  • Backport to branch to failed

GitHub error: Branch not found

Cherry-pick of b523a65 has failed:

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

You are currently cherry-picking commit b523a65f.
  (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:
	modified:   config/config.go
	modified:   config/toml.go
	new file:   internal/guard/guard.go
	new file:   internal/guard/guard_test.go
	modified:   mempool/app_mempool.go
	modified:   mempool/app_mempool_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   CHANGELOG.md

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

JayT106 added a commit to crypto-org-chain/cometbft that referenced this pull request May 27, 2026
* fix(blocksync): prevent maxPeerHeight poisoning (cometbft#5803)

(cherry picked from commit a7e53f0)

* chore(execution, state): height validation (cometbft#5804)

Improves height validation in state and execution.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 4c067e2)

* fix(lp2p): reactor panic recovery (backport cometbft#5816) (cometbft#5817)

Closes STACK-2679

---

#### 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#5816 done by
[Mergify](https://mergify.com).

Co-authored-by: Dmitry S <[email protected]>

* build(deps): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (backport cometbft#5823) (cometbft#5824)

Bumps
[github.com/Masterminds/semver/v3](https://github.com/Masterminds/semver)
from 3.4.0 to 3.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Masterminds/semver/releases">github.com/Masterminds/semver/v3's
releases</a>.</em></p>
<blockquote>
<h2>v3.5.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Adding more prerelease tests by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/273">Masterminds/semver#273</a></li>
<li>Update constraint error messages by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/278">Masterminds/semver#278</a></li>
<li>Fix edge cases by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/279">Masterminds/semver#279</a></li>
<li>Adding some checks in by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/280">Masterminds/semver#280</a></li>
<li>Updating deps by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/281">Masterminds/semver#281</a></li>
<li>Bump github/codeql-action from 4.35.1 to 4.35.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/282">Masterminds/semver#282</a></li>
<li>Bump actions/cache from 4.2.3 to 5.0.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/283">Masterminds/semver#283</a></li>
<li>Bump golangci/golangci-lint-action from 7.0.1 to 9.2.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/284">Masterminds/semver#284</a></li>
<li>Updating gitignore for devcontainers by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/286">Masterminds/semver#286</a></li>
<li>Fixing some quality issues by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/287">Masterminds/semver#287</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
made their first contribution in <a
href="https://redirect.github.com/Masterminds/semver/pull/282">Masterminds/semver#282</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0">https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Masterminds/semver/blob/master/CHANGELOG.md">github.com/Masterminds/semver/v3's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Masterminds/semver/commit/8b89c86cb53c57cfd5d07c13de12bc4d78954e99"><code>8b89c86</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/287">#287</a>
from mattfarina/fix-da-issues</li>
<li><a
href="https://github.com/Masterminds/semver/commit/29d51d0ea4bffe39173673685d0dd312447d74a7"><code>29d51d0</code></a>
Fixing some quality issues</li>
<li><a
href="https://github.com/Masterminds/semver/commit/87f651dbe2f616342d6408b997ad7116ba72ddf3"><code>87f651d</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/286">#286</a>
from mattfarina/update-devcontainer</li>
<li><a
href="https://github.com/Masterminds/semver/commit/158a6852a7e66d99594653227d3e8c3dc6d160ca"><code>158a685</code></a>
Updating gitignore for devcontainers</li>
<li><a
href="https://github.com/Masterminds/semver/commit/7e83c080cfb4455752c654805b189274a10890ab"><code>7e83c08</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/284">#284</a>
from Masterminds/dependabot/github_actions/golangci/g...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/697e27f32e7419eb896e7d3ec680c65fc673166b"><code>697e27f</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/283">#283</a>
from Masterminds/dependabot/github_actions/actions/ca...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/1591f8e3806198f60fa4dcaf2751bfc805c7740d"><code>1591f8e</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/282">#282</a>
from Masterminds/dependabot/github_actions/github/cod...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/3f5ff1737a28437e536d3ec54e41919577748ae6"><code>3f5ff17</code></a>
Bump golangci/golangci-lint-action from 7.0.1 to 9.2.0</li>
<li><a
href="https://github.com/Masterminds/semver/commit/04baa3376047b6d5e79ffcc60f69332dd3e26c85"><code>04baa33</code></a>
Bump actions/cache from 4.2.3 to 5.0.5</li>
<li><a
href="https://github.com/Masterminds/semver/commit/45939fec77cd7d07d586b823284d11423028e9c2"><code>45939fe</code></a>
Bump github/codeql-action from 4.35.1 to 4.35.2</li>
<li>Additional commits viewable in <a
href="https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/Masterminds/semver/v3&package-manager=go_modules&previous-version=3.4.0&new-version=3.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details><hr>This is an automatic backport of pull request cometbft#5823 done
by [Mergify](https://mergify.com).

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): Bump github.com/Masterminds/semver/v3 from 3.4.0 to 3.5.0 (backport cometbft#5823) (cometbft#5824)

Bumps
[github.com/Masterminds/semver/v3](https://github.com/Masterminds/semver)
from 3.4.0 to 3.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Masterminds/semver/releases">github.com/Masterminds/semver/v3's
releases</a>.</em></p>
<blockquote>
<h2>v3.5.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Adding more prerelease tests by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/273">Masterminds/semver#273</a></li>
<li>Update constraint error messages by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/278">Masterminds/semver#278</a></li>
<li>Fix edge cases by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/279">Masterminds/semver#279</a></li>
<li>Adding some checks in by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/280">Masterminds/semver#280</a></li>
<li>Updating deps by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/281">Masterminds/semver#281</a></li>
<li>Bump github/codeql-action from 4.35.1 to 4.35.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/282">Masterminds/semver#282</a></li>
<li>Bump actions/cache from 4.2.3 to 5.0.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/283">Masterminds/semver#283</a></li>
<li>Bump golangci/golangci-lint-action from 7.0.1 to 9.2.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/Masterminds/semver/pull/284">Masterminds/semver#284</a></li>
<li>Updating gitignore for devcontainers by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/286">Masterminds/semver#286</a></li>
<li>Fixing some quality issues by <a
href="https://github.com/mattfarina"><code>@​mattfarina</code></a> in <a
href="https://redirect.github.com/Masterminds/semver/pull/287">Masterminds/semver#287</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
made their first contribution in <a
href="https://redirect.github.com/Masterminds/semver/pull/282">Masterminds/semver#282</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0">https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Masterminds/semver/blob/master/CHANGELOG.md">github.com/Masterminds/semver/v3's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Masterminds/semver/commit/8b89c86cb53c57cfd5d07c13de12bc4d78954e99"><code>8b89c86</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/287">#287</a>
from mattfarina/fix-da-issues</li>
<li><a
href="https://github.com/Masterminds/semver/commit/29d51d0ea4bffe39173673685d0dd312447d74a7"><code>29d51d0</code></a>
Fixing some quality issues</li>
<li><a
href="https://github.com/Masterminds/semver/commit/87f651dbe2f616342d6408b997ad7116ba72ddf3"><code>87f651d</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/286">#286</a>
from mattfarina/update-devcontainer</li>
<li><a
href="https://github.com/Masterminds/semver/commit/158a6852a7e66d99594653227d3e8c3dc6d160ca"><code>158a685</code></a>
Updating gitignore for devcontainers</li>
<li><a
href="https://github.com/Masterminds/semver/commit/7e83c080cfb4455752c654805b189274a10890ab"><code>7e83c08</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/284">#284</a>
from Masterminds/dependabot/github_actions/golangci/g...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/697e27f32e7419eb896e7d3ec680c65fc673166b"><code>697e27f</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/283">#283</a>
from Masterminds/dependabot/github_actions/actions/ca...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/1591f8e3806198f60fa4dcaf2751bfc805c7740d"><code>1591f8e</code></a>
Merge pull request <a
href="https://redirect.github.com/Masterminds/semver/issues/282">#282</a>
from Masterminds/dependabot/github_actions/github/cod...</li>
<li><a
href="https://github.com/Masterminds/semver/commit/3f5ff1737a28437e536d3ec54e41919577748ae6"><code>3f5ff17</code></a>
Bump golangci/golangci-lint-action from 7.0.1 to 9.2.0</li>
<li><a
href="https://github.com/Masterminds/semver/commit/04baa3376047b6d5e79ffcc60f69332dd3e26c85"><code>04baa33</code></a>
Bump actions/cache from 4.2.3 to 5.0.5</li>
<li><a
href="https://github.com/Masterminds/semver/commit/45939fec77cd7d07d586b823284d11423028e9c2"><code>45939fe</code></a>
Bump github/codeql-action from 4.35.1 to 4.35.2</li>
<li>Additional commits viewable in <a
href="https://github.com/Masterminds/semver/compare/v3.4.0...v3.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/Masterminds/semver/v3&package-manager=go_modules&previous-version=3.4.0&new-version=3.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details><hr>This is an automatic backport of pull request cometbft#5823 done
by [Mergify](https://mergify.com).

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(light): stop witness comparison after divergence checks (backport cometbft#5820) (cometbft#5825)

Return immediately when a witness reports conflicting headers or
proposer-priority divergence so the detector cannot treat a mismatch as
a valid match. Add a detector test that keeps header hashes equal while
diverging proposer priorities to verify ErrProposerPrioritiesDiverge is
returned.

---

#### PR checklist

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

Co-authored-by: JayT106 <[email protected]>
Co-authored-by: Matt Acciai <[email protected]>

* perf(consensus): skip fsync for unsigned internal messages (block parts) (cometbft#5695)

## Summary

- Skip `fsync` (`WriteSync`) for `BlockPartMessage` in the consensus
WAL's `receiveRoutine`, using buffered `Write` instead
- Only signed messages (`VoteMessage`, `ProposalMessage`) retain
`WriteSync` for double-signing prevention
- Adds explicit type-switch with `default: panic` to prevent future
signed message types from silently bypassing fsync
- Replaces stale TODO in `replay_test.go` with documentation of the
selective-fsync approach

## Safety analysis

**Why signed messages MUST keep `WriteSync`:**
- Pre-sign `FlushAndSync` ensures WAL replay reaches the same
deterministic state
- Post-sign `WriteSync` ensures the signed message is durable before
`handleMsg` processes/broadcasts it
- Without this, crash-replay could re-sign a different vote →
equivocation

**Why `BlockPartMessage` can safely use `Write`:**
1. Block parts are unsigned data chunks derived from the proposal block
2. On crash: proposal exists (fsynced), some block parts may be missing
→ round times out → consensus proceeds
3. The periodic 2-second WAL flush (`processFlushTicks`) eventually
flushes them
4. Any subsequent `WriteSync` (vote) or `FlushAndSync` (pre-sign) also
flushes buffered block parts
5. `EndHeightMessage` uses `WriteSync`, which flushes ALL buffered
writes before the end marker

**Defensive measures:**
- Explicit `case *BlockPartMessage` (not `default`) ensures new message
types panic rather than silently bypassing fsync
- `default: panic("unexpected internal message type")` with SAFETY
comment for future maintainers
- WAL `Write` failure panics (matches `WriteSync` behavior) since write
errors indicate disk failure

## Benchmark results (Apple M1 Max SSD)

```
BenchmarkWALWrite-10          ~1μs/op     1680 B/op    13 allocs/op
BenchmarkWALWriteSync-10      ~4.4ms/op   1680 B/op    13 allocs/op

BenchmarkWALRoundSimulation/AllWriteSync-10       ~233ms/round
BenchmarkWALRoundSimulation/SelectiveFsync-10     ~9.3ms/round  (~25x faster)
```

---

#### PR checklist

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

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
(cherry picked from commit 62a15e7)

* fix(abci): prevent panic on unlock in socket server panic recovery (cometbft#5593)

---

#### PR checklist
Fix a bug in handleRequests where the panic recovery defer function
would attempt to unlock appMtx even when the lock was never acquired.
- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: Alex | Cosmos Labs <[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 320e79e)

* changelog

* changelog

* chore(v0.39.2): restore Krakatoa app mempool and finalize changelog (cometbft#5827)

## Summary
- Cherry-pick Krakatoa restoration commit `f4a9ba936` into
`chore/0.39.2-prep`, restoring app mempool/reactor flow and related
ABCI/proxy/config wiring.
- Reintroduce app-mempool e2e fixtures and proto/generated ABCI updates
required for the restored flow.
- Finalize `v0.39.2` release notes in `CHANGELOG.md` while keeping
existing backport entries (`cometbft#5803`, `cometbft#5804`, `cometbft#5816`, `cometbft#5820`, `cometbft#5823`).

## Test plan
- [x] `go test ./abci/... ./mempool/... ./proxy/... ./config/...`
- [x] `make proto-gen`
- [x] `make proto-lint`

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Eric Warehime <[email protected]>
Co-authored-by: mattac21 <[email protected]>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(mempool): allow CheckTx retries (backport cometbft#5802) (cometbft#5832)

Backport cometbft#5802

Closes STACK-2402

* fix(mempool): allow CheckTx retries (backport cometbft#5802) #2 (cometbft#5833)

---

#### PR checklist

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

* build(deps): Bump github.com/lib/pq from 1.11.2 to 1.12.0 (backport cometbft#5713) (cometbft#5723)

Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.11.2 to
1.12.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/lib/pq/releases">github.com/lib/pq's
releases</a>.</em></p>
<blockquote>
<h2>v1.12.0</h2>
<ul>
<li>
<p>The next release may change the default sslmode from
<code>require</code> to <code>prefer</code>. See <a
href="https://redirect.github.com/lib/pq/issues/1271">#1271</a> for
details.</p>
</li>
<li>
<p><code>CopyIn()</code> and <code>CopyInToSchema()</code> have been
marked as deprecated. These are simple query builders and not needed for
<code>COPY [..] FROM STDIN</code> support (which is <em>not</em>
deprecated). (<a
href="https://redirect.github.com/lib/pq/issues/1279">#1279</a>)</p>
<pre><code>// Old
tx.Prepare(CopyIn(&quot;temp&quot;, &quot;num&quot;, &quot;text&quot;,
&quot;blob&quot;, &quot;nothing&quot;))
<p>// Replacement
tx.Prepare(<code>copy temp (num, text, blob, nothing) from stdin</code>)
</code></pre></p>
</li>
</ul>
<h3>Features</h3>
<ul>
<li>
<p>Support protocol 3.2, and the <code>min_protocol_version</code> and
<code>max_protocol_version</code> DSN parameters (<a
href="https://redirect.github.com/lib/pq/issues/1258">#1258</a>).</p>
</li>
<li>
<p>Support <code>sslmode=prefer</code> and <code>sslmode=allow</code>
(<a
href="https://redirect.github.com/lib/pq/issues/1270">#1270</a>).</p>
</li>
<li>
<p>Support <code>ssl_min_protocol_version</code> and
<code>ssl_max_protocol_version</code> (<a
href="https://redirect.github.com/lib/pq/issues/1277">#1277</a>).</p>
</li>
<li>
<p>Support connection service file to load connection details (<a
href="https://redirect.github.com/lib/pq/issues/1285">#1285</a>).</p>
</li>
<li>
<p>Support <code>sslrootcert=system</code> and use
<code>~/.postgresql/root.crt</code> as the default value of sslrootcert
(<a href="https://redirect.github.com/lib/pq/issues/1280">#1280</a>, <a
href="https://redirect.github.com/lib/pq/issues/1281">#1281</a>).</p>
</li>
<li>
<p>Add a new <code>pqerror</code> package with PostgreSQL error codes
(<a
href="https://redirect.github.com/lib/pq/issues/1275">#1275</a>).</p>
<p>For example, to test if an error is a UNIQUE constraint
violation:</p>
<pre><code>if pqErr, ok :=
errors.AsType[*pq.Error](https://github.com/lib/pq/blob/HEAD/err); ok
&amp;&amp; pqErr.Code == pqerror.UniqueViolation {
    log.Fatalf(&quot;email %q already exsts&quot;, email)
}
</code></pre>
<p>To make this a bit more convenient, it also adds a
<code>pq.As()</code> function:</p>
<pre><code>pqErr := pq.As(err, pqerror.UniqueViolation)
if pqErr != nil {
    log.Fatalf(&quot;email %q already exsts&quot;, email)
}
</code></pre>
</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>
<p>Fix SSL key permission check to allow modes stricter than 0600/0640
(<a
href="https://redirect.github.com/lib/pq/issues/1265">#1265</a>).</p>
</li>
<li>
<p>Fix Hstore to work with binary parameters (<a
href="https://redirect.github.com/lib/pq/issues/1278">#1278</a>).</p>
</li>
<li>
<p>Clearer error when starting a new query while pq is still processing
another query (<a
href="https://redirect.github.com/lib/pq/issues/1272">#1272</a>).</p>
</li>
<li>
<p>Send intermediate CAs with client certificates, so they can be signed
by an intermediate CA (<a
href="https://redirect.github.com/lib/pq/issues/1267">#1267</a>).</p>
</li>
<li>
<p>Use <code>time.UTC</code> for UTC aliases such as
<code>Etc/UTC</code> (<a
href="https://redirect.github.com/lib/pq/issues/1283">#1283</a>).</p>
</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/lib/pq/blob/master/CHANGELOG.md">github.com/lib/pq's
changelog</a>.</em></p>
<blockquote>
<h2>v1.12.0 (2026-03-18)</h2>
<ul>
<li>
<p>The next release may change the default sslmode from
<code>require</code> to <code>prefer</code>.
See <a href="https://redirect.github.com/lib/pq/issues/1271">#1271</a>
for details.</p>
</li>
<li>
<p><code>CopyIn()</code> and <code>CopyInToSchema()</code> have been
marked as deprecated. These are
simple query builders and not needed for <code>COPY [..] FROM
STDIN</code> support (which
is <em>not</em> deprecated). (<a
href="https://redirect.github.com/lib/pq/issues/1279">#1279</a>)</p>
<pre><code>// Old
tx.Prepare(CopyIn(&quot;temp&quot;, &quot;num&quot;, &quot;text&quot;,
&quot;blob&quot;, &quot;nothing&quot;))
<p>// Replacement
tx.Prepare(<code>copy temp (num, text, blob, nothing) from stdin</code>)
</code></pre></p>
</li>
</ul>
<h3>Features</h3>
<ul>
<li>
<p>Support protocol 3.2, and the <code>min_protocol_version</code> and
<code>max_protocol_version</code> DSN parameters (<a
href="https://redirect.github.com/lib/pq/issues/1258">#1258</a>).</p>
</li>
<li>
<p>Support <code>sslmode=prefer</code> and <code>sslmode=allow</code>
(<a
href="https://redirect.github.com/lib/pq/issues/1270">#1270</a>).</p>
</li>
<li>
<p>Support <code>ssl_min_protocol_version</code> and
<code>ssl_max_protocol_version</code> (<a
href="https://redirect.github.com/lib/pq/issues/1277">#1277</a>).</p>
</li>
<li>
<p>Support connection service file to load connection details (<a
href="https://redirect.github.com/lib/pq/issues/1285">#1285</a>).</p>
</li>
<li>
<p>Support <code>sslrootcert=system</code> and use
<code>~/.postgresql/root.crt</code> as the default
value of sslrootcert (<a
href="https://redirect.github.com/lib/pq/issues/1280">#1280</a>, <a
href="https://redirect.github.com/lib/pq/issues/1281">#1281</a>).</p>
</li>
<li>
<p>Add a new <code>pqerror</code> package with PostgreSQL error codes
(<a
href="https://redirect.github.com/lib/pq/issues/1275">#1275</a>).</p>
<p>For example, to test if an error is a UNIQUE constraint
violation:</p>
<pre><code>if pqErr, ok :=
errors.AsType[*pq.Error](https://github.com/lib/pq/blob/master/err); ok
&amp;&amp; pqErr.Code == pqerror.UniqueViolation {
    log.Fatalf(&quot;email %q already exsts&quot;, email)
}
</code></pre>
<p>To make this a bit more convenient, it also adds a
<code>pq.As()</code> function:</p>
<pre><code>pqErr := pq.As(err, pqerror.UniqueViolation)
if pqErr != nil {
    log.Fatalf(&quot;email %q already exsts&quot;, email)
}
</code></pre>
</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>
<p>Fix SSL key permission check to allow modes stricter than <a
href="https://redirect.github.com/0600/0640/issues/0600">0600/06400600</a>
(<a
href="https://redirect.github.com/lib/pq/issues/1265">#1265</a>).</p>
</li>
<li>
<p>Fix Hstore to work with binary parameters (<a
href="https://redirect.github.com/lib/pq/issues/1278">#1278</a>).</p>
</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/lib/pq/commit/42ab0ff7c4b1b585fa6cd216a12a126715b5af06"><code>42ab0ff</code></a>
Change default sslmode from &quot;require&quot; to
&quot;prefer&quot;</li>
<li><a
href="https://github.com/lib/pq/commit/6d40f13cfefe5ae4b489404b45114ba03224947a"><code>6d40f13</code></a>
Release v1.12.0</li>
<li><a
href="https://github.com/lib/pq/commit/386fc0e764f82951e9706dd8e618fc416fb5fb2c"><code>386fc0e</code></a>
Document NULL behaviour with COPY</li>
<li><a
href="https://github.com/lib/pq/commit/a62682e9083edee5ffe2d3904e80c30aaaa0877f"><code>a62682e</code></a>
Better staticcheck cache 2</li>
<li><a
href="https://github.com/lib/pq/commit/87ee06c600347478cfef07ad31b5ea617008aee7"><code>87ee06c</code></a>
Better staticcheck cache</li>
<li><a
href="https://github.com/lib/pq/commit/09624587cd3d4b69cd4a1a3b403b544ec0ddb2f7"><code>0962458</code></a>
Rewrite tests to use pqerror, pq.As()</li>
<li><a
href="https://github.com/lib/pq/commit/0d209810a155b9b8a173ab6d5da332f8c6cbc2c9"><code>0d20981</code></a>
Don't move pq.Error to pqerror.Error</li>
<li><a
href="https://github.com/lib/pq/commit/433213859e656dfe7dbba17b2838839e03a43ca2"><code>4332138</code></a>
Add pqerror package</li>
<li><a
href="https://github.com/lib/pq/commit/620d6d50817f9c4dcbfcbfeadb12ec552b636bf3"><code>620d6d5</code></a>
Make tests run faster</li>
<li><a
href="https://github.com/lib/pq/commit/dc8ff5d519b00bfa67626e68ea1ff3fdde0cc1b2"><code>dc8ff5d</code></a>
Implement connection service file</li>
<li>Additional commits viewable in <a
href="https://github.com/lib/pq/compare/v1.11.2...v1.12.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/lib/pq&package-manager=go_modules&previous-version=1.11.2&new-version=1.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details><hr>This is an automatic backport of pull request cometbft#5713 done
by [Mergify](https://mergify.com).

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: aljo242 <[email protected]>
Co-authored-by: mattac21 <[email protected]>

* chore: changelog updates for release (cometbft#5836)

---

#### PR checklist

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

* test(consensus): fix flaky TestByzantinePrevoteEquivocation (backport cometbft#5814) (cometbft#5840)

## Summary
Fix the failing CI at
https://github.com/cometbft/cometbft/actions/runs/25421557069/job/74564693795?pr=5837

`TestByzantinePrevoteEquivocation` was sporadically timing out on CI
under the `-race` detector. The root cause was goroutine leaks:
subscriptions were created with `context.Background()`, so the
subscriber goroutines had no clean exit path when a block with evidence
never arrived — they blocked forever on `sub.Out()`, leaked across
tests, and exhausted resources on the runner.

## Changes

- Replace `for range sub.Out()` with a `select` that also handles
`sub.Canceled()`, so goroutines exit cleanly when the eventbus stops
during test cleanup
- Add `subErrCh` to surface unexpected subscription cancellation errors
instead of silently swallowing them

## Test plan

- [x] `go test ./consensus/... -run TestByzantinePrevoteEquivocation -v
-count=1` passes locally
- [x] CI passing<hr>This is an automatic backport of pull request cometbft#5814
done by [Mergify](https://mergify.com).

Co-authored-by: songgaoye <[email protected]>

* test(consensus): fix cs.GetRoundState deadlock after ensureNewProposal (backport cometbft#5815) (cometbft#5842)

The same deadlock pattern existed across multiple consensus tests in
`state_test.go`, `replay_test.go`, and `node_test.go`:

- The consensus goroutine holds `cs.mtx` while publishing a vote event
  and blocks until the test drains it.
- The test calls `cs.GetRoundState()` (which acquires `cs.mtx`) between
  receiving the proposal event and draining the vote channel.
- Both sides wait on each other until `go test -timeout` aborts the run.

**Fix:** make `ensureNewProposal` return the `types.BlockID` from the
`EventDataCompleteProposal` it already reads. All call sites that only
needed `ProposalBlock.Hash()` and `ProposalBlockParts.Header()` now use
`blockID.Hash` and `blockID.PartSetHeader` directly. For sites that need
the full `ProposalBlock` (e.g. `Time`, `Txs`) but only use it after
channel drains, `GetRoundState()` is deferred to after those drains.

**Files fixed:**
- `consensus/common_test.go`: `ensureNewProposal` now returns
`types.BlockID`
- `consensus/state_test.go`: 13 call sites fixed across 11 tests
- `consensus/replay_test.go`: 6 call sites fixed in
`setupChainWithChangingValidators`
- `node/node_test.go`: 4 tests fixed to not bind the hardcoded GRPC port
36658,
  preventing address-in-use failures when tests run in parallel

#### PR checklist

- [x] Tests written/updated
- [ ] 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#5815 done by
[Mergify](https://mergify.com).

Co-authored-by: songgaoye <[email protected]>

* fix(mempool): fix setRecheckFull/setDone race causing spurious ErrRecheckFull (backport cometbft#5837) (cometbft#5844)

* fix(blocksync): validate blocksync response sender and signature count (backport cometbft#5860) (cometbft#5862)

---

Adds additional validation to blocksync, ensuring _before response
unmarshalling_ that we have made a `BlockRequest` to the peer that is
sending us a `BlockResponse` recently, and also that the response
contains a valid amount of commit signatures (not > MaxVoteCount). To do
this preunmarshal validation, we have added a `MsgBytesFilter` interface
that `Reactors` can implement. Currently only `BLOCKSYNC` does. The
`FilterMsgBytes` function is called for both comet P2P and libp2p
implementations, inside of the `onReceive` function when setting up a
peer for comet p2p, and inside of `handleStream` for libp2p, just before
unmarshalling the message in both.

#### 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#5860 done by
[Mergify](https://mergify.com).

Co-authored-by: mattac21 <[email protected]>

* feat(consensus): additional validation for vote ext signatures (backport cometbft#5873) (cometbft#5876)

<hr>This is an automatic backport of pull request cometbft#5873 done by
[Mergify](https://mergify.com).

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: Alex | Cosmos Labs <[email protected]>

* test(types): clarify EventBusBufferCapacity test intent (cometbft#5886)

improves the test added in cometbft#5883:

- rename `cap` → `bufCap` (shadows the builtin `cap` function)
- add a comment explaining why the server is intentionally not started
(blocking is on the `s.cmds` channel level, not subscriber delivery)
- use `range bufCap` loop instead of hardcoded publish calls
- collapse final assertion to one line

---------

Co-authored-by: jay.tseng <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Vlad J <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Acciai <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: songgaoye <[email protected]>
Co-authored-by: Alex | Cosmos Labs <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Eric Warehime <[email protected]>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: songgaoye <[email protected]>
kevindharmawan pushed a commit to SeeMoReLab/cometbft that referenced this pull request Jul 30, 2026
Fixed a UX hiccup: `RPC.BroadcastTxSync()` calls `appMempool.CheckTx()`
that limited retries. With Krakatoa's mempool that meant you couldn't
resubmit a cosmos tx if your balance was low, for example.

This PR drops the tx hash from the "seen cache" after a delay, letting
you resubmit while still protecting the node from DoS.

Closes STACK-2402

---

#### PR checklist

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

2 participants