near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.32k stars 622 forks source link

query.function_call Error when executing code on the Read RPC side #9702

Open gmilescu opened 1 year ago

gmilescu commented 1 year ago

When we making a request

   {
      "jsonrpc": "2.0",
      "id": "dontcare",
      "method": "query",
      "params": {
        "request_type": "call_function",
        "block_id": 100523214,
        "account_id": "ofpcore.near",
        "method_name": "get_stages_max_number",
        "args_base64": "eyJwcm9qZWN0X2lkIjogIjE2NjE5NDk3NjkxOTIifQ=="
      }
    }

From Read RPC we get

{
    "jsonrpc": "2.0",
    "error": {
"code": -32000,
"message": "Server error",
"data": "Function call returned an error: wasm execution failed with error: CompilationError(PrepareError(Deserialization))",
"name": "HANDLER_ERROR",
"cause": {
    "info": {
"block_hash": "74ENVfd6tHDCoKEfipcFWMDFyeJQR1EMX1J86oF2smtZ",
"block_height": 100523214,
"vm_error": "wasm execution failed with error: CompilationError(PrepareError(Deserialization))"
    },
    "name": "CONTRACT_EXECUTION_ERROR"
}
    },
    "id": "dontcare"
}

From NEAR RPC we get

{
    "jsonrpc": "2.0",
    "result": {
"block_hash": "74ENVfd6tHDCoKEfipcFWMDFyeJQR1EMX1J86oF2smtZ",
"block_height": 100523214,
"logs": [],
"result": [
    34,
    51,
    50,
    34
]
    },
    "id": "dontcare"
}

Need help from the nearcore team, perhaps someone can tell me what nuances may be involved in the execution of the contract_code.

cc Bohdan Khorolets

ND-607 created by None

gmilescu commented 1 year ago

Fired an issue in the repo for public visibility https://github.com/near/read-rpc/issues/115

by 61c24882bce5e000697cf541