Skip to content

Conversation

@kcalvinalvin
Copy link
Contributor

@kcalvinalvin kcalvinalvin commented Feb 2, 2025

The if statement in GetAncestor was quite hard to make sense of.
Simplifying it improves readability and the added test ensures that
the performance remains the same.

I'm not quite sure if the test makes sense to have but including it as
it's the code used to make sure no loss in performance was made.
Tested locally up to height 1<<29.

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 2, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31778.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK Chand-ra

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31835 (validation: set BLOCK_FAILED_CHILD correctly by stratospher)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

The if statement in GetAncestor was quite hard to make sense of.
Simplifying it improves readability and the added test ensures that the
performance remains the same.
@Chand-ra
Copy link

Chand-ra commented Mar 9, 2025

Concept ACK 5983f1
CBlockIndex::GetAncestor is easier to comprehend with this change, but I'm not sure if duplicating the two versions in test/blockchain_tests.cpp is the best way to test the change. A single test to verify GetAncestor agnostic of its implementation might be better?

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@DrahtBot
Copy link
Contributor

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@maflcko
Copy link
Member

maflcko commented Jul 21, 2025

Closing for now due to inactivity. Feel free to ask for this to be re-opened or you may open a fresh pull request, once you are working on this again.

@maflcko maflcko closed this Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants