Skip to content

Bound catchup header targets by the configured network proof-of-work limit #1711

Description

@icellan

services/blockvalidation/catchup/header_validation.go:ValidateHeaderProofOfWork calls HasMetTargetDifficulty without a network-target bound. It is used by the live catchup header-validation path. Checking a hash against the target chosen in its own header does not establish that the declared target is permitted on the configured network.

Pass network parameters through the catchup validation entry points and enforce the network PoW limit before accepting header work or progressing to expensive processing. Keep the expected-difficulty schedule check separate: a network floor is necessary but does not replace that rule. Preserve the intended STN and regtest parameter behavior.

Acceptance: a synthetic header whose hash satisfies an easier-than-mainnet target is rejected on mainnet; the configured minimum is accepted where appropriate; malformed nBits still fails; test the live caller wiring as well as the helper. See also #1435 for the distinct accumulated-chainwork requirement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions