Page MenuHomePhabricator

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

Authored by PiRK on Jan 18 2021, 22:46.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC197d07192c8d: 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

Diff Detail