wip: Standard L2 Genesis
Description
WIP Standard L2 Genesis
Semgrep found 1 sol-style-return-arg-fmt finding:
Named return arguments to functions must be appended with an underscore (_)
Semgrep found 2 golang_fmt_errorf_no_params findings:
No fmt.Errorf invocations without fmt arguments allowed
Semgrep found 6 sol-style-return-arg-fmt findings:
- packages/contracts-bedrock/src/L2/interfaces/IL1Block.sol
- packages/contracts-bedrock/src/L2/L1Block.sol
Named return arguments to functions must be appended with an underscore (_)
Semgrep found 2 sol-style-require-reason findings:
require() must include a reason string
Ignore this finding from sol-style-require-reason.Semgrep found 12 sol-safety-deployutils-args findings:
- packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
_args parameter should be wrapped with DeployUtils.encodeConstructor
Ignore this finding from sol-safety-deployutils-args.
Semgrep found 6 sol-style-require-reason findings:
- packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol
require() must include a reason string
Ignore this finding from sol-style-require-reason.
Semgrep found 3 sol-style-require-reason findings:
- packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
require() must include a reason string
Ignore this finding from sol-style-require-reason.Semgrep found 1 err-todo finding:
TODO in error handling code
Ignore this finding from err-todo.
Another possible feature to include is https://github.com/ethereum-optimism/optimism/issues/12136. This would make the enshrined revenue sharing predeploy much simpler to implement. This is a 2 line change and is backwards compatible, we could also wait to roll this out until we get around to shipping the enshrined revshare contract
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Semgrep found 1 sol-style-require-reason finding:
require() must include a reason string
Ignore this finding from sol-style-require-reason.Semgrep found 5 sol-style-input-arg-fmt findings:
- packages/contracts-bedrock/src/L2/SuperchainWETH.sol
Inputs to functions must be prepended with an underscore (_)
Semgrep found 1 no-direct-write-to-responsewriter finding:
Detected directly writing or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package and render data using 'template.Execute()'.
Ignore this finding from no-direct-write-to-responsewriter.Semgrep found 1 no-direct-write-to-responsewriter-taint finding:
Untrusted input could be used to tamper with a web page rendering, which can lead to a Cross-site scripting (XSS) vulnerability. XSS vulnerabilities occur when untrusted input executes malicious JavaScript code, leading to issues such as account compromise and sensitive information leakage. To prevent this vulnerability, validate the user input, perform contextual output encoding or sanitize the input. For more information, see: Go XSS prevention.
View Dataflow Graph
flowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>op-challenger/game/fault/trace/prestates/multi_test.go</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/ethereum-optimism/optimism/blob/55f5e1966ee76a29a670edc211482c6f62d68f0a/op-challenger/game/fault/trace/prestates/multi_test.go#L172 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 172] r.URL</a>"]
end
%% Intermediate
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/ethereum-optimism/optimism/blob/55f5e1966ee76a29a670edc211482c6f62d68f0a/op-challenger/game/fault/trace/prestates/multi_test.go#L172 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 172] w.Write([]byte(r.URL.Path))</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
File0:::invis
%% Connections
Source --> Sink
Semgrep found 3 sol-style-require-reason findings:
require() must include a reason string
Ignore this finding from sol-style-require-reason.
Semgrep found 1 sol-style-require-reason finding:
require() must include a reason string
Ignore this finding from sol-style-require-reason.Semgrep found 12 sol-style-notice-over-dev-natspec findings:
- packages/contracts-bedrock/test/L2/SequencerFeeVault.t.sol
- packages/contracts-bedrock/test/L2/Predeploys.t.sol
- packages/contracts-bedrock/test/L2/FeeVault.t.sol
- packages/contracts-bedrock/test/L1/SystemConfig.t.sol
- packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol
- packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol
Prefer @notice over @dev in natspec comments
Semgrep found 3 sol-style-malformed-revert findings:
- packages/contracts-bedrock/test/universal/Proxy.t.sol
- packages/contracts-bedrock/test/mocks/Callers.sol
- packages/contracts-bedrock/test/invariants/FaultDisputeGame.t.sol
Malformed revert statement style.
Ignore this finding from sol-style-malformed-revert.Semgrep found 9 sol-style-malformed-require findings:
- packages/contracts-bedrock/test/safe-tools/CompatibilityFallbackHandler_1_3_0.sol
- packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20/helpers/MockL2ToL2CrossDomainMessenger.t.sol
- packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20/handlers/Protocol.t.sol
- packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
- packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol
- packages/contracts-bedrock/test/L2/GasPriceOracle.t.sol
- packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol
"Hash not approved" Malformed require statement style.
Ignore this finding from sol-style-malformed-require.
@tynes I'm opening this up for your initial review.
Status:
- Contract code should be feature complete.
- There is a single failing contract test I still need to debug.
- Many other checks still need fixing (spacers, semgrep, interfaces, etc).
- Still want to migrate other L1 contracts to OZ' v5 Initializable
- Still need to update
op-deployerto support the newfeeAdminrole
Semgrep found 1 sol-style-require-reason finding:
require() must include a reason string
Ignore this finding from sol-style-require-reason.
Semgrep found 6 sol-style-input-arg-fmt findings:
- packages/contracts-bedrock/src/universal/interfaces/IWETH.sol
Inputs to functions must be prepended with an underscore (_)
Semgrep found 1 golang_fmt_errorf_no_params finding:
No fmt.Errorf invocations without fmt arguments allowed
Going to close this PR due to it being replaced by another