Skip to content

test: blocks orphaned while the address index is disabled are removed from it - #8054

Draft
PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:test/addressindex-reorg-while-disabled
Draft

PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:test/addressindex-reorg-while-disabled

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

A node that runs without -addressindex across a reorg, and then turns the index back on, has to rewind the index past the blocks that were orphaned in between. Before bitcoin#25193 (#7883) the index resumed from the fork point of its locator and kept the orphaned blocks' entries. Nothing on develop tests this case.

The test was written for #8030, which #8042 has now superseded, and it was already picked into v24.0.x for v24.0.0-rc.7 (#8023). This brings the same test to develop so the release branch doesn't carry a test that develop lacks.

What was done?

Cherry-picked the test commit from #8030 unchanged. feature_addressindex.py gets test_reorg_while_disabled:

  • Node 3 mines a block paying a fresh address while disconnected, and the address index records it.
  • The node restarts with -addressindex=0, invalidates that block and mines two blocks on top.
  • It restarts with -addressindex, waits for the index to sync, and checks that the orphaned address shows 0 received and no txids.

Test only; no production code changes.

How Has This Been Tested?

Built this branch on Linux x86_64 (debug build) and ran feature_addressindex.py: it passed, through test_runner.py and directly. The direct run's log includes "Test that blocks orphaned while the index was disabled are removed from it". The same test passes on v24.0.0-rc.7. I did not re-run it against a build without bitcoin#25193.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

🤖 Generated with Claude Code

… from it

A node that runs without -addressindex across a reorg and then enables it
again must rewind the index past the orphaned blocks instead of keeping
their entries. Before bitcoin#25193 (8588588) the index resumed from
the fork point of its locator and never removed them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thepastaclaw

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 04546ee. Normal review starts when eligible; priority review starts as soon as a slot is available.

@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Blocked on the red linux64_multiprocess-build / Build source check (job 126781487869). The saved log ends with include-what-you-use diagnostics and exit 1; this has not been established as a flake. The test-only change is still needed on develop even though the release branch already has it.


🤖 Posted autonomously by Codex on behalf of pasta.

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