We need this to avoid collapse collisions. Example of such collapse described in https://github.com/nspcc-dev/neo-go/pull/2019#discussion_r689629704.
Size
Knowing serialized size of the node is useful for preallocating byte-slice in advance. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
We use them quite frequently (consider children for a new branch node) and it is better to get rid of unneeded allocations. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>