Skip to content

OffchainLabs/arbitrum-docs / .agents/skills/arbitrum-best-practices

arbitrum-best-practices

Verified

Arbitrum L2 development best practices. Use when implementing bridges, Orbit chains, SDK integrations, or debugging cross-chain transactions. Triggers on Arbitrum, L2, rollup, bridge, retryable, Orbit, Nitro, or cross-chain contexts.

rules/bridge-l2-l1-messaging.md

View on GitHub
---
title: L2-to-L1 Messages Require Challenge Period
impact: CRITICAL
impactDescription: withdrawal timing
tags: bridge, l2-l1, messaging, withdrawals
---

## L2-to-L1 Messages Require Challenge Period

L2-to-L1 withdrawals cannot execute immediately. The ~7 day challenge period is fundamental to optimistic rollup security—it allows fraud proofs to be submitted if the state is invalid.

**Incorrect (expecting immediate execution):**

```typescript
// Bad: Attempting to execute immediately after sending
const tx = await arbSys.sendTxToL1(l1Target, calldata)
await tx.wait()
await outbox.executeTransaction(...) // Will fail!
```

**Correct (wait for confirmation status):**

```typescript
// Good: Check status before attempting execution
const message = messages[0]
const status = await message.status(l1Provider)

if (status === L2ToL1MessageStatus.CONFIRMED) {
  await message.execute(l1Provider) // Ready after ~7 days
} else {
  console.log('Still in challenge period')
}
```

The challenge period is ~7 days on mainnet, ~1 hour on Sepolia testnet. This delay is non-negotiable—it's the security mechanism that makes optimistic rollups work.

For detailed implementation, see [L2 to L1 Messaging](https://docs.arbitrum.io/how-arbitrum-works/arbos/l2-l1-messaging).
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall