Currently, when smart contracts write to their state, the storage dictionary is updated without dynamically metering the size of the state payload. Because contract storage is maintained as a Python dictionary that gets serialized, we should calculate its size dynamically by measuring the byte length of its JSON representation: len(json.dumps(account['storage'])).
Currently, when smart contracts write to their state, the storage dictionary is updated without dynamically metering the size of the state payload. Because contract storage is maintained as a Python dictionary that gets serialized, we should calculate its size dynamically by measuring the byte length of its JSON representation: len(json.dumps(account['storage'])).