Replies: 4 comments 3 replies
-
So, instead of incorporating the new opcodes introduced in SabVM directly into Solidity (which would, arguably, require a separate team of people to implement and maintain), create - at SabVM's genesis - some Solidity contracts (the precompiles) "exposing" the SabVM-specific opcodes in the form of "regular" (on the surface) Solidity contract functions. Any other contract on the SabVM chain will be able to call those functions, as if they are Solidity language instructions/functions. Under the hood, however, because SabVM would have a special relationship and work directly with those precompiles, whenever one of those opcodes-exposing functions from inside the precompile contracts is called, the VM would interpret that as a trigger - and, instead of the actual Solidity code inside those functions (which could just as well be empty, if my understanding is correct), run the predetermined, VM-level logic that, essentially, implements the respective opcode. Have I got the idea correctly? Side question: for the existing Solidity compiler to be compatible with the SabVM contracts, must the precompile function calls be performed just like any other contract call, with the address of the contract specified alongside the function signature and whatnot? If yes, then, it doesn't sound too developer-friendly, as every SabVM contract wanting to access the SabVM-specific features/opcodes would need to manually "import" the information about what the precompile functions signatures - and where to call them from. Ideally, all this knowledge would somehow be inherited by all of the contracts automatically. However, I don't know how/whether this could be arranged without changing the Solidity compiler 🤔 |
Beta Was this translation helpful? Give feedback.
-
Closing this as outdated in favor of #86. |
Beta Was this translation helpful? Give feedback.
-
Interesting story of how Optimism used to have an OVM and a Solidity transpiler, which was ultimately ditched as a result of a happenstance of meeting George Hotz, who had found a way to get rid of the transpiler and in effect enable EVM equivalence: |
Beta Was this translation helpful? Give feedback.
-
More context from Georgios:
|
Beta Was this translation helpful? Give feedback.
-
Two possibilities:
At Devconnect 2023, I spoke with two Solidity core devs (Hari and Alex) about Sablier V3, and they have strongly advised us against the 1st approach and in favor of the 2nd approach.
A PoC for the 2nd approach:
Finally, a demo from our V3 slides:
Cc @IaroslavMazur
Beta Was this translation helpful? Give feedback.
All reactions