Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

1

Some answers: 1) I'm not sure where you get your idea about petabytes. Currently a full node takes about 200GB of space: https://etherscan.io/chartsync/chaindefault . Even if you use an archive node (which is very rarely needed) it takes about 3,5 TB: https://etherscan.io/chartsync/chainarchive . So petabytes don't seem to be reality. Clients of course don'...


3

The pattern you are using is valid for certain table-like sets, but you should be aware of the limitations. It is ill-advised to do anything with a contract that loops - Getting Loopy with Solidity. You can, however, make it possible for a client to loop. It should be understood that "client" is an off-chain entity, in this context, because if it wasn't ...


3

Trust me. Everytime (everytime!) you are thinking to loop trough a dataset whose dimensions you cannot predict at the “start of the time“ in a blockchain based system, you are using blockchain for the wrong thing and/or your algorithm must be changed by rethinking it. Your model should be something where if a new “user” is added, the simply operation to add ...


0

Eli and Ismael are exactly right. This syntax... simpleStruct storage newStruct; causes an "uninitialized storage pointer" error in 0.5.x compilers. You need to initialize with = to set it to something, otherwise it will default to slot 0 in memory, which is a horrible thing because it mean overwriting whatever else is there. This is a confusing and ...


1

No. It would be expensive and it would not scale. The name of the game is to economize on writes and avoid loops. It's so important that your approach to problems like this may seem counter-intuitive, at first. You have to work out what the value would be if the data was updated in place. For that, you would just need to know the original number and the ...


Top 50 recent answers are included