From c600cfc65506e4cc669e9c00430e228f4c4db641 Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Wed, 27 May 2020 16:18:11 -0600 Subject: [PATCH] Cleanup programming model doc (#10274) --- docs/art/sdk-tools.bob | 38 +++++++++++++++++++------------------- docs/src/apps/README.md | 6 +++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/art/sdk-tools.bob b/docs/art/sdk-tools.bob index 5ad2b5dc52..3687a4b503 100644 --- a/docs/art/sdk-tools.bob +++ b/docs/art/sdk-tools.bob @@ -1,20 +1,20 @@ - .----------------------------------------. - | Solana Runtime | - | | - | .------------. .------------. | - | | | | | | - .-------->| Verifier +-->| Accounts | | - | | | | | | | - .----------. | | `------------` `------------` | - | +--------` | ^ | - | Client | | LoadAccounts | | - | +--------. | .----------------` | - `----------` | | | | - | | .------+-----. .-------------. | - | | | | | | | - `-------->| Loader +-->| Interpreter | | - | | | | | | - | `------------` `-------------` | - | | - `----------------------------------------` + .-------------------------------------. + | Solana Runtime | + | | + .----------. | .------------. .------------. | + | Program | | | BPF | | Executable | | + | Author +------>| Bytecode +-->| Account | | + | | | | Verifier | | | | + `----------` | `------------` `------------` | + | | | + | .----------------` | + | | LoadAccounts | + | V | + .----------. | .------------. .-------------. | + | | | | BPF | | BPF | | + | Client +------>| Loader +-->| Interpreter | | + | | | | | | | | + `----------` | `------------` `-------------` | + | | + `-------------------------------------` diff --git a/docs/src/apps/README.md b/docs/src/apps/README.md index 878e3e6c06..5c70d454e2 100644 --- a/docs/src/apps/README.md +++ b/docs/src/apps/README.md @@ -1,6 +1,6 @@ # Programming Model -An _app_ interacts with a Solana cluster by sending it _transactions_ with one or more _instructions_. The Solana _runtime_ passes those instructions to user-contributed _programs_. An instruction might, for example, tell a program to transfer _lamports_ from one _account_ to another or create an interactive contract that governs how lamports are transfered. Instructions are executed sequentially and atomically. If any instruction is invalid, any changes made within the transaction are discarded. +An _app_ interacts with a Solana cluster by sending it _transactions_ with one or more _instructions_. The Solana _runtime_ passes those instructions to user-contributed _programs_. An instruction might, for example, tell a program to transfer _lamports_ from one _account_ to another or create an interactive contract that governs how lamports are transfered. Instructions are executed sequentially and atomically. If any instruction is invalid, all account changes are discarded. ### Accounts and Signatures @@ -10,7 +10,7 @@ The transaction also marks some accounts as _read-only accounts_. The runtime pe ### Recent Blockhash -A Transaction includes a recent blockhash to prevent duplication and to give transactions lifetimes. Any transaction that is completely identical to a previous one is rejected, so adding a newer blockhash allows multiple transactions to repeat the exact same action. Transactions also have lifetimes that are defined by the blockhash, as any transaction whose blockhash is too old will be rejected. +A transaction includes a recent blockhash to prevent duplication and to give transactions lifetimes. Any transaction that is completely identical to a previous one is rejected, so adding a newer blockhash allows multiple transactions to repeat the exact same action. Transactions also have lifetimes that are defined by the blockhash, as any transaction whose blockhash is too old will be rejected. ### Instructions @@ -22,7 +22,7 @@ Each instruction specifies a single program account \(which must be marked execu As shown in the diagram above a client creates a program and compiles it to an ELF shared object containing BPF bytecode and sends it to the Solana cluster. The cluster stores the program locally and makes it available to clients via a _program ID_. The program ID is a _public key_ generated by the client and is used to reference the program in subsequent transactions. -A program may be written in any programming language that can target the Berkley Packet Filter \(BPF\) safe execution environment. The Solana SDK offers the best support for C programs, which is compiled to BPF using the [LLVM compiler infrastructure](https://llvm.org). +A program may be written in any programming language that can target the Berkley Packet Filter \(BPF\) safe execution environment. The Solana SDK offers the best support for C/C++ and Rust programs, which are compiled to BPF using the [LLVM compiler infrastructure](https://llvm.org). ## Storing State between Transactions