specs icon indicating copy to clipboard operation
specs copied to clipboard

Feat: Decoupled `OptimismPortal`

Open tynes opened this issue 5 months ago • 3 comments

The OptimismPortal currently enshrines the proof system in its implementation. You can observe this fact with the following links:

  • https://github.com/ethereum-optimism/optimism/blob/3f7a8ad1b8030a3d01d44bc57bf0553a249eae23/packages/contracts-bedrock/src/L1/OptimismPortal.sol#L71
  • https://github.com/ethereum-optimism/optimism/blob/3f7a8ad1b8030a3d01d44bc57bf0553a249eae23/packages/contracts-bedrock/src/L1/OptimismPortal2.sol#L90

We should move the proof system outside of the OptimismPortal and instead only enshrine the concept of an authorized caller that can pass through a Types.WithdrawalTransaction to execute. It would be assumed that this other caller did verify the proof.

This will help to reduce the size of the OptimismPortal contract, as it is right at the codesize limits. We do not want to be in a position where we need to move quickly and cannot due to the code being too large. This problem was hit when porting custom gas token to the OptimismPortal2.

This will also help to make it easier to maintain things like op-succinct. This will unblock us from removing the L2OutputOracle from the codebase without breaking other integrations.

The upgrade path can be straight forward for tooling like viem, if the semver is above a certain version then viem can grab the address of the authorized caller contract from the portal and then send its transaction to the authorized caller rather than the portal. The authorized caller can maintain the same ABI of the portal for simplicity.

The name for the authorized caller could be "verifier" as its role would be to verify proofs.

tynes avatar Sep 05 '24 00:09 tynes