Full Life Cycle Async Pipelining
Last updated
Last updated
While blockchain technology has evolved substantially, transaction execution efficiency remains a major bottleneck, limiting throughput and overall performance. Traditional blockchain architectures encounter several resource-intensive hotspots that constrain their capabilities.
The above figure shows the time breakdown of different stages in the Geth client during sequential execution. Other blockchain clients exhibit similar stages, though with variations due to database design differences. Key resource hotspots in traditional blockchain systems include CPU Utilization, Disk I/O, and Network bandwidth.
1. CPU Utilization: CPU resources are heavily taxed in blockchain operations, especially during execution, merklization, and various database operations (e.g., compaction and pruning). Merklization, in particular, is CPU-intensive, which becomes especially challenging at larger data scales.
2. Disk I/O: Execution and database operations place a significant load on disk I/O. For instance, transaction execution requires loading accounts and storage slots, while merklization involves accessing Trie nodes. Even optimized storage models like reth and erigon continue to face issues like read and write amplification.
3. Network: Consensus mechanisms rely on extensive network communication, making both bandwidth and latency crucial to overall system performance.
These constraints underline the need for an optimized pipelining mechanism to address these resource hotspots effectively, streamlining the transaction execution process and enhancing blockchain performance.
A well-designed pipelining mechanism can significantly improve blockchain performance by ensuring efficient resource utilization and minimizing bottlenecks. The key components of an effective pipelining mechanism include:
Synchronization and Coordination: Ensuring smooth data flow and alignment across different stages is crucial. This involves maintaining data consistency and providing reliable responses within a decentralized environment.
Resource Management: Effective pipelining dynamically allocates CPU, network, and I/O resources in real-time. Concurrency control is essential to prevent contention and race conditions, ensuring that resources are used optimally.
I/O Optimization: Reducing read/write latency and efficiently managing large-scale data are critical for maximizing parallelism during execution. This helps to minimize the delays associated with I/O operations.
Network Considerations: Ensuring fast and reliable data propagation is necessary for maintaining fault tolerance and enabling smooth recovery from network faults.
Designing an effective pipelining mechanism involves overcoming several significant challenges:
Accurate control of read and write concurrency under multi-versions data: Managing multiple data versions without causing read/write conflicts is a complex task that requires precise control mechanisms.
Disk reads significantly impact parallel execution efficiency: High-frequency disk access can create bottlenecks in parallel processes, reducing overall execution efficiency.
Competition for CPU and I/O resources with executors: Ensuring that executors have sufficient resources while balancing the needs of other processes is critical to maintaining performance.
Real blocks can only be generated after consensus broadcast: Consensus completion is necessary before finalizing blocks, adding complexity to the pipelining process and requiring careful coordination.
Pharos deconstructs all blockchain processes into six essential stages to optimize the utilization of network, disk I/O, CPU, and other system resources. This approach achieves three major advantages: high TPS, low latency, and enhanced security and reliability:
High TPS: Pharos minimizes disk I/O during execution and merklization stages, taking full advantage of multi-core processors to achieve high throughput.
Low Latency: Resources are prioritized for the transaction finality of the latest block, ensuring that most Web3 users experience low latency in their operations.
Security and Reliability:
Data Integrity: Ensures that no data is lost at any finalized stage, even if all validators fail simultaneously.
Rapid Resynchronization: Validators can quickly recover and update to the latest state after a crash.
Consistent Data Management: Strict management of reads and writes prevents data inconsistencies during parallel processing.
By leveraging three key solutions—Parallel Block Stages, Dynamic Resource Allocation, and Flexible Finality—Pharos sets the foundation for more robust and responsive Web3 applications, effectively addressing the performance limitations inherent in traditional blockchain systems.
1. Parallel Block Stages: Pharos allows different stages between blocks to be executed simultaneously, boosting throughput and lowering latency.
2. Dynamic Resource Allocation: By recognizing that different time slices have different resource preferences, Pharos improves resource management and reduces storage bottlenecks.
3. Flexible Finality: Pharos accommodates varying finality requirements for SDKs, clients, and nodes, enabling efficient resource allocation and faster confirmations.
Ordering Finality: Ensures permanent transaction sequencing.
Transaction Finality: Provides deterministic execution results.
Block Finality: Allows immediate access to finalized blocks.