Review report

bitcoin/bitcoin: PR #36540

1 minor finding · 3 suggestions

Findings

Link

[minor] · Wallet resend test races startup resubmission

With -persistmempool=0, RPC readiness does not wait for wallet resubmission, so the immediate assertion can observe zero or one transaction and fail intermittently.

Location: test/functional/wallet_resendwallettransactions.py:86 (head).

Details and suggested fix

restart_node() waits for RPC and getmempoolinfo()['loaded'], which tracks only the mempool-file load attempt. With persistence disabled, that attempt finishes independently of the wallet. RPC warmup ends before StartWallets() invokes postInitProcess(), and the wallet submits the parent and child separately, so this assertion can run before either submission or between them. Keep the child txid returned by sendall() and use self.wait_until(lambda: set(node.getrawmempool()) == {txid, child_txid}). This still detects child-first submission: the restart uses real time, periodic resend is 12 to 36 hours away, and no peers are connected. No CI occurrence was identified, so the failure frequency is unconfirmed.


Optional improvements

Link

[suggestion] · Expiry removal lacks a retention regression test

Deleting the expiry fixture leaves the removed runtime and mempool.dat age filters without a regression check for retaining otherwise acceptable transactions older than 336 hours.

Location: test/functional/mempool_expiry.py:79 (base).

Details and suggested fix

The replacement USDT case uses immediate RBF, the wallet case advances only 36 hours and disables persistence, and mempool_persist.py reloads recently created entries. Those assertions do not distinguish the new behavior from the old runtime expiry or loader cutoff. Retain a MiniWallet parent/child fixture well below -maxmempool, advance mocktime beyond the old 336-hour cutoff, submit an independent transaction to exercise LimitMempoolSize, and assert both txids and their original entry times remain. Then restart with persistence enabled and the advanced -mocktime supplied at startup, wait for loaded, and repeat the assertions. MiniWallet prevents wallet startup resubmission from masking a failed reload.


Link

[suggestion] · One dependency pair can miss a resubmission-order regression

The replacement samples one parent/child pair rather than ten, so a regression to unordered mapWallet iteration can still pass when that pair happens to be visited parent-first.

Location: test/functional/wallet_resendwallettransactions.py:83 (head).

Details and suggested fix

The -persistmempool=0 restart correctly isolates wallet resubmission, but mapWallet is an unordered map with a random salt. Removing the WalletTxOrderComparator sort would therefore still return both entries whenever this pair is visited parent-first. Create several independent parent/child pairs from separate UTXOs before the same restart, then wait for all expected txids. This restores the previous sampling breadth without additional restarts. It remains probabilistic; a deterministic unit test of submission order is another option.


Link

[suggestion] · Periodic recovery of an absent chain is no longer tested

The restart covers forced startup submission, not periodic recovery after eviction, and commit 323cd0c's claimed chain peer-inv check is absent.

Location: test/functional/wallet_resendwallettransactions.py:79 (head).

Details and suggested fix

The old case asserted that both transactions were absent before invoking the periodic resend scheduler. The replacement recovers them only through postInitProcess() with force=true and no broadcast. The remaining periodic inv checks use transactions already in the mempool, for which BroadcastTransaction skips admission and only reannounces. Although both modes share ResubmitWalletTransactions, a regression skipping absent transactions only with force=false could pass. Size-limit eviction still makes this recovery relevant. Add a periodic recovery case using size eviction, arranging fees and capacity so the unconfirmed chain can be admitted again. Satisfy the five-minute transaction-age condition, advance beyond the resend timer, run mockscheduler, and check both txids. Also update commit 323cd0c's description of checking chain rebroadcast via peer invs to match the actual coverage.


Coverage details