|
| 1 | +# Zone Commands |
| 2 | + |
| 3 | +## Release-first smoke test |
| 4 | + |
| 5 | +```bash |
| 6 | +cargo build --bin tempo-zone --release |
| 7 | +``` |
| 8 | + |
| 9 | +Create a fresh zone when you need a clean router test: |
| 10 | + |
| 11 | +```bash |
| 12 | +just deploy-zone my-zone |
| 13 | +``` |
| 14 | + |
| 15 | +That recipe creates the zone, stores `sequencerKey` in `generated/my-zone/zone.json`, and starts the node immediately. If you need tighter control, run: |
| 16 | + |
| 17 | +```bash |
| 18 | +target/debug/tempo-xtask create-zone --output generated/my-zone --l1-rpc-url "$HTTP_RPC" --sequencer "$SEQUENCER_ADDR" --private-key "$SEQUENCER_KEY" |
| 19 | +target/debug/tempo-xtask set-encryption-key --l1-rpc-url "$HTTP_RPC" --portal "$PORTAL" --private-key "$SEQUENCER_KEY" |
| 20 | +``` |
| 21 | + |
| 22 | +## Start a zone in release |
| 23 | + |
| 24 | +```bash |
| 25 | +RUST_LOG=warn just zone-up my-zone false release |
| 26 | +``` |
| 27 | + |
| 28 | +Health check: |
| 29 | + |
| 30 | +```bash |
| 31 | +cast block-number --rpc-url http://localhost:8546 |
| 32 | +``` |
| 33 | + |
| 34 | +Read deployment metadata: |
| 35 | + |
| 36 | +```bash |
| 37 | +jq '{zoneId, portal, tempoAnchorBlock, zoneFactory, swapAndDepositRouter, sequencerAddress}' generated/my-zone/zone.json |
| 38 | +``` |
| 39 | + |
| 40 | +## Direct deposit + withdrawal validation |
| 41 | + |
| 42 | +Set the active portal first: |
| 43 | + |
| 44 | +```bash |
| 45 | +export L1_PORTAL_ADDRESS="$(jq -r '.portal' generated/my-zone/zone.json)" |
| 46 | +``` |
| 47 | + |
| 48 | +Approve the L1 portal before depositing: |
| 49 | + |
| 50 | +```bash |
| 51 | +just max-approve-portal |
| 52 | +``` |
| 53 | + |
| 54 | +Send a deposit to the zone: |
| 55 | + |
| 56 | +```bash |
| 57 | +just send-deposit 1000000 |
| 58 | +``` |
| 59 | + |
| 60 | +Approve the L2 outbox before withdrawing: |
| 61 | + |
| 62 | +```bash |
| 63 | +just max-approve-outbox |
| 64 | +``` |
| 65 | + |
| 66 | +Request a withdrawal back to L1: |
| 67 | + |
| 68 | +```bash |
| 69 | +just send-withdrawal 400000 |
| 70 | +``` |
| 71 | + |
| 72 | +`just send-withdrawal` only waits for L1 finalization if both `L1_RPC_URL` and `L1_PORTAL_ADDRESS` are set. |
| 73 | + |
| 74 | +## Router validation flow |
| 75 | + |
| 76 | +Deploy the router: |
| 77 | + |
| 78 | +```bash |
| 79 | +just deploy-router my-zone |
| 80 | +``` |
| 81 | + |
| 82 | +Run the demo with defaults: |
| 83 | + |
| 84 | +```bash |
| 85 | +just demo-swap-and-deposit my-zone |
| 86 | +``` |
| 87 | + |
| 88 | +If you need overrides, pass them positionally because the current recipe treats them as positional args: |
| 89 | + |
| 90 | +```bash |
| 91 | +just demo-swap-and-deposit my-zone 100000000 0 http://localhost:8546 |
| 92 | +``` |
| 93 | + |
| 94 | +Direct xtask equivalent: |
| 95 | + |
| 96 | +```bash |
| 97 | +target/debug/tempo-xtask demo-swap-and-deposit \ |
| 98 | + --zone-dir generated/my-zone \ |
| 99 | + --l1-rpc-url "$HTTP_RPC" \ |
| 100 | + --zone-rpc-url http://localhost:8546 \ |
| 101 | + --private-key "$PRIVATE_KEY" \ |
| 102 | + --amount 100000000 \ |
| 103 | + --tick 0 |
| 104 | +``` |
| 105 | + |
| 106 | +## Sync debugging |
| 107 | + |
| 108 | +Tail the zone log: |
| 109 | + |
| 110 | +```bash |
| 111 | +tail -f /tmp/tempo-zone-my-zone*/logs/*/reth.log |
| 112 | +``` |
| 113 | + |
| 114 | +Useful patterns: |
| 115 | + |
| 116 | +```bash |
| 117 | +rg -n "Prepared L1 block deposits|Including advanceTempo|TokenEnabled|DepositProcessed|WithdrawalProcessed" /tmp/tempo-zone-my-zone*/logs/*/reth.log |
| 118 | +``` |
| 119 | + |
| 120 | +When `demo-swap-and-deposit` stalls at token enablement: |
| 121 | + |
| 122 | +1. Get the L1 tx block for the `enableToken` tx: |
| 123 | + |
| 124 | +```bash |
| 125 | +cast receipt <tx-hash> --rpc-url "$HTTP_RPC" |
| 126 | +``` |
| 127 | + |
| 128 | +2. Compare it with the latest processed L1 block in the log: |
| 129 | + |
| 130 | +```bash |
| 131 | +tail -n 200 /tmp/tempo-zone-my-zone*/logs/*/reth.log | rg "Prepared L1 block deposits|Including advanceTempo" |
| 132 | +``` |
| 133 | + |
| 134 | +If the zone is still behind the tx block, wait longer or rerun the test with a `release` node. |
| 135 | + |
| 136 | +## Known failure modes |
| 137 | + |
| 138 | +- `swapAndDepositRouter not found`: run `just deploy-router <name>` or pass `--router`. |
| 139 | +- Missing sequencer key: read `sequencerKey` from `generated/<name>/zone.json` or set `SEQUENCER_KEY`. |
| 140 | +- Timeout waiting for `TokenEnabled`: the zone is usually still catching up. |
| 141 | +- Restart crash with `failed to seed transferPolicyId ... Uninitialized`: inspect `crates/tempo-zone/src/l1_state/tip403/cache.rs` and prefer a fresh zone for smoke tests involving temporary tokens. |
0 commit comments