From 7ab5eacebc635ce0666acc1f253a8c5aac1b3a57 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 4 Feb 2025 23:19:18 -0600 Subject: [PATCH] update accounts page links --- content/docs/core/accounts.mdx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/content/docs/core/accounts.mdx b/content/docs/core/accounts.mdx index 19be22ab..a2dbd786 100644 --- a/content/docs/core/accounts.mdx +++ b/content/docs/core/accounts.mdx @@ -10,23 +10,23 @@ description: On Solana, all data is contained in what we call "accounts". You can think of data on Solana as a public database with a single "Accounts" table, where each entry in this table is an individual account with the same base -[Account type](https://github.com/anza-xyz/agave/blob/v2.1.11/sdk/account/src/lib.rs#L48-L60). +[Account type](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/account/src/lib.rs#L48-L60). ![Accounts](/assets/docs/core/accounts/accounts.png) ## Key Points - Accounts can store up to - [10MiB](https://github.com/anza-xyz/agave/blob/v2.1.12/sdk/program/src/system_instruction.rs#L85) + [10MiB](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/program/src/system_instruction.rs#L85) of data, which contain either executable program code or program state. - Accounts require a - [rent deposit](https://github.com/anza-xyz/agave/blob/v2.1.12/sdk/rent/src/lib.rs#L93-L97) + [rent deposit](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/rent/src/lib.rs#L93-L97) in lamports (SOL) that is proportional to the amount of data stored, which is fully refundable when the account is closed. - Every account has a program - [owner](https://github.com/anza-xyz/agave/blob/v2.1.11/sdk/account/src/lib.rs#L55). + [owner](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/account/src/lib.rs#L55). Only the program that owns an account can modify its data or deduct its lamport balance. However, anyone can increase the balance. @@ -61,9 +61,9 @@ details are covered on the [Program Derived Address](/docs/core/pda) page. ### Account Type Accounts have a max size of -[10MiB](https://github.com/anza-xyz/agave/blob/v2.1.12/sdk/program/src/system_instruction.rs#L85) +[10MiB](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/program/src/system_instruction.rs#L85) and every account on Solana has the same base -[Account](https://github.com/anza-xyz/agave/blob/v2.1.11/sdk/account/src/lib.rs#L48-L60) +[Account](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/account/src/lib.rs#L48-L60) type. ![Account Type](/assets/docs/core/accounts/account-type.svg) @@ -119,9 +119,9 @@ balance that is proportional to amount of data stored on the account (in bytes). This minimum balance is called "rent", although it functions more like a deposit because the full amount can be recovered when an account is closed. You can find the calculation -[here](https://github.com/anza-xyz/agave/blob/v2.1.12/sdk/rent/src/lib.rs#L93-L97) +[here](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/rent/src/lib.rs#L93-L97) using these -[constants](https://github.com/anza-xyz/agave/blob/v2.1.12/sdk/rent/src/lib.rs#L47-L70). +[constants](https://github.com/anza-xyz/agave/blob/v2.1.13/sdk/rent/src/lib.rs#L47-L70). The term "rent" is due to a deprecated mechanism that regularly deducted lamports from accounts that fell below the rent threshold. This mechanism is no @@ -150,14 +150,14 @@ development: ### System Program By default, all new accounts are owned by the -[System Program](https://github.com/anza-xyz/agave/tree/v2.1.12/programs/system/src). +[System Program](https://github.com/anza-xyz/agave/tree/v2.1.13/programs/system/src). The System Program performs several key tasks: -- [New Account Creation](https://github.com/anza-xyz/agave/blob/v2.1.12/programs/system/src/system_processor.rs#L146): +- [New Account Creation](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/system/src/system_processor.rs#L146): Only the System Program can create new accounts. -- [Space Allocation](https://github.com/anza-xyz/agave/blob/v2.1.12/programs/system/src/system_processor.rs#L71): +- [Space Allocation](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/system/src/system_processor.rs#L71): Sets the byte capacity for the data field of each account. -- [Assign Program Ownership](https://github.com/anza-xyz/agave/blob/v2.1.12/programs/system/src/system_processor.rs#L113): +- [Assign Program Ownership](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/system/src/system_processor.rs#L113): Once the System Program creates an account, it can reassign the designated program owner to a different program account. This is how custom programs take ownership of new accounts created by the System Program. @@ -172,7 +172,7 @@ transaction fee payers. ### BPFLoader Program The -[BPF Loader](https://github.com/anza-xyz/agave/tree/v2.1.12/programs/bpf_loader/src) +[BPF Loader](https://github.com/anza-xyz/agave/tree/v2.1.13/programs/bpf_loader/src) is the program owner of all custom programs on the network, excluding other native programs. It is responsible for deploying, upgrading, and executing custom programs. @@ -196,7 +196,7 @@ programs to execute their instructions. ### Program Account When new programs are currently -[deployed](https://github.com/anza-xyz/agave/blob/v2.1.12/programs/bpf_loader/src/lib.rs#L527) +[deployed](https://github.com/anza-xyz/agave/blob/v2.1.13/programs/bpf_loader/src/lib.rs#L527) on Solana, technically three separate accounts are created: - **Program Account**: The main account representing an on-chain program. This