Skip to content

Commit 01abc03

Browse files
authored
Cleanup stray accountNonce reference (#1880)
* Cleanup stray accountNonce reference * Comment for system.account upgrades
1 parent e041946 commit 01abc03

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/start/FAQ.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ The length for this transaction validity is set to 50 blocks, which translates t
3636

3737
## My chain does not support system.account queries
3838

39-
The API always tracks the latest Substrate master in terms of examples. This means that nonce & balance queries are done via the `api.query.system.account(<account>)` which returns a Tuple `(Index, AccountData)` where the first is the nonce, the second a struct containing the free and reserved balances. As with all `api.query.*` endpoint, this is decorated based on what the chain you connect to support.
39+
The API always tracks the latest Substrate master in terms of examples. This means that nonce & balance queries are done via the `api.query.system.account(<account>)` which returns a Tuple `(Index, AccountData)` where the first is the nonce, the second a struct containing the free and reserved balances. As with all `api.query.*` endpoints, this is decorated based on what the chain you connect to support, via the metadata exchange.
4040

4141
It is possible that you are connecting to an older chain that has not been upgraded yet. For these chains, this storage entry won't be available (yet). To query the nonce on older chains, you can do a query to `api.query.system.accountNonce(<account>)` and balances can be retrieved via `api.query.balances.freeBalance(<account>)`.
42+
43+
Likewise, if your chain has been upgraded recently and you are still using the old `system.accountNonce` or `balances.freeBalance` queries in your code (which is now not available in the chain metadata), you need to update it to query the new location.

docs/start/api.tx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The result for this call (we will deal with subscriptions in a short while), is
2828

2929
Despite the single-line format of `signAndSend`, there is a lot happening under the hood (and all of this can be manually provided) -
3030

31-
- Based on the sender, the API will retrieve the `system.accountNonce` to determine the next nonce to use
31+
- Based on the sender, the API will query `system.account` (or `system.accountNonce` on older chains) to determine the next nonce to use
3232
- The API will retrieve the current block hash and use it to create a mortal transaction, i.e. the transaction will only be valid for a limited number of blocks (by default this is 5 mins at 6s block times)
3333
- It will construct a payload and sign this, this includes the `genesisHash`, the `blockHash` for the start of the mortal era as well as the current chain `specVersion`
3434
- The transaction is submitted to the node

0 commit comments

Comments
 (0)