Skip to content

docs/INVARIANTS.md: add outbound no-replay invariant#804

Open
kcsongor wants to merge 1 commit intomainfrom
cs/ntt-outbound-replay-invariant
Open

docs/INVARIANTS.md: add outbound no-replay invariant#804
kcsongor wants to merge 1 commit intomainfrom
cs/ntt-outbound-replay-invariant

Conversation

@kcsongor
Copy link
Contributor

@kcsongor kcsongor commented Jan 29, 2026

Summary by CodeRabbit

  • Documentation
    • Added INV-032: per-transceiver outbound emission uniqueness to prevent duplicate outbound message emissions.
    • Described enforcement approaches across platforms, including per-transceiver release tracking and queue removal to stop re-emission.
    • Defined new error codes for detecting and reporting duplicate emission attempts.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds INV-032 to docs/INVARIANTS.md: an invariant requiring that each transceiver may emit a specific outbound message only once, with Solana/Sui using a released bitmap and EVM using atomic queue deletion; introduces related error codes and references to updated outbox/queue logic.

Changes

Cohort / File(s) Summary
Outbound Message Invariant Documentation
docs/INVARIANTS.md
Adds INV-032: per-transceiver outbound emission uniqueness. Documents enforcement mechanisms (released bitmap for Solana/Sui, atomic queue deletion for EVM), mentions new error codes (MessageAlreadySent, EMessageAlreadySent), and references OutboxItem.released, try_release(), and completeOutboundQueuedTransfer().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I nibble at the log with care,
One hop, one send — no duplicate dare.
Bitmaps and queues keep mischief at bay,
INV-032 guards the one-way.
Hooray for messages sent just once! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding an outbound replay protection invariant to the INVARIANTS.md documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cs/ntt-outbound-replay-invariant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/INVARIANTS.md`:
- Around line 280-289: Update INV-032 to clarify that the same
OutboxItem.released bitmap implementation underpins INV-004, INV-005 and INV-032
(hence reuse of the MessageAlreadySent / EMessageAlreadySent error names) and
explicitly document that EVM enforces the invariant differently:
completeOutboundQueuedTransfer() relies on atomic queue deletion and absence of
an entry (results in OutboundQueuedTransferNotFound on a second attempt) rather
than emitting a MessageAlreadySent error; reference OutboxItem.released,
try_release(), completeOutboundQueuedTransfer(), MessageAlreadySent,
EMessageAlreadySent, and OutboundQueuedTransferNotFound in the note so readers
understand shared implementation vs distinct EVM enforcement.

@johnsaigle johnsaigle force-pushed the cs/ntt-outbound-replay-invariant branch from 5324da5 to c736593 Compare January 30, 2026 19:01
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.

2 participants