can a contract handle an array with ten million elements?

islandBillyislandBilly Posts: 5
I have written a contract that has an array of uint256's inside a simple struct. The rest of the struct is just some strings and a smaller integer. If the Dapp that manages this contract becomes widely accepted, the array of uints could hit tens of millions of elements. Considering how Solidity has trouble retrieving more than 6 or 8 state variables at a time, and how the EVM is compared to a 1995 cell phone, can anybody tell me whether my array will be okay if it gets that big??

Comments

  • o0ragman0oo0ragman0o Posts: 1,224 mod
    As long as you're dealing with the array atomically, i.e, updating only a few individual elements each transaction, there is no problem. Just don't try to 'delete' it in one hit, that will go OOG and potentially lock up your contract
Sign In or Register to comment.