A method for executing a smart contract, comprising: starting, by a blockchain node of a blockchain network after a smart contract has been deployed and consensus has been reached on the smart contract in the blockchain network, to compile a bytecode of the smart contract into a first machine code by using ahead-of-time, AoT, compilation and storing the first machine code; and performing, by the blockchain node in execution of the smart contract and in response to the first machine code of the smart contract not being locally stored in the blockchain node, just-in-time, JIT, compilation on the bytecode of the smart contract to obtain a second machine code and storing the second machine code, and executing the second machine code, the performing the JIT compilation on the bytecode of the smart contract comprising: querying, by the blockchain node in executing the smart contract, a current AoT compilation status of the bytecode of the smart contract in response to the first machine code of the smart contract not being locally stored in the blockchain node; and in response to the bytecode being in AoT compilation, performing JIT compilation on the bytecode of the smart contract; and in response to the bytecode not being in AoT compilation, starting AoT compilation and performing JIT compilation on the bytecode of the smart contract, the performing the JIT compilation on the bytecode of the smart contract further comprising: in a process of at least one of interpreting or executing the bytecode of the smart contract, identifying a hotspot second machine code, and storing the hotspot second machine code for subsequent invoking; or performing optimizing compilation to obtain the second machine code and storing the second machine code in the process of at least one of interpreting or executing the bytecode of the smart contract. starting, by a blockchain node of a blockchain network after a smart contract has been deployed and consensus has been reached on the smart contract in the blockchain network, to compile a bytecode of the smart contract into a first machine code by using ahead-of-time, AoT, compilation and storing the first machine code; and performing, by the blockchain node in execution of the smart contract and in response to the first machine code of the smart contract not being locally stored in the blockchain node, just-in-time, JIT, compilation on the bytecode of the smart contract to obtain a second machine code and storing the second machine code, and executing the second machine code, the performing the JIT compilation on the bytecode of the smart contract comprising: querying, by the blockchain node in executing the smart contract, a current AoT compilation status of the bytecode of the smart contract in response to the first machine code of the smart contract not being locally stored in the blockchain node; and in response to the bytecode being in AoT compilation, performing JIT compilation on the bytecode of the smart contract; and in response to the bytecode not being in AoT compilation, starting AoT compilation and performing JIT compilation on the bytecode of the smart contract, querying, by the blockchain node in executing the smart contract, a current AoT compilation status of the bytecode of the smart contract in response to the first machine code of the smart contract not being locally stored in the blockchain node; and in response to the bytecode being in AoT compilation, performing JIT compilation on the bytecode of the smart contract; and in response to the bytecode not being in AoT compilation, starting AoT compilation and performing JIT compilation on the bytecode of the smart contract, the performing the JIT compilation on the bytecode of the smart contract further comprising: in a process of at least one of interpreting or executing the bytecode of the smart contract, identifying a hotspot second machine code, and storing the hotspot second machine code for subsequent invoking; or performing optimizing compilation to obtain the second machine code and storing the second machine code in the process of at least one of interpreting or executing the bytecode of the smart contract. in a process of at least one of interpreting or executing the bytecode of the smart contract, identifying a hotspot second machine code, and storing the hotspot second machine code for subsequent invoking; or performing optimizing compilation to obtain the second machine code and storing the second machine code in the process of at least one of interpreting or executing the bytecode of the smart contract.