Skip to content

P2P merkle validation test exits during collection without RC_P2P_SECRET #5511

@Youngboy1609

Description

@Youngboy1609

Summary

node/tests/test_epoch_proposal_merkle_validation.py imports rustchain_p2p_gossip before setting a test HMAC secret. Since rustchain_p2p_gossip.py now intentionally exits at import time when RC_P2P_SECRET is unset, this test file cannot be collected in a normal shell without that environment variable.

Reproduction

From a clean checkout with no RC_P2P_SECRET exported:

python -m pytest node\tests\test_epoch_proposal_merkle_validation.py -q

Current result:

SystemExit: [P2P] FATAL: RC_P2P_SECRET environment variable is not set or contains an insecure placeholder value.

No tests run because collection aborts while importing rustchain_p2p_gossip.

Expected behavior

The test should set a deterministic unit-test RC_P2P_SECRET before importing the P2P gossip module, matching the pattern used by nearby P2P tests such as test_p2p_endpoint_auth.py, test_p2p_gossip_routes.py, and test_p2p_vote_spoofing.py.

Bug bounty reference: #305

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions