Reconcile identical Starknet messages delivered to Ethereum
Two Starknet-to-Ethereum messages with the same sender, recipient and payload can have the same message hash. The L1 core contract tracks how many matching messages remain consumable.
Count occurrences before matching deliveries
Derive the message hash from the Starknet sender, padded L1 recipient, payload length and payload elements under the protocol encoding. When indexing L2 events retain their individual positions as well as the hash.
message hash H published twice → available count 2
one successful consumption → available count 1
If two messages produce H and the authorized L1 destination consumes one, one occurrence remains. A database with H as a unique row and only a consumed boolean cannot represent this state correctly.
Check who actually consumed the message
L1 consumption binds the destination to the calling address. A matching payload in some unrelated transaction does not consume the message. Also distinguish an L2 emission from availability after the relevant state update reaches Ethereum. docs.starknet.io Starknet documentation