Last updated 3 weeks ago
PSM provides a mock model blockchain for straightforward unit testing. However, it could more closely track the state of the main chain. Refactoring and an extended feature set will accomplish this.
We propose enhancing Plutus testing by advancing PSM's features and refactoring its codebase. This will result in a more effective simulation of the Cardano ledger and its most advanced capabilities.
This is the total amount allocated to MLabs – Enhancing and Evolving the Plutus Simple Model (PSM) Test Library. 4 out of 6 milestones are completed.
1/6
Evaluate the usage of the library and community needs
Cost: ₳ 35,286
Delivery: Month 1 - Nov 2023
2/6
Minimal implementation of CLB
Cost: ₳ 52,929
Delivery: Month 5 - Mar 2024
3/6
Unified testing
Cost: ₳ 77,629
Delivery: Month 7 - May 2024
4/6
Conway support
Cost: ₳ 63,515
Delivery: Month 9 - Jul 2024
5/6
Support non-haskell tools and frameworks
Cost: ₳ 63,515
Delivery: Month 10 - Aug 2024
6/6
Documentation, promotion, and closeout
Cost: ₳ 59,986
Delivery: Month 11 - Sep 2024
NA
No dependencies.
Project will be fully open source.
Overview
The plutus-simple-model (PSM) is a unit test library for Plutus with an estimation of resource usage. The library defines a simple mock model of the Cardano blockchain to unit test Plutus contracts and estimates the usage of resources. PSM has several strengths:
Problem
The Plutus Simple Model (PSM) test library is already a highly regarded tool in the Cardano ecosystem due to its robust capabilities in simulating the execution of smart contracts. Its strengths lie in its accurate representation of the UTXO model, its emulation of time and slot numbers, and the possibility of creating various transaction scenarios.
PSM came to life early in the Alonzo era, yet Cardano – and the related developer experience – has evolved drastically since. For instance, PSM often leverages PlutusTx for on-chain interactions, while developers have largely turned to libraries such as Plutarch, Aiken, etc in its place. PSM already supports external libraries such as Plutarch, but this integration could be enhanced and interoperability with other tools generally improved.
And this speaks little to other possible features that would benefit from the ease of use testing offered by PSM. Currently, PSM supports Plutus V1 as well as V2 features – inline datums, reference scripts, etc. However, the library has yet to have been updated to fully reflect the developments surrounding the Conway era and CIP-1694. Other cutting-edge features like transaction chaining could also be added.
Solution
PSM has been in maintenance mode throughout 2023. Yet, MLabs and other teams building in the space still use the library heavily owing to its ease of use and reliability. We propose updating PSM to reflect the current state of the Cardano ledger while also adding better support for external platforms and languages. Finally, basic quality-of-life improvements and some refactoring will ensure PSM remains ergonomic and popular among builders.
More specifically, intended improvements include:
Market
Smart contract auditors, developers and teams building Cardano DApps and tooling.
Intended Challenge – OSDE: Open Source Dev Ecosystem
Challenge Question – "Can we build a community-owned Open-Source Ecosystem that’s commercially viable to drive growth, increase opportunities, and increase project visibility for the whole Cardano Community?"
How does updating PSM help developers?
Updating PSM will lead to a more streamlined and efficient development process, which is essential as Cardano's ledger and its interaction continue to evolve. This update not only augments PSM's compatibility with emerging external platforms and languages but also addresses discrepancies between our mock model and the main chain's behaviour. By enhancing PSM, we further enable developers to leverage its simple yet robust unit testing, facilitating confident and efficient smart contract deployment on Cardano.
We will consider the following as we measure our proposal’s success:
In the spirit of complete transparency with the Cardano community, the outputs of our proposal will be widely available. Foremost, as an open-source project, the GitHub repo will be the obvious resource for updates, documentation, and educational resources. This repo will be updated as the project progresses - a primary deliverable of this proposal.
MLabs has a noteworthy social media presence. We'll make active use of these channels to share regular updates with less technical community members. Finally, we'll actively share progress reports through the typical, publicly-available Catalyst channels. MLabs has a strong compliance record, and this will not change throughout the progress of this proposal.
MLabs, a leading consultancy in the Cardano ecosystem, has a proven track record and significant experience. Our team consists of seasoned engineers, each holding expertise in their respective fields. Moreover, we have consistently demonstrated our ability to deliver complicated projects with a high degree of trust and accountability. We have an extensive portfolio of satisfied client projects as well as several popular Catalyst projects. We're committed to upholding these standards for our PSM enhancement proposal. Moreover, we are committed to working in an open-source and transparent manner.
The main goals of our project are:
To validate our approach, we will:
Milestone 1: Project Planning and Expanded Interoperability (Months 1-3)
Milestone 2: Implement quality-of-life improvements (Months 4-5)
Milestone 3: Extended functionality to reflect the current ledger and modern features (Months 6-7)
Milestone 4: Documentation and Wrap-up (Month 8)
Milestone 1: Project Planning and Expanded Interoperability
Milestone 2: Implement Quality-of-Life Improvements
Milestone 3: Extended Functionality to Reflect Current Ledger
Milestone 4: Documentation and Wrap-up
Milestone 1 – 140 hours
Milestone 2 – 175 hours
Milestone 3 – 250 hours
Milestone 4 – 85 hours
Total: 650 hours
Plus 20% change budget: 780 hours
Subtotal: 780 hours @$95/hour = $74,100 USD
Total (@ rate $0.21 USD / ADA): 352860 ADA
**In the interest of full transparency, please note we have applied a conservative USD/ADA exchange rate in pricing this proposal. This is to ensure our operations remain stable regardless of market conditions. Although we firmly believe the future of Cardano is bright, we recognize the price of ADA and all cryptocurrencies is inherently volatile. Our financial obligations are denominated in fiat. Most importantly, this includes the salary of our engineers whose hard work makes projects like this possible.
In the unlikely scenario of severe negative price movement beyond our forecasted rate, it is possible that MLabs may need to temporarily suspend work on this proposal until the market recovers. Rest assured, this decision would be made solely to protect our business's long-term viability and never taken lightly.
We appreciate your understanding and support, and we are excited to see what we can achieve together.
The budget for this project is a cost-effective investment for the Catalyst community. Enhancing the Plutus Simple Model (PSM) will greatly benefit developers by making unit testing more efficient, simple to perform, and reliable. The quality-of-life improvements, better support for other platforms, and expanded functionalities are all aimed to ease the developers' work and improve the output of their efforts. As PSM is open source, it can be used, forked, and further improved by others in the future.
NB: Monthly reporting was deprecated from January 2024 and replaced fully by the Milestones Program framework. Learn more here
MLabs
MLabs is a premier development firm in the Cardano Ecosystem. We are an IOG Plutus Partner and work regularly to develop the Cardano blockchain and ecosystem. Our team is composed of talented developers who have helped build community projects such as:
And several others. Through our work with early-stage projects, we have one of the largest groups of Haskell/Plutus developers in the Cardano community.
Website: https://mlabs.city/
Core Team
Vladimir Kalnitsky
Vladimir is a key maintainer for MLabs open source projects including CTL and Plutip. His involvement will include guiding high-level implementation details, dependency monitoring (especially for Chang hardfork-related upgrades), and ensuring the project meets our high standards for quality.
Borja Bonet Seguí
Borja is a key Delivery Manager at MLabs, in addition to being on our Auditing team lead. As PSM and related tools help us lower the cost of the audits we provide, and since our auditing team is often the first consumers for open source testing projects at MLabs, Borja will be involved at both the user testing and delivery assurance level.