Open john-g-g opened 6 years ago
FYI if you try to send anything larger than 9007199254740991
to any of our node.js services they will throw an error
The ID field in FC's jsonrpc parser is known to be buggy. (#216)
That was one of the big motivations for replacing it with the jsonrpc plugin in appbase. I will not be fixing any problems with master
and only appbase
.
A bit more descriptive bug report for appbase is the ID field returns the incorrect type for IDs greater than 2^32 - 1.
I did some debugging and the type parsing in the jsonrpc plugin is working correctly for 2^32. It correctly identifies and stores that value as a uint64. However, it serializes as a string.
When I did an idump
of 2^32 it logged as an int. Which leads me to believe there is something in the json parser that is causing the value to be written as a string.
steemd
When the value of a JSONRPC request id exceeds the max value of an int64 but is less than the max value of a uint64, the JSONRPC response id value is incorrectly cast as an int64, probably here: https://github.com/steemit/fc/blob/master/src/rpc/json_connection.cpp#L150
id < max int64 : id is correct value but incorrect type, should be int not string
max int64 < id < max uint64: incorrect id value, correct id type
max int64 < id < max uint64: incorrect value, correct id type
id > max uint64: no id value
appbase
id < max uint64: id is correct value but incorrect type, should be int not string