Earn 7.0% APY staking with Solana Compass
Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 7.0% APY yield on your SOL, while supporting us to create new guides and tools. Learn more
Earn 7.0% APY staking with Solana Compass
Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 7.0% APY yield on your SOL, while supporting us to create new guides and tools.
Breakpoint 2023: Program Runtime v2
The latest updates on Solana's Program Runtime v2 aim to enhance efficiency, composability, and ease of use for developers.
In a recent event, Alessandro and his colleague Alex from Solana Labs' runtime team discussed substantial improvements coming to the Solana blockchain through the next version of the program runtime, known as Runtime v2. Their work, which spans compilers and virtual machines, will introduce optimizations and API changes aiming to expedite execution and simplify development workflows. They highlight that this upgrade isn't merely incremental improvements but signifies a considerable shift that promises to remove technical debt and elevate the platform's capabilities, enabling developers to create more sophisticated and interoperative blockchain programs.
Enhanced Execution Speed and Efficiency
One of the main improvements expected from Runtime v2 is significantly faster execution speeds for Solana's on-chain programs. By rewriting heavyweight features like Cross-Program Invocation (CPI) and memory allocation to be more efficient, the team is reducing the usage of CPU and memory bandwidth. This process involves minimizing technical debt accrued over time and lifting many of the artificial constraints currently in place, like CPI depth and memory allocation limits. As a result, developers can anticipate more generous compute budgets, giving rise to more complex and compositionally rich on-chain programs.
Simplified Developer Experience
The update will see a simplification and improvement of the public-facing APIs. This includes the elimination of boilerplate code currently required to write on-chain programs, like the entry-point macro and AccountInfo structures. More notably, the update will introduce support for generic interfaces, which will enable extensible and composable programming. By fully supporting traits and interfaces, developers will be able to more readily create, share, and build upon each other's work, and modify the behavior of programs like the SPL token programmatically. The new workflow integrated into the cargo toolchain will further streamline publishing and dependency management for Solana developers.
Demonstration of the Prototype
Alessandro showcased a demo, albeit a prototype not ready for deployment, illustrating how the new features work in practice. The demonstration included defining and publishing a trait abstraction to the Solana registry with cargo publish. It showed the implementation of a trait in a toy NFT program and how a third-party program could easily interact via these abstracted interfaces. While Alex explained that this feature is still under development, the demo offered a glimpse into a more refined and cohesive developer experience.
Facts + Figures
- The Runtime v2 upgrade is a broad-ranging project being worked on for the past year with more work expected in the coming year.
- A major goal of the upgrade is to remove the accumulated technical debt in the current runtime.
- The new runtime will allow for the removal of a number of artificial constraints around features like CPI and memory allocation.
- Developers will receive a higher compute budget, enabling more complex on-chain programs.
- Boilerplate code, such as entry-point macros and AccountInfo structures, will be eliminated from the development process.
- The introduction of generic interfaces will improve composability and allow for more complex use cases to be implemented on-chain.
- A new cargo toolchain integration will simplify the publishing of programs and management of dependencies.
- The existing runtime (Runtime v1) will continue to operate alongside Runtime v2 for a significant transition period.
- The Runtimes will be interoperable, with v2 able to call into v1, but not vice versa.
- "We are removing a lot of the technical debt that we have accumulated over the years in the runtime."
- "By making [features] a lot faster, we are also going to be able to remove a lot of the artificial constraints and limits that we have had to put around them."
- "The infamous entry-point macro is going away. Entry points are mostly going away entirely."
- "This increases a lot the way the composition works."
- "One VM instance for every instruction...is going away. We're dissolving that into one VM per transaction."
- "We want to radically rethink how composability works on Solana."
What is Program Runtime v2?
The Program Runtime v2 is an overhaul of Solana's blockchain runtime that introduces various improvements aimed at enhancing performance, reducing constraints, simplifying developer workflows, and fostering a more collaborative ecosystem.
Why is the introduction of generic interfaces significant?
Generic interfaces provide a framework through which developers can code more extensible and composable applications. By allowing traits and interfaces within the platform, Solana will enable programs to share functionalities and interoperate more flexibly and efficiently, leading to a richer set of use cases.
How will the developer experience change with the new runtime?
Developers will experience a streamlined process with less boilerplate code and more straightforward publishing and dependency management due to the integration with the cargo toolchain. The reduction in technical debt and removal of artificial limits will moreover allow developers to craft more complex programs with greater compute budgets.
Will the existing programs require updates to function on Runtime v2?
While the new runtime introduces breaking API changes that offer new functionality, existing programs based on Runtime v1 will continue to be supported and operational. There remains a clear incentive for developers to upgrade for the additional benefits, but it is not a necessity.
What does the prototype demonstration convey about the new runtime?
The prototype demonstration conveyed that the new runtime would simplify the processes of defining, implementing, and interacting with program interfaces. It highlighted how future Solana developers could handle traits, publish on-chain programs, and include dependencies on other programs seamlessly in their project workflows.
- Key Points:
- Facts + Figures
- Top quotes
- Questions Answered