3 ms·
(Readers who have similar developer questions should check out the Ethereum Stack Exchange. It's really useful! https://ethereum.stackexchange.com/ https://ethe
by natrius 11y ago
(Readers who have similar developer questions should check out the Ethereum Stack Exchange. It's really useful! https://ethereum.stackexchange.com/ https://ethereum.stackexchange.com/)
Blockchains have to produce new blocks regularly to be useful. Think of the gas limit like the amount of time you have to render a new frame in graphics applications. If you have unbounded computation in a time-dependent system that anyone can submit instructions to, you're gonna get some DoS attacks.
> There is (last I checked), no way to know if your program will go over. Just trial and error
It's easy to check: blockchains are deterministic state machines. You can simulate a transaction to see what would happen with the current state, and as long as the state of your contract isn't modified by another transaction in the meantime, you'll get the same results on the chain.
> Last i checked, the only way to run a program is to deploy it. So, you have to setup your own private chain to test on and continuously deploy and wait and test.
Most developers use TestRPC to simulate a blockchain. It's like developing a web app with SQLite or another in-memory database.
https://github.com/ethereumjs/testrpc/ https://github.com/ethereumjs/testrpc/
https://truffle.readthedocs.org/en/latest/ https://truffle.readthedocs.org/en/latest/