Do you need to traverse related transactions in the entire blockchain when reading variables in smart contracts?

if an array is defined in the smart contract, and the append method. So to read the latest value of this array, do you need to traverse the relevant transactions in the entire block chain and read out all the append (and possibly delete) to finally get the latest array? It looks troublesome.

I see that input data is one of the transactions initiated to Contract Address. But it only involves the methods and parameters to be called. How did transaction"s ordering solve in Ethernet Square?


this is actually a misunderstanding.
Etay Fong is a virtual machine, which you can understand to mean that all environments are ready before running your program. The variable is right there, just read it. It's like a machine. Because what is stored in his virtual machine is the final state.
input data is only additional data for this transaction.


No, the contract is essentially an account. Data can be stored in the account system of Etay Fong. Without adding a block, the data of some accounts will be changed. If the contract is called, the data will change, in fact, after the block is linked up, that is, the new data.

this is what the data in the contract looks like, and storage is the variable data in the contract.

"143f5e185e5724a1794739d37245b5b790d9e981": {
            "balance": "0",
            "nonce": 0,
            "root": "ca8c4b371ca57e115d36d825df11edb2ed0d3a95fe16d62ddc1588d2dba7e44f",
            "codeHash": "7612f2653b712e6...fa640e2294c876098b1358f0b4e8",
            "code": "60806040526004361....",
            "storage": {
                "00000000000000000000...0000000000000000000000000": "0a",
                "00000000000000000000...0000000000000000000000001": "64",
                "00000000000000000000...0000000000000000000000002": "01",
                "034feb03b7facb45a16a...b0ac9c170ab4ad6508986005c": "820400"
            }
        }
Menu