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

[Fuzzer] New util to generate corpus for AptosVM #16089

Merged
merged 7 commits into from
Mar 18, 2025

Conversation

zi0Black
Copy link
Contributor

Description

The generate_runnable_state_from_project function is now available. This function generates a new test case for the AptosVM fuzzers based on a Move project. The project must include an entry function, which can accept either a signer or no arguments. While this is a limitation, the entry function can still create the necessary arguments for other functions within the project, generating code to enhance the fuzzer's coverage.

Some examples of using it with mem and string native functions have been added.

How Has This Been Tested?

Local build and coverage analysis before and after adding the generated test case.

Key Areas to Review

N/A

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

zi0Black added 2 commits March 8, 2025 21:34
This commit enhances the fuzzer's capabilities by introducing a new feature to generate runnable states directly from Move project folders. Key changes include:

- Added a new CLI subcommand `generate_runnable_state_from_project`
- Implemented logic to compile Move packages and extract entry functions
- Added validation for entry function requirements (no generics, signer handling)
- Updated README with usage instructions for the new feature
- Modified Cargo.toml to make consensus feature optional
- Improved fuzzer's flexibility for test case generation
@zi0Black zi0Black requested review from gedigi and GotenJBZ March 10, 2025 11:48
Copy link

trunk-io bot commented Mar 10, 2025

⏱️ 10m total CI duration on this PR
Job Cumulative Duration Recent Runs
check-dynamic-deps 4m 🟩🟩
rust-cargo-deny 3m 🟩🟩
semgrep/ci 1m 🟩🟩
general-lints 51s 🟩🟩
file_change_determinator 24s 🟩🟩
permission-check 8s 🟩🟩
permission-check 5s 🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@zi0Black
Copy link
Contributor Author

CI is failing because of #16093 (review)

@zi0Black zi0Black enabled auto-merge (squash) March 17, 2025 16:49

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379

Compatibility test results for 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379 (PR)
1. Check liveness of validators at old version: 82240c9c7137087c575bf5d670abfa0dddc3ae9f
compatibility::simple-validator-upgrade::liveness-check : committed: 9034.08 txn/s, latency: 3537.44 ms, (p50: 3000 ms, p70: 3500, p90: 5000 ms, p99: 15100 ms), latency samples: 307720
2. Upgrading first Validator to new version: bddfaa5ec7b4ba41f40b08121cf9775ab4899379
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 2944.73 txn/s, latency: 9880.87 ms, (p50: 10700 ms, p70: 12300, p90: 12900 ms, p99: 12900 ms), latency samples: 64480
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 2961.61 txn/s, latency: 11279.29 ms, (p50: 12600 ms, p70: 13100, p90: 13400 ms, p99: 13400 ms), latency samples: 112600
3. Upgrading rest of first batch to new version: bddfaa5ec7b4ba41f40b08121cf9775ab4899379
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 2363.77 txn/s, latency: 12542.38 ms, (p50: 14200 ms, p70: 15500, p90: 15700 ms, p99: 15800 ms), latency samples: 54540
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 2315.28 txn/s, latency: 14565.99 ms, (p50: 16000 ms, p70: 16400, p90: 16600 ms, p99: 16700 ms), latency samples: 89740
4. upgrading second batch to new version: bddfaa5ec7b4ba41f40b08121cf9775ab4899379
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 5131.64 txn/s, latency: 5902.46 ms, (p50: 6600 ms, p70: 7200, p90: 7800 ms, p99: 8100 ms), latency samples: 101720
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 5472.75 txn/s, latency: 6258.46 ms, (p50: 6900 ms, p70: 7100, p90: 7300 ms, p99: 7400 ms), latency samples: 187240
5. check swarm health
Compatibility test for 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on bddfaa5ec7b4ba41f40b08121cf9775ab4899379

two traffics test: inner traffic : committed: 12582.96 txn/s, latency: 3154.33 ms, (p50: 3000 ms, p70: 3300, p90: 3300 ms, p99: 4200 ms), latency samples: 4784340
two traffics test : committed: 99.96 txn/s, latency: 1819.13 ms, (p50: 1700 ms, p70: 2000, p90: 2400 ms, p99: 2900 ms), latency samples: 1720
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.867, avg: 1.478", "ConsensusProposalToOrdered: max: 0.316, avg: 0.306", "ConsensusOrderedToCommit: max: 0.486, avg: 0.455", "ConsensusProposalToCommit: max: 0.788, avg: 0.761"]
Max non-epoch-change gap was: 1 rounds at version 14156 (avg 0.00) [limit 4], 1.89s no progress at version 14156 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.02s no progress at version 2091615 (avg 1.02s) [limit 16].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379

Compatibility test results for 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379 (PR)
Upgrade the nodes to version: bddfaa5ec7b4ba41f40b08121cf9775ab4899379
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1864.73 txn/s, submitted: 1872.62 txn/s, failed submission: 7.89 txn/s, expired: 7.89 txn/s, latency: 1545.51 ms, (p50: 1500 ms, p70: 1700, p90: 2100 ms, p99: 2700 ms), latency samples: 165420
Upgrade the remaining nodes to version: bddfaa5ec7b4ba41f40b08121cf9775ab4899379
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1766.25 txn/s, submitted: 1772.88 txn/s, failed submission: 6.64 txn/s, expired: 6.64 txn/s, latency: 1695.00 ms, (p50: 1500 ms, p70: 1800, p90: 2200 ms, p99: 3600 ms), latency samples: 159702
5. check swarm health
Compatibility test for 82240c9c7137087c575bf5d670abfa0dddc3ae9f ==> bddfaa5ec7b4ba41f40b08121cf9775ab4899379 passed
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1696.15 txn/s, submitted: 1701.57 txn/s, failed submission: 5.42 txn/s, expired: 5.42 txn/s, latency: 1767.04 ms, (p50: 1700 ms, p70: 1800, p90: 2400 ms, p99: 3000 ms), latency samples: 150220
Test Ok

@zi0Black zi0Black merged commit fb1f396 into main Mar 18, 2025
46 checks passed
@zi0Black zi0Black deleted the fuzzing-tool-manual-corpus branch March 18, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants