Repository navigation
fix(light): stop witness comparison after divergence checks (backport #5820) - #5826
Merged
Merged
Conversation
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 --------- Co-authored-by: Matt Acciai <[email protected]> (cherry picked from commit 24e5aeb) # Conflicts: # CHANGELOG.md
Contributor
Author
|
Cherry-pick of 24e5aeb has failed: 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 |
Contributor
|
PR author is not in the allowed authors list. |
Pin golangci-lint to the repository's stable version and remove flaky assumptions in TestProvider so CI no longer fails on unrelated lint drift or timing-sensitive heights. Co-authored-by: Cursor <[email protected]>
mattac21
force-pushed
the
mergify/bp/v0.38.x/pr-5820
branch
from
May 4, 2026 19:19
75d3323 to
8a29516
Compare
mattac21
approved these changes
May 4, 2026
mattac21
enabled auto-merge
May 4, 2026 19:19
4 tasks
JayT106
added a commit
to crypto-org-chain/cometbft
that referenced
this pull request
Oct 5, 2026
Backport of the test change in upstream cometbft#5826; fast runners pass height 1000 before the assertions run.
JayT106
added a commit
to crypto-org-chain/cometbft
that referenced
this pull request
Oct 7, 2026
* perf(indexer): paginate tx search results before loading txs Sort and page matched txs by the height and index stored in event keys, so only the requested page is read from the store. The local RPC client now passes the caller's context to TxSearch and BlockSearch. * chore: add changelog entry * chore(ci): pin golangci-lint to v2.11.3 Matches upstream v0.38.x; @latest flags existing code with newer checks. * test(light): make TestProvider independent of chain height Backport of the test change in upstream cometbft#5826; fast runners pass height 1000 before the assertions run. * perf(indexer): cut per-match allocations in tx search Dedup matches by sorting instead of a set, keep the hash as a substring of the map key, and parse the event sequence without splitting the key. Peak heap for a 100k-match page-1 query drops from 96MB to 45MB. * chore: single changelog entry, paginated tx search benchmark * refactor(indexer): keep TxIndexer.Search, add optional PageSearcher Search keeps its v0.38 signature. The kv indexer also implements txindex.PageSearcher, which rpc/core uses when available and otherwise falls back to loading, sorting and slicing every match. * fix(indexer): guard page offset overflow in Paginate page comes from the request and is validated only after the search, so a huge page overflowed (page-1)*perPage and panicked when slicing. Also assert that the kv indexer built from config is a PageSearcher. * fixes and optimisation * chore: keep changelog entry to the PR title --------- Co-authored-by: Thomas Nguy <[email protected]>
JayT106
added a commit
to crypto-org-chain/cometbft
that referenced
this pull request
Nov 23, 2026
* perf(indexer): paginate tx search results before loading txs Sort and page matched txs by the height and index stored in event keys, so only the requested page is read from the store. The local RPC client now passes the caller's context to TxSearch and BlockSearch. * chore: add changelog entry * chore(ci): pin golangci-lint to v2.11.3 Matches upstream v0.38.x; @latest flags existing code with newer checks. * test(light): make TestProvider independent of chain height Backport of the test change in upstream cometbft#5826; fast runners pass height 1000 before the assertions run. * perf(indexer): cut per-match allocations in tx search Dedup matches by sorting instead of a set, keep the hash as a substring of the map key, and parse the event sequence without splitting the key. Peak heap for a 100k-match page-1 query drops from 96MB to 45MB. * chore: single changelog entry, paginated tx search benchmark * refactor(indexer): keep TxIndexer.Search, add optional PageSearcher Search keeps its v0.38 signature. The kv indexer also implements txindex.PageSearcher, which rpc/core uses when available and otherwise falls back to loading, sorting and slicing every match. * fix(indexer): guard page offset overflow in Paginate page comes from the request and is validated only after the search, so a huge page overflowed (page-1)*perPage and panicked when slicing. Also assert that the kv indexer built from config is a PageSearcher. * fixes and optimisation * chore: keep changelog entry to the PR title --------- Co-authored-by: Thomas Nguy <[email protected]> (cherry picked from commit 5cbc9c4) Port to v0.38.26: the golangci-lint pin and TestProvider fix are already upstream, so those hunks drop out; the changelog entry moves under a new UNRELEASED section.
JayT106
added a commit
to crypto-org-chain/cometbft
that referenced
this pull request
Nov 30, 2026
* perf(indexer): paginate tx search results before loading txs Sort and page matched txs by the height and index stored in event keys, so only the requested page is read from the store. The local RPC client now passes the caller's context to TxSearch and BlockSearch. * chore: add changelog entry * chore(ci): pin golangci-lint to v2.11.3 Matches upstream v0.38.x; @latest flags existing code with newer checks. * test(light): make TestProvider independent of chain height Backport of the test change in upstream cometbft#5826; fast runners pass height 1000 before the assertions run. * perf(indexer): cut per-match allocations in tx search Dedup matches by sorting instead of a set, keep the hash as a substring of the map key, and parse the event sequence without splitting the key. Peak heap for a 100k-match page-1 query drops from 96MB to 45MB. * chore: single changelog entry, paginated tx search benchmark * refactor(indexer): keep TxIndexer.Search, add optional PageSearcher Search keeps its v0.38 signature. The kv indexer also implements txindex.PageSearcher, which rpc/core uses when available and otherwise falls back to loading, sorting and slicing every match. * fix(indexer): guard page offset overflow in Paginate page comes from the request and is validated only after the search, so a huge page overflowed (page-1)*perPage and panicked when slicing. Also assert that the kv indexer built from config is a PageSearcher. * fixes and optimisation * chore: keep changelog entry to the PR title --------- Co-authored-by: Thomas Nguy <[email protected]> (cherry picked from commit 5cbc9c4) Port to v0.40.x: the golangci-lint pin and TestProvider fix are already upstream, so those hunks drop out.
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.
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
CHANGELOG.mddocs/orspec/) and code commentsThis is an automatic backport of pull request #5820 done by [Mergify](https://mergify.com).