namada
namada copied to clipboard
Audit the codebase for erroneous usage of architecture dependent types
Values of type usize and many pointer types vary in representation, depending on the underlying architecture of the host system. During deterministic protocol steps, Namada shouldn't rely on expressions utilizing usize, unless we set an artificial upper limit on the values of these types. For instance, use u32::MAX as the max value of a usize; then, the access of index i of a vector v might look like &v[i & (u32::MAX as usize)].
This is important, to preserve the safety properties of the BFT system (i.e. each node executes the same sequence of steps).
We decided just to add a warning on non-64 bit systems for the time being.