Repository navigation
test(chain): cover TxGraph::insert_anchor highest-height indexing - #2390
Open
evanlinjin wants to merge 1 commit into
Open
evanlinjin wants to merge 1 commit into
evanlinjin wants to merge 1 commit into
Conversation
3 of 4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2390 +/- ##
==========================================
+ Coverage 79.11% 79.71% +0.60%
==========================================
Files 31 31
Lines 6061 6148 +87
Branches 289 291 +2
==========================================
+ Hits 4795 4901 +106
+ Misses 1187 1176 -11
+ Partials 79 71 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
evanlinjin
force-pushed
the
dv/replace-2345
branch
from
October 18, 2026 12:39
8e81d9c to
ab40d6b
Compare
evanlinjin
marked this pull request as ready for review
October 18, 2026 12:50
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.
Description
Adds a regression test that
TxGraph::insert_anchorkeeps exactly onetxids_by_descending_anchor_heightentry per tx, at its highest anchor height, and that the index is rebuilt the same way from the changesets.The bug in #2344 (the index used the last anchor in the
BTreeSet, which wasn't necessarily the highest one) went away with #2299:Anchornow only hasanchor_block(), and itsOrdcompares theBlockIdfirst, so the last anchor is the highest. This test pins that down, usingConfirmationBlockTimes whose confirmation times aren't in height order, plus a second anchor at the same height.Unlike #2345, this is test-only: the original's code change is no longer in its diff after the rebase, and its
CanonicalTaskunit test covers the same ordering through a crate-private API.assert_eq!(recovered, graph)already compares the index (TxGraphderivesPartialEq), so the test doesn't need a separate check onrecovered.Replaces #2345
Fixes #2344
Changelog notice
None (test only).
Checklists
All Submissions:
🤖 Generated with Claude Code