Skip to content

Fix: MailboxRouterTransport for real algod (ARC-4 + burn accounts) - #43

Open
0xLeif wants to merge 5 commits into
mainfrom
fix/mailbox-localnet-arc4
Open

Fix: MailboxRouterTransport for real algod (ARC-4 + burn accounts)#43
0xLeif wants to merge 5 commits into
mainfrom
fix/mailbox-localnet-arc4

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ARC-4-encode mailbox put/fanout envelopes as uint16_be(len) ‖ bytes (arc4EncodeDynamicBytes).
  • On burn/reclaim, resolve the depositor via box read and pass it in foreign accounts so the inner refund succeeds.
  • Unit tests + LocalNet e2e (app 1002): put/read/burn, 3-leg fanout, 2049 B negative — all green.

Test plan

  • bun test (516 pass)
  • fledge verify lane green
  • LocalNet round-trip against deployed RavenRouter (~/raven-e2e/scratch/mailbox-roundtrip.ts) — 18/18 PASS
  • CI green on this PR

Made with Cursor

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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@0xLeif 0xLeif left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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-d with 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.md bumped 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) and REQ-algochat-025 (depositor foreign accounts for burn/reclaim refunds) — with requirement-to-test evidence mapped in testing.md.
  • specsync check --strict passes locally on the pushed tree, and the trust check 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.

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