Closed justmoon closed 5 years ago
Even for those totals we could theoretically wrap them in a class that uses long until it exceeds 64 bits and then switched to bignum
I think it would be totally reasonable to cap our STREAM reference implementation at UInt64. For reference, that would introduce a limit of $18.4 billion at nanodollar resolution. So I wouldn't edit the spec to say that STREAM - the protocol - has a cap of UInt64 but we may want to add a note that some implementations may have a cap.
If you are actually going to send that kind of money over STREAM, I would hope you'd be using a more enterprise-y implementation than the JavaScript reference one anyway.
cc/ @sentientwaffle @emschwartz
Updated to latest
oer-utils
with improved performance.Did a quick benchmark of bignumber.js vs long. Long is ~33 times faster:
This also allows us removing
bignumber.js
as a dependency ofilp-packet
. Obviously, it' still an indirect dependency viaoer-utils
but it isn't used at all for (de)serializing ilp-packets. It might be worth making anoer-utils-light
which doesn't depend on bignumber.js at all. I don't think anything in ILP actually needs support for >64 bit numbers.Edit: Updated the benchmark to add deserialization. About 10x difference.