-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DEPLOY-295]: Refactors L2EP Contracts #11758
Conversation
…ses, and refactors test cases by using a L2EPTest helper
…erUptimeFeed test cases, adds ScrollCrossDomainForwarder skeleton
…st case grouping and more comments
…o ScrollCrossDomainForwarder helper function
…ndry import path for Example test
…rs script for L2EP, updates README
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
ab8757e
I see you updated files related to |
Quality Gate passedIssues Measures |
Closing this as it appears to be stale. Feel free to re-open if it's still needed. |
Background
L2EP currently requires 4 Solidity smart contracts to be developed and deployed on the target chain. These contracts are:
CrossDomainForwarder
CrossDomainGovernor
SequencerUptimeFeed
Validator
Each of these contracts share an almost identical implementation per chain. In fact, the code between Scroll and Optimism is nearly identical and by extension contains a lot of duplication. This current trajectory will be unsustainable to maintain as we expand L2EP to other chains.
Overview
This PR refactors the L2EP Solidity contracts such that:
Methodology
Instead of each chain having to define separate Validator, Governor, Forwarder, and Sequencer contracts with nearly identical code, this PR adds an abstract class for each of them. These abstract classes contain the functionality that is shared/duplicated for each chain. The result is that all shared code now exists in a centralized location making it easier to reuse and debug while cutting down on the size of existing contracts. Each chain will still need its own Validator, Governor, etc. contracts, but unlike before, they can now inherit from their corresponding abstract contracts and override methods as needed to account for any chain-specific differences. The effect: code that is specific to a particular chain now lives in the folder belonging to that chain.
This PR maintains full backwards compatibility with the existing L2EP design. Additionally, these new changes do not introduce any extra deployment steps. However, gas consumption is not the same. Some methods have experienced an increase in gas usage whereas others have experienced a decline. The gas snapshot included in the PR can be used to view the differences.
Summary of Notable Changes
CrossDomainForwader.sol
CrossDomainGovernor.sol
SequencerUptimeFeed.sol
GasLimitValidator.sol
(needed for Optimism and Scroll, but not Arbitrum)Validator.sol
Additional Note(s)