Skip to content

feat(model): callback-bounded adversaries — reentrancy specs at the call boundary (#1963 slice 6) - #2260

Merged
Th0rgal merged 1 commit into
mainfrom
feat/2087-callback-bridge
Aug 12, 2026
Merged

feat(model): callback-bounded adversaries — reentrancy specs at the call boundary (#1963 slice 6)#2260
Th0rgal merged 1 commit into
mainfrom
feat/2087-callback-bridge

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Aug 12, 2026

Copy link
Copy Markdown
Member

Lane 2.1 of the roadmap: CallbackBounded restricts an AdversaryModel's committed transitions to finite reentry schedules drawn from the contract's registered entrypoints (ReentrancySpec), formalizing "the callee can call back into the caller, pick entrypoints, observe intermediate state, and reenter before the continuation" — while excluding caller-state magic no entrypoint could perform.

  • CallbackBounded.denoteCall_preserves / denote_preserves / transaction_preserves: one invariant obligation per entrypoint covers every externally opened window of any CallProgram and the transaction commit/revert boundary.
  • Consumer corollaries on the Midnight take/liquidate example (callback_bounded_program_preserves_I, callback_bounded_transaction_preserves_I).
  • Property manifest/exclusions and VERIFICATION_STATUS/llms.txt counters updated (300 → 302).

Validation: full lake build OK, make check all passed, no sorry/admit/new axiom.


Note

Medium Risk
Touches security-critical reentrancy and external-call adversary modeling, but is additive Lean proof infrastructure with no new axioms or runtime behavior changes.

Overview
Extends reentrancy rely-guarantee proofs to the external-call boundary: a CallbackBounded adversary may only commit finite reentry schedules drawn from the caller's registered entrypoints, not arbitrary caller-state updates.

Adds CallbackBridge with denoteCall_preserves / denote_preserves / transaction_preserves, so one per-entrypoint invariant obligation covers every externally opened window of any CallProgram and the transaction commit/revert path.

Wires the Midnight take/liquidate example with callback_bounded_program_preserves_I and callback_bounded_transaction_preserves_I, and bumps theorem counters 300 → 302.

Reviewed by Cursor Bugbot for commit c3f6924. Bugbot is set up for automated code reviews on this repo. Configure here.

…the call boundary (#1963/#2087)

CallbackBounded: an adversary whose committed transitions are finite
reentry schedules drawn from the caller's registered entrypoints — the
callee may reenter through any entrypoints in any order before the
first call's continuation, but cannot perform caller-state transitions
no entrypoint could.

Laws: denoteCall_preserves (per window, all kinds/results),
denote_preserves (whole CallProgram), transaction_preserves (through
the commit/revert boundary). Consumer corollaries added to
ReentrancyRelyGuarantee (Midnight take/liquidate example): the single
liquidate obligation now covers every externally opened window of any
call program and the transaction boundary.

Manifest/coverage/status artifacts updated (302 properties).
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Ready Ready Preview Aug 12, 2026 11:51am

Request Review

@Th0rgal
Th0rgal merged commit a3c70fc into main Aug 12, 2026
4 of 6 checks passed
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5fbce0d2-840a-4e18-bc00-6af58be43c22)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OpenCodeReview first-pass review

OCR did not run — this diff has no OCR-supported files. Not a review outcome.

No changed files matched OCR include rules.

OCR pilot metrics & packet coverage

OCR pilot metrics

  • Routing: no-supported (router-v10)
  • Changed files: 0 supported / 0 total; Lean 0, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 0 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status no-supported; comments 0; files 0; tokens 0; tool calls 0; warnings 0; duration 0s

Pilot mode: advisory only. Codex Review remains the merge gate.

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.

1 participant