Skip to content

Commit bd8a496

Browse files
authored
Merge branch 'main' into x402-support
2 parents 50512ac + d88638e commit bd8a496

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

docs/pos/concepts/finality/finality.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
## How to Get Finalized Block
66

7-
Simply use the standard `eth_getBlockByNumber` JSON-RPC method with the `"finalized"` block parameter to retrieve information about the most recently finalized block in Polygon PoS. Finalized blocks are considered highly secure and irreversible, making them crucial for applications requiring strong transaction certainty.
7+
Use the standard `eth_getBlockByNumber` JSON-RPC method with the `"finalized"` block parameter to retrieve information about the most recently finalized block in Polygon PoS.
8+
Finalized blocks are considered highly secure and irreversible,
9+
making them crucial for applications requiring strong transaction certainty.
810

911
To get the finalized block, you can use the following JSON-RPC call:
1012

@@ -32,12 +34,7 @@ async function milestones_checkFinality(client: any, txHash: string): Promise<bo
3234
console.log(`Your transaction block: ${tx.blockNumber}`)
3335

3436
// Checking whether the finalized block number via milestones has reached the transaction block number.
35-
if (latestBlock.number !== null && latestBlock.number > tx.blockNumber) {
36-
console.log("Your transaction block has been confirmed after 16 blocks");
37-
return true
38-
} else {
39-
return false
40-
}
37+
return (latestBlock.number !== null && latestBlock.number > tx.blockNumber)
4138
}
4239
```
4340

@@ -67,8 +64,8 @@ async function milestones_checkFinality(client: any, txHash: string): Promise<bo
6764
### Results
6865

6966
The results should show whether the transaction has been finalized based on the
70-
selected milestone mechanism and network. Usually Milestones will take 3-5
71-
seconds to finalize the transaction.
67+
selected milestone mechanism and network.
68+
Usually Milestones will take 2–5 seconds to finalize the transaction.
7269

7370

7471

@@ -86,16 +83,20 @@ deterministic finality is Ethereum.
8683
With the introduction of milestones:
8784

8885
- Finality is **deterministic** even before a checkpoint is submitted to L1.
89-
After a certain number of blocks in consensus layer, a milestone is proposed and
90-
validated by Heimdall. Once 2/3+ of the network agrees, the milestone is
91-
finalized, and all transactions up to that milestone are considered final,
92-
with no chance of reorganization.
86+
With the new milestones flow, every validator proposes the local bor blocks'
87+
hashes they see after the last milestone.
88+
This gets done at every Heimdall height, leveraging vote extensions.
89+
Basically, on the consensus layer, at height H, every validator proposes the block hashes
90+
he has produced/imported since the last finalized milestone via vote extensions;
91+
then these vote extensions become available at the next height.
92+
When finalizing heimdall height H+1, Heimdall looks for the longest common sequence of block hashes
93+
from all the validators that have 2/3+ agreement, and that gets finalized as the new milestone.
9394

9495
- Separation of Checkpoints and Milestones: Checkpoints still occur every 256
9596
blocks (minimum) and are submitted to Ethereum. However, milestones provide
96-
much faster finality on Polygon chain, using Heimdall layer for
97+
much faster finality on Polygon Chain, using Heimdall layer for
9798
finalization, improving the user experience significantly.
9899

99-
_Finality achieved after a number of blocks confirmation,
100-
as well as a consensus period among the validators (approx. 3-5 seconds)_
100+
_Finality achieved after a block confirmation,
101+
as well as a consensus period among the validators (approx. 2–5 seconds)_
101102

mkdocs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ nav:
6767
- Stripe: pos/payments/onramps/onramps-stripe.md
6868
- Transfers:
6969
- USDC: pos/payments/transfers/transfer-usdc.md
70-
- x402:
71-
- Overview: pos/payments/x402/overview.md
72-
- Quickstart for Buyers: pos/payments/x402/quickstart-buyers.md
73-
- Quickstart for Sellers: pos/payments/x402/quickstart-sellers.md
7470
- Node how-tos:
7571
- Prerequisites: pos/how-to/prerequisites.md
7672
- Sync node using snapshots: pos/how-to/snapshots.md

0 commit comments

Comments
 (0)