cannon: Finish emulating rest of 64-bit instructions
This completes 64-bit instruction execution (except lld/scd which is handled separately).
Testing
- Differential tests for non-trivial 32-bit instructions asserting backwards compatibility.
- Added new tests for 64-bit instructions (except lld/scd).
- Fuzz tests for
dmult
These tests are only run on by the 64-bit VM. So they do not run on CI, except for the dmult fuzz test which is executed by the fuzz-golang job.
Meta
Semgrep found 6 sol-style-input-arg-fmt findings:
- packages/contracts-bedrock/src/L2/interfaces/ISuperchainWETH.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
Semgrep found 1 math-random-used finding:
Do not use math/rand. Use crypto/rand instead.
Semgrep found 1 marshal-json-pointer-receiver finding:
MarshalJSON with a pointer receiver has surprising results: https://github.com/golang/go/issues/22967
Ignore this finding from marshal-json-pointer-receiver.Semgrep found 1 err-nil-check finding:
superfluous nil err check before return
Ignore this finding from err-nil-check.
Codecov Report
Attention: Patch coverage is 19.81132% with 85 lines in your changes missing coverage. Please review.
Project coverage is 63.79%. Comparing base (
f6ca236) to head (8fb303e). Report is 30 commits behind head on develop.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| cannon/mipsevm/exec/mips_instructions.go | 19.81% | 79 Missing and 6 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #12483 +/- ##
===========================================
- Coverage 64.86% 63.79% -1.08%
===========================================
Files 54 54
Lines 4460 4538 +78
===========================================
+ Hits 2893 2895 +2
- Misses 1391 1461 +70
- Partials 176 182 +6
| Flag | Coverage Δ | |
|---|---|---|
| cannon-go-tests | 63.79% <19.81%> (-1.08%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| cannon/mipsevm/exec/mips_instructions.go | 64.89% <19.81%> (-9.30%) |
:arrow_down: |
Semgrep found 1 sol-style-require-reason finding:
require() must include a reason string
Ignore this finding from sol-style-require-reason.Semgrep found 1 sol-style-notice-over-dev-natspec finding:
Prefer @notice over @dev in natspec comments
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 8 golang_fmt_errorf_no_params findings:
- op-chain-ops/deployer/state/intent.go
- op-chain-ops/deployer/bootstrap/bootstrap.go
- op-chain-ops/deployer/apply.go
No fmt.Errorf invocations without fmt arguments allowed
@mbaxter I fixed a bug in dmult. And I've removed the dmult fuzz tests in favor of more static tests. I couldn't figure out a way to reimplement dmult correctly using the Go std library. At least not without copying the implementation used by mipsevm, which defeats the purpose of the fuzz test.
I have verified the expected dmult behavior using user-mode qemu like I mentioned earlier. All static test cases were written based off the results of qemu-mips. Please let me know if there are any more interesting cases you'd like me to add.
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/498a36def44ac54d68189319fff89cc45994414b/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] r.URL</a>"]
end
%% Intermediate
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/ethereum-optimism/optimism/blob/498a36def44ac54d68189319fff89cc45994414b/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] w.Write([]byte(r.URL.Path))</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
File0:::invis
%% Connections
Source --> Sink
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 ban_non_wraparound_modifiers finding:
Modifiers that don't do something before and after execution are banned.
Ignore this finding from ban_non_wraparound_modifiers.