L1/L2 Reorg Behaviour

Just doing some digging into chain reorgs and was hoping you might have some details on how Starknet handles them:

  • In the instance of an L2 reorg (very unlikely but it did happen in back in April 2024):

    • How does Starknet handle the submitted transactions? I assume they mark the transaction as REVERTED, but do they re-process the transaction or would we need to resubmit?
    • I guess it is up to us to monitor the last block hash we received to ensure there has not been a reorg or do Starknet give an easy mechanism for this?
  • In the instance of an L1 reorg:

    • For an unconfirmed transaction:

      • Does the transaction remain in the mempool and is reprocessed? Would this end up with a new Tx hash? How might we be notified of this new Tx?
    • For a confirmed (multiple confirmations) transaction (incredibly unlikely)

      • Starknet would mark this as REVERTED?
      • If so, I guess we need to resubmit? And we would do this by listening for REVERTED transactions
      • Could this potentially lead to a situation in which one transaction (Tx1) is confirmed on L1 (on what turns out to be an uncle), another (Tx2) is later confirmed on L1 on the canonical which means Tx2 is final but Tx1 is reverted after Tx2 is submitted?

Any help here or pointing in the right direction would be very useful.