You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Understand how CRE handles blockchain finality across different chains, including confidence levels, finality tags, and block depth configurations."
7
+
datePublished: "2025-12-03"
8
+
lastModified: "2025-12-03"
9
+
---
10
+
11
+
import { Aside, CopyText } from"@components"
12
+
13
+
Finality determines when a blockchain transaction is considered irreversible. Until a block is finalized, it could be reorganized (replaced by a different block if the chain temporarily forks), which means any data you read from it might change.
14
+
15
+
Different blockchains achieve finality in different ways and at different speeds. CRE abstracts these differences through **confidence levels**, allowing you to specify your finality requirements without needing to know the underlying chain-specific implementation.
16
+
17
+
You specify confidence levels in two places:
18
+
19
+
-**[EVM Log Triggers](/cre/reference/sdk/triggers/evm-log-trigger)** — The `confidence` parameter determines when the trigger fires based on block finality.
20
+
-**[EVM Client contract reads](/cre/reference/sdk/evm-client)** — The `blockNumber` parameter lets you query data from `LATEST` or `FINALIZED` blocks.
21
+
22
+
## Confidence levels
23
+
24
+
When reading from the blockchain or setting up triggers, you can specify one of three confidence levels:
|**`LATEST`**| The most recent block. No finality guarantees—the block could still be reorganized. | Non-critical, time-sensitive operations where speed matters more than certainty. |
29
+
|**`SAFE`**| A block that is unlikely to be reorganized, but not yet fully finalized. | A balance between speed and security for most operations. |
30
+
|**`FINALIZED`**| A block that is considered irreversible. This is the safest option. | Critical operations where you need absolute certainty the data won't change. |
31
+
32
+
<Asidetype="note"title="Default behavior">
33
+
If you don't specify a confidence level, CRE defaults to `SAFE` for triggers and `LATEST` for contract reads.
34
+
</Aside>
35
+
36
+
### Choosing the right level
37
+
38
+
-**Use `FINALIZED`** when: Processing financial transactions, updating critical state, or when incorrect data could cause significant issues.
39
+
-**Use `SAFE`** when: You need reasonable confidence without waiting for full finality. Good for most monitoring and alerting use cases.
40
+
-**Use `LATEST`** when: Building real-time dashboards, price displays, or other applications where showing the most current data is more important than guaranteed accuracy.
41
+
42
+
## How confidence levels work per chain
43
+
44
+
CRE translates confidence levels to the appropriate blockchain mechanism:
45
+
46
+
### SAFE and LATEST
47
+
48
+
For all supported chains, `SAFE` and `LATEST` use the chain's native `safe` and `latest` block tags respectively. These are standard JSON-RPC block parameters supported by all CRE-compatible chains.
49
+
50
+
### FINALIZED
51
+
52
+
-**Finality tag**: Uses the chain's native `finalized` block tag
53
+
-**Block depth**: Waits for a specified number of blocks to pass
Finality determines when a blockchain transaction is considered irreversible. Until a block is finalized, it could be reorganized (replaced by a different block if the chain temporarily forks), which means any data you read from it might change.
7120
+
7121
+
Different blockchains achieve finality in different ways and at different speeds. CRE abstracts these differences through **confidence levels**, allowing you to specify your finality requirements without needing to know the underlying chain-specific implementation.
7122
+
7123
+
You specify confidence levels in two places:
7124
+
7125
+
- **[EVM Log Triggers](/cre/reference/sdk/triggers/evm-log-trigger)** — The `confidence` parameter determines when the trigger fires based on block finality.
7126
+
- **[EVM Client contract reads](/cre/reference/sdk/evm-client)** — The `blockNumber` parameter lets you query data from `LATEST` or `FINALIZED` blocks.
7127
+
7128
+
## Confidence levels
7129
+
7130
+
When reading from the blockchain or setting up triggers, you can specify one of three confidence levels:
| **`LATEST`** | The most recent block. No finality guarantees—the block could still be reorganized. | Non-critical, time-sensitive operations where speed matters more than certainty. |
7135
+
| **`SAFE`** | A block that is unlikely to be reorganized, but not yet fully finalized. | A balance between speed and security for most operations. |
7136
+
| **`FINALIZED`** | A block that is considered irreversible. This is the safest option. | Critical operations where you need absolute certainty the data won't change. |
7137
+
7138
+
<Aside type="note" title="Default behavior">
7139
+
If you don't specify a confidence level, CRE defaults to `SAFE` for triggers and `LATEST` for contract reads.
7140
+
</Aside>
7141
+
7142
+
### Choosing the right level
7143
+
7144
+
- **Use `FINALIZED`** when: Processing financial transactions, updating critical state, or when incorrect data could cause significant issues.
7145
+
- **Use `SAFE`** when: You need reasonable confidence without waiting for full finality. Good for most monitoring and alerting use cases.
7146
+
- **Use `LATEST`** when: Building real-time dashboards, price displays, or other applications where showing the most current data is more important than guaranteed accuracy.
7147
+
7148
+
## How confidence levels work per chain
7149
+
7150
+
CRE translates confidence levels to the appropriate blockchain mechanism:
7151
+
7152
+
### SAFE and LATEST
7153
+
7154
+
For all supported chains, `SAFE` and `LATEST` use the chain's native `safe` and `latest` block tags respectively. These are standard JSON-RPC block parameters supported by all CRE-compatible chains.
7155
+
7156
+
### FINALIZED
7157
+
7158
+
- **Finality tag**: Uses the chain's native `finalized` block tag
7159
+
- **Block depth**: Waits for a specified number of blocks to pass
| `Call` | `*evm.CallMsg` | Contains the actual details of the function call you want to make. |
13377
-
| `BlockNumber` | `*pb.BigInt` | Optional. The block number to query. Defaults to `latest`. Use `-2` for `latest` (the most recent block, which may be subject to re-orgs) or `-3` for `finalized` (a block that is considered immutable and safe from re-orgs). |
| `Call` | `*evm.CallMsg` | Contains the actual details of the function call you want to make. |
13435
+
| `BlockNumber` | `*pb.BigInt` | Optional. The block number to query. Defaults to `latest`. Use `-2` for `latest` (the most recent block, which may be subject to re-orgs) or `-3` for `finalized` (a block that is considered immutable and safe from re-orgs). See [Finality and Confidence Levels](/cre/concepts/finality) for details on how finality is determined per chain. |
13378
13436
13379
13437
#### `evm.CallMsg`
13380
13438
@@ -14122,9 +14180,9 @@ The configuration struct for the EVM log trigger.
14122
14180
| `Topics` | `[]*evm.TopicValues` | A fixed 4-element array to filter event topics. The first element contains event signatures, and the next three elements contain indexed argument values. An empty array element acts as a wildcard. |
14123
14181
| `Confidence` | `ConfidenceLevel` | The block confirmation level to monitor. Can be: <ul><li>**`evm.ConfidenceLevel_CONFIDENCE_LEVEL_SAFE` (default):** A block that is considered unlikely to be reorged but is not yet irreversible.</li><li>**`evm.ConfidenceLevel_CONFIDENCE_LEVEL_LATEST`:** The most recent block. This is the fastest but least secure, as the block could be orphaned. Best for non-critical, time-sensitive actions.</li><li>**`evm.ConfidenceLevel_CONFIDENCE_LEVEL_FINALIZED`:** A block that is considered irreversible. This is the safest option, as the event is guaranteed to be on the canonical chain, but it requires waiting longer for finality.</li></ul> |
14124
14182
14125
-
14126
-
<Aside type="caution" title="SAFE block tag fallback">
14127
-
**Some chains do not support the SAFE block tag** (e.g., Shibarium). When you specify `CONFIDENCE_LEVEL_SAFE` on chains that don't support it, CRE automatically falls back to `CONFIDENCE_LEVEL_FINALIZED` for safety. Users are responsible for knowing which chains support the SAFE tag. If you need consistent behavior across all chains, explicitly use `CONFIDENCE_LEVEL_FINALIZED` or `CONFIDENCE_LEVEL_LATEST`.
14183
+
<Aside type="note" title="Finality details">
14184
+
For details on how each confidence level maps to specific chains and estimated wait times, see [Finality and
0 commit comments