Skip to content

Commit adf4517

Browse files
authored
bnb-smart-chain/developers/json_rpc: improve doc for eth_getFinalizedXXX (#715)
1 parent f3e2b8e commit adf4517

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/bnb-smart-chain/developers/json_rpc/bsc-api-list.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ These methods allow you to handle block finality using a straightforward API.
9393
- `-1` represents at least `len(currentValidators) * 1/2`
9494
- `-2` represents at least `len(currentValidators) * 2/3`
9595
- `-3` represents at least `len(currentValidators)`
96+
* Using `-1`, `-2`, or `-3` provides a convenient way to select the desired security level according to your application and the corresponding waiting time. When one of these values is used as the parameter, the returned block is increasingly less likely to be reverted. **Historically, blocks returned by `eth_getFinalizedHeader` with `-1`, `-2`, or `-3` on BSC have never been reverted.**
97+
* If the highest security level is required, you can choose `-3`.
9698
* This function calculates `probabilisticFinalizedHeight` as the highest height of the block verified by `verifiedValidatorNum` validators and then returns the block header with a height equal to `max(fastFinalizedHeight, probabilisticFinalizedHeight)`.
9799
* The height of the returned block header is guaranteed to increase monotonically.
98100
For example:
@@ -105,6 +107,8 @@ curl -X POST "http://localhost:8545/" -H "Content-Type: application/json" --dat
105107
- `-1` represents at least `len(currentValidators) * 1/2`
106108
- `-2` represents at least `len(currentValidators) * 2/3`
107109
- `-3` represents at least `len(currentValidators)`
110+
* Using `-1`, `-2`, or `-3` provides a convenient way to select the desired security level according to your application and the corresponding waiting time. When one of these values is used as the parameter, the returned block is increasingly less likely to be reverted. **Historically, blocks returned by `eth_getFinalizedHeader` with `-1`, `-2`, or `-3` on BSC have never been reverted.**
111+
* If the highest security level is required, you can choose `-3`.
108112
* This function calculates `probabilisticFinalizedHeight` as the highest height of the block verified by `verifiedValidatorNum` validators and then returns the block header with a height equal to `max(fastFinalizedHeight, probabilisticFinalizedHeight)`.
109113
* If `fullTx` is true, the block includes all transactions; otherwise, only transaction hashes are included.
110114
* The height of the returned block is guaranteed to be monotonically increasing.

0 commit comments

Comments
 (0)