4 ms·
Thank you, nice concise explanation. In an enterprise or company, when it is growing from startup to market gorilla, there are often tales of screw ups like th
by ChuckMcM 9y ago
Thank you, nice concise explanation.
In an enterprise or company, when it is growing from startup to market gorilla, there are often tales of screw ups like this that happened to some poor sysadmin or programmer. And the company develops a sort of genetic memory of what not to do. Like children, companies that learn the 'dangerous' things early before they can do real harm, grow up to be less likely to do something really stupid later in their existence.
But I don't know what vector could be used to pass this sort of cultural knowledge between ethereum contract writers from generation to generation. It needs a 'book of sins' that everyone can read and contribute to in order to insure that new contracts won't suffer the problems of the early ones.
- DennisP 9y agoOne effort along these lines is the Consensys best practices document: https://consensys.github.io/smart-contract-best-practices/ https://consensys.github.io/smart-contract-best-practices/
- ChuckMcM 9y agoThat looks like it is headed in the right direction. I observe that in companies there are stories (often with particpant's names) which exemplify bad practices. Part of the motivation to do better seems to come from not wanting to be the person in one of these stories.
- luckyt 9y agoIn the "Known Attacks" section, they advocate using a mutex to prevent reentrant situations, but they're using a boolean, setting it to true before the operation and setting it to false afterwards. This is not secure -- it's possible for two threads to set it to true at the same time! You need to use an atomic concurrency operation like compare-and-swap [1] to implement a mutex. [1] https://en.wikipedia.org/wiki/Compare-and-swap https://en.wikipedia.org/wiki/Compare-and-swap
- socrates1024 9y agoThe Ethereum VM is single threaded, so this isn't actually a problem
- ballenf 9y agoBack in the dual floppy drive days, I vividly remember getting the diskcopy a: b: right but accidentally placed the blank in a:. I vividly remember doing it a second time some months later. But never again. In my defense I was an idiot and was 8 or 9 years old, so fortunately it was just some shareware game disk that I was trying to copy for a friend only to lose my only copy. The error made here is in an enormously more complex domain, but kind feels like they just accidentally low-level formatted an important diskette.
- Drdrdrq 9y agoYeah, I guess we all learned to write-protect the floppies the hard way... When you lose data you become a bit more paranoid about making mistakes. Fortunatelly floppies could be protected with a bit of tape.
- thefalcon 9y agoI never understood why you would ever write-protect a floppy. Then again, I had a Mac 512k with a single floppy drive. (Insert Disk A; CRANK WHIRR GRIND SPIT; Insert Disk B; WHIRR WHIRR CRANK GRIND SPIT; Insert Disk A...)
- StavrosK 9y agoOr rather, without a bit of tape. Tape was for writing, that's why many commercial disks shipped with the window permanently open.