ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.18k stars 290 forks source link

Numbers design decision #94

Closed GregTheGreek closed 5 years ago

GregTheGreek commented 5 years ago

As per our discussion on 08/02/19 with @JonathanLorimer @wemeetagain @GregTheGreek @ansermino

We have decided to temporarily take focus off of fixed-size-number-ts and explore using big numbers.

We could utilize javascript number api for everything under 2**53 - 1 (i.e uint8, uint16, ....).

Any notes I missed please add them.

tynes commented 5 years ago

Node.js LTS has added BigInts [1], they are seeing some usage in Handshake [2]. Might be useful for the BLS Signatures

[1] https://developers.google.com/web/updates/2018/05/bigint [2] https://github.com/handshake-org/goosig/blob/master/lib/js/bigmath.js

wemeetagain commented 5 years ago

@tynes Thanks for the heads up! I think we'd love to use native BigInts if possible, though it may take us a while to migrate in that direction. Some thoughts in no particular order:

tynes commented 5 years ago

Thanks for sharing all of this! We have a bunch of good JS tools over here at bcoin/handshake and I'm rooting for y'all and looking for ways to collaborate when it makes sense