chore: update Solana docs and code comments that specify "BPF" to "SBF"
This commit is contained in:
parent
37507a2de6
commit
34865d032c
|
@ -1398,7 +1398,7 @@ fn process_show(
|
||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(format!("{} is not a BPF program", account_pubkey).into())
|
Err(format!("{} is not an SBF program", account_pubkey).into())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(format!("Unable to find the account {}", account_pubkey).into())
|
Err(format!("Unable to find the account {}", account_pubkey).into())
|
||||||
|
@ -1468,7 +1468,7 @@ fn process_dump(
|
||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(format!("{} is not a BPF program", account_pubkey).into())
|
Err(format!("{} is not an SBF program", account_pubkey).into())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(format!("Unable to find the account {}", account_pubkey).into())
|
Err(format!("Unable to find the account {}", account_pubkey).into())
|
||||||
|
|
|
@ -392,7 +392,7 @@ struct QosServiceMetricsStats {
|
||||||
/// accumulated estimated builtin programs Compute Units to be packed into block
|
/// accumulated estimated builtin programs Compute Units to be packed into block
|
||||||
estimated_builtins_execute_cu: AtomicU64,
|
estimated_builtins_execute_cu: AtomicU64,
|
||||||
|
|
||||||
/// accumulated estimated BPF program Compute Units to be packed into block
|
/// accumulated estimated SBF program Compute Units to be packed into block
|
||||||
estimated_bpf_execute_cu: AtomicU64,
|
estimated_bpf_execute_cu: AtomicU64,
|
||||||
|
|
||||||
/// accumulated actual program Compute Units that have been packed into block
|
/// accumulated actual program Compute Units that have been packed into block
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
| Solana Runtime |
|
| Solana Runtime |
|
||||||
| |
|
| |
|
||||||
.----------. | .------------. .------------. |
|
.----------. | .------------. .------------. |
|
||||||
| Program | | | BPF | | Executable | |
|
| Program | | | SBF | | Executable | |
|
||||||
| Author +------>| Bytecode +-->| Account | |
|
| Author +------>| Bytecode +-->| Account | |
|
||||||
| | | | Verifier | | | |
|
| | | | Verifier | | | |
|
||||||
`----------` | `------------` `------------` |
|
`----------` | `------------` `------------` |
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
| | LoadAccounts |
|
| | LoadAccounts |
|
||||||
| V |
|
| V |
|
||||||
.----------. | .------------. .-------------. |
|
.----------. | .------------. .-------------. |
|
||||||
| | | | BPF | | BPF | |
|
| | | | SBF | | SBF | |
|
||||||
| Client +------>| Loader +-->| Interpreter | |
|
| Client +------>| Loader +-->| Interpreter | |
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
`----------` | `------------` `-------------` |
|
`----------` | `------------` `-------------` |
|
||||||
|
|
|
@ -99,7 +99,7 @@ For example
|
||||||
export RUST_LOG=solana=info,solana::banking_stage=debug
|
export RUST_LOG=solana=info,solana::banking_stage=debug
|
||||||
```
|
```
|
||||||
|
|
||||||
- To enable BPF program logging:
|
- To enable SBF program logging:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export RUST_LOG=solana_bpf_loader=trace
|
export RUST_LOG=solana_bpf_loader=trace
|
||||||
|
|
|
@ -24,7 +24,7 @@ and so this document attempts to clarify and codify the process for new releases
|
||||||
|
|
||||||
### Release Cadence
|
### Release Cadence
|
||||||
|
|
||||||
The Solana RPC API, Rust SDK, CLI tooling, and BPF Program SDK are all updated and shipped
|
The Solana RPC API, Rust SDK, CLI tooling, and SBF Program SDK are all updated and shipped
|
||||||
along with each Solana software release and should always be compatible between `PATCH`
|
along with each Solana software release and should always be compatible between `PATCH`
|
||||||
updates of a particular `MINOR` version release.
|
updates of a particular `MINOR` version release.
|
||||||
|
|
||||||
|
|
|
@ -4160,7 +4160,7 @@ Example:
|
||||||
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
|
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
|
||||||
"err": null,
|
"err": null,
|
||||||
"logs": [
|
"logs": [
|
||||||
"BPF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
|
"SBF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,7 +11,7 @@ Solana's Rust crates are [published to crates.io][crates.io] and can be found
|
||||||
Some important crates:
|
Some important crates:
|
||||||
|
|
||||||
- [`solana-program`] — Imported by programs running on Solana, compiled
|
- [`solana-program`] — Imported by programs running on Solana, compiled
|
||||||
to BPF. This crate contains many fundamental data types and is re-exported from
|
to SBF. This crate contains many fundamental data types and is re-exported from
|
||||||
[`solana-sdk`], which cannot be imported from a Solana program.
|
[`solana-sdk`], which cannot be imported from a Solana program.
|
||||||
|
|
||||||
- [`solana-sdk`] — The basic off-chain SDK, it re-exports
|
- [`solana-sdk`] — The basic off-chain SDK, it re-exports
|
||||||
|
|
|
@ -14,7 +14,7 @@ Both types of programs run on top of the [Sealevel runtime](https://medium.com/s
|
||||||
- Programs can own other Accounts
|
- Programs can own other Accounts
|
||||||
- Programs can only _change the data_ or _debit_ accounts they own
|
- Programs can only _change the data_ or _debit_ accounts they own
|
||||||
- Any program can _read_ or _credit_ another account
|
- Any program can _read_ or _credit_ another account
|
||||||
- Programs are considered stateless since the primary data stored in a program account is the compiled BPF code
|
- Programs are considered stateless since the primary data stored in a program account is the compiled SBF code
|
||||||
- Programs can be upgraded by their owner (see more on that below)
|
- Programs can be upgraded by their owner (see more on that below)
|
||||||
|
|
||||||
## Types of programs
|
## Types of programs
|
||||||
|
|
|
@ -43,15 +43,15 @@ limited but there are many points of possible failures. The following are
|
||||||
possible failure points and information about what errors to expect and where to
|
possible failure points and information about what errors to expect and where to
|
||||||
get more information:
|
get more information:
|
||||||
|
|
||||||
- The BPF loader may fail to parse the program, this should not happen since the
|
- The SBF loader may fail to parse the program, this should not happen since the
|
||||||
loader has already _finalized_ the program's account data.
|
loader has already _finalized_ the program's account data.
|
||||||
- `InstructionError::InvalidAccountData` will be returned as part of the
|
- `InstructionError::InvalidAccountData` will be returned as part of the
|
||||||
transaction error.
|
transaction error.
|
||||||
- The BPF loader may fail to setup the program's execution environment
|
- The SBF loader may fail to setup the program's execution environment
|
||||||
- `InstructionError::Custom(0x0b9f_0001)` will be returned as part of the
|
- `InstructionError::Custom(0x0b9f_0001)` will be returned as part of the
|
||||||
transaction error. "0x0b9f_0001" is the hexadecimal representation of
|
transaction error. "0x0b9f_0001" is the hexadecimal representation of
|
||||||
[`VirtualMachineCreationFailed`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/programs/bpf_loader/src/lib.rs#L44).
|
[`VirtualMachineCreationFailed`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/programs/bpf_loader/src/lib.rs#L44).
|
||||||
- The BPF loader may have detected a fatal error during program executions
|
- The SBF loader may have detected a fatal error during program executions
|
||||||
(things like panics, memory violations, system call errors, etc...)
|
(things like panics, memory violations, system call errors, etc...)
|
||||||
- `InstructionError::Custom(0x0b9f_0002)` will be returned as part of the
|
- `InstructionError::Custom(0x0b9f_0002)` will be returned as part of the
|
||||||
transaction error. "0x0b9f_0002" is the hexadecimal representation of
|
transaction error. "0x0b9f_0002" is the hexadecimal representation of
|
||||||
|
@ -71,7 +71,7 @@ logs](debugging.md#logging).
|
||||||
For example, an access violation involving the stack will look something like
|
For example, an access violation involving the stack will look something like
|
||||||
this:
|
this:
|
||||||
|
|
||||||
`BPF program 4uQeVj5tqViQh7yWWGStvkEG1Zmhx6uasJtWCJziofM failed: out of bounds memory store (insn #615), addr 0x200001e38/8`
|
`SBF program 4uQeVj5tqViQh7yWWGStvkEG1Zmhx6uasJtWCJziofM failed: out of bounds memory store (insn #615), addr 0x200001e38/8`
|
||||||
|
|
||||||
## Monitoring Compute Budget Consumption
|
## Monitoring Compute Budget Consumption
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ for more information.
|
||||||
|
|
||||||
## ELF Dump
|
## ELF Dump
|
||||||
|
|
||||||
The BPF shared object internals can be dumped to a text file to gain more
|
The SBF shared object internals can be dumped to a text file to gain more
|
||||||
insight into a program's composition and what it may be doing at runtime.
|
insight into a program's composition and what it may be doing at runtime.
|
||||||
|
|
||||||
- [Create a dump file of a Rust program](developing-rust.md#elf-dump)
|
- [Create a dump file of a Rust program](developing-rust.md#elf-dump)
|
||||||
|
@ -97,14 +97,14 @@ insight into a program's composition and what it may be doing at runtime.
|
||||||
|
|
||||||
## Instruction Tracing
|
## Instruction Tracing
|
||||||
|
|
||||||
During execution the runtime BPF interpreter can be configured to log a trace
|
During execution the runtime SBF interpreter can be configured to log a trace
|
||||||
message for each BPF instruction executed. This can be very helpful for things
|
message for each SBF instruction executed. This can be very helpful for things
|
||||||
like pin-pointing the runtime context leading up to a memory access violation.
|
like pin-pointing the runtime context leading up to a memory access violation.
|
||||||
|
|
||||||
The trace logs together with the [ELF dump](#elf-dump) can provide a lot of
|
The trace logs together with the [ELF dump](#elf-dump) can provide a lot of
|
||||||
insight (though the traces produce a lot of information).
|
insight (though the traces produce a lot of information).
|
||||||
|
|
||||||
To turn on BPF interpreter trace messages in a local cluster configure the
|
To turn on SBF interpreter trace messages in a local cluster configure the
|
||||||
`solana_rbpf` level in `RUST_LOG` to `trace`. For example:
|
`solana_rbpf` level in `RUST_LOG` to `trace`. For example:
|
||||||
|
|
||||||
`export RUST_LOG=solana_rbpf=trace`
|
`export RUST_LOG=solana_rbpf=trace`
|
||||||
|
|
|
@ -5,7 +5,7 @@ title: "Deploying Programs"
|
||||||

|

|
||||||
|
|
||||||
As shown in the diagram above, a program author creates a program, compiles it
|
As shown in the diagram above, a program author creates a program, compiles it
|
||||||
to an ELF shared object containing BPF bytecode, and uploads it to the Solana
|
to an ELF shared object containing SBF bytecode, and uploads it to the Solana
|
||||||
cluster with a special _deploy_ transaction. The cluster makes it available to
|
cluster with a special _deploy_ transaction. The cluster makes it available to
|
||||||
clients via a _program ID_. The program ID is an _address_ specified when
|
clients via a _program ID_. The program ID is an _address_ specified when
|
||||||
deploying and is used to reference the program in subsequent transactions.
|
deploying and is used to reference the program in subsequent transactions.
|
||||||
|
|
|
@ -39,14 +39,14 @@ using the `no-entrypoint` feature.
|
||||||
At a minimum, Solana Rust programs must pull in the
|
At a minimum, Solana Rust programs must pull in the
|
||||||
[solana-program](https://crates.io/crates/solana-program) crate.
|
[solana-program](https://crates.io/crates/solana-program) crate.
|
||||||
|
|
||||||
Solana BPF programs have some [restrictions](#restrictions) that may prevent the
|
Solana SBF programs have some [restrictions](#restrictions) that may prevent the
|
||||||
inclusion of some crates as dependencies or require special handling.
|
inclusion of some crates as dependencies or require special handling.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
- Crates that require the architecture be a subset of the ones supported by the
|
- Crates that require the architecture be a subset of the ones supported by the
|
||||||
official toolchain. There is no workaround for this unless that crate is
|
official toolchain. There is no workaround for this unless that crate is
|
||||||
forked and BPF added to that those architecture checks.
|
forked and SBF added to that those architecture checks.
|
||||||
- Crates may depend on `rand` which is not supported in Solana's deterministic
|
- Crates may depend on `rand` which is not supported in Solana's deterministic
|
||||||
program environment. To include a `rand` dependent crate refer to [Depending
|
program environment. To include a `rand` dependent crate refer to [Depending
|
||||||
on Rand](#depending-on-rand).
|
on Rand](#depending-on-rand).
|
||||||
|
@ -68,7 +68,7 @@ machine which can be used for unit testing:
|
||||||
$ cargo build
|
$ cargo build
|
||||||
```
|
```
|
||||||
|
|
||||||
To build a specific program, such as SPL Token, for the Solana BPF target which
|
To build a specific program, such as SPL Token, for the Solana SBF target which
|
||||||
can be deployed to the cluster:
|
can be deployed to the cluster:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -305,12 +305,12 @@ Rust's `panic!`, `assert!`, and internal panic results are printed to the
|
||||||
|
|
||||||
```
|
```
|
||||||
INFO solana_runtime::message_processor] Finalized account CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ
|
INFO solana_runtime::message_processor] Finalized account CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ
|
||||||
INFO solana_runtime::message_processor] Call BPF program CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ
|
INFO solana_runtime::message_processor] Call SBF program CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ
|
||||||
INFO solana_runtime::message_processor] Program log: Panicked at: 'assertion failed: `(left == right)`
|
INFO solana_runtime::message_processor] Program log: Panicked at: 'assertion failed: `(left == right)`
|
||||||
left: `1`,
|
left: `1`,
|
||||||
right: `2`', rust/panic/src/lib.rs:22:5
|
right: `2`', rust/panic/src/lib.rs:22:5
|
||||||
INFO solana_runtime::message_processor] BPF program consumed 5453 of 200000 units
|
INFO solana_runtime::message_processor] SBF program consumed 5453 of 200000 units
|
||||||
INFO solana_runtime::message_processor] BPF program CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ failed: BPF program panicked
|
INFO solana_runtime::message_processor] SBF program CGLhHSuWsp1gT4B7MY2KACqp9RUwQRhcUFfVSuxpSajZ failed: BPF program panicked
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Panic Handler
|
### Custom Panic Handler
|
||||||
|
@ -369,7 +369,7 @@ for more information.
|
||||||
|
|
||||||
## ELF Dump
|
## ELF Dump
|
||||||
|
|
||||||
The BPF shared object internals can be dumped to a text file to gain more
|
The SBF shared object internals can be dumped to a text file to gain more
|
||||||
insight into a program's composition and what it may be doing at runtime. The
|
insight into a program's composition and what it may be doing at runtime. The
|
||||||
dump will contain both the ELF information as well as a list of all the symbols
|
dump will contain both the ELF information as well as a list of all the symbols
|
||||||
and the instructions that implement them. Some of the BPF loader's error log
|
and the instructions that implement them. Some of the BPF loader's error log
|
||||||
|
|
|
@ -18,7 +18,7 @@ Depth](developing/programming-model/calling-between-programs.md#call-depth)
|
||||||
|
|
||||||
## `CallDepthExceeded` error
|
## `CallDepthExceeded` error
|
||||||
|
|
||||||
This error means the BPF stack depth was exceeded.
|
This error means the SBF stack depth was exceeded.
|
||||||
|
|
||||||
See [call depth](overview.md#call-depth)
|
See [call depth](overview.md#call-depth)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ native instructions.
|
||||||
|
|
||||||
## Memory map
|
## Memory map
|
||||||
|
|
||||||
The virtual address memory map used by Solana BPF programs is fixed and laid out
|
The virtual address memory map used by Solana SBF programs is fixed and laid out
|
||||||
as follows
|
as follows
|
||||||
|
|
||||||
- Program code starts at 0x100000000
|
- Program code starts at 0x100000000
|
||||||
|
@ -42,7 +42,7 @@ the attempted violation.
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|
||||||
BPF uses stack frames instead of a variable stack pointer. Each stack frame is
|
SBF uses stack frames instead of a variable stack pointer. Each stack frame is
|
||||||
4KB in size.
|
4KB in size.
|
||||||
|
|
||||||
If a program violates that stack frame size, the compiler will report the
|
If a program violates that stack frame size, the compiler will report the
|
||||||
|
@ -67,7 +67,7 @@ crates may include functionality that violates the stack frame restrictions even
|
||||||
if the program doesn't use that functionality. If the program violates the stack
|
if the program doesn't use that functionality. If the program violates the stack
|
||||||
size at runtime, an `AccessViolation` error will be reported.
|
size at runtime, an `AccessViolation` error will be reported.
|
||||||
|
|
||||||
BPF stack frames occupy a virtual address range starting at 0x200000000.
|
SBF stack frames occupy a virtual address range starting at 0x200000000.
|
||||||
|
|
||||||
## Call Depth
|
## Call Depth
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ added to support writable data.
|
||||||
|
|
||||||
## Signed division
|
## Signed division
|
||||||
|
|
||||||
The BPF instruction set does not support [signed
|
The SBF instruction set does not support [signed
|
||||||
division](https://www.kernel.org/doc/html/latest/bpf/bpf_design_QA.html#q-why-there-is-no-bpf-sdiv-for-signed-divide-operation).
|
division](https://www.kernel.org/doc/html/latest/bpf/bpf_design_QA.html#q-why-there-is-no-bpf-sdiv-for-signed-divide-operation).
|
||||||
Adding a signed division instruction is a consideration.
|
Adding a signed division instruction is a consideration.
|
||||||
|
|
||||||
|
@ -156,19 +156,19 @@ loader see:
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
BPF program deployment is the process of uploading a BPF shared object into a
|
SBF program deployment is the process of uploading a BPF shared object into a
|
||||||
program account's data and marking the account executable. A client breaks the
|
program account's data and marking the account executable. A client breaks the
|
||||||
BPF shared object into smaller pieces and sends them as the instruction data of
|
SBF shared object into smaller pieces and sends them as the instruction data of
|
||||||
[`Write`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/sdk/program/src/loader_instruction.rs#L13)
|
[`Write`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/sdk/program/src/loader_instruction.rs#L13)
|
||||||
instructions to the loader where loader writes that data into the program's
|
instructions to the loader where loader writes that data into the program's
|
||||||
account data. Once all the pieces are received the client sends a
|
account data. Once all the pieces are received the client sends a
|
||||||
[`Finalize`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/sdk/program/src/loader_instruction.rs#L30)
|
[`Finalize`](https://github.com/solana-labs/solana/blob/bc7133d7526a041d1aaee807b80922baa89b6f90/sdk/program/src/loader_instruction.rs#L30)
|
||||||
instruction to the loader, the loader then validates that the BPF data is valid
|
instruction to the loader, the loader then validates that the SBF data is valid
|
||||||
and marks the program account as _executable_. Once the program account is
|
and marks the program account as _executable_. Once the program account is
|
||||||
marked executable, subsequent transactions may issue instructions for that
|
marked executable, subsequent transactions may issue instructions for that
|
||||||
program to process.
|
program to process.
|
||||||
|
|
||||||
When an instruction is directed at an executable BPF program the loader
|
When an instruction is directed at an executable SBF program the loader
|
||||||
configures the program's execution environment, serializes the program's input
|
configures the program's execution environment, serializes the program's input
|
||||||
parameters, calls the program's entrypoint, and reports any errors encountered.
|
parameters, calls the program's entrypoint, and reports any errors encountered.
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ For further information see [deploying](deploying.md)
|
||||||
|
|
||||||
### Input Parameter Serialization
|
### Input Parameter Serialization
|
||||||
|
|
||||||
BPF loaders serialize the program input parameters into a byte array that is
|
SBF loaders serialize the program input parameters into a byte array that is
|
||||||
then passed to the program's entrypoint, where the program is responsible for
|
then passed to the program's entrypoint, where the program is responsible for
|
||||||
deserializing it on-chain. One of the changes between the deprecated loader and
|
deserializing it on-chain. One of the changes between the deprecated loader and
|
||||||
the current loader is that the input parameters are serialized in a way that
|
the current loader is that the input parameters are serialized in a way that
|
||||||
|
|
|
@ -45,7 +45,7 @@ If an account is marked "executable" in its metadata, then it is considered a
|
||||||
program which can be executed by including the account's public key in an
|
program which can be executed by including the account's public key in an
|
||||||
instruction's [program id](transactions.md#program-id). Accounts are marked as
|
instruction's [program id](transactions.md#program-id). Accounts are marked as
|
||||||
executable during a successful program deployment process by the loader that
|
executable during a successful program deployment process by the loader that
|
||||||
owns the account. When a program is deployed to the execution engine (BPF deployment),
|
owns the account. When a program is deployed to the execution engine (SBF deployment),
|
||||||
the loader determines that the bytecode in the account's data is valid.
|
the loader determines that the bytecode in the account's data is valid.
|
||||||
If so, the loader permanently marks the program account as executable.
|
If so, the loader permanently marks the program account as executable.
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,14 @@ the transaction may perform, and operational bounds the transaction must adhere
|
||||||
to.
|
to.
|
||||||
|
|
||||||
As the transaction is processed compute units are consumed by its
|
As the transaction is processed compute units are consumed by its
|
||||||
instruction's programs performing operations such as executing BPF instructions,
|
instruction's programs performing operations such as executing SBF instructions,
|
||||||
calling syscalls, etc... When the transaction consumes its entire budget, or
|
calling syscalls, etc... When the transaction consumes its entire budget, or
|
||||||
exceeds a bound such as attempting a call stack that is too deep, the runtime
|
exceeds a bound such as attempting a call stack that is too deep, the runtime
|
||||||
halts the transaction processing and returns an error.
|
halts the transaction processing and returns an error.
|
||||||
|
|
||||||
The following operations incur a compute cost:
|
The following operations incur a compute cost:
|
||||||
|
|
||||||
- Executing BPF instructions
|
- Executing SBF instructions
|
||||||
- Passing data between programs
|
- Passing data between programs
|
||||||
- Calling system calls
|
- Calling system calls
|
||||||
- logging
|
- logging
|
||||||
|
@ -94,9 +94,9 @@ log_pubkey_units: 100,
|
||||||
|
|
||||||
Then any transaction:
|
Then any transaction:
|
||||||
|
|
||||||
- Could execute 1,400,000 BPF instructions, if it did nothing else.
|
- Could execute 1,400,000 SBF instructions, if it did nothing else.
|
||||||
- Cannot exceed 4k of stack usage.
|
- Cannot exceed 4k of stack usage.
|
||||||
- Cannot exceed a BPF call depth of 64.
|
- Cannot exceed a SBF call depth of 64.
|
||||||
- Cannot exceed invoke stack height of 5 (4 levels of cross-program invocations).
|
- Cannot exceed invoke stack height of 5 (4 levels of cross-program invocations).
|
||||||
|
|
||||||
> **NOTE:** Since the compute budget is consumed incrementally as the transaction executes,
|
> **NOTE:** Since the compute budget is consumed incrementally as the transaction executes,
|
||||||
|
|
|
@ -133,8 +133,8 @@ program will process this instruction. The program's account's owner specifies
|
||||||
which loader should be used to load and execute the program, and the data
|
which loader should be used to load and execute the program, and the data
|
||||||
contains information about how the runtime should execute the program.
|
contains information about how the runtime should execute the program.
|
||||||
|
|
||||||
In the case of [on-chain BPF programs](developing/on-chain-programs/overview.md),
|
In the case of [on-chain SBF programs](developing/on-chain-programs/overview.md),
|
||||||
the owner is the BPF Loader and the account data holds the BPF bytecode. Program
|
the owner is the SBF Loader and the account data holds the BPF bytecode. Program
|
||||||
accounts are permanently marked as executable by the loader once they are
|
accounts are permanently marked as executable by the loader once they are
|
||||||
successfully deployed. The runtime will reject transactions that specify programs
|
successfully deployed. The runtime will reject transactions that specify programs
|
||||||
that are not executable.
|
that are not executable.
|
||||||
|
|
|
@ -57,4 +57,4 @@ testnet running 150 nodes on a gigabit network and demonstrated soak tests
|
||||||
processing an _average_ of 200 thousand transactions per second with bursts
|
processing an _average_ of 200 thousand transactions per second with bursts
|
||||||
over 500 thousand. The project was also extended to support on-chain programs
|
over 500 thousand. The project was also extended to support on-chain programs
|
||||||
written in the C programming language and run concurrently in a safe execution
|
written in the C programming language and run concurrently in a safe execution
|
||||||
environment called BPF.
|
environment called SBF.
|
||||||
|
|
|
@ -25,4 +25,4 @@ for it and also write the current instruction index and then the bpf program can
|
||||||
necessary information from there.
|
necessary information from there.
|
||||||
|
|
||||||
Note: custom serialization of instructions is used because bincode is about 10x slower
|
Note: custom serialization of instructions is used because bincode is about 10x slower
|
||||||
in native code and exceeds current BPF instruction limits.
|
in native code and exceeds current SBF instruction limits.
|
||||||
|
|
|
@ -50,7 +50,7 @@ A fee could be calculated based on:
|
||||||
requested amount. After processing, the actual number of units consumed
|
requested amount. After processing, the actual number of units consumed
|
||||||
will be known, and the payer will be refunded the difference, so the payer
|
will be known, and the payer will be refunded the difference, so the payer
|
||||||
only pays for what they used. Builtin programs will have a fixed cost
|
only pays for what they used. Builtin programs will have a fixed cost
|
||||||
while BPF program's cost will be measured at runtime.
|
while SBF program's cost will be measured at runtime.
|
||||||
6. Precompiled programs
|
6. Precompiled programs
|
||||||
- Precompiled programs are performing compute-intensive operations. The work
|
- Precompiled programs are performing compute-intensive operations. The work
|
||||||
incurred by a precompiled program is predictable based on the instruction's
|
incurred by a precompiled program is predictable based on the instruction's
|
||||||
|
|
|
@ -34,4 +34,4 @@ All data accounts owned by Move modules must set their owners to the loader, `MO
|
||||||
|
|
||||||
### Interacting with Solana programs
|
### Interacting with Solana programs
|
||||||
|
|
||||||
To invoke instructions in non-Move programs, Solana would need to extend the Move VM with a `process_instruction()` system call. It would work the same as `process_instruction()` Rust BPF programs.
|
To invoke instructions in non-Move programs, Solana would need to extend the Move VM with a `process_instruction()` system call. It would work the same as `process_instruction()` Rust SBF programs.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Return data from BPF programs
|
# Return data from SBF programs
|
||||||
|
|
||||||
## Problem
|
## Problem
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ block, any of these would cause the transaction or rpc to fail.
|
||||||
## Existing solution
|
## Existing solution
|
||||||
|
|
||||||
The existing solution that Solang uses, writes the return data to the callee account data.
|
The existing solution that Solang uses, writes the return data to the callee account data.
|
||||||
The caller's account cannot be used, since the callee may not be the same BPF program, so
|
The caller's account cannot be used, since the callee may not be the same SBF program, so
|
||||||
it will not have permission to write to the callee's account data.
|
it will not have permission to write to the callee's account data.
|
||||||
|
|
||||||
Another solution would be to have a single return data account which is passed
|
Another solution would be to have a single return data account which is passed
|
||||||
|
@ -136,9 +136,9 @@ strings in the [stable log](https://github.com/solana-labs/solana/blob/952928419
|
||||||
|
|
||||||
Solidity on Ethereum allows the contract to return an error in the return data. In this case, all
|
Solidity on Ethereum allows the contract to return an error in the return data. In this case, all
|
||||||
the account data changes for the account should be reverted. On Solana, any non-zero exit code
|
the account data changes for the account should be reverted. On Solana, any non-zero exit code
|
||||||
for a BPF prorgram means the entire transaction fails. We do not wish to support an error return
|
for a SBF prorgram means the entire transaction fails. We do not wish to support an error return
|
||||||
by returning success and then returning an error in the return data. This would mean we would have
|
by returning success and then returning an error in the return data. This would mean we would have
|
||||||
to support reverting the account data changes; this too expensive both on the VM side and the BPF
|
to support reverting the account data changes; this too expensive both on the VM side and the SBF
|
||||||
contract side.
|
contract side.
|
||||||
|
|
||||||
Errors will be reported via sol_log.
|
Errors will be reported via sol_log.
|
||||||
|
|
|
@ -374,7 +374,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(3)
|
.number_of_values(3)
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.help("Install a BPF program at the given address"),
|
.help("Install a SBF program at the given address"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("inflation")
|
Arg::with_name("inflation")
|
||||||
|
|
|
@ -8,13 +8,13 @@ macro_rules! to_builtin {
|
||||||
|
|
||||||
/// Builtin programs that are always available
|
/// Builtin programs that are always available
|
||||||
fn genesis_builtins(bpf_jit: bool) -> Vec<Builtin> {
|
fn genesis_builtins(bpf_jit: bool) -> Vec<Builtin> {
|
||||||
// Currently JIT is not supported on the BPF VM:
|
// Currently JIT is not supported on the SBF VM:
|
||||||
// !x86_64: https://github.com/qmonnet/rbpf/issues/48
|
// !x86_64: https://github.com/qmonnet/rbpf/issues/48
|
||||||
// Windows: https://github.com/solana-labs/rbpf/issues/217
|
// Windows: https://github.com/solana-labs/rbpf/issues/217
|
||||||
#[cfg(any(not(target_arch = "x86_64"), target_family = "windows"))]
|
#[cfg(any(not(target_arch = "x86_64"), target_family = "windows"))]
|
||||||
let bpf_jit = {
|
let bpf_jit = {
|
||||||
if bpf_jit {
|
if bpf_jit {
|
||||||
info!("BPF JIT is not supported on this target");
|
info!("SBF JIT is not supported on this target");
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ edition = "2021"
|
||||||
fast-math = "0.1"
|
fast-math = "0.1"
|
||||||
solana-program = { path = "../sdk/program", version = "=1.15.0" }
|
solana-program = { path = "../sdk/program", version = "=1.15.0" }
|
||||||
|
|
||||||
# This can go once the BPF toolchain target Rust 1.42.0+
|
# This can go once the SBF toolchain target Rust 1.42.0+
|
||||||
[target.bpfel-unknown-unknown.dependencies]
|
[target.bpfel-unknown-unknown.dependencies]
|
||||||
matches = "0.1.9"
|
matches = "0.1.9"
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,9 @@ pub struct ComputeBudget {
|
||||||
pub sha256_byte_cost: u64,
|
pub sha256_byte_cost: u64,
|
||||||
/// Maximum number of slices hashed per syscall
|
/// Maximum number of slices hashed per syscall
|
||||||
pub sha256_max_slices: u64,
|
pub sha256_max_slices: u64,
|
||||||
/// Maximum BPF to BPF call depth
|
/// Maximum SBF to BPF call depth
|
||||||
pub max_call_depth: usize,
|
pub max_call_depth: usize,
|
||||||
/// Size of a stack frame in bytes, must match the size specified in the LLVM BPF backend
|
/// Size of a stack frame in bytes, must match the size specified in the LLVM SBF backend
|
||||||
pub stack_frame_size: usize,
|
pub stack_frame_size: usize,
|
||||||
/// Number of compute units consumed by logging a `Pubkey`
|
/// Number of compute units consumed by logging a `Pubkey`
|
||||||
pub log_pubkey_units: u64,
|
pub log_pubkey_units: u64,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! The solana-program-test provides a BanksClient-based test framework BPF programs
|
//! The solana-program-test provides a BanksClient-based test framework SBF programs
|
||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::integer_arithmetic)]
|
||||||
|
|
||||||
// Export tokio for test clients
|
// Export tokio for test clients
|
||||||
|
@ -117,7 +117,7 @@ pub fn builtin_process_instruction(
|
||||||
// Copy indices_in_instruction into a HashSet to ensure there are no duplicates
|
// Copy indices_in_instruction into a HashSet to ensure there are no duplicates
|
||||||
let deduplicated_indices: HashSet<IndexOfAccount> = instruction_account_indices.collect();
|
let deduplicated_indices: HashSet<IndexOfAccount> = instruction_account_indices.collect();
|
||||||
|
|
||||||
// Serialize entrypoint parameters with BPF ABI
|
// Serialize entrypoint parameters with SBF ABI
|
||||||
let (mut parameter_bytes, _regions, _account_lengths) = serialize_parameters(
|
let (mut parameter_bytes, _regions, _account_lengths) = serialize_parameters(
|
||||||
invoke_context.transaction_context,
|
invoke_context.transaction_context,
|
||||||
invoke_context
|
invoke_context
|
||||||
|
@ -423,7 +423,7 @@ fn default_shared_object_dirs() -> Vec<PathBuf> {
|
||||||
if let Ok(dir) = std::env::current_dir() {
|
if let Ok(dir) = std::env::current_dir() {
|
||||||
search_path.push(dir);
|
search_path.push(dir);
|
||||||
}
|
}
|
||||||
trace!("BPF .so search path: {:?}", search_path);
|
trace!("SBF .so search path: {:?}", search_path);
|
||||||
search_path
|
search_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ impl Default for ProgramTest {
|
||||||
/// used to override this preference at runtime. `cargo test-bpf` will set `BPF_OUT_DIR`
|
/// used to override this preference at runtime. `cargo test-bpf` will set `BPF_OUT_DIR`
|
||||||
/// automatically.
|
/// automatically.
|
||||||
///
|
///
|
||||||
/// BPF program shared objects and account data files are searched for in
|
/// SBF program shared objects and account data files are searched for in
|
||||||
/// * the value of the `BPF_OUT_DIR` environment variable
|
/// * the value of the `BPF_OUT_DIR` environment variable
|
||||||
/// * the `tests/fixtures` sub-directory
|
/// * the `tests/fixtures` sub-directory
|
||||||
/// * the current working directory
|
/// * the current working directory
|
||||||
|
@ -501,7 +501,7 @@ impl ProgramTest {
|
||||||
me
|
me
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Override default BPF program selection
|
/// Override default SBF program selection
|
||||||
pub fn prefer_bpf(&mut self, prefer_bpf: bool) {
|
pub fn prefer_bpf(&mut self, prefer_bpf: bool) {
|
||||||
self.prefer_bpf = prefer_bpf;
|
self.prefer_bpf = prefer_bpf;
|
||||||
}
|
}
|
||||||
|
@ -516,14 +516,14 @@ impl ProgramTest {
|
||||||
self.transaction_account_lock_limit = Some(transaction_account_lock_limit);
|
self.transaction_account_lock_limit = Some(transaction_account_lock_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Override the BPF compute budget
|
/// Override the SBF compute budget
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
#[deprecated(since = "1.8.0", note = "please use `set_compute_max_units` instead")]
|
#[deprecated(since = "1.8.0", note = "please use `set_compute_max_units` instead")]
|
||||||
pub fn set_bpf_compute_max_units(&mut self, bpf_compute_max_units: u64) {
|
pub fn set_bpf_compute_max_units(&mut self, bpf_compute_max_units: u64) {
|
||||||
self.compute_max_units = Some(bpf_compute_max_units);
|
self.compute_max_units = Some(bpf_compute_max_units);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Execute the BPF program with JIT if true, interpreted if false
|
/// Execute the SBF program with JIT if true, interpreted if false
|
||||||
pub fn use_bpf_jit(&mut self, use_bpf_jit: bool) {
|
pub fn use_bpf_jit(&mut self, use_bpf_jit: bool) {
|
||||||
self.use_bpf_jit = use_bpf_jit;
|
self.use_bpf_jit = use_bpf_jit;
|
||||||
}
|
}
|
||||||
|
@ -578,13 +578,13 @@ impl ProgramTest {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add a BPF program to the test environment.
|
/// Add a SBF program to the test environment.
|
||||||
///
|
///
|
||||||
/// `program_name` will also be used to locate the BPF shared object in the current or fixtures
|
/// `program_name` will also be used to locate the SBF shared object in the current or fixtures
|
||||||
/// directory.
|
/// directory.
|
||||||
///
|
///
|
||||||
/// If `process_instruction` is provided, the natively built-program may be used instead of the
|
/// If `process_instruction` is provided, the natively built-program may be used instead of the
|
||||||
/// BPF shared object depending on the `BPF_OUT_DIR` environment variable.
|
/// SBF shared object depending on the `BPF_OUT_DIR` environment variable.
|
||||||
pub fn add_program(
|
pub fn add_program(
|
||||||
&mut self,
|
&mut self,
|
||||||
program_name: &str,
|
program_name: &str,
|
||||||
|
@ -594,7 +594,7 @@ impl ProgramTest {
|
||||||
let add_bpf = |this: &mut ProgramTest, program_file: PathBuf| {
|
let add_bpf = |this: &mut ProgramTest, program_file: PathBuf| {
|
||||||
let data = read_file(&program_file);
|
let data = read_file(&program_file);
|
||||||
info!(
|
info!(
|
||||||
"\"{}\" BPF program from {}{}",
|
"\"{}\" SBF program from {}{}",
|
||||||
program_name,
|
program_name,
|
||||||
program_file.display(),
|
program_file.display(),
|
||||||
std::fs::metadata(&program_file)
|
std::fs::metadata(&program_file)
|
||||||
|
@ -654,7 +654,7 @@ impl ProgramTest {
|
||||||
if valid_program_names.is_empty() {
|
if valid_program_names.is_empty() {
|
||||||
// This should be unreachable as `test-bpf` should guarantee at least one shared
|
// This should be unreachable as `test-bpf` should guarantee at least one shared
|
||||||
// object exists somewhere.
|
// object exists somewhere.
|
||||||
warn!("No BPF shared objects found.");
|
warn!("No SBF shared objects found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,17 +670,17 @@ impl ProgramTest {
|
||||||
|
|
||||||
let program_file = find_file(&format!("{}.so", program_name));
|
let program_file = find_file(&format!("{}.so", program_name));
|
||||||
match (self.prefer_bpf, program_file, process_instruction) {
|
match (self.prefer_bpf, program_file, process_instruction) {
|
||||||
// If BPF is preferred (i.e., `test-bpf` is invoked) and a BPF shared object exists,
|
// If SBF is preferred (i.e., `test-sbf` is invoked) and a BPF shared object exists,
|
||||||
// use that as the program data.
|
// use that as the program data.
|
||||||
(true, Some(file), _) => add_bpf(self, file),
|
(true, Some(file), _) => add_bpf(self, file),
|
||||||
|
|
||||||
// If BPF is not required (i.e., we were invoked with `test`), use the provided
|
// If SBF is not required (i.e., we were invoked with `test`), use the provided
|
||||||
// processor function as is.
|
// processor function as is.
|
||||||
//
|
//
|
||||||
// TODO: figure out why tests hang if a processor panics when running native code.
|
// TODO: figure out why tests hang if a processor panics when running native code.
|
||||||
(false, _, Some(process)) => add_native(self, process),
|
(false, _, Some(process)) => add_native(self, process),
|
||||||
|
|
||||||
// Invalid: `test-bpf` invocation with no matching BPF shared object.
|
// Invalid: `test-sbf` invocation with no matching SBF shared object.
|
||||||
(true, None, _) => {
|
(true, None, _) => {
|
||||||
warn_invalid_program_name();
|
warn_invalid_program_name();
|
||||||
panic!(
|
panic!(
|
||||||
|
|
|
@ -349,7 +349,7 @@ fn check_loader_id(id: &Pubkey) -> bool {
|
||||||
|| bpf_loader_upgradeable::check_id(id)
|
|| bpf_loader_upgradeable::check_id(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create the BPF virtual machine
|
/// Create the SBF virtual machine
|
||||||
pub fn create_vm<'a, 'b>(
|
pub fn create_vm<'a, 'b>(
|
||||||
program: &'a VerifiedExecutable<RequisiteVerifier, ThisInstructionMeter>,
|
program: &'a VerifiedExecutable<RequisiteVerifier, ThisInstructionMeter>,
|
||||||
regions: Vec<MemoryRegion>,
|
regions: Vec<MemoryRegion>,
|
||||||
|
@ -1395,7 +1395,7 @@ impl Executor for BpfExecutor {
|
||||||
) {
|
) {
|
||||||
Ok(info) => info,
|
Ok(info) => info,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
ic_logger_msg!(log_collector, "Failed to create BPF VM: {}", e);
|
ic_logger_msg!(log_collector, "Failed to create SBF VM: {}", e);
|
||||||
return Err(InstructionError::ProgramEnvironmentSetupFailure);
|
return Err(InstructionError::ProgramEnvironmentSetupFailure);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1427,7 +1427,7 @@ impl Executor for BpfExecutor {
|
||||||
.write(&mut trace_buffer, &analysis)
|
.write(&mut trace_buffer, &analysis)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let trace_string = String::from_utf8(trace_buffer).unwrap();
|
let trace_string = String::from_utf8(trace_buffer).unwrap();
|
||||||
trace!("BPF Program Instruction Trace:\n{}", trace_string);
|
trace!("SBF Program Instruction Trace:\n{}", trace_string);
|
||||||
}
|
}
|
||||||
drop(vm);
|
drop(vm);
|
||||||
let (_returned_from_program_id, return_data) =
|
let (_returned_from_program_id, return_data) =
|
||||||
|
|
|
@ -21,7 +21,7 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Maximum number of instruction accounts that can be serialized into the
|
/// Maximum number of instruction accounts that can be serialized into the
|
||||||
/// BPF VM.
|
/// SBF VM.
|
||||||
const MAX_INSTRUCTION_ACCOUNTS: u8 = NON_DUP_MARKER;
|
const MAX_INSTRUCTION_ACCOUNTS: u8 = NON_DUP_MARKER;
|
||||||
|
|
||||||
enum SerializeAccount<'a> {
|
enum SerializeAccount<'a> {
|
||||||
|
|
|
@ -78,9 +78,9 @@ pub const MAX_SIGNERS: usize = 16;
|
||||||
pub enum SyscallError {
|
pub enum SyscallError {
|
||||||
#[error("{0}: {1:?}")]
|
#[error("{0}: {1:?}")]
|
||||||
InvalidString(Utf8Error, Vec<u8>),
|
InvalidString(Utf8Error, Vec<u8>),
|
||||||
#[error("BPF program panicked")]
|
#[error("SBF program panicked")]
|
||||||
Abort,
|
Abort,
|
||||||
#[error("BPF program Panicked in {0} at {1}:{2}")]
|
#[error("SBF program Panicked in {0} at {1}:{2}")]
|
||||||
Panic(String, u64, u64),
|
Panic(String, u64, u64),
|
||||||
#[error("Cannot borrow invoke context")]
|
#[error("Cannot borrow invoke context")]
|
||||||
InvokeContextBorrowFailed,
|
InvokeContextBorrowFailed,
|
||||||
|
@ -386,7 +386,7 @@ fn translate_slice<'a, T>(
|
||||||
.map(|value| &*value)
|
.map(|value| &*value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Take a virtual pointer to a string (points to BPF VM memory space), translate it
|
/// Take a virtual pointer to a string (points to SBF VM memory space), translate it
|
||||||
/// pass it to a user-defined work function
|
/// pass it to a user-defined work function
|
||||||
fn translate_string_and_do(
|
fn translate_string_and_do(
|
||||||
memory_mapping: &MemoryMapping,
|
memory_mapping: &MemoryMapping,
|
||||||
|
@ -435,10 +435,10 @@ macro_rules! declare_syscall {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_syscall!(
|
declare_syscall!(
|
||||||
/// Abort syscall functions, called when the BPF program calls `abort()`
|
/// Abort syscall functions, called when the SBF program calls `abort()`
|
||||||
/// LLVM will insert calls to `abort()` if it detects an untenable situation,
|
/// LLVM will insert calls to `abort()` if it detects an untenable situation,
|
||||||
/// `abort()` is not intended to be called explicitly by the program.
|
/// `abort()` is not intended to be called explicitly by the program.
|
||||||
/// Causes the BPF program to be halted immediately
|
/// Causes the SBF program to be halted immediately
|
||||||
SyscallAbort,
|
SyscallAbort,
|
||||||
fn inner_call(
|
fn inner_call(
|
||||||
_invoke_context: &mut InvokeContext,
|
_invoke_context: &mut InvokeContext,
|
||||||
|
@ -454,8 +454,8 @@ declare_syscall!(
|
||||||
);
|
);
|
||||||
|
|
||||||
declare_syscall!(
|
declare_syscall!(
|
||||||
/// Panic syscall function, called when the BPF program calls 'sol_panic_()`
|
/// Panic syscall function, called when the SBF program calls 'sol_panic_()`
|
||||||
/// Causes the BPF program to be halted immediately
|
/// Causes the SBF program to be halted immediately
|
||||||
SyscallPanic,
|
SyscallPanic,
|
||||||
fn inner_call(
|
fn inner_call(
|
||||||
invoke_context: &mut InvokeContext,
|
invoke_context: &mut InvokeContext,
|
||||||
|
@ -480,7 +480,7 @@ declare_syscall!(
|
||||||
);
|
);
|
||||||
|
|
||||||
declare_syscall!(
|
declare_syscall!(
|
||||||
/// Dynamic memory allocation syscall called when the BPF program calls
|
/// Dynamic memory allocation syscall called when the SBF program calls
|
||||||
/// `sol_alloc_free_()`. The allocator is expected to allocate/free
|
/// `sol_alloc_free_()`. The allocator is expected to allocate/free
|
||||||
/// from/to a given chunk of memory and enforce size restrictions. The
|
/// from/to a given chunk of memory and enforce size restrictions. The
|
||||||
/// memory chunk is given to the allocator during allocator creation and
|
/// memory chunk is given to the allocator during allocator creation and
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @brief Example C based BPF program that prints out the parameters
|
* @brief Example C based SBF program that prints out the parameters
|
||||||
* passed to it
|
* passed to it
|
||||||
*/
|
*/
|
||||||
#include <sol/deserialize.h>
|
#include <sol/deserialize.h>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @brief Example C based BPF program that prints out the parameters
|
* @brief Example C based SBF program that prints out the parameters
|
||||||
* passed to it
|
* passed to it
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-128bit-dep"
|
name = "solana-sbf-rust-128bit-dep"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-alloc"
|
name = "solana-sbf-rust-alloc"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that test dynamic memory allocation
|
//! Example Rust-based SBF program that test dynamic memory allocation
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-call-depth"
|
name = "solana-sbf-rust-call-depth"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that tests call depth and stack usage
|
//! Example Rust-based SBF program that tests call depth and stack usage
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
custom_heap_default, custom_panic_default, entrypoint::SUCCESS, log::sol_log_64, msg,
|
custom_heap_default, custom_panic_default, entrypoint::SUCCESS, log::sol_log_64, msg,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-caller-access"
|
name = "solana-sbf-rust-caller-access"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-curve25519"
|
name = "solana-sbf-rust-curve25519"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-custom-heap"
|
name = "solana-sbf-rust-custom-heap"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF that tests out using a custom heap
|
//! Example Rust-based SBF that tests out using a custom heap
|
||||||
|
|
||||||
use {
|
use {
|
||||||
solana_program::{
|
solana_program::{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-dep-crate"
|
name = "solana-sbf-rust-dep-crate"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests dependent crates
|
//! Example Rust-based SBF program tests dependent crates
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use {
|
use {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-deprecated-loader"
|
name = "solana-sbf-rust-deprecated-loader"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that supports the deprecated loader
|
//! Example Rust-based SBF program that supports the deprecated loader
|
||||||
|
|
||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-dup-accounts"
|
name = "solana-sbf-rust-dup-accounts"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that tests duplicate accounts passed via accounts
|
//! Example Rust-based SBF program that tests duplicate accounts passed via accounts
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-error-handling"
|
name = "solana-sbf-rust-error-handling"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that exercises error handling
|
//! Example Rust-based SBF program that exercises error handling
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use {
|
use {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-external-spend"
|
name = "solana-sbf-rust-external-spend"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that moves a lamport from one account to another
|
//! Example Rust-based SBF program that moves a lamport from one account to another
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-finalize"
|
name = "solana-sbf-rust-finalize"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF sanity program that finalizes a BPF program
|
//! Example Rust-based SBF sanity program that finalizes a BPF program
|
||||||
|
|
||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-get-minimum-delegation"
|
name = "solana-sbf-rust-get-minimum-delegation"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-inner_instruction_alignment_check"
|
name = "solana-sbf-rust-inner_instruction_alignment_check"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF noop program
|
//! Example Rust-based SBF noop program
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
account_info::AccountInfo,
|
account_info::AccountInfo,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-instruction-introspection"
|
name = "solana-sbf-rust-instruction-introspection"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that exercises instruction introspection
|
//! Example Rust-based SBF program that exercises instruction introspection
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-invoke"
|
name = "solana-sbf-rust-invoke"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
pub const TEST_SUCCESS: u8 = 1;
|
pub const TEST_SUCCESS: u8 = 1;
|
||||||
pub const TEST_PRIVILEGE_ESCALATION_SIGNER: u8 = 2;
|
pub const TEST_PRIVILEGE_ESCALATION_SIGNER: u8 = 2;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
pub mod instructions;
|
pub mod instructions;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
#![cfg(feature = "program")]
|
#![cfg(feature = "program")]
|
||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-invoke-and-error"
|
name = "solana-sbf-rust-invoke-and-error"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-invoke-and-ok"
|
name = "solana-sbf-rust-invoke-and-ok"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-invoke-and-return"
|
name = "solana-sbf-rust-invoke-and-return"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-invoked"
|
name = "solana-sbf-rust-invoked"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
instruction::{AccountMeta, Instruction},
|
instruction::{AccountMeta, Instruction},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
pub mod instructions;
|
pub mod instructions;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that issues a cross-program-invocation
|
//! Example Rust-based SBF program that issues a cross-program-invocation
|
||||||
|
|
||||||
#![cfg(feature = "program")]
|
#![cfg(feature = "program")]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-iter"
|
name = "solana-sbf-rust-iter"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests loop iteration
|
//! Example Rust-based SBF program tests loop iteration
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-log-data"
|
name = "solana-sbf-rust-log-data"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that uses sol_log_data syscall
|
//! Example Rust-based SBF program that uses sol_log_data syscall
|
||||||
|
|
||||||
#![cfg(feature = "program")]
|
#![cfg(feature = "program")]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-many-args"
|
name = "solana-sbf-rust-many-args"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests loop iteration
|
//! Example Rust-based SBF program tests loop iteration
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::log::*;
|
use solana_program::log::*;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests loop iteration
|
//! Example Rust-based SBF program tests loop iteration
|
||||||
|
|
||||||
mod helper;
|
mod helper;
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-many-args-dep"
|
name = "solana-sbf-rust-many-args-dep"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Solana Rust-based BPF program utility functions and types
|
//! Solana Rust-based SBF program utility functions and types
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{log::sol_log_64, msg};
|
use solana_program::{log::sol_log_64, msg};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-mem"
|
name = "solana-sbf-rust-mem"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-membuiltins"
|
name = "solana-sbf-rust-membuiltins"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-noop"
|
name = "solana-sbf-rust-noop"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF noop program
|
//! Example Rust-based SBF noop program
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-panic"
|
name = "solana-sbf-rust-panic"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that panics
|
//! Example Rust-based SBF program that panics
|
||||||
|
|
||||||
#[cfg(all(feature = "custom-panic", target_os = "solana"))]
|
#[cfg(all(feature = "custom-panic", target_os = "solana"))]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-param-passing"
|
name = "solana-sbf-rust-param-passing"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests loop iteration
|
//! Example Rust-based SBF program tests loop iteration
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
use {
|
use {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-param-passing-dep"
|
name = "solana-sbf-rust-param-passing-dep"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF program written in Rust"
|
description = "Solana SBF program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program tests loop iteration
|
//! Example Rust-based SBF program tests loop iteration
|
||||||
|
|
||||||
extern crate solana_program;
|
extern crate solana_program;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-rand"
|
name = "solana-sbf-rust-rand"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF program that tests rand behavior
|
//! Example Rust-based SBF program that tests rand behavior
|
||||||
|
|
||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-realloc"
|
name = "solana-sbf-rust-realloc"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
instruction::{AccountMeta, Instruction},
|
instruction::{AccountMeta, Instruction},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
pub mod instructions;
|
pub mod instructions;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
#![cfg(feature = "program")]
|
#![cfg(feature = "program")]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-realloc-invoke"
|
name = "solana-sbf-rust-realloc-invoke"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
pub const INVOKE_REALLOC_ZERO_RO: u8 = 0;
|
pub const INVOKE_REALLOC_ZERO_RO: u8 = 0;
|
||||||
pub const INVOKE_REALLOC_ZERO: u8 = 1;
|
pub const INVOKE_REALLOC_ZERO: u8 = 1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
pub mod instructions;
|
pub mod instructions;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Example Rust-based BPF realloc test program
|
//! Example Rust-based SBF realloc test program
|
||||||
|
|
||||||
#![cfg(feature = "program")]
|
#![cfg(feature = "program")]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-ro-account_modify"
|
name = "solana-sbf-rust-ro-account_modify"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-ro-modify"
|
name = "solana-sbf-rust-ro-modify"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "solana-sbf-rust-sanity"
|
name = "solana-sbf-rust-sanity"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
description = "Solana BPF test program written in Rust"
|
description = "Solana SBF test program written in Rust"
|
||||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
repository = "https://github.com/solana-labs/solana"
|
repository = "https://github.com/solana-labs/solana"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue