Polkadot SDK Version Manager

[TLDR] Built a tool to manage/update Polkadot SDK crates.io version with a simple CLI. I was having problems integrating pallets/runtimes from different repos/orgs until I realised a simple tool like this could save so much time. I think this can be useful for anyone building parachains so sharing it. Check it out!.

The psvm is a tool that I think could really make the development process easier when dealing with Polkadot SDK crates.io versions, especially for those involved in Parachain development, while at the same time making it more secure by tackling one of the Common Polkadot SDK Security Risks: Outdated Crates. Let me share more in detail why I think it’s something worth checking out.

If you’ve ever worked with Polkadot’s SDKs using crates.io dependencies, you probably have seen this issue: you decide to change the Polkadot SDK crates dependencies source from github.com to crates.io, only to find yourself down the rabbit hole of version mismatches. You’re manually checking each dependency, trying to figure out which version goes with which, and it feels like you’re piecing together a puzzle with missing pieces. Frustrating, right?

This is where psvm steps in. Essentially, it’s a tool that takes care of the version chaos. It ensures that the Polkadot SDK dependencies in the Cargo.toml are updated to a specific Polkadot SDK version such as v1.3.0 and in sync with what’s on crates.io.

The tool tries to be as simple as possible to use. You don’t need to manually search for and update each SDK dependency anymore, psvm does that automatically. Under the hood, psvm has a mapping previously generated from Polkadot SDK monorepo version branches (i.e. v1.3.0), that connects every crate with its correct version (i.e. “xcm” → “4.0.0”).

For starters, psvm makes getting into Polkadot development much more approachable. It removes a barrier that might have discouraged many developers from exploring this ecosystem that is not being able to even setup a template environment with pallets/runtimes extracted from Polkadot SDK monorepo or other parachains repos. For example, if you find a nice pallet using Polkadot SDK version 1.7.0 and try to integrate with 1.3.0, the compiler could start throwing incompatibility errors that don’t explicitly say what is the real problem (version mismatch), for beginners this can be really discouraging.

Please give psvm a try. You can find all the details on how to get started, including installation and usage instructions, on its GitHub page. The setup is straightforward, and I think you’ll be pleasantly surprised at how much smoother the experience can be.

Feel free to provide any feedback or request/contribute new features!

18 Likes

Update

After some major changes in the tool’s workflow, now it’s possible to update to any version of Polkadot SDK on the latest changes. The tool now fetches the versions directly from the Polkadot SDK monorepo, so it’s even possible to update to a version that was just released.

The tool is also available now in crates.io.

2 Likes