HomePhabricator

Merge #12861: [tests] Stop feature_block.py from blowing up memory.

Description

Merge #12861: [tests] Stop feature_block.py from blowing up memory.

Summary:
PR12861 backport https://github.com/bitcoin/bitcoin/pull/12861/files
89fe5feea2 [tests] Stop feature_block.py from blowing up memory. (John Newbery)

Pull request description:

The new P2PDataStore class was sending full blocks in headers messages,
which meant that calls to send_blocks_and_test() would blow up memory if
called with a large number of blocks. Fix that by only sending headers
in headers messages.

This means that python should use just over 1GB for feature_block.py (with bitcoind also using just over 1GB). That's the same as before the feature_block.py refactor.

Backporter note: our feature_block.py isn't updated to use this yet, so we
don't have the bug. But it's good to bring this fix in now.

Depends on D3494

Test Plan: test_runner.py

Reviewers: deadalnix, jasonbcox, Fabien, #bitcoin_abc

Reviewed By: jasonbcox, #bitcoin_abc

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