Repository navigation
feat(core): add tests, benchmarks & fixes for S004/S005/S007/S008 - #1064
Merged
Gbangbolaoluwagbemiga merged 2 commits intoJun 28, 2026
Merged
Gbangbolaoluwagbemiga merged 2 commits into
Gbangbolaoluwagbemiga merged 2 commits into
Conversation
Closes HyperSafeD#499, HyperSafeD#500, HyperSafeD#502, HyperSafeD#503 S004 (ledger size): add performance benchmarks with budgets for small, nested, many-structs, and vault contract payloads including strict-limit variant using BatchSize::SmallInput. S005 (storage key collision): add unit tests + fixture covering cross- function collisions, cross-storage-type non-collisions, single key non-collision, and threat model edge cases. Fix fixture parse failure caused by outer doc comments before #![no_std] in syn::parse_str. S007 (custom rules): add unit tests for validate_custom_rules (invalid regex, empty pattern, empty name, Display impl) and analyze_custom_rules (line numbers, multi-match, overlapping rules, severity propagation, snippet trimming, graceful invalid-regex handling). S008 (events analysis): add unit tests + fixtures for inconsistent topic count detection and gas optimization hints. Fix multiline event publish calls (env.events()\n.publish(...)) being missed by the line scanner by adding a normalization pass that joins split lines before scanning.
|
@abayomiwav is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@abayomiwav Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or 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
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.
Summary
benches/benchmark.rscovering small structs, deep-nested structs, 20-struct throughput, the vault contract, and a strict-limit variant usingBatchSize::SmallInput.tests/storage_collision_test.rswith 9 tests covering the threat model (cross-function collision, cross-storage-type non-collision, enum-variant aliasing, empty source, single key, distinct keys, temporary storage). Addedtests/fixtures/storage_collision_contract.rs. Fixed fixture parse failure caused by outer///doc comments before#![no_std]insyn::parse_str.tests/custom_rules_test.rswith 15 tests forvalidate_custom_rules(invalid regex, empty pattern/name, multi-error,Displayimpl) andanalyze_custom_rules(line numbers, multi-match, overlapping rules, severity propagation, snippet trimming, graceful invalid-regex skip).tests/events_analysis_test.rswith 9 tests and two fixtures (events_clean_contract.rs,events_inconsistent_contract.rs). Fixed multilineenv.events()\n.publish(...)calls being silently skipped by the line scanner — added a normalization pass inscan_events_implthat joins split lines before scanning.Test plan
cargo test -p sanctifier-core --no-default-features— all 166 tests pass, 0 failurestests/custom_rules_test.rs(15 tests),tests/events_analysis_test.rs(9 tests),tests/storage_collision_test.rs(9 tests)tests/fixtures/events_clean_contract.rs,tests/fixtures/events_inconsistent_contract.rs,tests/fixtures/storage_collision_contract.rsbenches/benchmark.rswith S004/S005/S008 benchmark groupsCloses #499
Closes #500
Closes #502
Closes #503