Files
proxmox/docs/03-deployment/TRANSACTION_MIRROR_CHAIN138_COLLISION_FIX.md
defiQUG b3a8fe4496
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
chore: sync all changes to Gitea
- Config, docs, scripts, and backup manifests
- Submodule refs unchanged (m = modified content in submodules)

Made-with: Cursor
2026-03-02 11:37:34 -08:00

2.5 KiB

TransactionMirror Chain 138 — CreateCollision and skip-mirror steps

Purpose: If deploy-transaction-mirror-and-pmm-pool-after-txpool-clear.sh fails with CreateCollision (contract already at expected address), use this to fix and proceed to pool creation only.


Address from CreateCollision trace

When the deploy fails, the trace shows the address that already has code:

Address Role
0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141 Expected TransactionMirror address (deployer + nonce 13410). If CreateCollision occurs, a contract is already deployed here.

Lookup on Chain 138:
cast code 0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141 --rpc-url $RPC_URL_138

  • If code length > 2 (i.e. not 0x): contract exists; use it as the mirror and skip deploy.
  • If code length = 2: no contract at that address on current RPC state; deploy may have failed for another reason, or state differs (e.g. different node).

Exact env + script steps

Option A — Use existing mirror and run pool-only

  1. Set the mirror address in .env (if the collision address has code on your RPC):

    # In smom-dbis-138/.env
    TRANSACTION_MIRROR_ADDRESS=0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141
    
  2. Run the script with --skip-mirror (only creates the cUSDT/cUSDC PMM pool):

    ./scripts/deployment/deploy-transaction-mirror-and-pmm-pool-after-txpool-clear.sh --skip-mirror
    
  3. Or run without --skip-mirror:
    If TRANSACTION_MIRROR_ADDRESS is set and that address has code on chain, the script skips the TransactionMirror deploy and proceeds to pool creation.

Option B — Deploy a new TransactionMirror (different address)

If you need a new mirror (e.g. that address is wrong or empty):

  1. Clear any stuck nonce: ./scripts/clear-all-transaction-pools.sh then wait ~60s.
  2. Do not set TRANSACTION_MIRROR_ADDRESS (or unset it).
  3. Run the full script again (no --skip-mirror). The next deploy will use the current nonce and a new address.

Script options (reference)

Option Effect
(none) Deploy TransactionMirror (if not skipped), then create PMM pool.
--skip-mirror Skip mirror deploy; only create PMM pool. Requires TRANSACTION_MIRROR_ADDRESS in .env.
--dry-run Print commands only; no deploy.
--force Skip RPC reachability check.

Skip logic (no flag): if TRANSACTION_MIRROR_ADDRESS is set in .env and that address has code on Chain 138, the script skips the mirror deploy and continues to pool creation.