Polkadot Summit 24' - PoV-Reclaim & Elastic Scaling

PoV-Reclaim & Elastic Sclaing

Hi all, please see below a write up from one of the Polkadot Summit sessions that was held in Bangkok in 2024.
You can use the polkadot-summit tag to see all the other posts, and navigate to the summary post for a recap of the event.

11th March 2024 / POLKADOT SUMMIT ASIA

Host: Sebastian | Parity Tech - Core Dev, Node Team
Element: @sebastian:parity.io
EmaiL sebastian@parity.io

Summary of the session

This session focused on POV-Reclaim and Elastic Scaling, critical components for optimizing blockchain performance and scalability. It detailed how Proof of Validity (POV) size affects block fullness and introduced a method for reclaiming unused proof weight to increase transaction throughput. The discussion also covered elastic scaling, a mechanism for enhancing network capacity and efficiency.

Notes & Key questions asked

POV-Reclaim Overview
Introduced as a solution to manage and optimize proof space utilization within blocks, allowing for the reclamation of unused proof weight.

Determining Proof Weight
The uncertainty in proof space consumption was addressed by using benchmarking with reference hardware to establish worst-case scenarios.

Solution Steps

  • Exact consumed proof weight is determined using a new host function that lives on the node side, interacting with the storage trie and recorder.
  • The difference between the benchmarked and actual weight is computed.
  • Unused weight is reclaimed to allow for additional transactions within the same block.

Affected Codepaths
The solution impacts block production, block import, and PVF (Parachain Validation Function) execution.

Integration Process for a parachain team

  • Adding a host function to nodes.
  • Incorporating TransactionExtension into runtimes.
  • Enabling block import proof recording for accurate measurement and reclaiming.

Manual Reclaim Method
A detailed code snippet was provided to illustrate how to manually reclaim unused weight during the on_idle function, showing the process of utilizing a WeightMeter to manage and reclaim weight effectively.

Impact of Reclaiming:

  • Significantly affects transactions interacting with the same storage items.
  • Addresses the disparity between the maximum size of items and their actual utilized size.

Elastic Scaling

  • The session explained how elastic scaling works, including asynchronous backing to optimize network resources and the concept of parallel block building to maximize backing time.
  • Context given on authoring, backing and inclusion in a synchronous way leading to only a tiny 0.5 second duration for block authoring.
    • With Asynchronous-Backing this made a 0.5 second duration for block authoring become 2 second. A 4X increase.
    • With agile coretime we can achieve 2 cores running parallel and blocks every 3 seconds

  • Or we can do better, blocks every 2 seconds, using 3 cores

Constraints and Timing:

  • Discussed were the limitations and timing considerations for block authoring and import, emphasizing the need for efficient distribution and the potential for parallel processing to enhance throughput.

Key Takeaways & next steps

  • POV-Reclaim and Elastic Scaling are crucial for improving the scalability and efficiency of blockchain networks, allowing for better resource management and increased transaction capacity.

  • Benchmarking is essential for accurately determining the proof weight and optimizing the reclamation process.

  • Implementation requires modifications to node host functions, runtime extensions, and an understanding of the impact on block production and import processes.

  • Future Directions: The session suggests further exploration and development in elastic scaling, including the potential for parallel block building and overcoming the constraints related to block authoring and distribution times.

  • Community Involvement: Encourages feedback and collaboration from the community to refine these processes and integrate them into broader ecosystem practices for enhanced scalability and performance.

1 Like