Review report

bitcoin/bitcoin: PR #36540

1 minor finding · 3 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · Post-restart assertion races wallet resubmission

The functional test can observe 0 or 1 mempool entries after restart_node() because RPC readiness does not wait for wallet resubmission.

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

Details and suggested fix

restart_node() waits for RPC readiness and getmempoolinfo()['loaded'], not for wallet startup. RPC warmup ends before client->start() invokes StartWallets() and postInitProcess(), which submits the transactions individually. With -persistmempool=0, the initload thread can already set loaded after skipping the empty load path, so this assertion can observe an empty or partially repopulated mempool and fail intermittently. Keep the child txid returned by sendall and use self.wait_until(lambda: set(node.getrawmempool()) == {txid, child_txid}). A bounded wait still catches child-first submission because the restarted wallet's periodic resend timer is 12–36 hours away.


Optional improvements

Link

[suggestion] · Aged-transaction retention lacks regression coverage

The replacement tests do not check retention past the former 336-hour cutoff during admission or persistent reload.

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

Details and suggested fix

The deleted MiniWallet scenario crossed the parent's expiry threshold and submitted an independent transaction to trigger maintenance. The replacements use immediate RBF or a persistence-disabled wallet restart after only 36 hours, while mempool_persist.py reloads recent transactions. These scenarios would not distinguish a return of either age filter. Retain an age-independent version using a MiniWallet parent and child: advance mocktime beyond 336 hours, submit an independent transaction below the size limit, and check both entries and their original timestamps. Then restart with persistence enabled and the same advanced -mocktime, and check them again. Avoid wallet-owned transactions so wallet startup resubmission cannot mask a failed reload.


Link

[suggestion] · Single-pair restart weakens resubmission-order coverage

With one parent/child pair, the ordering test can pass through a favorable traversal even if insertion-order sorting is removed.

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

Details and suggested fix

The old scenario exercised ten different parent/child chains, but the replacement checks only one pair. mapWallet is a randomly salted unordered_map; if ResubmitWalletTransactions stopped sorting through WalletTxOrderComparator, a parent-first traversal could still satisfy this assertion. The long-chain restart in wallet_basic.py keeps persistence enabled, allowing mempool.dat to restore the chain independently. Create several independent parent/child chains from separate UTXOs before the existing -persistmempool=0 restart, then wait for all expected txids afterward. This strengthens the functional test without relying on numeric txid order, which does not control the salted traversal.


Link

[suggestion] · CTxMemPool overview still describes the removed time index

The class overview lists three indexed criteria even though mapTx now provides only txid and wtxid hash lookups.

Location: src/txmempool.h:226 (base).

Details and suggested fix

Removing entry_time leaves the overview's “3 criteria” statement and “time in mempool” bullet inaccurate. Entries still store timestamps, but the container no longer indexes them chronologically. Update the paragraph to describe the two hash lookup indexes and remove the time bullet.


Design and approach

Delivering the #33510 retention goal does not require skipping the one-major-release grace period in doc/developer-notes.md:1420-1441. Unless this option warrants an explicit exception, phase out -mempoolexpiry by disabling expiry by default while keeping it functional and deprecated for one release, so configured operators can adapt. This preserves the immediate default-policy benefit but delays the index memory saving and cleanup.

Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.