Skip to content

feat(v1): add permissionless timeout fallback for stalled disputes (#166) - #176

Closed
s6pa1rta3n-lab wants to merge 1 commit into
drydocs:mainfrom
s6pa1rta3n-lab:fix-issue-166
Closed

feat(v1): add permissionless timeout fallback for stalled disputes (#166)#176
s6pa1rta3n-lab wants to merge 1 commit into
drydocs:mainfrom
s6pa1rta3n-lab:fix-issue-166

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

Resolves #166. In Tholos v1, when an assertion enters Status::Disputed, it previously had no mechanism to recover if resolvers became unresponsive, went offline, or failed to reach a majority consensus, leaving both the asserter and disputer bonds locked indefinitely.

This PR introduces a permissionless liveness fallback:

  • Configures stalled_dispute_timeout_secs upon contract initialization (bounded between 1 second and MAX_STALLED_DISPUTE_TIMEOUT_SECS of 21 days).
  • Exposes admin configuration via set_stalled_dispute_timeout and public read via get_stalled_dispute_timeout.
  • Records disputed_at timestamp when an assertion is disputed.
  • Implements reclaim_stalled_dispute(id): permissionless fallback callable after disputed_at + timeout < env.ledger().timestamp() that transitions the assertion to Status::Resolved with final_outcome: None and safely refunds both asserter and disputer bonds.
  • Follows checks-effects-interactions (storage state updated before token transfers).
  • Respects paused contract guardrails and refreshes instance storage TTL.
  • Regenerates TypeScript SDK bindings and updates documentation in CONTRACT.md and INTEGRATION.md.

Verification

  • cargo fmt --check: Passed
  • shellcheck -x scripts/*.sh scripts/lib/*.sh: Passed
  • cargo clippy --workspace --all-targets --locked -- -D warnings: Passed (0 warnings)
  • cargo test --workspace --locked: 185 tests passed (78 v1, 107 v2)
  • cargo build --workspace --lib --target wasm32v1-none --release --locked: Built successfully
  • TypeScript SDK drift verification: 0 drift
  • pnpm -C packages/tholos-sdk build: Passed
  • pnpm -C demos/freelance-escrow build: Passed

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

@collinsezedike

Copy link
Copy Markdown
Collaborator

@s6pa1rta3n-lab Closing. #166 has no assignee. Comment on the issue and wait to be assigned before opening a PR.

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.

[Bug] Stalled disputes have no liveness fallback in tholos v1

2 participants