-
Notifications
You must be signed in to change notification settings - Fork 228
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
test(script): add more complicated scripts to unit tests #3187
Merged
Conversation
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
yangby-cryptape
force-pushed
the
pr/add-tests
branch
2 times, most recently
from
November 17, 2021 19:30
a772d14
to
883b3d9
Compare
yangby-cryptape
force-pushed
the
pr/add-tests
branch
from
November 17, 2021 23:27
883b3d9
to
1f6c1b9
Compare
driftluo
approved these changes
Nov 19, 2021
zhangsoledad
approved these changes
Nov 22, 2021
bors r= driftluo, zhangsoledad |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Add more complicated scripts to test the crate
ckb-script
.Changes
Tip: It's better to review this PR by reviewing each commits.
Refactor tests.
test(script): convert duplicate codes into functions to simplify them (7d060aa)
At present, to add one test has to copy a lot of duplicate codes, so do refactor first.
test(script): add a Makefile to make almost all test scripts to be reproducible (883b3d9)
Before this commit, only the latest 3 scripts could be re-built to same binaries from source files.
I add a
Makefile
and aREADME.md
to record the compile environments for almost all test scripts.So we can re-build these scripts more easily.
TODO: Still left 4 binaries couldn't be built from source files.
Add new tests.
test(script): current cycles should be always monotonically increased (794c539)
test(script): resume from snapshot with loading codes many times (d987413)
test(script): vm_version should be correct after resuming from snapshot (bd24f17)
test(script): current cycles should be correct after resuming from snapshot (5fc8bed)
Find a bug which resolved in fix: fix current cycles syscall on chunk run with snapshot #3188.
test(script): to load code into global is not allowed in vm0 (d13e1f5)
Ref:
test(script): hint instructions are not allowed in vm0 (b244812)
Ref:
test(script): flags of stack memory are not reset after they freed (a0c8927)
This feature looks like a bug but not.
If any function initializes a piece of stack memory, after the lifetime of that function, the stack memory will be freed.
But the flag of that piece of stack memory will not reset.
So, if we call a function which load code into a piece of stack memory, then we call another function, it could raise an error
InvalidPermission
if the second function tries to write the previous piece of stack memory.Ref:
W^X
Check List
Tests
Release note