Skip to content

test: do not tie the MNHF signal snapshot test to the number of deployments - #8150

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
knst:test-mnhf-signals-any-fork-count
Nov 14, 2026
Merged

PastaPastaPasta merged 1 commit into
dashpay:developfrom
knst:test-mnhf-signals-any-fork-count

Conversation

@knst

@knst knst commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

mnhf_signals_outnumbering_deployments_are_valid in evo_snapshot_tests.cpp builds four MNHF signals and requires that count to exceed Consensus::MAX_VERSION_BITS_DEPLOYMENTS. There are three deployments today, so the test fails with [4 <= 4] as soon as a fourth one is added, although nothing about the snapshot code changed. Discovered here: #8089 (comment)

What was done?

EvoSnapshot::Validate() bounds the signal map by VERSIONBITS_NUM_BITS only. The test now fills one signal for every version bit, which is the largest valid map whatever the number of deployments is, and no longer references the deployment enum.

How Has This Been Tested?

Changed test: evo_snapshot_tests/mnhf_signals_outnumbering_deployments_are_valid now validates, hashes and round-trips a snapshot whose signal map has VERSIONBITS_NUM_BITS entries.

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

…yments

mnhf_signals_outnumbering_deployments_are_valid built four signals and
required that to exceed MAX_VERSION_BITS_DEPLOYMENTS, so it fails as soon
as a fourth deployment is added.

EvoSnapshot::Validate() bounds the map by VERSIONBITS_NUM_BITS only. Fill
every version bit instead, which is the largest valid map whatever the
number of deployments is.

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mnhf_signals_outnumbering_deployments_are_valid test now adds one signal for every bit from 0 through VERSIONBITS_NUM_BITS - 1. It retains checks for validation, hashing, serialization, and round-trip preservation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: Minimal · up to 8bc95

This is a test-only change that keeps the snapshot test from breaking when the number of deployments changes. It has no production impact and no merge-blocking risk is apparent.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the MNHF signal snapshot test no longer depends on the number of deployments. It matches the raw summary, which describes the test filling one signal per version bit i…
Description check Passed The description explains the failing test, the cause (a fixed count of four signals compared against MAX_VERSION_BITS_DEPLOYMENTS), and the fix (one signal per VERSIONBITS_NUM_BITS entry). It matches …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the MNHF signal snapshot test no longer depends on the number of deployments. It matches the raw summary, which describes the test filling one signal per version bit instead of four signals and the deployment-count assertion.

Full details: Description check

Explanation

The description explains the failing test, the cause (a fixed count of four signals compared against MAX_VERSION_BITS_DEPLOYMENTS), and the fix (one signal per VERSIONBITS_NUM_BITS entry). It matches the raw summary and the PR objectives.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8cf690d2-9615-449d-9117-2e79da9a649c
Commits

Reviewing files that changed from the base of the PR and between 62f7069 and 8bc9594.

Files selected for processing: 1

  • src/test/evo_snapshot_tests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@PastaPastaPasta
PastaPastaPasta merged commit 3a6a621 into dashpay:develop Nov 14, 2026
39 of 40 checks passed
@knst
knst deleted the test-mnhf-signals-any-fork-count branch November 14, 2026 17:03
@thepastaclaw

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.

  • 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 8bc9594. Normal review starts when eligible; priority review starts as soon as a slot is available.

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.

3 participants