Ethereum smart contracts in a nutshell for hackers
5 stars based on
It looks like you're new here. If you want to get involved, click one of these buttons! December in General Project Discussion non-technical. Hello all, I would ethereum life cycle to understand some details about the contract lifecycle. Sorry for n00b questions So here it goes: When the contract is written, compiled, and sent in transaction, where does it reside afterwards?
AFAIU, it gets stored in the storage area of every single client that is connected to the network? Later, when someone decides to invoke the method of already published contract, how is this contract "found" over the network? Also, physically, what client executes the code of such found contract? If a contract inherits from another one that has been already published, is the ethereum life cycle part identified in some sort of "lookup" over the whole network?
How is then executed? AFAIU, the parent part is not "merged" with the child and send together? If there are more and more devs creating contracts Let's say after 10 years, in order to synchronize the network, all the new clients must download all this code into their storage areas, is that right?
I understand all the innovations in physical network transport etc, but if the concept of Ethereum gets really strong traction, could the network "crush" over the burden of so much binary code getting transported during synchronization every time? When a contract is created from a transaction, it gets its own account. This is a normal account with a balance and nonce etc, but it also has the code in it, and data storage. You call contracts by transacting to the account with the code in it.
If an account has code in it, that code is run when the account is the target of a transaction. Code is run by all full nodes, by a VM thats included in the client. Inheritance works like normal. What you're probably thinking about are library contracts, which are special contracts that has their own accounts and that you must link to when compiling ethereum life cycle contract that use them.
It ethereum life cycle true that code is added continuously, and that the database grows with time. Every node does not need all the code though. There are light clients that can somehow "lazy load" the data they need if I'm not wrongand don't need to host the entire chain. A few people controlling the data. That is a real risk with users having to download a massive database in order to use the system, or have to rely on other users to download it for them.
There are solutions being worked out, not sure what Ethereum will use in the coming iterations. Thanks for the answer. So, to understand correctly with a bit of nitpicking: When the contract is deployed, and "mycontract. Now, if the code is executed on all the nodes in the network, I expect them to have some private chatting to establish consensus that this method call has been completed successfully.
Did I have that right? The result of sendTransaction is the transaction hash. Now, one shall wait for the call to be "approved" by the consensus, as I guess before that happens during mining IIUC.
How one then checks for such approval and inclusion of ethereum life cycle "call trace" into the blockchain? We cannot check for contract address, since it has been deployed already ethereum life cycle. Do I need ethereum life cycle look at particular block? If during sendTransaction, called method returned something, is this return value lost?
Or is it included in the blockchain? If yes, how to check that? If we would like to suicide the contract, is the code also removed from the blockchain ethereum life cycle, or is it only deactivated?
I only wonder what amount of synchronization is needed between all the nodes in ethereum life cycle first case Sign In or Register to comment.