Trident Manifest#
Trident supports its own Trident Manifest, called Trident.toml. This section describes all possible configuration fields.
Metrics#
Configure fuzzing statistics and reporting.
Fields:
enabled- Show and save statistics after the fuzzing session.dashboard- Save a HTML dashboard after the fuzzing session.json- Save a JSON file after the fuzzing session.
Regression#
Configure regression testing to track account state changes across fuzzing sessions.
Fields:
enabled- Save a JSON file with all monitored states after the fuzzing session.
Note
The feature hashes contents of accounts. If the contents depend on time, the final hash might not match the one from the first fuzzing session.
Coverage#
Configure code coverage analysis during fuzzing sessions.
[fuzz.coverage]
enable = true
server_port = 58432
loopcount = 5
format = "json"
attach_extension = true
Fields:
enable- Collect code coverage data and generate a report upon completion. Default:false.server_port- HTTP server port for communication with the Solana VS Code extension. Default:58432.loopcount- Number of execution flows before generating intermediate coverage data. Set to0for end-of-session only. Default:0.format- Output format for coverage reports:jsonorhtml. Default:json.attach_extension- Enable real-time coverage visualization in VS Code. Requiresloopcount > 0andformat = "json". Default:false.
Warning
Coverage is only gathered for programs deployed through an entrypoint!
Entrypoint deployment guide
Entrypoint deployment guide#
-
Comment out the program in
Trident.toml -
Add the program dependency to
Cargo.toml -
Add
syscall-v1orsyscall-v2feature depending on the version ofsolana-program. Programs written forsolana-programv1.x should usesyscall-v1, programs written forsolana-programv2.x should usesyscall-v2feature. -
Import the programs entrypoint in
test_fuzz.rs -
Deploy the entrypoint in
test_fuzz.rs
Programs#
Load dumped programs from a desired cluster during fuzzing.
[[fuzz.programs]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
upgrade_authority = "account address goes here"
program = "metaplex-program/metaplex-token-metadata.so"
Fields:
address- The program's public key.upgrade_authority- (Optional) The upgrade authority address.program- Path to the program's.sofile.
Accounts#
Load dumped accounts from a desired cluster during fuzzing.
[[fuzz.accounts]]
address = "6YG3J7PaxyMnnbU67ifyrgF3BzNzc7cD8hPkqK6ATweE"
filename = "tests/accounts/core_bridge_mainnet/guardian_set_5_mock.json"
Fields:
address- The account's public key.filename- Path to the JSON file containing the account data.
Fork#
Fork accounts directly from Solana clusters (mainnet, devnet, testnet) for use during fuzzing.
[[fuzz.fork]]
address = "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"
cluster = "m"
overwrite = false
Fields:
address- The public key of the account to fork.-
cluster- The cluster to fetch from:mormainnet- Mainnet Betadordevnet- Devnettortestnet- Testnet- Custom RPC URL (e.g.,
https://my-rpc.com)
-
overwrite- (Optional) Re-fetch the account even if cached. Default:false.
Forked accounts are cached locally in .fuzz-artifacts/fork-cache/. For upgradeable programs (v3 loader), Trident automatically fetches both the program account and its associated program data account.
Loader Support
Trident detects and reports the loader type for each forked program:
- v3 loader (upgradeable) - Fully supported with automatic program data fetching
- v1 loader (deprecated) - Loaded as regular account
- v2 loader (bpf_loader) - Loaded as regular account
- v4 loader - Loaded as regular account (not fully supported)
See Forking for advanced usage.