This is a follow-up PR to #18628. In addition to the hash-functions limit test introduced with commit https://github.com/bitcoin/bitcoin/pull/18628/commits/fa4c29bc1d2425f861845bae4f3816d9817e622a, 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).
Also fixes #18711 by changing the misbehaviour check on "filteradd without filterset" (introduced with #18544) below to also use the more commonly used assert_debug_log method.