neo-project / neo

NEO Smart Economy
MIT License
3.47k stars 1.03k forks source link

Integer size restriction in StdLib.jsonSerialize #2498

Open csmuller opened 3 years ago

csmuller commented 3 years ago

Summary or problem description I'm just curious what the rationale is behind the restriction of integers to max 2^53-1 when serializing to JSON? Specifically, the restriction became an issue when trying to json-serialize a UInt160 as an integer with StdLib.jsonSerialize(...).

Do you have any solution you want to propose? Depends on the answers to the above question. What about 2^160-1?

Neo Version

roman-khimov commented 3 years ago

In some way it comes from RFC 7159, but at the same time given our use case with lots of huge integers this limit is well, too limiting, see #2082 and nspcc-dev/neofs-node#122 also.