Increase limit by power of two to avoid all cells/transactions were filtered out in light-client-wasm#237
Increase limit by power of two to avoid all cells/transactions were filtered out in light-client-wasm#237Officeyutong wants to merge 3 commits intodevelopfrom
limit by power of two to avoid all cells/transactions were filtered out in light-client-wasm#237Conversation
|
How the original |
The original implementation is based on RocksDB, which returns an iterator over selected elements, we can implement such API on wasm but it will be much more difficult. In my opinion, light client usually won't involve too much data so I think the current implementation in this PR is acceptable |
Sorry for the misunderstanding. When I say the "original implementation", I mean the version of WASM light client. ckb-light-client/wasm/light-client-wasm/src/lib.rs Lines 787 to 797 in d5dd7c1 ckb-light-client/wasm/light-client-wasm/src/lib.rs Lines 903 to 910 in d5dd7c1 |
This is somewhat controversial. It is not uncommon to have addresses with hundreds of cells/NFTs. If these NFTs also store image data, the data size may be larger than expected. |
Seems Increase by fixed page size:
Increase by power of 2:
|

This PR changes the logic of
get_cellsandget_transactionsin light-client-wasminternal_limit, which was initialized bylimitfrom rpc call, it will increase by power of two if no cells/transactions were found after filtered logic.internal_limitwill be used forlimitofstorage.collect_iteratorinternal_limitreachesu32::MAX, we can assume that no data was found, since the maximum value oflimitisu32::MAX