Skip to content
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

Replace Quick mode with Thorough mode #2457

Merged
merged 3 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions manticore/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ def positive(value):
)

eth_flags.add_argument(
"--quick-mode",
"--thorough-mode",
action="store_true",
help="Configure Manticore for quick exploration. Disable gas, generate testcase only for alive states, "
"do not explore constant functions. Disable all detectors.",
help="Configure Manticore for more exhaustive exploration. Evaluate gas, generate testcases for dead states, "
"explore constant functions, and run a small suite of detectors.",
)

config_flags = parser.add_argument_group("Constants")
Expand Down
2 changes: 1 addition & 1 deletion manticore/ethereum/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def choose_detectors(args):
def ethereum_main(args, logger):
m = ManticoreEVM(workspace_url=args.workspace)

if args.quick_mode:
if not args.thorough_mode:
args.avoid_constant = True
args.exclude_all = True
args.only_alive_testcases = True
Expand Down
6 changes: 3 additions & 3 deletions manticore/ethereum/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ def main():
eth_flags = parser.add_argument_group("Ethereum flags")

eth_flags.add_argument(
"--quick-mode",
"--thorough-mode",
action="store_true",
help="Configure Manticore for quick exploration. Disable gas, generate testcase only for alive states, "
"do not explore constant functions. Disable all detectors.",
help="Configure Manticore for more exhaustive exploration. Evaluate gas, generate testcases for dead states, "
"explore constant functions, and run a small suite of detectors.",
)
eth_flags.add_argument(
"--contract_name", type=str, help="The target contract name defined in the source code"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ run_truffle_tests(){
mkdir truffle_tests
cd truffle_tests
truffle unbox metacoin
coverage run -m manticore . --contract MetaCoin --workspace output --exclude-all --evm.oog ignore --evm.txfail optimistic
coverage run -m manticore . --contract MetaCoin --workspace output --exclude-all --thorough-mode --evm.oog ignore --evm.txfail optimistic
# Truffle smoke test. We test if manticore is able to generate states
# from a truffle project.
count=$(find output/ -name '*tx' -type f | wc -l)
Expand Down
4 changes: 3 additions & 1 deletion tests/ethereum/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def test_regressions_imports(self):

def test_1102(self):
with tempfile.TemporaryDirectory() as workspace:
self._simple_cli_run("1102.sol", workspace=workspace, testcases=True)
self._simple_cli_run(
"1102.sol", workspace=workspace, testcases=True, args=["--thorough-mode"]
)

with open(os.path.join(workspace, "global.findings")) as gf:
global_findings = gf.read().splitlines()
Expand Down