feat: introduce SharedLockbox#13144
feat: introduce SharedLockbox#13144agusduha wants to merge 58 commits intoethereum-optimism:feat/interop-stable-devnetfrom
Conversation
* feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * chore: update compiler version
chore: sync develop
* feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert
#128) * feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * feat: add liqudity migrator contract with its unit test and interface * chore: remove underscore on stack var * chore: add todo * chore: run pre-pr * chore: add contract title natspec and proxied * refactor: integrate testing suite with common test * chore: pre-pr * chore: add spec test
* feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert * feat: integrate system config with superchain config * fix: remove OPCM interop * test: add dependency counter test
fix: merge conflict lockbox
* feat: Add pause check Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> * test: add tests natspecs --------- Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks>
…ox-2 fix: merge conflicts in lockbox
* feat: use superchain config lockbox in portal * test: add new sharedlockbox test
…ox-3 fix: merge conflict in develop sync
* feat: liquidity migrator deployment * test: fix comment * test: fix internal variables names
* feat: dependency set refactor * fix: deploy script variable name * fix: pr * fix: pr
…ox-4 fix: merge conflict lockbox
ControlCplusControlV
left a comment
There was a problem hiding this comment.
looks good overall, just some general stylistic comments
| emit ETHLocked(msg.sender, msg.value); | ||
| } | ||
|
|
||
| /// @notice Unlocks ETH from the lockbox. |
There was a problem hiding this comment.
Would add natspec alerts that it cannot be called when paused as well
| /// @notice Internal initializer. | ||
| /// @param _guardian Address of the guardian, can pause the OptimismPortal. | ||
| /// @param _paused Initial paused status. | ||
| function _initialize(address _guardian, bool _paused) internal { |
There was a problem hiding this comment.
may be a dumb q but why are these functions seperate?
There was a problem hiding this comment.
To be reused in the inherited contract. This is because there is a semgrep rule that force the initialize function to be external and to have the initializer modifier
|
|
||
| /// @notice The address of the cluster manager, which can add a chain to the dependency set. | ||
| /// It can only be modified by an upgrade. | ||
| bytes32 public constant CLUSTER_MANAGER_SLOT = bytes32(uint256(keccak256("superchainConfig.clusterManager")) - 1); |
There was a problem hiding this comment.
Inconsistent with OPTIMISM_PORTAL_STORAGE_SLOT which just sets the resulting value, we should use one format (value and preimagei n comments, or vice versa) across everything, I would favor pre-image and then let the value be determined at compile time
There was a problem hiding this comment.
We are trying to follow the ERC7201 for unstructured storage in general, this was an exception because the SuperchainConfig guardian role is being defined like this
|
|
||
| /// @notice Storage slot that the SuperchainConfigDependencies struct is stored at. | ||
| /// keccak256(abi.encode(uint256(keccak256("superchainConfig.dependencies")) - 1)) & ~bytes32(uint256(0xff)); | ||
| bytes32 internal constant SUPERCHAIN_CONFIG_DEPENDENCIES_SLOT = |
There was a problem hiding this comment.
same comment as above with OPTIMISM_PORTAL_STORAGE_SLOT
|
|
||
| /// @notice Checks if a chain is part or not of the dependency set. | ||
| /// @param _chainId The chain ID to check for. | ||
| function isInDependencySet(uint256 _chainId) public view returns (bool) { |
There was a problem hiding this comment.
is this function documented in the spec?
There was a problem hiding this comment.
Yes it should, the specs are gonna be refactored too tho
| event DependencyAdded(uint256 indexed chainId, address indexed systemConfig, address indexed superchainConfig); | ||
|
|
||
| /// @notice The minimum gas limit for the withdrawal tx to update the dependency set on L1. | ||
| uint256 internal constant ADD_DEPENDENCY_WITHDRAWWAL_GAS_LIMIT = 400_000; |
There was a problem hiding this comment.
where does this value come from?
There was a problem hiding this comment.
We made some gas consumption tests, we put a high minimum gas limit to ensure the withdrawal doesn't fail.
This code is not going to be used though
|
/ci authorize f805e78 |
|
We made the following decisions:
This will make us code complete for the audit, pending any other fixes the wonderland security team finds |
* feat: descope dependency manager * test: fix tests * test: fix tests
* fix: I-0 * fix: I-1 * fix: I-2 * fix: I-3 * fix: I-6 * fix: I-7 * fix: I-9 * fix: pre pr
…ox-10 fix: sync develop
* fix: portal withdrawal checks * fix: include current withdrawal check
|
/ci authorize 2860621 |
|
Not sure what the problem is with the go tests, we may need to rebase |
|
@tynes these are not flakes, these are real bugs. |
|
/ci authorize d1e7d79 |
|
/ci authorize 24476ae |
|
Looks like there are still some failing go tests |
what does this mean? |
|
It means that there's a revert preventing OP Deployer from deploying the contracts. I'll look into it. |
|
Replaced by #14199. |
Description
Introducing the
SharedLockboxcontract to improve the Superchain’s interoperable ETH withdrawal user experience, preventing withdrawal failures caused by insufficient ETH in theOptimismPortal. Additionally, theSuperchainConfigis being updated to manage the network’s dependency set.Tests
SharedLockboxtestsOptimismPortal,SuperchainConfigandSystemConfigAdditional context
As we talked, this should be applied on the Isthmus upgrade.
OPContractsManagerInteropandSystemConfigInteropbecause its only purpose was to set thedenpendencyManageraddress and is not needed anymoreDeploySuperchainscript to enforce contract deployment order to precalculate addresses. This is needed because theSharedLockboxand theSuperchainConfiginitializers have a cross dependency.addDependencyfunction to enforce the chain ID andSystemConfigaddress compatibility as mentioned in the spec, but there is no current source of truth for thatMetadata
Closes #13143