Open Serhy opened 4 months ago
So you asking of a regression - remove exact error why eth_call
cannot be performed and get empty result instead?
I have to admit now, @awskii that the issue might be more intentional behavior than a bug.
Essentially as I see it's about excluding gas by default in read-only eth_call method (i.e. when it's not specified explicitly).
That would align behavior with other clients I checked. Let me know if makes sense (then it would fall under 'improvement') or whether that's by design in Erigon.
0x result is also stated as wrong - 0 should be encoded as 0x0
Example where expected result is not wrong but 0
{
"method": "eth_call",
"params": [
{
"from": "0x5aAEB6B20d8EDD123c63aAa3Cf3c13F5969e630c",
"to": "0x3a0e542d1c1ac4b7593b00d262424f28456b7fd2",
"data": "0x2d0335ab0000000000000000000000005aAEB6B20d8EDD123c63aAa3Cf3c13F59F9e130c"
},
"latest"
],
"id": 1,
"jsonrpc": "2.0"
}
Expected result:
{
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000000000000",
"id": 1
}
Current result:
{
"jsonrpc": "2.0",
"id": 9,
"error": {
"code": -32000,
"message": "insufficient funds for gas * price + value: address 0x5aaEb6b20D8eDd123C63Aaa3Cf3C13f5969e630c have 0 want 350000000"
}
}
IMO it doesn't make sense for a "read-only" eth_call
to error out here because the from
account has no/not enough gas in their account.
We already have rpc.gascap to weed out max gas per RPC calls, and this is a departure from how other clients handle this.
We see this same issue on Polygon/Matic - if the from account has 0 MATIC the eth_calls error out, if you remove from
key it works as expected and returns a result.
System information
Erigon version:
./erigon --version
OS & Version: Windows/Linux/OSX Linux
Erigon Command (with flags/config):
Consensus Layer:
lighthouse:v5.1.0
Consensus Layer Command (with flags/config):Chain/Network: Gnosis Mainnet
Expected behaviour
Actual behaviour
Steps to reproduce the behaviour