Discrepancy Detection
Last updated
Last updated
The Challenge Process begins when a Validating Node (VN) detects a discrepancy in the way transactions are processed. These discrepancies can arise in various forms, typically involving mismatches in the sequence or content of transactions. Below are examples of specific discrepancies that VNs monitor for, along with practical cases.
The sequencer is responsible for processing off-chain orders in the correct order. If the sequencer processes these orders out of order, VNs will detect this and raise a challenge.
Example:
Order 1: User A submits a sell order for 1 BTC to buy 1 ETH at 10:01 AM.
Order 2: User B submits a sell order for 1 ETH to buy 1 BTC at 10:02 AM.
The correct sequence should be that Order 1 is processed before Order 2. If the sequencer mistakenly processes Order 2 before Order 1, VNs will detect this as a discrepancy in the sequencing and trigger a challenge.
VNs also compare the transactions processed by the off-chain sequencer with the corresponding records on the blockchain. If the data submitted on-chain does not match the off-chain data processed by the sequencer, this can trigger a challenge.
Example:
On-Chain Data: The blockchain shows Order A as Sell 1 BTC for 1 ETH.
Off-Chain Sequencer: The sequencer records Order A as Sell 0.5 BTC for 1 ETH (incorrect data).
In this case, the on-chain transaction does not match the off-chain transaction, and the VNs detect this mismatch. They initiate a challenge to investigate why the data does not align.
Another key role of VNs is to ensure that all valid orders are processed and included. If the sequencer excludes a valid order from being posted on-chain, VNs will catch this and trigger a challenge.
Example:
Order 1: User A submits a valid order to sell 1 BTC for 1 ETH.
Order 2: User B submits a valid order to sell 1 ETH for 1 BTC.
Both orders are valid, but only Order 2 is posted on-chain by the sequencer. If Order 1 is excluded (not posted on-chain), VNs will detect that it was missing, by comparing it to the on-chain orders (Submission B) method and initiate a challenge.
Let’s consider a scenario where VNs detect an incorrect order match or exclusion.
Example:
Order A: Sell 1 BTC for 1 ETH (submitted by User A).
Order B: Sell 1 ETH for 1 BTC (submitted by User B).
Order C: Sell 1 ETH for 1 BTC (submitted by User C).
The orders are such that Order A could match with either Order B or Order C. The correct match depends on the order in which Order B and Order C arrived. If Order B arrived first, it should match with Order A. If the sequencer incorrectly matches Order A with Order C (despite Order B arriving earlier), VNs will detect this mis-sequencing and raise a challenge.
Additionally, if Order A is excluded entirely from the on-chain records, VNs will flag this as an exclusion issue and initiate a challenge to investigate why the order was not included.