-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Asterisc contracts VM tests - Forge Test #22
Conversation
5a62887
to
9ac7ca0
Compare
59b7068
to
66116a4
Compare
I'm not too familiar with riscv (not yet!). But some notes upon skimming the tests: It'll be great to have actual coverage data on the VM. For now, having just a comment or an lcov screenshot in the PR description illustrating this. It'll be great to have codecov setup on asterisc though. There are a couple reverts in the VM. The tests should cover these as well, however unlikely they are to occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may not related to this PR, but can you add SPDX-License-Identifier to the new contract files? and, please follow the code convention of import lines.
import { Test } from "forge-std/Test.sol";
@Inphi Thanks for your feedback. Will try to harden VMs by adding tests which covers reverts. I tried to extract the test coverage data, by running
This seems to be nontrivial to fix, so will make this as a separate task. I tried the So, to sum up; additional tasks are:
|
This is a great PR. It'll be very helpful for our test coverage. Thank you! |
Will update this in a separate PR, along with versioning up solidity to |
Description
Implements forge test for supported RISCV instruction and preimage operations. Basically ethereum-optimism/optimism#6638 but for asterisc.
This PR contains 95 tests, and over 2.5K LOC of code. I tried to break the diff by atomically commit the changes. Please
review each commit step by step.
I am somewhat confident that this new test suite covers almost every nontrivial(ignoring no-ops) state transitions.
References
116
(starting from the first page) is especially useful. Please think this doc as a source of truth.Step by Step guideline
srliw
andsraiw
instruction.RV64A
is also supported.CSSR
toCSRR
.Tests
Added gas snapshots(by running
forge snapshot
) by file. Below is the outputAdditional context
Current dependencies on/for this PR: