Something rather basic I am not getting - Say I lay a transaction aimed to change the state of a smart contract, which in turn will interact with other contracts etc. until it reaches a halt. Obviously my transaction has to be put in a block.
Question is - WHEN exactly are all the state changing going to happen?
a) Is it only after the transaction was put into a finalized block? In this case it will be required for a change in states to be put again in the later blocks.
b) Are they happening the minute the transaction is sent? If that holds then if my transaction was rejected by the miners (for too-low gas price for example) then the changes happened without a valid transaction.
Adding to the second option, if in this case the states changes are reverted, doesn't this opens a door to a DDoS attack on the network, simply make the network calculate a bunch of things subjected to a transaction (or many) that will not go through.
c) Another option I'm thinking of is that the transaction and all subsequent transaction are 'packed' together and have to be put to the same block. Thing here, from what I understand from the EVM mechanism, the nodes are not reading from the blockchain's history, but doing the calculations once a contract was activated.
It could be that I missed some basic point regarding the networks architecture, if so, I'll be glad if you could point it out to me. (And I'm not a programmer, so please be gentle with using code citations :) )