Hyperdrive V2 in Vyper #461
Replies: 2 comments
-
Very nice writeup, @ControlCplusControlV. Troubleshooting errors when running solidity from python is quite difficult. On a crash we receive an error code in Python, which we have to manually look up in a table to see something like "arithmetic overflow/underflow". When I was in Fort Worth, I asked Jonny and Alex "what can cause an arithmetic overflow or underflow" in Solidity and their answer was "are you serious?". To narrow down the issue, I currently use the "add a bunch of prints" approach. The first time I did this it took about 2 hours to find the line of code that caused the crash. I could probably do it in 30 mins now. Doing this in 0 seconds is a 100% speedup. This is just an example of the benefits we'd get from working together in the same language ecosystem. Let's piss in the same pot. |
Beta Was this translation helpful? Give feedback.
-
This is a discussion to make Vyper into formal consideration for Hyperdrive v2, with the key reasons centering around tighter integrations for the sims team, better testing tooling, and improved efficiency and readability.
Is Vyper Hard to Learn?
While most of smart contracts team is not familiar with Vyper, Vyper is a very simple language to learn, with some small features, and no where near the amount of foot-guns as Solidity, so while the smart contract team will have to learn a new syntax, the concepts stay the same.
Vyper is More Feature Complete
Vyper has many cool features such as default function parameters allowing massive calldata savings on L2 while still being interface compliant, default return values allow us to support USDT and other safeTransfer cases easily.
Vyper is also significantly more efficient even compared to Solidity Assembly, due to its unique IR and more low level handing of memory (although it still has builtins to manage low level functionality) and with Cancun opcodes like
mcopy
this lead will only increase.Titanoboa would also allow our sims team to directly use our contracts, and with its superior feature set to foundry (it will point to the line where execution failed rather than dumping a trace -- but it can do that too). Pinging @wakamex to explain more here
Is Vyper Secure
Some alfa I have is that ToB is beginning work with Vyper to ensure security, as funded by Curve. Speaking of secure protocols trusting Vyper both the number #1 and number #4 protocols by TvL use Vyper.
Beta Was this translation helpful? Give feedback.
All reactions