Open hanabi1224 opened 4 months ago
There's also an interesting case where Forest fails with deserialisation error:
❯ curl -s -X POST 127.0.0.1:2345/rpc/v1 \
-H 'Content-Type: application/json' \
--data '{"id": 4, "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"accessList": [], "data": "somedata", "from": "someaddress", "maxFeePerGas": "0x186a0", "maxPriorityFeePerGas": "0x186a0", "nonce": "0x25e2", "to": "someaddress", "type": "0x02"}]}'
{"jsonrpc":"2.0","id":4,"error":{"code":-32602,"message":"error deserializing parameter","data":{"error":"missing field `gas`","index":0,"name":"tx","type":"forest_filecoin::lotus_json::LotusJson<forest_filecoin::rpc::methods::eth::types::EthCallMessage>"}}}⏎
while Lotus fails on something else:
❯ curl -s -X POST 127.0.0.1:1234/rpc/v1 \
-H 'Content-Type: application/json' \
--data '{"id": 4, "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"accessList": [], "data": "somedata", "from": "someaddress", "maxFeePerGas": "0x186a0", "maxPriorityFeePerGas": "0x186a0", "nonce": "0x25e2", "to": "someaddress", "type": "0x02"}]}'
{"error":{"code":1,"message":"failed to estimate gas: message execution failed: exit 33, revert reason: 0xdd88982f, vm error: message failed with backtrace:\n00: f0134698 (method 3844450837) -- contract reverted (33)\n01: f0134698 (method 6) -- contract reverted (33)\n (RetCode=33)"},"id":4,"jsonrpc":"2.0"}
This might be related to the fact that this structure in Lotus gets deserialised first with some non-trivial logic behind it.
Note that the request might be malformed in some way.
Issue summary
Lotus
uses someFilecoin.EthCall
functionalities that have yet to be implemented inforest
to make the failure messages more user-friendly forFilecoin.EthEstimateGas
. We should close the gap onceFilecoin.EthCall
is implemented e.g.Other information and links