!5335zly/evm-receipt-gate-fixes → develop04f101627c

Fix EVM receipt skipping for failed outbounds and direct token deposits

AI-generatedEverything on this page was written by an AI agent from the diff: the summaries, the narration, the diagrams, the flags and the glossary. It can be wrong or incomplete, so check it against the code before you rely on it.

2commits
10files
377lines changed
108lines to read
3chains gated
nonemigration

Where the diff is

When a block gets its receipts

A cached transaction now forces a fetch; direct deposits must name the vault.

Router bloomrouter log?Tx fieldsvault in tx?Signer cachenew final checkSkipno cached txFetch receiptshit or read errorFailedrelease lockDirect parsercall and log agree
newchanged

3-minute explainer

What changed

The stuck outbound

A reverted outbound from a delisted vault never reached the receipt code.

signedrevertedvault leftlocked

Signer cache check

A cache hit or read error fetches receipts before any skip.

bloomtx fieldssigner cache

Receipt decides

Failed clears the entry; successful keeps its double-sign protection.

  • failed → retry
  • success → stays locked

Direct deposits name the vault

Call and Transfer event must agree on one active vault.

call recipientactive vaultlog topic

Event sets the amount

The vault is credited what the event reports, not the request.

100call asks98event, credited

Rollout risk

No version gate; only chains with the direct inbound Mimir on are exposed.

EVMDirectERC20Inbound-<chain>

Line by line · every changed logic line, narrated

4:32runtime
8code chapters
100%logic lines narrated (90/90)
7flagged spots
speed

Chapters

What to check

Ask an AI about this change

Chat assistantClaude, ChatGPT, … (reads a link)

Coding agentClaude Code, Cursor, … (reads the repo)

The context file is context.md. Use Copy with context for an AI that can't open links; it pastes the whole file in.

Glossary

Calldata
A transaction's input bytes: a 4-byte selector, then 32-byte words. For transfer, those words are recipient and amount.
Direct ERC20 inbound
A token transfer straight to a vault, bypassing the router, so it carries no memo and uses memoless or refund handling. direct_erc20_transfer.go ↗
logsBloom
A block header filter over log addresses and topics. It has no false negatives, so a miss rules a router log out.
Mimir
Node-voted runtime settings. EVMDirectERC20Inbound-<chain> turns direct inbounds on per chain. mimir_strings.go ↗
Receipt gate
Scanner logic that skips fetching a block's receipts when nothing in the block could produce an observation. receipts_gate.go ↗
Reverse index
Signer cache entries mapping a broadcast hash to its outbound item. The new check reads it, and RemoveSigned uses it. signer_cache_store.go ↗
Signer cache
Node-local LevelDB record of outbounds this node signed. It blocks signing the same outbound twice until cleared. signer_cache_store.go ↗
Transfer event
The log an ERC20 token emits. Its indexed topics hold sender and recipient, and its data holds the amount.