HomePhabricator

test: add further BIP37 size limit checks to p2p_filter.py

Description

test: add further BIP37 size limit checks to p2p_filter.py

Summary:

This is a follow-up PR to PR18628 (D8929). In addition to the hash-functions limit test introduced with commit fa4c29b, it adds checks for the following size limits as defined in BIP37:

ad message type filterload:

The filter itself is simply a bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.

ad message type filteradd:

The data field must be smaller than or equal to 520 bytes in size (the maximum size of any potentially matched object).

Also introduces new constants for the limits (or reuses the max script size constant in case for the filteradd limit).

This is a backport of Core PR18672
Depends on D8949

Test Plan: ninja && test/functional/test_runner.py p2p_filter

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Jan 19 2021, 08:59
PiRKCommitted on Jan 19 2021, 08:59
abc-botPushed on Jan 19 2021, 09:05
Reviewer
Restricted Project
Differential Revision
D8950: test: add further BIP37 size limit checks to p2p_filter.py
Parents
rABC2e6177c0ef87: net: limit BIP37 filter lifespan (active between 'filterload'..'filterclear')
Branches
Unknown
Tags
Unknown