Description
From my understanding of rfc9171, there isn't really a limit on the number of canonical blocks you can have. However, ION imposes a soft limit of around 255. This is because the block number is stored as a unsigned char in the ExtensionBlock struct, and selectBlkNumber similarly returns an unsigned char.
selectBlkNumber in particular could pose trouble if someone were to send a bundle containing a block number set to a multiple of 255. In that case, selectBlkNumber would return 0 due to rolling over after adding 1.
It's probably best to either impose a hard limit on the maximum block number, or store it as a uvast. According to the spec, the block number is simply for uniquely identifying blocks, so there is nothing stopping an implementation from starting their canonical block numbering from 2^64-1 instead of starting from 2 like ION does (0 and 1 are reserved for primary and payload blocks).