SNS.yaml: string fields min max in bytes

In the SNS template there are various string fields expressed with limitation in bytes.

# URL to the dapp controlled by the SNS project.
# Must be a string from 10 to 512 bytes.
url: ~

# The title of the NNS proposal. Must be a string of 4 to 256 bytes.
title: ~

# The description of the proposal. Must be a string of 10 to 2,000 bytes.
summary: ~

Is it correct that the limitation is in bytes and not the number of characters?

If it is in bytes, can it be expressed in the number of characters for consistency reason (e.g. name and description are expressed in number of characters) and ease of understanding?

1 Like

The limitations are indeed in bytes, including for name and description. This means that name and description are misleadingly documented. I will make a PR to fix that later today. Expressing the limits in terms of characters would be more intuitive, but it is more complicated than it sounds due to the interaction between unicode’s definition of a character and the need to be able to place bounds on the size in memory of these fields.

I see, it makes sense but, a bit a pity from a consumer perspective. I’ll double check the documentation once updated that way I can update my validator accordingly if necessary.