Skip to content

pow: indexer blocks use powLimit even on regtest - #25

Open
Avecci-Claussen wants to merge 1 commit into
fractal-bitcoin:fractal-29.xfrom
Avecci-Claussen:fix/regtest-indexer-nbits
Open

Avecci-Claussen wants to merge 1 commit into
fractal-bitcoin:fractal-29.xfrom
Avecci-Claussen:fix/regtest-indexer-nbits

Conversation

@Avecci-Claussen

Copy link
Copy Markdown

In GetNextWorkRequired, the regtest no-retargeting shortcut
(fPowNoRetargeting → return previous nBits) was evaluated before the
indexer-block rule (return powLimit). On regtest, an indexer block
following a mined block would therefore be required to carry the previous
block's nBits instead of powLimit, contradicting the FIP-101 rule
that indexer blocks always use powLimit and breaking regtest setups
that mine indexer blocks after non-trivial-PoW blocks.

Reorder the checks so the indexer rule wins. Mainnet/testnet behavior is
unchanged (both checks only matter on regtest).

Test plan: pow_tests run (pre-existing Fractal DAA expectation
failures unchanged; no new failures).

GetNextWorkRequired checked fPowNoRetargeting before the indexer branch,
so on regtest an indexer block was required to carry the previous
block's nBits instead of powLimit, contradicting the indexer rule that
ContextualCheckBlockHeader expects and the documented behaviour. Move
the indexer check first. fPowNoRetargeting is only set on regtest, so
mainnet/testnet3 behaviour is unchanged.
@jiedo

jiedo commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for taking the time to review the code and submit these PRs. We appreciate the effort and suggestions. After consideration, we’ve decided not to move forward with these changes at this time, so we’ll be closing these PRs. Thank you for your understanding.

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