ethereum-optimism / optimistic-specs

Optimistic: Bedrock, is a protocol that strives to be an extremely simple optimistic rollup that maintains 1:1 compatibility with Ethereum
MIT License
167 stars 36 forks source link

Locked funds in Deposit contract #365

Closed Inphi closed 2 years ago

Inphi commented 2 years ago

A user deposit may not be applied by L2. I'm trying to figure out cases where this OK. From my current understanding, this should not be desirable because the user cannot generate proofs to redeem the fund locked in the deposit feed. In particular, I'm concerned about this piece of code here. The following is a scenario that triggers the opnode error highlighted in the aforementioned code.

  1. Fund an account with 2 ETH on L1.
  2. Create a deposit transaction on L2, minting 1 ETH, while transferring 5 ETH to any address:
    depositTransaction{value: 1 ether}(address, 5 ether, 40000, false, "0x")

    Doing so does not create any deposit transactions on L2, and the account balance of the sender remains unchanged. So not even the minted ETH is added to its balance. While this is obviously a bug, its resolution is not totally clear. But maybe we can decide on the following:

Expected behavior

  1. The engine mustn't drop any deposit transactions. Maybe this can be relaxed for deposits that don't mint.
  2. Any ETH minted in a deposit tx must always be applied to the depositor's account, even if the deposit tx itself reverts.
protolambda commented 2 years ago

This was fixed in https://github.com/ethereum-optimism/optimistic-specs/pull/366 I believe