forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contracts-bedrock: fix custom gas token withdrawals to L1 (ethereum-o…
…ptimism#10685) * contracts-bedrock: fix custom gas token withdrawals to L1 The previous implementation of the `FeeVault` used the `StandardBridge` to withdraw `ether`. Under custom gas token, this meant that withdrawals to L1 didn't work and withdrawals to L2 were the only supported path. This updates the `L2ToL1Messenger` to withdraw to L1 via the `L2ToL1Messenger`. This fixes the ability to withdraw to L1 while custom gas token is enabled while also saving some gas on both L1 and L2 by removing extra call frames. The reason why this was originally implemented using the `StandardBridge` was to reduce additional changes during the development of bedrock so that more effort could be spent thinking about the new protocol design, as the legacy implementation used the `StandardBridge` for doing the withdrawal. Having the `StandardBridge` used for `ether` deposits and withdrawals is unncessarily expensive and a bit of a leaky abstraction. Gas savings are scalability improvements, both on L1 and on L2. Also uses a new variant of `SafeCall` that passes through all gas in its `transfer`. The implementation ensures to assert on the return value of the call to hold the invariant true that the `totalProcessed` will always be consistent. If the call reverts, then its possible for the `ether` to not be transferred and `totalProcessed` to be incremented. Also bump the semver of the contracts to a beta version. They will be bumped out of beta at a release of the contracts. The tests are also improved for both the `SafeCall` library as well as the `FeeVault`. * op-e2e: withdrawal tests * e2e: update test with comments * feevault: fix tech debt Updates the `FeeVault` to use modern style guide. Its not great to leak `immutable` style into the ABI so add extra getters and mark the legacy getters as deprecated. Doing this now will help to migrate to the new getters in 1 year from now. Also add in the storage layout spacer that was previously noticed in an audit, see ethereum-optimism#9477. * semver-lock: update + compiler warning * snapshots: regenerate * lint: fix * tests: fixup * gas-snapshot: update * test: fix * contracts-bedrock: reuse existing implementation of send in SafeCall Co-authored-by: Matt Solomon <[email protected]> * contracts-bedrock: update gap in FeeVault for inheritance to start at 50 gap * contracts-bedrock: add missing assertions in tests for SequencerFeeVault * contracts-bedrock: remove redundant if clause in SafeCall tests * contracts-bedrock: fix gas relation in SafeCall tests * contracts-bedrock: update send method tests for SafeCall * op-e2e: add missing check in custom gas token tests * contracts-bedrock: fix types in SafeCall tests * contracts-bedrock: update snapshots * contracts-bedrock: update semver-lock * op-e2e: fix custom_gas_token test * op-e2e: fix custom gas token test * contracts-bedrock: fix tests for custom gas token * op-e2e: fix tests for custom gas token * op-e2e: fix build --------- Co-authored-by: Diego <[email protected]> Co-authored-by: Matt Solomon <[email protected]>
- Loading branch information
1 parent
2a01915
commit c04ca0c
Showing
22 changed files
with
447 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.