PlatONnetwork/PlatON-Go

Failed to query the contract storage tree

Closed this issue · 2 comments

Hi there,

when I try to call the statedb.ForEachStorage method to query all k-v key-value pairs under the specified contract, no data is returned

System information

PlatON version: alaya-0.14.0
OS & Version: Windows/Linux/OSX
Commit hash : (if develop)

合约树在提交过程中会将hashKey和preimageKey的映射关系保存在内存,但不会提交到磁盘,因为数据量太大。在早期的版本中可以通过调用computeStateDB API回放指定区块,重新获取hashKey和preimageKey的映射关系,从而遍历整颗合约树,但因为经济模型加引入了快照DB,导致重放区块被限制,所以整个查询逻辑目前不支持

The contract tree will save the mapping relationship between hashKey and preimageKey in memory during the submission process, but will not submit it to disk because the amount of data is too large. In the earlier version, you can replay the specified block by calling the computeStateDB API, re-obtain the mapping relationship between hashKey and preimageKey, so as to traverse the entire contract tree, but because the economic model adds a snapshot DB, the replay block is restricted, so The entire query logic is currently not supported