Parity version: 1.7.2-beta
OS & Version: Linux 64bit
Parity appears to violate the JSON RPC Standard defined here:
https://github.com/ethereum/wiki/wiki/JSON-RPC
When encoding QUANTITIES (integers, numbers): encode as hex, prefix with "0x", the most compact representation (slight exception: zero should be represented as "0x0").
Input:
{
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"4000000"
],
"id": 0,
"jsonrpc": "2.0"
}
Output:
0x45
Input:
{
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"4000000"
],
"id": 0,
"jsonrpc": "2.0"
}
Output:
WARNING: @{code=-32602; message=invalid argument 0: hex string without 0x prefix}
It seems that Parity is accepting raw integers (as string) where 4000000 is automatically being translated to "0x3d0900"
This could cause incompatibility between Geth and Parity nodes for developers if they don't test code on both clients thinking that other clients (such as Geth) would accept "4000000" when it does not.
@tomusdrw seems like it's time to remove the leniency we put in place last year when Geth was the one accepting misformatted parameters, not Parity.
Most helpful comment
@tomusdrw seems like it's time to remove the leniency we put in place last year when Geth was the one accepting misformatted parameters, not Parity.