Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Finality Explainer #987

Merged
merged 59 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a6ac1ab
Initial commit
krofax Oct 14, 2024
0b36071
updated docs
krofax Oct 14, 2024
10bac65
updated the docs and added image
krofax Oct 14, 2024
2063c26
updated the docs
krofax Oct 14, 2024
880a3eb
fix lint issues
krofax Oct 14, 2024
7cbd715
updated finality docs
krofax Oct 23, 2024
f35ba6c
fix linting errors
krofax Oct 23, 2024
0b66134
fix conflict
krofax Oct 23, 2024
e87c41b
updated few grammar errors
krofax Oct 23, 2024
d1003e6
updated the tones
krofax Oct 23, 2024
5d50382
updated some concepts
krofax Oct 23, 2024
96d6722
removed duplications
krofax Oct 23, 2024
565bc82
Updated structure
krofax Oct 23, 2024
1a136d6
resolved suggestions
krofax Oct 23, 2024
16f6052
fix lint errors
krofax Oct 23, 2024
0139df2
Update pages/stack/transactions/_meta.json
krofax Oct 24, 2024
186d941
Update pages/stack/transactions/_meta.json
krofax Oct 24, 2024
4eced45
Update pages/stack/transactions/_meta.json
krofax Oct 24, 2024
062aa1a
Update pages/stack/transactions/_meta.json
krofax Oct 24, 2024
fc42888
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
c1ebce7
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
2b3e7ed
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
965f8b9
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
8cf8f59
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
60e3688
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
a19a677
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
6340edd
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
ce345b5
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
1d70689
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
b9acf97
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
f6f4a38
resolved comments
krofax Oct 24, 2024
376a990
fix conflict
krofax Oct 24, 2024
867fb4c
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
8a9ecd0
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
b2cac6a
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
f5929b5
updated content
krofax Oct 24, 2024
d27bae6
updated the docs
krofax Oct 24, 2024
b71df34
removed wrong word
krofax Oct 24, 2024
aacd64f
resolved comments
krofax Oct 24, 2024
71ea8fc
Used sentence case in meta json file
krofax Oct 24, 2024
d7bec26
Update pages/stack/transactions/transaction-finality.mdx
sbvegan Oct 24, 2024
04bb7e9
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 24, 2024
e755619
Update pages/stack/transactions/transaction-finality.mdx
krofax Oct 30, 2024
f9a4bb0
updated text
krofax Oct 30, 2024
4513c5c
fix merge conflict
krofax Oct 30, 2024
99abedd
fix merge conflcits
krofax Oct 30, 2024
8c54927
feat: miscellanous improvements to finality doc
smartcontracts Nov 1, 2024
eda6ab7
Removed passive tones, and rephrased contents
krofax Nov 6, 2024
4c88d3a
replaced image with a mermaid diagram
krofax Nov 6, 2024
241c587
update meta.json
krofax Nov 6, 2024
1a13d97
Fix merge conflict
krofax Nov 6, 2024
c8c3d52
updated meta.json
krofax Nov 6, 2024
76396df
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 7, 2024
47ad29d
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 7, 2024
71774a7
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 7, 2024
816ac38
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 7, 2024
45a3248
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 7, 2024
1186141
remove todo
krofax Nov 7, 2024
4460b89
Update pages/stack/transactions/transaction-finality.mdx
krofax Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pages/stack/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ import { Card, Cards } from 'nextra/components'
Documentation covering Cross Domain, Deposit Flow, Fees, Forced Transaction, Transaction Flow, Transactions, Withdrawal Flow in the Transactions section of the OP Stack ecosystem.

<Cards>
<Card title="Cross-Domain" href="/stack/transactions/cross-domain" />

<Card title="Deposit flow" href="/stack/transactions/deposit-flow" />
<Card title="Transactions" href="/stack/transactions/transactions" />

<Card title="Transaction fees on OP Stack" href="/stack/transactions/fees" />

<Card title="Transaction finality OP Stack" href="/stack/transactions/transaction-finality" />

<Card title="Forced transaction" href="/stack/transactions/forced-transaction" />

<Card title="Cross-Domain" href="/stack/transactions/cross-domain" />

<Card title="Deposit flow" href="/stack/transactions/deposit-flow" />


<Card title="Transaction Flow" href="/stack/transactions/transaction-flow" />

<Card title="Withdrawal flow" href="/stack/transactions/withdrawal-flow" />

<Card title="Transactions" href="/stack/transactions/transactions" />
</Cards>
1 change: 1 addition & 0 deletions pages/stack/transactions/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"fees": "Transaction fees",
"transaction-flow": "Transaction flow",
"transaction-finality" : "Transaction finality",
"deposit-flow": "Deposit flow",
"withdrawal-flow": "Withdrawal flow",
"forced-transaction": "Forced transaction",
Expand Down
85 changes: 85 additions & 0 deletions pages/stack/transactions/transaction-finality.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Transaction finality
lang: en-US
description: Learn when transactions on OP Stack chains can be considered finalized.
---

import Image from 'next/image'
import { Callout } from 'nextra/components'

# Transaction finality

This guide explains when transactions on OP Stack chains are considered finalized and addresses common misconceptions about transaction finality on the OP Stack.

krofax marked this conversation as resolved.
Show resolved Hide resolved
## Basics of finality

Transaction finality refers to the point at which a transaction becomes irreversible under certain assumptions. For example, Ethereum transactions are considered finalized when specific conditions in Ethereum's consensus mechanism are met. Many applications built on Ethereum rely on this property when making decisions, such as crediting a user's account after they deposit funds.

