Skip to content

Fix/deterministic error ordering#646

Open
afurious wants to merge 694 commits intoJagadeeshftw:devfrom
afurious:fix/deterministic-error-ordering
Open

Fix/deterministic error ordering#646
afurious wants to merge 694 commits intoJagadeeshftw:devfrom
afurious:fix/deterministic-error-ordering

Conversation

@afurious
Copy link

closes #612
Ensure Deterministic Error Ordering and Prioritization

morelucks and others added 30 commits February 25, 2026 15:44
…er-ci-integration

PR for Jagadeeshftw#486 Add Tests for Invariant Checker Integration in CI
…ion-flows

test: add tests for dispute resolution flows
…cy-audit-and-guards

Security/reentrancy audit and guards
…-escrow-dependencies

Feat/cross program escrow dependencies
…lation-entrypoints

feat(dry-run-simulator)
…als-rounding-policy-consistency

feat: standardize token decimals and rounding policy in contracts
…-asset-identifiers

Refactor/normalize asset identifiers
…e-scenarios

test: add tests for multi-token fee and cross-token scenarios
…applications handlers

- Define clear validation precedence hierarchy for all handlers
- Reorder validation checks to follow consistent priority:
  1. Service Availability (db, config)
  2. Input Format Validation (params parsing)
  3. Authentication (user verification)
  4. Request Body Validation (payload checks)
  5. External Account Linking (GitHub account)
  6. Resource Existence (project/issue lookup)
  7. Database/Internal Errors (unexpected failures)
  8. Authorization (permission checks)
  9. Business Logic Constraints (business rules)
  10. External Service Errors (GitHub API)

- Apply() handler: Reordered to check service → input → auth → body → linking → existence → business logic
- PostBotComment() handler: Reordered to separate existence, internal errors, authorization, and business logic
- Withdraw() handler: Reordered to check existence before authorization, separate internal errors
- Assign() handler: Reordered to separate existence, internal errors, authorization, and business logic
- Unassign() handler: Reordered to separate existence, internal errors, authorization, and business logic
- Reject() handler: Reordered to separate existence, internal errors, authorization, and business logic

This change improves debuggability and predictability by ensuring the same
inputs always produce the same error, regardless of execution path.
@Jagadeeshftw
Copy link
Owner

@afurious Can you please resolve the conflicts?

Jagadeeshftw and others added 25 commits February 26, 2026 23:58
…t-validation-human-readable-identifiers

Fix/harden input validation human readable identifiers
…lags

feat: add on-chain risk flags for programs and escrows
feat: added Sandbox Mode for Testing New Features with Real Data
…rogram-search-pagination

feat: add escrow and program search with pagination
…list-modes

Feat/blocklist allowlist modes
…e-reward-token-support

PR for Jagadeeshftw#570 Support Non-Transferable Reward Tokens in Bounties
Resolved conflicts in contracts/bounty_escrow/contracts/escrow/src/lib.rs:
- Combined test module imports (test_risk_flags + error_precedence_tests)
- Integrated deterministic error ordering in lock_funds and release_funds
- Maintained proper error priority checks from both branches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.