Skip to content

Conversation

@bowenwang1996
Copy link
Collaborator

Fixes #3950.

Test plan

  • test_view_state_too_large
  • Nayduck


impl TrieViewer {
/// Upper bound of the size of contract state that is still viewable.
const CONTRACT_STATE_SIZE_LIMIT: u64 = 50_000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How complicated is it to be exposed via the config.json file, so we can recommend people to run their own RPC node with the limit bumped to the values they feel is necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it is related to the jsonrpc timeout (which is currently hardcoded). We need to refactor that part as well :(

@frol frol changed the title fix(rpc): state of large accounts cannot be viewed feat(rpc): viewing large contract state is now prohibted to avoid excessive resource consumption Mar 31, 2021
@frol frol added the automerge label Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject view_state JSON RPC requests for big accounts

6 participants