Skip to content

Commit 61a6ee4

Browse files
authored
Update reference block documentation (#1369)
1 parent add0fe0 commit 61a6ee4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

docs/build/basics/transactions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ Transactions may declare parameters it needs during execution, these must be pro
6666

6767
A reference to a recent block used for expiry. A transaction is considered expired if it is submitted to Flow after reference block height + N, where N is a constant defined by the network. On mainnet current setting for N is 600 which amounts to approximately 10 minutes for expiry (please note this is subject to change).
6868

69+
:::caution
70+
It is recommended to use the latest finalized block as the reference block, as it is the most recent block guaranteed to be included by the network. Using the latest sealed block is not recommended, as sealing occurs after finalization and could cause the transaction to fall outside of the expiration window.
71+
:::
72+
6973
### Gas Limit
7074

7175
When a transaction is executed each operation consumes a predefined amount of computational units (we define more about that in the Fees documentation). This defines the maximum amount of computation that is allowed to be done during this transaction. If a transaction completes execution using fewer computational units than the limit, it remains unaffected. However, if it hits this limit during execution, the transaction will fail, its changes will be reverted, but fees will still be applied. The maximum computational limit for Flow mainnet is currently at 9999, but this might change. The maximum network limit is defined to protect the network from transactions that would run forever.

docs/tools/clients/fcl-js/sdk-guidelines.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ The gas limit depends on the complexity of the transaction script. Until dedicat
305305
A transaction will be rejected if it is submitted past its expiry block. Flow calculates transaction expiry using the _reference block_ field on a transaction.
306306
A transaction expires after `600` blocks are committed on top of the reference block, which takes about 10 minutes at average Mainnet block rates.
307307

308+
It is recommended to use the latest finalized block as the reference block, as it is the most recent block guaranteed to be included by the network. Using the latest sealed block is not recommended, as sealing occurs after finalization and could cause the transaction to fall outside of the expiration window. If not specified, FCL will automatically use the latest finalized block as the reference block.
309+
308310
### Mutate
309311
[<img src="https://raw.githubusercontent.com/onflow/sdks/main/templates/documentation/ref.svg" width="130" />](./api.md#mutate)
310312

docs/tools/clients/flow-go-sdk/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,12 @@ tx.SetProposalKey(
10091009
creatorAccountKey.SequenceNumber,
10101010
)
10111011

1012-
// Get the latest sealed block to use as a reference block
1013-
latestBlock, err := flowClient.GetLatestBlockHeader(context.Background(), true)
1012+
// Get the latest finalized block to use as a reference block
1013+
// It is recommended to use the latest finalized block as the reference block, as
1014+
// it is the most recent block guaranteed to be included by the network. Using the
1015+
// latest sealed block is not recommended, as sealing occurs after finalization and
1016+
// could cause the transaction to fall outside of the expiration window.
1017+
latestBlock, err := flowClient.GetLatestBlockHeader(context.Background(), false)
10141018
if err != nil {
10151019
panic("failed to fetch latest block")
10161020
}

0 commit comments

Comments
 (0)