# About Reorg

## What is Reorg?

Kaspa’s DAG structure may experience reorganizations (Reorgs):

* A single Transaction can appear in multiple blocks.
* The chain block dictates which of the transactions in the merged blocks are accepted.&#x20;
* It‘s possible that transactions, which were declared as accepted, are not accepted anymore. This happens only in the most recent blocks around the DAG tips.

## How does Kasplex L2 handle Reorg?

Kasplex L2 handle Reorg via:

1. **Monitoring**: Layer 2 Nodes track reorgs in real-time.
2. **State Rollback**: If Layer 1 undergoes a reorganization, Layer 2 reverts all transactions within the reorganization range to ensure that the Layer 2 transaction order always aligns with Layer 1.



Before Reorg:

<figure><img src="https://3072090064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJeFNvEeYZbGwlFw4JbOo%2Fuploads%2FcOj23VAc5MfkRkbt5gmr%2Freorg1.png?alt=media&#x26;token=34de1e96-0c46-4dc3-8fc9-806ad80516bd" alt=""><figcaption></figcaption></figure>

* Selected Chain: A→B→C
* Layer 2 Transaction Order: ( tx1, tx2, tx3, tx4, tx5, tx6 )



After Reorg:

<figure><img src="https://3072090064-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJeFNvEeYZbGwlFw4JbOo%2Fuploads%2F0OOENIjXXy8HdvzlQSLO%2Freorg2.png?alt=media&#x26;token=d427c3f6-d07e-4a22-84cc-6305fa8f0210" alt=""><figcaption></figcaption></figure>

* ( E ) is added, pointing to ( C ) and ( D ). Suppose ( D )’s subtree has higher blue work than ( C )’s, so ( E ) selects ( D ) as its parent.
* Selected Chain: A→B→D→E
* Layer 2 Transaction Order: ( tx1, tx2, tx3, tx4, **tx7, tx8**, tx5, tx6, tx9, tx10 )
