feat(invariants): improve precompile coverage with new handlers #2531
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.
Summary
Add new invariant test handlers to improve Rust precompile code coverage, identified through instrument-coverage benchmarking of
tempo-foundryPR #245.Changes
TIP20.t.sol — 2 new handlers:
mintWithMemo(tokenSeed, recipientSeed, amount, memoSeed)— exercisestip20::mint_with_memopathburnWithMemo(tokenSeed, amount, memoSeed)— exercisestip20::burn_with_memo+ internal_burnpathValidatorConfig.t.sol — 1 new handler:
changeValidatorStatusByIndex(indexSeed, newStatus)— exercisesvalidator_config::change_validator_status_by_indexT1+ dispatch pathCoverage Impact
Benchmarked with
-Cinstrument-coverageon the fuzz profile binary (10 runs × 1000 depth, seed=42):Not addressed (future work)
is_t2()check), not testable on current T1 hardforkcheck_and_mark_expiring_nonce, AccountKeychainauthorize_transfer, TIP20transfer_fee_pre/post_tx, FeeAMMexecute_fee_swap) — ~620 uncovered LOC not reachable from Solidity invariant testsvec.rs,array.rs,hashmap.rs) — internal implementation with Rust proptestsRelated: tempoxyz/tempo-foundry#245