Is there a limit on a collection inside a template?
- cohen.avrahamOP 1
G-d willing
Hello,
Is there a limit on the size of a collection I can use inside a template?
Saying a collection of 100K elements… is that possible?
And what about updating the contract with 100K elements, how heavy-lifting will it be?Thanks,
- Luciano
cohen.avraham:And what about updating the contract with 100K elements, how heavy-lifting will it be?
One thing I know is that there is no structural sharing on the ledger. So if I have a 100k element list on a contract, and I prepend one element to it, it will re-write all 101k values (unlike that same operation in memory).
- cohen.avraham
G-d willing
Thanks @Luciano for your reply.
I am aware to the consequences of adding another element to the collection.
But, can I assume that when it reaches 200K elements, the application won’t be able to handle it due to memory limit? Generally, I would like to know when this approach is about to fail - ali-abrar 2
You might eventually hit transaction size limits, depending on how large each of these elements is. See Transaction size threshold?