This is the fourth update for my work in the CDAP. Until now, I have mainly been focusing on analyzing the existing uses of the SELFDESTRUCT
opcode in Ethereum. In the last couple of weeks, however, I have in addition started working on defining a new Layer 2 technique, which is similar to zk-rollups but requires less data on-chain.
SELFDESTRUCT
analysisWhen I wrote my last update, I was still waiting for some feedback on whether the backwards-incompabilities I found were critical enough to try preserving SELFDESTRUCT
as is. Shortly after, I got feedback that this was probably not enough to outweight the advantages of neutering SELFDESTRUCT
, and that I should do more analysis on what might break when neutering SELFDESTRUCT
.
I also talked to the creator of Pine Finance, and it turned out that the situation was a bit different than I first thought. At first, I was thinking that the redeployed contracts were the result of a user using the same vault more than once, but I was told that the front-end creates new vault addresses each time, so this was not the case. Instead, the redeployed contracts were the result of an edge-case where a user tries to cancel an order, but the call runs out of gas when trying to transfer the tokens in the vault. As a result, the call that tries to move the tokens in the vault reverts, but the vault still selfdestructs. If SELFDESTRUCT
is neutered, the remaining tokens in the vault would be at risk in this edge case.
Here is a list of redeployments of the same vault. As can be seen on etherscan, all redeployments except the last were the result of a failed cancelOrder.
It is still unclear to me if this problem can be avoided in the front-end, or if it is necessary to deploy a new version of pinecore. If it can be prevented in the front-end, the situation would not be so bad after all.
SELFDESTRUCT
SELFDESTRUCT
-refunds were removed. This should have lead to less selfdestructing (obviously for gas tokens, but perhaps also in other use cases).I have started a new project that I will work on along with the SELFDESTRUCT
analysis. The goal of this project is to define a new Layer 2 solution I have in mind.
This Layer 2 solution is similar to zk-rollups, but needs less on-chain data. This is solved by borrowing some ideas from Plasma, where each user stores some data that is needed for withdrawing in the case where the operator misbehaves. Unlike Plasma, and similar to zk-rollups, users won't have to watch the chain for malicious behavior.
The concept is still in its infancy, but for those interested in getting a rough idea, I have started writing on the document here.