namada icon indicating copy to clipboard operation
namada copied to clipboard

Audit the codebase for erroneous usage of architecture dependent types

Open sug0 opened this issue 3 years ago • 1 comments

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).

sug0 avatar Nov 25 '22 16:11 sug0

We decided just to add a warning on non-64 bit systems for the time being.

cwgoes avatar May 09 '24 14:05 cwgoes