w3f / polkadot-spec

The Polkadot Protocol Specification
https://spec.polkadot.network
Creative Commons Attribution Share Alike 4.0 International
179 stars 70 forks source link

SCALE: Compact Encoding description needs to be modified #654

Closed bhargavbh closed 1 year ago

bhargavbh commented 1 year ago

In the Compact/ Length encoding Definition, for the case n>= 2^ 30, the value m should denote the length of the actual integer being encoded. Currently, m also counts the byte used for encoding length (= the first byte). With this change, the encoding can be used to represent number up to (2^(63+4)*8) -1 = (2^536) -1. The implementations already use this convention.