Skip to content

State of contract <contract name> is too large to be viewed #4343

@think-in-universe

Description

@think-in-universe

Describe the bug
As merged in the PR #4167 , now contract with large state cannot be viewed with RPC. That makes sense to improve performance and avoid attack.

Here we have a contract whose state's size is almost constant and is queryable until several days ago. We want to understand what has happened that caused the issue here. Is there any way to bypass the limit and view the latest state, so we can debug how the state was changed?

To Reproduce

Query the account state with prefix p.

http post https://rpc.testnet.near.org jsonrpc=2.0 id=dontcare method=query \
  params:='{
    "request_type": "view_state",
    "finality": "final",
    "account_id": "feiyu-dev.testnet",
    "prefix_base64": "cAo="
  }'

HTTP/1.1 200 OK
Alt-Svc: clear
Content-Length: 153
Via: 1.1 google
access-control-allow-origin: 
content-type: application/json
date: Mon, 31 May 2021 14:45:18 GMT

{
    "error": {
        "code": -32000,
        "data": "State of contract feiyu-dev.testnet is too large to be viewed",
        "message": "Server error"
    },
    "id": "dontcare",
    "jsonrpc": "2.0"
}

Expected behavior
We need some approach to debug why the state is too large to be viewed, since the state's size should be almost constant.

Version (please complete the following information):

  • testnet

Additional context
This issue blocks one feature of a DApp. We want to understand why the error happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions