Skip to content

fix: skip TIP-403 enforcement on ZoneInbox deposit mints to prevent zone lockup#390

Open
decofe wants to merge 1 commit intomainfrom
dankrad/fix-tip403-blocked-sender-deposit-lockup
Open

fix: skip TIP-403 enforcement on ZoneInbox deposit mints to prevent zone lockup#390
decofe wants to merge 1 commit intomainfrom
dankrad/fix-tip403-blocked-sender-deposit-lockup

Conversation

@decofe
Copy link
Copy Markdown
Member

@decofe decofe commented Apr 15, 2026

Fixes #389.

When an invalid encrypted deposit is refunded to a TIP-403 blocked sender, the ZoneTip20Token precompile rejects the mint and the zone engine retries forever — permanently locking the zone.

Changes

  • crates/precompiles/src/ztip20.rs: Skip enforce_mint TIP-403 check when caller is ZONE_INBOX_ADDRESS. Deposit mints (both successful and failed-deposit refunds) are system operations where the sequencer already enforces recipient policy. Refunds to blocked senders must always succeed to prevent lockup.
  • crates/tempo-zone/src/l1.rs: Add best-effort sender TIP-403 check when redirecting failed encrypted deposits to sender. Uses match ... await instead of await? so RPC/cache failures don't stall block preparation.

Trust model note

This removes the on-chain TIP-403 guard for ZoneInbox mints. Successful encrypted deposit policy enforcement now relies entirely on the sequencer's off-chain check in L1BlockDeposits::prepare(). This is acceptable because the sequencer is already trusted to route encrypted deposits, but it's a deliberate scope change.

Testing

cargo test -p zone-precompiles -p tempo-zone  # 43 passed
cargo clippy -p zone-precompiles -p tempo-zone -- -D warnings  # clean
cargo fmt --all --check  # clean

New test: inbox_mint_skips_tip403_for_blocked_recipient — verifies ZoneInbox mints to a blocked address succeed while issuer mints to the same address are still rejected.

Prompted by: dankrad

…one lockup

When an invalid encrypted deposit is refunded to a TIP-403 blocked sender,
the zone mint reverts and the engine retries forever, locking the zone.

- Skip enforce_mint for ZONE_INBOX_ADDRESS callers (both successful deposit
  mints and failed-deposit refunds). The sequencer already enforces TIP-403
  for deposit recipients, and refunds to blocked senders must always succeed.
- Add best-effort sender TIP-403 check in the sequencer for observability
  when redirecting failed deposits to the sender.

Prompted by: dankrad

Amp-Thread-ID: https://ampcode.com/threads/T-019d92ce-6afd-736f-9cef-7322c8d2018d
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.

bug: zone locks up when invalid encrypted deposit refunds to TIP-403 blocked sender

1 participant