1

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 :) )

1 Answer 1

1

So, after further digging, I've found an answer to my own question: (From the white-paper on GitHub):

"A commonly asked question is "where" contract code is executed, in terms of physical hardware. This has a simple answer: the process of executing contract code is part of the definition of the state transition function, which is part of the block validation algorithm, so if a transaction is added into block B the code execution spawned by that transaction will be executed by all nodes, now and in the future, that download and validate block B."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.