Skip to content

fix: audit deadline boundary semantics across all four lifecycle functions - #159

Open
blessedDev-xyz wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
blessedDev-xyz:test/deadline-boundary-audit
Open

fix: audit deadline boundary semantics across all four lifecycle functions#159
blessedDev-xyz wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
blessedDev-xyz:test/deadline-boundary-audit

Conversation

@blessedDev-xyz

Copy link
Copy Markdown

Summary

Audits every intent.deadline comparison in the intent lifecycle and pins the boundary behaviour with explicit tests and rustdoc comments.

Findings

Function Operator Boundary (now == deadline) Semantics
accept_intent now >= deadline fails deadline is exclusive — solver's window is [created_at, deadline)
fill_intent now >= deadline fails fill window is exclusive — solver must fill before deadline
slash_solver now < deadline succeeds deadline is inclusive — slash opens at the deadline second
expire_intent now < deadline succeeds deadline is inclusive — expiry opens at the deadline second

All comparisons are logically consistent with the state machine design. The asymmetry (>= vs <) is intentional: accept/fill protect the actor in the window; slash/expire open the action at the boundary.

Changes

  • lib.rs: rustdoc boundary-semantics comments added next to each of the four comparison sites
  • test.rs: 6 new boundary tests (at exactly now == deadline) added under a dedicated ─── Deadline Boundary Tests section

Validation

cargo fmt, cargo clippy -- -D warnings, cargo test — 61 tests pass, 0 fail.

Closes #42

…tent/slash_solver/expire_intent

- Add boundary tests (now == deadline) for all four lifecycle functions to
  document and pin the exact behavior at the boundary second
- add/fill use >= (deadline is exclusive for the action window)
- slash/expire use < (deadline is inclusive — action is valid at the deadline
  second itself, not strictly after)
- Add rustdoc boundary-semantics comments next to each comparison site

Closes stellar-vortex-protocol#42
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@blessedDev-xyz 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! 🚀

Learn more about application limits

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.

Audit deadline comparison operators across accept_intent/fill_intent/slash_solver/expire_intent for off-by-one consistency

2 participants