docs: improve inline documentation for overflow prevention - #864
Open
q404365631 wants to merge 684 commits into
Open
docs: improve inline documentation for overflow prevention#864q404365631 wants to merge 684 commits into
q404365631 wants to merge 684 commits into
Conversation
…timization feat: optimize chat interface for mobile viewports
I added changeloggeneration with git-cliff
…py-step ci: add cargo clippy checks to contract workflows (leojay-net#310)
…window-isolation test(contract): add per-user quota reset isolation test (leojay-net#319)
Add admin audit
docs: expand README with project architecture overview
…ices show live crypto prices in chat sidebar
…ll_denied_addresses feat(contract): add admin-only get_all_denied_addresses query
…en_daily_deposit_limit_enforcement test(contract): add test for per-token daily deposit limit enforcement
…or_escrow_accounting test(contract): add invariant test for escrow accounting after migratio
# Conflicts: # stellar-contracts/src/lib.rs
# Conflicts: # stellar-contracts/src/lib.rs
…eojay-net#713 - feat(leojay-net#706): Added Zod validation to AdminGuard.tsx and unit tests - feat(leojay-net#707): Added max bounds loop prevention in deny_address - feat(leojay-net#710): Added circuit breaker bounds limiting in get_receipt_by_index - fix(leojay-net#713): Corrected edge validation via explicit bounds checking in withdraw_fees
…anel-copy-docs-timeline feat: implement issues
…inline-documentation-for-admin-authentication-logic docs: improve inline documentation for admin authentication logic
…eojay-net#670 - Error Boundary, Pagination, and Admin Auth Docs
…-672-670 Resolve issues leojay-net#666, leojay-net#684, leojay-net#672, leojay-net#670
- Replace saturating_add with checked_add in propose_upgrade so that an overflow in current_ledger + delay returns Error::Overflow instead of silently clamping to u32::MAX (which could produce an incorrect executable_after value) - Add missing delay boundary check: reject delay < MIN_UPGRADE_DELAY with Error::UpgradeDelayTooShort to prevent zero-delay timelock bypass - Fix off-by-one in execute_upgrade: change strict < to <= so execution at exactly executable_after is rejected, matching the rest of the timelock pattern (execute_admin_action, execute_renounce_admin) - Add missing admin auth and paused-state check to execute_upgrade - Add tests covering all boundary conditions and overflow edge cases docs: improve inline documentation for overflow prevention (leojay-net#659) - Add comprehensive Rustdoc to propose_upgrade, execute_upgrade, cancel_upgrade, check_invariants, require_not_paused, enforce_withdrawal_quota, and validate_and_increment_nonce explaining the overflow-prevention strategy at each site - Expand math.rs with full Rustdoc for mul_div_floor, mul_div_ceil, scale_floor including overflow boundary analysis and unit tests - Document all protocol constants with inline comments explaining their role in overflow-safe arithmetic - Add docs/OVERFLOW_PREVENTION.md: architectural guide covering all four overflow strategies (checked_add, saturating_add, fixed-point math, guarded subtraction) with examples and contributor checklist - Update docs/VERSION_MIGRATION.md with upgrade mechanism API reference and link to overflow guide - Update README.md documentation table
…docs-upgrade-validation
…cs-upgrade-validation Fix/overflow docs upgrade validation, fuzz test and invariant test
…et#695, leojay-net#687 - Issue leojay-net#62: Add Sentry integration for frontend and API error tracking - Install @sentry/nextjs package - Configure Sentry for client, server, and edge runtimes - Add error capturing to API routes - Update .env.example with SENTRY_DSN variable - Issue leojay-net#699: Add dark mode fallback to admin/page.tsx - Replace hardcoded Tailwind colors with CSS tokens - Use theme utility classes (theme-surface, theme-text-primary, etc.) - Add dynamic chart colors that respond to theme changes - Ensure all UI elements support light/dark themes - Add unit tests for dark mode support - Issue leojay-net#695: Implement replay protection for withdraw_fees - Add FeeWithdrawalNonce storage key per admin address - Require nonce parameter in withdraw_fees function - Validate nonce matches expected value before withdrawal - Increment nonce after successful withdrawal - Add get_fee_withdrawal_nonce getter function - Add comprehensive tests for replay protection - Issue leojay-net#687: Fix edge case validation in request_withdrawal - Validate token is whitelisted before processing - Check withdrawal amount doesn't exceed contract balance - Validate liabilities won't overflow - Ensure new liabilities don't exceed net deposited amount - Prevent recipient from being contract itself - Add explicit error returns for all edge cases - Add tests for edge case validation All features include tests and follow project conventions.
…s-62-699-695-687 Feat: Sentry Features Implementation
Adds set_emergency_recovery with capped limits and event emission, introduces overflow-safe counters in execute_batch_admin and heartbeat nonce progression, and expands pause/emergency/batch regression tests for the assigned upstream issues. Made-with: Cursor
…igned-issues-655-653-644-622 Fix issues leojay-net#655, leojay-net#653, leojay-net#644, and leojay-net#622 in one batch
feat(frontend): add accessible avatar contrast normalization to chat …
Keep rapid filter interactions consistent by tracking pending filter selections until the debounced URL sync completes. Add hook tests that verify batched debounced updates and immediate optimistic filtering behavior. Made-with: Cursor
- SplitViewComparison: semantic CSS variables, regions, toolbar, dialog labelling (leojay-net#638 leojay-net#643) - LandingPage: main landmark, section labels, form label, social link labels (leojay-net#640) - PriceTicker: focused keyboard shortcuts + tests (leojay-net#648) Made-with: Cursor
…ntend-a11y-theme-ticker-638-640-643-648 feat(frontend): SplitView tokens/ARIA, Landing ARIA, PriceTicker shortcuts
Closes leojay-net#555. Closes leojay-net#558. Closes leojay-net#562. Closes leojay-net#564. Made-with: Cursor
…62-564 feat: set_limit cap, ReceiptDrawer E2E, fiat telemetry, heartbeat invariants
- leojay-net#634: Rustdoc for check_slippage + docs/slippage-threshold.md + README link - leojay-net#637: Zod validation for StellarFiatModal submit paths - leojay-net#639: Theme-aligned divider classes from useFeatureFlag + regression test - leojay-net#641: AbortController on AuditTable fetches + regression test Made-with: Cursor
…7-639-641 fix: slippage docs, Zod fiat modal, feature-flag borders, audit race
…nce-transaction-filters feat(frontend): debounce transaction filters with optimistic state
…work toasts - Add Soroban invariant tests for pause and execute_batch_admin - Repair corrupted/duplicate tests in test.rs for SDK API drift - Network status toasts in SplitViewComparison and AIAssistant fetch paths - Unit tests for toast behavior Made-with: Cursor
…ues-538-554-550-563 test(contract): pause & batch admin invariants; network toasts (DRIPS)
- Add Quick Decision Table to OVERFLOW_PREVENTION.md for fast API selection - Add Common Pitfalls section covering counter increments and chained additions - Update checklist to include internal-counter safety - Replace plain +1 with checked_add(1).unwrap_or(u64::MAX) for ReceiptCounter in lib.rs for defensive consistency with overflow-checks policy
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.
Closes #592
This PR updates the overflow-prevention documentation and hardens one internal counter increment:
Markdown guide updates (OVERFLOW_PREVENTION.md):
Inline code improvements (lib.rs):