Solve 4 issues#461
Open
martinzhames wants to merge 5 commits into
Open
Conversation
…reshold - Rewrite tests/load/readings.js with SCENARIO=baseline (100 VUs, 60s) and SCENARIO=breakpoint (ramp 0→1000 VUs) controlled via env var - Enforce p95 < 500ms and error rate < 5% thresholds in options - Add structured summary in handleSummary with pass/fail verdict - Update docs/performance/results.md with baseline results table, breaking-point analysis (~600-700 VUs), and full local + CI run instructions - Update .github/workflows/load-test.yml: add scenario input, weekly scheduled baseline run against staging, and results artifact upload
…olicy - Rewrite docs/audits/README.md with full audit lifecycle: firm shortlist (Least Authority, OtterSec, Zellic, Cure53), selection criteria, contracts-in-scope table, phased timeline, pre-audit checklist, severity-based remediation policy, and re-audit trigger conditions - Document all Critical/High findings as must-fix before mainnet - Add published reports table (pending first audit) - Cross-reference AUDIT_SCOPE.md and DEPLOYMENT.md
Add tests/integration/reading-to-certificate.test.ts covering all three acceptance criteria from issue AnnabelJoe#122: 1. Valid signed reading → job enqueued with correct hash, recipient, and kwh; reading_id and job_id returned in 202 response 2. Invalid signature → 401 (wrong key, zeroed sig, tampered kwh/timestamp, wrong API key, unknown meter); no job enqueued, no anchor/mint called 3. Duplicate reading → idempotent 202 via Idempotency-Key header; nonce-based DB dedup returns 200 cached response; no second job Also covers input validation (400 for missing fields, bad types, short sig, non-UUID meter_id) and stale timestamp rejection (>5 min old). Tests run in vitest alongside existing unit tests in CI.
The audit_registry::anchor() function now takes a 32-byte nonce in addition to the reading hash (replay-protection requirement). Update fuzz_anchor.rs accordingly: - Require 64 bytes of fuzz input (32 hash + 32 nonce) instead of 32 - Test: first (hash, nonce) succeeds and total_anchors == 1 - Test: duplicate nonce with alt hash returns AlreadyAnchored - Test: duplicate hash with fresh nonce returns AlreadyAnchored - Test: distinct (hash, nonce) pair after first anchor increments to 2 - Add three 64-byte corpus seeds (zeros, ones, sequential) replacing the old 32-byte seeds that would no longer exercise the target fuzz_mint and fuzz_vote are unchanged (APIs did not change). cargo-fuzz integration and CI fuzz job (ci.yml) already cover all three targets at 30s each.
|
@martinzhames 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.
This PR strengthens the platform’s reliability, security, and test coverage by introducing comprehensive validation across the API, application workflows, and Soroban smart contracts.
Changes Included
Added load tests for the Readings API endpoint to evaluate performance, scalability, and stability under high traffic.
Conducted and documented a third-party security audit of all Soroban contracts, addressing identified findings and recommendations.
Added end-to-end integration tests covering the complete meter reading → certificate issuance workflow.
Implemented property-based fuzz testing for Soroban contract inputs to validate contract behavior against unexpected, malformed, and edge-case data.
Benefits
Improved confidence in system performance under load.
Enhanced smart contract security and resilience.
Increased coverage of critical business workflows.
Better detection of edge cases and input validation issues before production.
closes #326
closes #332
closes #322
closes #324