You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the most part we only use BigInts where a protobuf definitions means we need to handle values encoded as 64 bit numbers - we cannot use the js number type here because it can only handle integers up to 53 bits.
If the incoming message specifies things as 64 numbers I think we need to support the full range otherwise we could open ourselves up to attack or introduce unpredictable behaviour since js nodes will act differently compared to other implementations based on the data they are sent.
I think it depends on the field. For example, in ChainSafe/js-libp2p-gossipsub#327 we are looking at decoding the backoff field in the prune control message as a number. The backoff field is the time in seconds to wait before re-grafting. If a huge backoff value is provided, it doesn't really matter if we wait 2 ** 53 + 5 or 2 ** 53 + 1 seconds because we'll all be dead anyways.
This is the impetus for this issue. Inspect which uses of bigint are needed in practical terms.
Inspired by ChainSafe/lodestar#5892 and ipfs/protons#112
cc: @wemeetagain
The text was updated successfully, but these errors were encountered: