Fix: MailboxRouterTransport for real algod (ARC-4 + burn accounts) - #43
Fix: MailboxRouterTransport for real algod (ARC-4 + burn accounts)#430xLeif wants to merge 5 commits into
Conversation
Real algod rejected puts (missing uint16 length prefix on byte[]) and burns (depositor absent from foreign accounts for the inner MBR refund). Co-authored-by: Cursor <cursoragent@cursor.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
0xLeif
left a comment
There was a problem hiding this comment.
Reviewed and fixed up. The code changes themselves are solid — the ARC-4 dynamic-bytes encoding (uint16_be(len) ‖ bytes) matches the raven router ABI, and resolving the depositor via box read for the burn/reclaim foreign-accounts array is the right fix for the inner MBR refund (skipping it for absent boxes keeps burn idempotent). Tests cover the new behavior well.
What was failing: the trust gate. This repo's Trust policy (require_change_for_meaningful_files in .specsync/sdd.json) requires every meaningful changed path to be covered by an active SpecSync change, and the PR touched src/** and specs/** without one:
error: meaningful changed paths are not covered by an active change: specs/algochat/algochat.spec.md, src/blockchain/mailbox.test.ts, src/blockchain/mailbox.ts, src/index.ts, src/services/mailbox-router.service.test.ts, src/services/mailbox-router.service.ts
Fix (pushed to this branch): ran the full SDD lifecycle for the change —
- Created
CHG-0007-fix-mailboxroutertransport-for-real-algod-arc-4-encode-put-envelopes-include-dwith completed context/requirements/plan/tasks/testing/docs/design/research artifacts, definition + closing approvals, and passing verification evidence (fledge lanes run verify, 516 tests green). - Semantic delta applied to the canonical spec:
algochat.spec.mdbumped to version 5 with the CHG-0007 change-log row, and two new requirements recorded —REQ-algochat-024(ARC-4 dynamic byte encoding of put envelopes) andREQ-algochat-025(depositor foreign accounts for burn/reclaim refunds) — with requirement-to-test evidence mapped intesting.md. specsync check --strictpasses locally on the pushed tree, and thetrustcheck is now green on this PR.
One nit (non-blocking): the spec change log now has both the original hand-written 2026-07-19 row and the CHG-0007 row for the same fix — the hand-written one can be dropped in a follow-up, but removing it post-acceptance would invalidate the verification digest, so I left it.
Summary
uint16_be(len) ‖ bytes(arc4EncodeDynamicBytes).accountsso the inner refund succeeds.Test plan
bun test(516 pass)fledgeverify lane green~/raven-e2e/scratch/mailbox-roundtrip.ts) — 18/18 PASSMade with Cursor