What Can OP-Geth Do ? (ENTRY POINT)
Core Execution Capabilities
1. Transaction Execution
- Execute EVM bytecode for smart contracts
- Process all transaction types including standard transactions and deposit transactions (0x7E)
- Run the Ethereum Virtual Machine (EVM) to execute opcodes
- Handle gas metering, computation limits, and execution tracing
2. State Management
- Maintain and update the entire L2 blockchain state (accounts, balances, contract storage)
- Store state in a database (LevelDB/key-value storage)
- Manage state roots and Merkle Patricia tries
- Handle state transitions based on executed transactions
3. Block Production and Validation
- Build execution payloads when instructed by op-node via Engine API
- Execute transactions within blocks
- Validate execution payloads received via
engine_newPayload - Generate receipts for executed transactions
- Update fork choice based on
engine_forkchoiceUpdatedcalls
4. Data Storage
- Store blocks, transactions, and receipts
- Maintain historical blockchain data (in full/archive mode)
- Cache frequently accessed data for performance
- Persist state to disk
5. JSON-RPC Interface
- Expose standard Ethereum JSON-RPC methods (eth__, debug__, net_*, etc.)
- Serve blockchain data queries (
eth_getBlockByNumber,eth_getBalance, etc.) - Accept transaction submissions (
eth_sendRawTransaction) - Provide execution traces and debugging information
- Support WebSocket, HTTP, and IPC transports
6. Engine API Operations
- Respond to
engine_newPayloadV1/V2with VALID, INVALID, SYNCING, or ACCEPTED status - Process
engine_forkchoiceUpdatedV1/V2to update canonical chain head - Build payloads when requested with PayloadAttributes
- Return built payloads via
engine_getPayloadV1/V2 - Maintain synchronization state with op-node
7. Deposit Transaction Handling
- Process L1 attributes deposit transactions (first transaction in every block)
- Execute user deposit transactions from L1
- Handle deposit-specific logic (no gas payment for system deposits, mint ETH for user deposits)
8. Sync Modes
- Operate in snap sync mode (default, faster)
- Operate in full sync mode (validates all transactions)
- Run as archive node (retains all historical state)
9. Gas and Fee Management
- Calculate intrinsic gas for transactions
- Enforce gas limits per transaction and per block
- Compute L1 data fees for rollup transactions
- Handle EIP-1559 dynamic fee parameters (configurable for L2)
10. Precompile Execution
- Execute standard Ethereum precompiled contracts
- Support OP Stack-specific precompiles (like secp256r1 in Fjord fork) op-geth is purely an execution engine - it executes what it’s told to execute and stores the resulting state. All higher-level decisions about what to execute and when are made by op-node through the Engine API.
I created a toy version of op-geth, cause why not here is the link to the toy
Toy implementation Order
- Data Storage
- State Management
- Transaction Execution
- Deposit Transaction Handling
- Block Production and Validation
- Engine API Operations
- JSON-RPC Interface