Describe the bug
MerkleBlockPayload doesn't check the limits of the expected values, in all of them the maximum values are Block.MaxTransactionsPerBlock. If we don't check this we can allocate more memory than expected.
To Reproduce
Steps to reproduce the behavior:
- Create a crafted MerkleBlockPayload with 16777216 Hashes (only the prefix, not the content)
- OnDeserialize it will allocate 16mb of items.
- It could produce a Deny of Service if a lot of nodes are doing the same at same time.
Expected behavior
Expect only MaxTransactionsPerBlock.
Describe the bug
MerkleBlockPayload doesn't check the limits of the expected values, in all of them the maximum values are
Block.MaxTransactionsPerBlock. If we don't check this we can allocate more memory than expected.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expect only
MaxTransactionsPerBlock.