Try   HackMD

Week 13-14

Code Integration and Enhancement

  • Successfully merged code into op-geth project.
  • Next Steps: Plan to refactor this portion of code for better performance and features, taking reference from the current standalone sequencer with a non-shared txpool.

Deep Dives

Unveiling Synchronization Mechanisms in Opstack

  • P2P Gossip Sync: Op-node receives the latest unsafe blocks via the p2p gossip protocol, pushed by the sequencer.
  • Request-Response Reverse Block Header Sync based on libp2p: Through this sync method, op-node can fill in any gaps in unsafe blocks.
  • Execution Layer (EL, also known as engine sync) Sync: In op-node, there are two flags that allow unsafe blocks coming from gossip to trigger long-range syncs in the engine. If EL is set up for this, it can perform any sync, like snap-sync.
  • Op-node RPC Sync: This is a simpler sync method based on trusted RPC methods when there are issues with L1.

Transitioning Block Safety: The Derivation Journey in Op-stack

  • Derivation is a process that transitions unsafe blocks to safe and finally to finalized by continuously running the derivation program. This program fetches Block X data from L1 and updates the local L2 unsafe Block A, transitioning Block A to a safe state, and after two epochs (64 blocks) on L1, marks Block A as a finalized block.

Optimizing Transaction Management: The Role of Op Batcher

  • Op Batcher is responsible for transmitting layer 2 information to layer 1, it collects unsafe block data to form multiple batches. Each block corresponds to one batch. When enough batches are collected for efficient compression, they are turned into a channel and sent to layer 1 in the form of frames to complete the upload of layer 2 information, optimizing transaction handling efficiency and management in the process.

Documentation and Community Recognition

  • Summarized the above research into a series of articles and stored them in a repository for community members to better understand the inner workings of Optimism.
  • Excitingly, this collection of articles in the repository was recognized by the Optimism official developer repo as the first resource from the community, which is a recognition of my research and contributions.