fix: skip TIP-403 enforcement on ZoneInbox deposit mints to prevent zone lockup#390
Open
fix: skip TIP-403 enforcement on ZoneInbox deposit mints to prevent zone lockup#390
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #389.
When an invalid encrypted deposit is refunded to a TIP-403 blocked sender, the
ZoneTip20Tokenprecompile rejects the mint and the zone engine retries forever — permanently locking the zone.Changes
crates/precompiles/src/ztip20.rs: Skipenforce_mintTIP-403 check when caller isZONE_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. Usesmatch ... awaitinstead ofawait?so RPC/cache failures don't stall block preparation.Trust model note
This removes the on-chain TIP-403 guard for
ZoneInboxmints. Successful encrypted deposit policy enforcement now relies entirely on the sequencer's off-chain check inL1BlockDeposits::prepare(). This is acceptable because the sequencer is already trusted to route encrypted deposits, but it's a deliberate scope change.Testing
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