24 Aug 23 12:03 am type: related: ethereum EVM

transactions in ethereum

  • state-changing actions = transaction
  • any node can broadcast for a txn to be executed on EVM
    • after this, a validator executes and propagates the txn to the whole network
  • txns require a fee and must be included in the validated block
  • a signature which is part of the txn data is what verifies that the sender authorized the txn
  • gasLimit is the max gas that can be consumed by the txn. EVM specifies the units of gas required by each computational step

the data field

  • most contracts interpret their data field in accordance with their contract’s ABI
  • first 4 bytes specify which fn to call denoted by their hash of name and arguments ( try using this to identify byte directory)
  • rest of the calldata are the arguments encoded

types

  • regular txn from one account to another
  • contract deployment
    • no to address, and data field is the contract code
  • contract execution
    • to is the contract addr
    • calldata are the arguments etc

lifecycle of a txn

  • hash is cryptographically generated
  • broadcasted to the network and added to a txn pool consisting of all other pending txns
  • a validator picks it up, includes it to a block to verify the txn and consider it successful
  • with time, the txn finalizes, after which it can never be altered unless there’s a network level attack which would cost billions

references

https://ethereum.org/en/developers/docs/transactions/