A future change will add more cases to this if-else if-...-else chain.
Using a match statement will be easier to follow then a very long
if-else if-... chain.
This change was broken out in order to have a higher signal to noise
ratio in the subsequent change.
The open_blockstore() helper currently takes multiple configurable
options. While the arguments are parsed at a high enough scope in
main.rs to avoid repeated calls, this parsing is duplicated in the
separate subcommand files (program.rs and bigtable.rs).
The repeated parsing is redundant, and also prone to having to missing
an arg (as was the case with bigtable not having wal_recovery_mode).
So, this PR consolidates the parsing to a single function and uses that
function across the previous callers.
* use PROGRAM_OWNER + program data for account executable
mock account data with executable_meta in precompiled program and update
test_bank_hash_consistency test
pr: return const slice and add comments
pr: use ReadableAccount
use const to get rid of magic number
add featuregate disable_bpf_loader_instructions to disable bpf loader management instructions, and deprecate_executable_meta_update_in_bpf_loader to deprecate executable flag update in bpf loader
deprecate usage of executable in Account
fix a test
fix sbp bench
fix sbf program tests
add feature gate to account and borrowed account apis
fix tests
more test fixes
* restore bpf_loader v2 tests
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
warning: `flatten()` will run forever if the iterator repeatedly produces an `Err`
--> ledger-tool/src/main.rs:2649:39
|
2649 | for line in f.lines().flatten() {
| ^^^^^^^^^ help: replace with: `map_while(Result::ok)`
|
note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
--> ledger-tool/src/main.rs:2649:29
|
2649 | for line in f.lines().flatten() {
| ^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
= note: `#[warn(clippy::lines_filter_map_ok)]` on by default
warning: `solana-ledger-tool` (bin "solana-ledger-tool" test) generated 1 warning
```
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> runtime/src/accounts/mod.rs:483:82
|
483 | let min_balance = match get_system_account_kind(payer_account).ok_or_else(|| {
| __________________________________________________________________________________^
484 | | error_counters.invalid_account_for_fee += 1;
485 | | TransactionError::InvalidAccountForFee
486 | | })? {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
= note: `#[warn(clippy::blocks_in_conditions)]` on by default
warning: this `let...else` may be rewritten with the `?` operator
--> runtime/src/bank.rs:3093:21
|
3093 | / let Some(vote_account) = get_vote_account(&vote_pubkey) else {
3094 | | return None;
3095 | | };
| |______________________^ help: replace it with: `let vote_account = get_vote_account(&vote_pubkey)?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
= note: `#[warn(clippy::question_mark)]` on by default
warning: this `let...else` may be rewritten with the `?` operator
--> runtime/src/bank.rs:4778:17
|
4778 | / let Some((_, account)) = accounts.get(i) else {
4779 | | return None;
4780 | | };
| |__________________^ help: replace it with: `let (_, account) = accounts.get(i)?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
Checking solana-bench-streamer v1.18.0 (/Users/brooks/src/solana/bench-streamer)
warning: `solana-runtime` (lib) generated 3 warnings
```
```
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> validator/src/dashboard.rs:223:38
|
223 | match async move {
| ______________________________________^
224 | | let rpc_addr = admin_client.rpc_addr().await?;
225 | | let start_time = admin_client.start_time().await?;
226 | | Ok::<_, jsonrpc_core_client::RpcError>((rpc_addr, start_time))
227 | | }
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
= note: `#[warn(clippy::blocks_in_conditions)]` on by default
warning: `solana-validator` (lib) generated 1 warning
```
```
error: unnecessary use of `.write(true)` because there is `.append(true)`
--> logger/src/lib.rs:61:9
|
61 | .write(true)
| ^^^^^^^^^^^^ help: remove `.write(true)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options
= note: `-D clippy::ineffective-open-options` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ineffective_open_options)]`
```
The initial implementation only allowed for outputting details for one
bank/slot. There are several usecases that could take advantage of the
file being able to contain details for multiple banks.
So, this PR adjusts the structure to contain details about multiple
banks. Note that using a basic diff will not work for comparing the old
format to this new format. Instead, a basic transform with jq will be
necessary to do so.
#### Problem
All structs that implement AccountsFile are required to support get_account,
but the implementation for HotAccounts is currently missing.
#### Summary of Changes
This PR implements HotAccountsReader::get_account_from_index_offset.
This will allow it to support AccountsFile::get_account API.
#### Test Plan
Add new unit-test.
* blockstore: write only dirty erasure meta and merkle root metas
* pr feedback: use enum to distinguish clean/dirty
* pr feedback: comments, rename
* pr feedback: use AsRef
#### Problem
There're some typos in the comments and assert messages index.rs mentioned in #34529
#### Summary of Changes
Fix the typos (only in assert message and comments).
#### Problem
Each AccountsFile is required to implement account_matches_owners(),
a public API that checks whether the account located at the specified
offset matches any input owners. However, the implementation of
account_matches_owners() for HotAccountsStorage is missing.
#### Summary of Changes
This PR implements HotStorageReader::account_matches_owners().
#### Test Plan
A new unit-test is added to this PR.
* Throttle unstaked quic streams for a given connection
* Fix interval duration check
* move wait to handle_chunk
* set max unistreams to 0
* drop new streams
* cleanup
* some more cleanup
* fix tests
* update test and stop code
* fix bench-tps