Skip to content

Commit 3fa9a94

Browse files
committed
docs(flashblocks): clarify fallback behavior
1 parent 92b6726 commit 3fa9a94

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

docs/apps/quickstart/build-app.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,24 @@ export const config = createConfig({
560560
For production, the public endpoints are rate-limited — connect through a Flashblocks-enabled [node provider](/base-chain/node-operators/node-providers). For the underlying RPC behavior (the `pending` block tag and supported methods), see the [RPC Overview](/base-chain/api-reference/rpc-overview#flashblocks) and the [Flashblocks Reference](/base-chain/flashblocks/faq).
561561
</Note>
562562

563+
### Handle stale or unavailable Flashblocks
564+
565+
Treat Flashblocks and `pending` reads as an optimistic UX layer. Keep canonical `latest` block polling and transaction receipt polling as the source of truth for balances, settlement, and irreversible user actions.
566+
567+
Use a fallback path when any of these conditions are met:
568+
569+
- Flashblock or `pending` updates stop changing within your expected update window while `latest` continues to progress.
570+
- A provider stops returning `pending` state or responds with repeated errors.
571+
- A WebSocket subscription disconnects, is rate limited, or reconnects repeatedly.
572+
573+
When the fallback path is active:
574+
575+
- Continue showing pending state when it is available, but label it as preconfirmed or optimistic.
576+
- Show the transaction hash immediately after submission so users can inspect progress independently.
577+
- Poll `eth_getTransactionReceipt` until the transaction is canonically included.
578+
- Refresh balances and final UI state from `latest` after inclusion.
579+
- Avoid blocking critical buttons or irreversible confirmations on `pending` state alone.
580+
563581
## Next steps
564582

565583
- **Go to mainnet** — add `base` to your `chains` array and transports in `config/wagmi.ts`, redeploy your contract to Base mainnet, and update `COUNTER_ADDRESS`.

0 commit comments

Comments
 (0)