Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
8 stars 0 forks source link

Limit response size of `GetSmartContract(Sub)State` #993

Closed JamesHinshelwood closed 1 month ago

JamesHinshelwood commented 3 months ago

Querying the state of large contracts on ZQ1 causes performance problems/crashes. Some contracts have a lot of state (~50 MiB).

Add configuration to limit the size of the response from these APIs. Default it to on at a sensible level (1 MiB?).

rrw-zilliqa commented 3 months ago

.. and remember to provide instructions on how to configure your zq2 node to disable the restriction :-) we also probably want to implement functionality to allow you to work out what state should be queried by GetContractSubState() otherwise block explorers will need to understand Scilla to show you state, which might be more than I want to implement :-p

JamesHinshelwood commented 3 months ago

Consider this blocked by #919 for now since that change will fundamentally affect how Scilla contract storage is stored and thus how we can account for its size.