Skip to content

docs(audit): add runbooks for sweep-event reconstruction (#287) and trustline pre-validation (#291) - #435

Merged
phertyameen merged 1 commit into
bridgelet-org:mainfrom
judithJn:docs/audit-runbooks-judithjn-287-291
Jul 26, 2026
Merged

docs(audit): add runbooks for sweep-event reconstruction (#287) and trustline pre-validation (#291)#435
phertyameen merged 1 commit into
bridgelet-org:mainfrom
judithJn:docs/audit-runbooks-judithjn-287-291

Conversation

@judithJn

Copy link
Copy Markdown
Contributor

Audit runbooks for sweep-event reconstruction and trustline pre-validation

Closes the two operational-runbook gaps currently assigned to @judithJn in the bridgelet-audit/ knowledge base:

Both files are documentation-only additions scoped to the `bridgelet-audit/runbooks/` directory. No changes to `contracts/`, `docs/`, `scripts/`, or `tools/`, matching the stated scope of both issues.


What this PR adds

`audit-sweep-event-logs.md` (closes #287)

Operational runbook describing how to reconstruct a single sweep’s full on-chain history from emitted event logs alone. Covers:

  • A complete inventory of every event the two contracts emit (`AccountCreated`, `PaymentReceived`/`MultiPaymentReceived`, `SweepExecutedMulti`, `AccountExpired`, `ReserveReclaimed` on `EphemeralAccount`; `SweepCompleted`, `DestinationAuthorized`, `DestinationUpdated` on `SweepController`) with topic symbols and field types.
  • A cross-contract correlation methodology: `EphemeralAccount`’s `ReserveReclaimed.sweep_id` field is not shared with `SweepController`, so correlation relies on the composite key `(ephemeral_account, destination, ledger_sequence)` plus a `get_nonce()` before/after snapshot for replay-protection evidence.
  • An explicit Known gaps table covering the 1-vs-(M-1) `PaymentReceived`/`MultiPaymentReceived` asymmetry on `record_payment`, the absence of a shared `sweep_id` field, the fact that `claim()` does not iterate `transfers::execute_transfers(...)`, `increment_nonce` running before the transfer tail, and per-transfer success/failure not being emitted.

`token-trustline-validation-before-sweep.md` (closes #291)

Operational runbook for caller-side pre-flight validation that every record-payment asset can be received by the proposed sweep destination, because `SweepController::transfers::execute_transfers(...)` has no in-contract trustline gate today. Covers:

  • How to pull the destination’s per-asset trustline state from Horizon (the per-asset matrix: trustline exists / authorized / headroom).
  • Per-asset decision logic and aggregated proceed/abort gate, with native XLM excluded.
  • Step-by-step interpretation of a failed sweep transaction as a trustline-specific cause (vs. a different transfer error), including race-condition recovery guidance for issuers with `AUTH_REVOCABLE`.
  • Explicit scoping statement that the `claim()` path is not covered by this runbook because `SweepController::claim` does not iterate `transfers::execute_transfers(...)`; callers using `claim()` should treat trustline validation as a separate problem class.

Why a single PR

The two issues are sibling gaps in the same `bridgelet-audit/runbooks/` knowledge-base initiative, both assigned to the same author, both explicitly scoped to be documentation-only additions to that folder, and both part of the bridgelet-audit knowledge-base initiative (36/100 and 40/100 respectively). Keeping them in one PR makes sense and matches the standard practice of grouping related knowledge-base contributions.


CI

The repo README documents that `.github/workflows/test.yml` is fully commented out and `.github/workflows/deploy-testnet.yml` only runs validation for Rust crates. This PR touches no Rust source and no script — only two new markdown files in `bridgelet-audit/runbooks/` — so there is no build, fmt, clippy, or test gate that could regress. CI is a no-op for this change by design.


Verification


Files

```text
docs/audit-runbooks-judithjn-287-291 (commit 0f4dbfc)
2 files changed, 338 insertions(+)
```

…validation

Closes the two operational-runbook gaps assigned to @judithJn:

  - bridgelet-org#287 bridgelet-audit/runbooks/audit-sweep-event-logs.md
      Documents how to reconstruct a sweep's full history from on-chain
      event logs alone across both EphemeralAccount and SweepController,
      the cross-contract correlation methodology, and the explicit
      gaps in event coverage today (payment-event pairing semantics,
      missing sweep_id correlation, claim() vs execute_sweep event
      signatures, per-transfer success/failure).

  - bridgelet-org#291 bridgelet-audit/runbooks/token-trustline-validation-before-sweep.md
      Documents the caller-side pre-flight checks required because
      SweepController::transfers::execute_transfers has no in-contract
      trustline gate today, including the per-asset decision matrix,
      row-level guidance on interpreting a failed sweep as a trustline
      vs other transfer failure, and the explicit limitations
      regarding the claim() path.

Both files are documentation-only additions to the bridgelet-audit
knowledge base; no contracts/, docs/, scripts/, or tools/ paths are
touched, matching the stated scope of issues bridgelet-org#287 and bridgelet-org#291.
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@judithJn 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

@phertyameen
phertyameen merged commit b79fa1b into bridgelet-org:main Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants