AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge ElementsProject/elements#1576: Fix intermittent failure in feature_pegin_subsidy.py

Public commit record

What the developer wrote

Authored by merge-script

96/100 · Strong
Merge ElementsProject/elements#1576: Fix intermittent failure in feature_pegin_subsidy.py

45fd28fca72b19fcc2db9d5fa013aee16febf75b test: fix fedpeg test to work with bitcoind parent (Byron Hambly)
22bb277474e10d02a2a30ad0d02ab03f59762b23 test: fix pegin subsidy test to work with bitcoind parent (Byron Hambly)
c6692e16c724ce3854b9c34fb49c86e7a7d44ab5 Fix intermittent failure in feature_pegin_subsidy.py (Tom Trevethan)

Pull request description:

feature_pegin_subsidy.py has several assertions comparing the burn subsidy against hardcoded constants assumed fixed-length witness (t * 72 bytes per signature), but the actual subsidy is computed by the node from the parent-chain deposit transaction's real fee and vsize. DER-signature lengths on the parent-chain transaction vary by a byte or two causing a rare intermittent failure.

Replaced hardcoded subsidy values with a Python function that replicates `CheckPeginSubsidyAndMinimum`'s computation.

ACKs for top commit:
delta1:
ACK 45fd28fca72b19fcc2db9d5fa013aee16febf75b; tested locally

Tree-SHA512: 2d193f8617aa0812f3fa2fce18369e893658d2d81c0bf6063de3b4543b211ac17f9e518ac4598cd39cac8cda0423da52a23ea3dd64705116d0f8966e6368b3d5
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit only updates test scripts to fix flaky automated tests. It changes how test code calculates expected pegin subsidy values and how test nodes bind to network ports when using Bitcoin Core as a parent chain. No production node code is modified, so this does not create or fix any security vulnerability in the Elements software itself.

Recommended action

No security action required. Treat as a normal test reliability improvement. Reviewers may optionally verify the Python helper compute_expected_subsidy accurately reflects the C++ CheckPeginSubsidyAndMinimum implementation to ensure the test remains meaningful.

Security signals we found

01

No changes to production source code

02

Changes limited to test/functional/ Python test scripts

03

Test assertion hardening: dynamic subsidy computation instead of hardcoded constants

04

Test network setup hardening: explicit bind addresses to prevent port collisions

05

No cryptographic, consensus, or RPC behavior changes in node code

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.