Nethermind.eth
Published in

Nethermind.eth

Helm, Warp One. Engage!

Thanks to Antonio, Artem, Greg and Jorik for helping with the blog

We are excited to announce the first major release of Warp! You can transpile your Solidity contracts with more confidence because we have been hard at work optimizing and testing Warp. Since our last update on Warp, we have 55x more tests and we support almost all of Solidity’s constructs barring those that do not have a semantic equivalent on StarkNet (msg.value, gas operations, coinbase, etc.). In this blog post, I’ll talk a bit about where Warp currently stands, our testing process and briefly touch on what you should expect for the future of Warp.

Before we delve into the details, a shout-out to all the people in the Nubia team & everyone we’ve worked closely with at StarkWare on this project: Artem, Atharva, Carmen, Dominic, Greg, Jorik, Julian, Szymon, Tomasz, Lior, Shahar, and Uri.

What can you do today?

Since we announced composability, we’ve added full support for strings of arbitrary length (Cairo only supports 31 byte strings natively); we’ve added optimization such as constant folding and basic dead code elimination, full support for constructors, and a pedersen builtin.

At this point, the limitations of Warp are only those which have no semantic translation on StarkNet. Here’s a list of Solidity/EVM-specific things that Warp can’t do right now. There are still some important features in the above list, like create2 and revert. They may be supported as StarkNet and Warp develop together.

Currently, users need to account for the fact that reverts cannot be caught when using Warp and that keccak is an expensive operation on StarkNet — we recommend using a pedersen instead if your use case allows.

Example of Solidity’s semantic test DSL

In order to test that Warp simulates Solidity’s semantics correctly, we’ve adapted the testing framework that solc uses to work with Warp. They cover things like remote contract calling, arithmetic, fallback behavior, storage behavior, memory management, and much much more. The tests have a DSL specifying a set of contracts and a list of function calls with their expected outputs. We’ve modified the Solidity compiler to extract these expectations and run them on our test deployment of StarkNet.

Additionally, we have packaged these in a nice cli command warp test , so now you can write contracts and tests in the same file and let Warp handle the rest.

Of the 1394, 948 tests are relevant to our semantics and we have all of them passing! 🎉

We have our own set of behavior tests, similar to the semantic tests, which we wrote ourselves. These tests cover the basic semantics and were intended to test edge cases of our pipeline while also testing the optimizations we’ve implemented.

We also have a set of regression tests that check differences in our AST as a result of each pass in our pipeline.

Altogether we have 1000+ tests covering a large proportion of Solidity’s semantics and that gives us reasonable confidence to release a major version.

Don’t take our word for it. Check out our git repo and run the tests yourself!

Keeping up with the Cairo-lang

The StarkNet team has been quick to release new versions of Cairo-lang over the past few months, and we have been quick to add support for the new features. Cairo-lang-v0.7.0 was just released a few days ago and we already have support for most of the features. Note: we’re still extensively testing our support for events, they will be supported in the coming weeks!

“What does this mean for me?” you say? Well, you can be assured that the Warp compiler will be at feature parity with the latest and greatest that StarkNet has to offer.

Conclusion

Next up for Warp: we are working on reducing the contract size and step count for Warp, improving the error messages, and adding full support for events.

We have an audit planned for this release for Warp. We are talking to ABDK and will keep the community updated with its progress!

We have a ton of cool projects at Nethermind, and we’re always looking for passionate people to join us. If you’re interested in working at the forefront of crypto, drop us an email with your CV at talent@nethermind.io or send us a DM on Swapnil & Jorik. If you’re interested in compilers, then the Warp team is very interested in you.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store