Skip to content

Commit 0e2209c

Browse files
add source code annotations
1 parent 5c840cd commit 0e2209c

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

docs/keys/proxies/create-proxy.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ After submitting the transaction, check the Polkadot.JS web app's **Explorer** p
9494

9595
:::warning
9696

97-
- With the SmallTransfer proxy type, transfers are limited to less than 0.5 TAO (500,000,000 RAO). Use the Transfer proxy type for amounts above this limit.
97+
- With the SmallTransfer proxy type, transfers are limited to less than 0.5 TAO (500,000,000 RAO). Use the Transfer proxy type for amounts above this limit. See [source code: SmallTransfer limit definition](https://github.com/opentensor/subtensor/blob/main/common/src/lib.rs#L43).
9898
- The delegate account must hold enough funds to cover transaction fees, which are approximately 25 µTAO (0.000025 TAO).
9999
:::
100100

@@ -178,9 +178,9 @@ After the announcement waiting period has passed, the delegate account can now e
178178

179179
## Troubleshooting
180180

181-
- `proxy.Duplicate`: A proxy with the same configuration already exists on the real account.
182-
- `proxy.Unannounced`: A non-zero delay proxy requires an announcement; announce and wait the delay.
183-
- `proxy.Unproxyable`/`system.CallFiltered`: The call is not permitted under the current `ProxyType`.
184-
- `proxy.TooMany`: You exceeded `MaxProxies` or `MaxPending`. Remove unused proxies/announcements.
185-
- `proxy.NotProxy`: Ensure youre submitting from the delegate account and referencing the correct real account.
181+
- `proxy.Duplicate`: A proxy with the same configuration already exists on the real account. See [source code: `Duplicate` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L739).
182+
- `proxy.Unannounced`: A non-zero delay proxy requires an announcement; announce and wait the delay. See [source code: `Unannounced` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L743).
183+
- `proxy.Unproxyable`/`system.CallFiltered`: The call is not permitted under the current `ProxyType`. See [source code: `Unproxyable` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L737).
184+
- `proxy.TooMany`: You exceeded `MaxProxies` or `MaxPending`. Remove unused proxies/announcements. See [source code: `TooMany` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L731).
185+
- `proxy.NotProxy`: Ensure you're submitting from the delegate account and referencing the correct real account. See [source code: `NotProxy` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L735).
186186
- `Token.FundsUnavailable`: Ensure that your real account has enough available funds to cover the transaction.

docs/keys/proxies/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The following table shows the available `ProxyType` options and their descriptio
6565
| `NonCritical` | Allows only non-critical operations. |
6666
| `NonTransfer` | Blocks all transfer operations. |
6767
| `Senate` | Allows senate governance operations. |
68-
| `NonFungible` | Blocks all TAO transfer or movement. |
68+
| `NonFungibile` (sic) | Blocks all TAO transfer or movement. |
6969
| `Triumvirate` | Allows triumvirate governance operations. |
7070
| `Governance` | Covers both senate and triumvirate governance operations. |
7171
| `Staking` | Allows staking-related operations. |
@@ -77,6 +77,8 @@ The following table shows the available `ProxyType` options and their descriptio
7777
| `SwapHotkey` | Allows hotkey swap operations. |
7878
| `SubnetLeaseBeneficiary` | Allows management of leased subnets. |
7979

80+
See [source code: ProxyType enum definition](https://github.com/opentensor/subtensor/blob/main/common/src/lib.rs#L144-L162) and [source code: proxy filtering implementation](https://github.com/opentensor/subtensor/blob/main/runtime/src/lib.rs#L678-L884).
81+
8082
### Choosing the Right `ProxyType`
8183

8284
When setting up proxies, always follow the principle of least privilege. Choose the narrowest `ProxyType` that covers the intended actions instead of defaulting to broad permissions. For example:
@@ -92,8 +94,8 @@ Only use the unrestricted `Any` type when no other option fits. If a proxy call
9294

9395
To ensure scalability and prevent abuse, proxy usage is subject to certain limits as shown:
9496

95-
- **`MaxProxies`**: This refers to the maximum number of delegate accounts that can be linked to a single real account. Each account can register up to 20 proxies in total. See [source code](https://github.com/opentensor/subtensor/blob/main/runtime/src/lib.rs#L644).
96-
- **`MaxPending`**: This refers to the maximum number of pending announcements that a delegate account can have. This limit helps prevent excessive queuing. Each account can have up to 75 pending announcements at a time. See [source code](https://github.com/opentensor/subtensor/blob/main/runtime/src/lib.rs#L645).
97+
- **`MaxProxies`**: This refers to the maximum number of delegate accounts that can be linked to a single real account. Each account can register up to 20 proxies in total. See [source code: MaxProxies configuration](https://github.com/opentensor/subtensor/blob/main/runtime/src/lib.rs#L670).
98+
- **`MaxPending`**: This refers to the maximum number of pending announcements that a delegate account can have. This limit helps prevent excessive queuing. Each account can have up to 75 pending announcements at a time. See [source code: MaxPending configuration](https://github.com/opentensor/subtensor/blob/main/runtime/src/lib.rs#L671).
9799

98100
## Best practices for using proxies
99101

docs/keys/proxies/pure-proxies.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ All transactions involving a pure proxy must be signed by the delegator account.
2525
When submitting calls with the `proxy(real, forceProxyType, call)` extrinsic, the pure proxy account is passed as the `real` argument, while the delegator signs the transaction. This effectively reverses the usual proxy relationship where the proxy account only authorizes the transaction, while the real account appears as the origin on chain.
2626

2727
:::info
28-
You can modify who signs for a pure proxy by assigning another account as its _any proxy_. This is done by executing a proxy call that creates a standard proxy with the `Any` proxy type. The new account can then sign on behalf of the pure proxy—for example, when updating signers in a multisig wallet.
28+
You can modify who signs for a pure proxy by assigning another account as its _any proxy_. This is done by executing a proxy call that creates a standard proxy with the `Any` proxy type. The new account can then sign on behalf of the pure proxy—for example, when updating signers in a multisig wallet. See [source code: pure proxy account generation](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L827-L850).
2929
:::
3030

3131
## Prerequisites
@@ -39,7 +39,7 @@ You can modify who signs for a pure proxy by assigning another account as its _a
3939

4040
## Create a pure proxy
4141

42-
Use the `proxy::createPure` extrinsic to create a pure proxy as shown:
42+
Use the `proxy::createPure` extrinsic to create a pure proxy as shown. See [source code: `createPure` implementation](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L328-L360):
4343

4444
1. In the navbar menu, navigate to **Developers****Extrinsics**.
4545
2. Under “using the selected account”, pick the delegator account.
@@ -92,7 +92,7 @@ Importing the proxy account makes it selectable in the Polkadot-JS web app UI.
9292

9393
### Kill a pure proxy
9494

95-
Pure proxies are killed using the `killPure` extrinsic as shown:
95+
Pure proxies are killed using the `killPure` extrinsic as shown. See [source code: `killPure` implementation](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L380-L406):
9696

9797
1. Go to **Developer****Extrinsics**.
9898
2. Under “using the selected account”, choose the pure proxy account.
@@ -114,6 +114,6 @@ Killing a pure proxy permanently deletes the account and releases its reserved d
114114
## Troubleshooting
115115

116116
- `Token.FundsUnavailable`: Ensure thhat the pure proxy account has been funded and has enough funds to cover the transfer.
117-
- `proxy.NotProxy`: Ensure youre executing the pure proxy correctly—from the creator account and referencing the pure proxy account as `real`.
118-
- `Proxy.NoPermission`: The `killPure` call is not permitted under the current.
117+
- `proxy.NotProxy`: Ensure you're executing the pure proxy correctly—from the creator account and referencing the pure proxy account as `real`. See [source code: `NotProxy` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L735).
118+
- `Proxy.NoPermission`: The `killPure` call is not permitted under the current. See [source code: `NoPermission` error](https://github.com/opentensor/subtensor/blob/main/pallets/proxy/src/lib.rs#L741).
119119
- `system.CallFiltered`: The call is not permitted under the current `ProxyType`.

0 commit comments

Comments
 (0)