HomePhabricator

[rpc] add unbroadcast info to mempool entries and getmempoolinfo

Description

[rpc] add unbroadcast info to mempool entries and getmempoolinfo

Summary:
a7ebe48b94c5a9195c8eabd193204c499cb4bfdb

  • expose info about number of txns in unbroadcast set and whether a mempool entry's tx has passed initial broadcast
  • makes rpcs more informative and allows for more explicit testing, eg tracking if tx is in unbroadcast set before and after originating node connects to peers (adds this in mempool_unbroadcast.py)
  • adds mempool method IsUnbroadcastTx to query for tx inclusion in mempool's unbroadcast set ------

651f1d816f054cb9c637f8a99c9360bba381ef58

  • mempool entry 'unbroadcast' field changes when tx passes initial broadcast (receive getdata), so anytime you compare mempool entries as a whole, you must wait for all broadcasts to complete ('unbroadcast' = False) otherwise the state may change in between calls
  • update P2PTxInvStore to send msg_getdata for invs and add functionality to wait for a list of txids to complete initial broadcast
  • make mempool_packages.py wait because it compares entries using getrawmempool and getmempoolentry ------

This is a backport of Core PR18895 [2/3]
https://github.com/bitcoin/bitcoin/pull/18895/commits/a7ebe48b94c5a9195c8eabd193204c499cb4bfdb
https://github.com/bitcoin/bitcoin/pull/18895/commits/651f1d816f054cb9c637f8a99c9360bba381ef58
Depends on D9023

Test Plan: ninja && test/functional/test_runner.py mempool_*

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9024

Details

Provenance
gzhao408 <gzhao408@berkeley.edu>Authored on Jan 22 2021, 09:41
PiRKCommitted on Jan 22 2021, 09:42
PiRKPushed on Jan 22 2021, 09:42
Reviewer
Restricted Project
Differential Revision
D9024: [rpc] add unbroadcast info to mempool entries and getmempoolinfo
Parents
rABC2666512cfb4d: wallet] remove nLastResend logic
Branches
Unknown
Tags
Unknown