the recipient (EOA or contract account) Amount of ether transferred Number of gas provided to execute this transaction Price used for each paid gas Compiled code of contract or the hash of the invoked method signature and encoded parameter https://etherscan.io/txsPending 22
◦ Valid signature (v, r, s) ◦ Valid nonce ▷ How does a miner decide to pack TXs? ◦ Limited block size, gasUsed <= gasLimit ◦ Order by price and nonce ◦ Empty block is valid 36
tx fee) = 500 Transaction execution (execution failed) Sender Start End operattion gas used 50 operattion gas used 30 gas -50 gas -30 gas 200 Tx value: 300 wei gas limit: 200 gas price: 1wei Sender balance -500 Miner Miner balance + 80 ether transfer revert / gas refund Sender balance +300 + 120 revert state 40
tx fee) = 500 Transaction execution (Out of Gas) Sender Start End operattion gas used 150 operattion gas used 80 gas -150 gas -50 gas 200 Tx value: 300 wei gas limit: 200 gas price: 1wei Sender balance -500 Miner Miner balance + 200 Sender balance +300 revert state 42 ether transfer revert / no gas refund
code runs into an infinite loop. ▷ Give large gas => enough balance ◦ Ether transfer: 21000 ◦ Token transfer depend on contract: 90000~200000 ▷ web3.eth.estimateGas ◦ Dry run transaction in EVM with current state 44
(Decentralization) ▷ No one can control the right to write ledger (Randomize) ▷ Same probability The first one to get the number less than 3 can write blockchain ledger. 48
occurred ◦ Need the confirmation to ensure the transaction is finalized Fork choice rule Difficulty 2,992,833,186,612,935 Total Difficulty 7,381,509,111,578,673,834,542 Difficulty 3,081,843,657,645,896 Total Difficulty 7,394,502,708,643,356,684,070 51
▷ Frequently forks ▷ Centralization Bias ◦ Miner with higher hashpower alway wins the block reward ◦ Miner with lower hashpower continues to work on side chain 52