## OP Stack finality

OP Stack chains in the standard configuration are Rollups that use Ethereum's consensus mechanism to order and finalize transactions rather than running a separate consensus protocol. Therefore, OP Stack chains inherit Ethereum's ordering and finality properties.

## Steps to finality

Transactions on OP Stack chains go through the following process to reach finality:

1. A user submits a transaction to the network, which forwards it to the Sequencer.
2. The Sequencer includes the transaction in a block and distributes it over a public peer-to-peer network. At this point, the transaction is considered **"unsafe"**, a technical term indicating that the transaction is in a block but its data has not yet been posted to Ethereum. This process typically takes a few seconds from transaction submission.
3. The Sequencer publishes this block's data to Ethereum, either as [blob data](https://www.eip4844.com/) or as calldata attached to a standard Ethereum transaction. Once included in an Ethereum block, the transaction is considered **"safe"**. This step usually takes 5–10 minutes from transaction submission.
4. The Ethereum block containing the Sequencer's transaction is finalized. At this point, the transaction reaches a **"finalized"** state. Ethereum finalization typically takes about 2 epochs (approximately 12.8 minutes from transaction submission) under normal network conditions, but may take longer during adverse conditions. Finality depends entirely on [Ethereum's consensus mechanism](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/#finality).

```mermaid

sequenceDiagram
participant User
participant Network
participant Sequencer
participant Ethereum

User->>Network: Submit transaction
Network->>Sequencer: Forward transaction
Sequencer->>Sequencer: Include transaction in block
Sequencer->>Network: Distribute block over P2P network
Note right of Sequencer: Transaction status: "unsafe"<br>(block data not yet posted to Ethereum)<br>~a few seconds

Sequencer->>Ethereum: Publish block data (as blob data<br>or calldata)
Note right of Ethereum: Transaction status: "safe"<br>(included in Ethereum block)<br>~5–10 minutes

Ethereum->>Ethereum: Finalize block (~65 blocks or ~13 mins)
Note right of Ethereum: Transaction status: "finalized"<br>~13 minutes (may vary)


```
krofax marked this conversation as resolved.
Show resolved Hide resolved
## Common misconceptions

### Transactions take 7 days to finalize

A common misconception is that transactions on OP Stack chains take 7 days to finalize. **This is incorrect.** Transactions on OP Stack chains become finalized when their data is included in a finalized Ethereum block, typically around 20–30 minutes after submission. To reorg a finalized OP Stack chain transaction, a reorg of the corresponding Ethereum block would be required.

This misconception often arises due to the OP Stack's Standard Bridge, which includes a 7-day delay on *withdrawals* of ETH and ERC-20 tokens. Withdrawing tokens from an OP Stack chain to Ethereum using the Standard Bridge requires a minimum 7-day wait. This delay affects only withdrawals through the Standard Bridge and does not impact transaction finality on the OP Stack chain.
krofax marked this conversation as resolved.
Show resolved Hide resolved

### Challenges in the Standard Bridge can cause a chain reorg
krofax marked this conversation as resolved.
Show resolved Hide resolved

Another misconception related to the belief that [finalization takes 7 days](#misconception-transactions-take-7-days-to-finalize) is that **Fault Proof challenges** created in response to withdrawals in the Standard Bridge can reorganize the OP Stack chain. **This is incorrect.** OP Stack transactions are not reorganized in response to Fault Proof challenges.

The [Standard Bridge](/builders/app-developers/bridging/standard-bridge) is a bridge application that is included by default with any OP Stack chain and connects the chain to its "parent" blockchain (usually Ethereum). It offers a high level of security for ETH and ERC-20 tokens moved through the bridge.

When using the Standard Bridge, users who send ETH or ERC-20 tokens to Ethereum must first burn those tokens on the OP Stack chain and then create a **withdrawal claim** on Ethereum.

Because the Standard Bridge cannot immediately verify withdrawal claims, it delays the claim by 7 days to allow the OP Stack Fault Proof system to filter out any invalid claims. Challenges only remove bad claims without affecting the Standard Bridge or the OP Stack chain.

### The Sequencer can always reorg the chain

A common misconception is that the Sequencer can trigger reorganizations of the OP Stack chain at any time. However, while the Sequencer can reorganize **"unsafe"** blocks (not yet published to Ethereum), reorganizations become more challenging once blocks are **"safe"** and become effectively impossible once blocks are **"finalized."**

* **Unsafe blocks:** The Sequencer can reorganize these blocks (typically within \~5–10 minutes).
* **Safe blocks:** The Sequencer would need to trigger a reorg on Ethereum itself, which is complex and unlikely.
* **Finalized blocks:** Once blocks are included in a finalized Ethereum block (typically after \~15–30 minutes), the Sequencer cannot reorganize them without compromising Ethereum's finality guarantees.
krofax marked this conversation as resolved.
Show resolved Hide resolved

### Ethereum reorgs cause OP Stack chain reorgs

If Ethereum experiences a reorg, OP Stack chains will attempt a graceful recovery. OP Stack nodes will downgrade **"safe"** transactions to **"unsafe"** if needed, while the Sequencer republishes transaction data to maintain chain continuity. Although extreme Ethereum network conditions could potentially affect the OP Stack chain, **"finalized"** OP Stack transactions are protected from reorgs.

## Conclusion

Transaction finality on the OP Stack is simpler than it may seem. OP Stack chains inherit Ethereum's finality guarantees, so once a transaction is **"finalized,"** it cannot be reversed.
Binary file added public/img/op-stack/protocol/tx-finality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading