* fix bank new_from_field for epoch reward status
* fix bank serde test assert for epoch reward status
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
The accounts command currently dumps every single account in the
AccountsDb. This is obviously a lot of output, so a previous change
streamed the accounts instead of collecting and dumping at the end.
The streaming approach is much more performant, but the implementation
is non-trivial. This change
- Moves the accounts output code to output.rs
- Refactor the logic to several objects that implment the functionality
- Adjust the json output to also include the summary
This change lays the groundwork for cleanly adding several more flags
that will allow for querying different subsets of accounts.
* Move EpochRewardsHasher to solana-sdk
* Cargo.lock
* Apparently we're allowing arithmetic_side_effects in all of runtime
* Move allow stmt to block instead of module
* Also allow in test mod
* Refactor bank load_and_execute_transactions
* Remove redundant clippy annotation
* Report check time where it is done in load_and_execute_transactions
* remove println from a test
* sync fee_structure with fee_rate_governor;
remove congestion_multiplier from calculacte_fee(), leave parameters unused for now.
* Update genesis processing to have a fallback collector id for tests
* DCOU-ify the collector id for tests parameter (#1902)
* wrap test_collector_id in DCOU
* rename param to collector_id_for_tests
* fix program test
* fix dcou
---------
Co-authored-by: Brooks <brooks@prumo.org>
* 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: 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
```
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.
* Finalize unified scheduler plumbing with min impl
* Fix comment
* Rename leftover type name...
* Make logging text less ambiguous
* Make PhantomData simplyer without already used S
* Make TaskHandler stateless again
* Introduce HandlerContext to simplify TaskHandler
* Add comment for coexistence of Pool::{new,new_dyn}
* Fix grammar
* Remove confusing const for upcoming changes
* Demote InstalledScheduler::context() into dcou
* Delay drop of context up to return_to_pool()-ing
* Revert "Demote InstalledScheduler::context() into dcou"
This reverts commit 049a126c905df0ba8ad975c5cb1007ae90a21050.
* Revert "Delay drop of context up to return_to_pool()-ing"
This reverts commit 60b1bd2511a714690b0b2331e49bc3d0c72e3475.
* Make context handling really type-safe
* Update comment
* Fix grammar...
* Refine type aliases for boxed traits
* Swap the tuple order for readability & semantics
* Simplify PooledScheduler::result_with_timings type
* Restore .in_sequence()
* Use where for aesthetics
* Simplify if...
* Fix typo...
* Polish ::schedule_execution() a bit
* Fix rebase conflicts..
* Make test more readable
* Fix test failures after rebase...
* Use 2's random selection to evict program cache
* implement decaying of usage counter
* replace RwLock with AtomicU64
* address review comments
* remove -> swap_remove
* Disables verification-less reloading.
* Refactors LoadedPrograms::extract() to use a mutable parameter instead of returning the list of missing entries.
* Refactors LoadedPrograms::extract() to use a mutable parameter instead of returning a LoadedProgramsForTxBatch.
* Adds explicit SecondLevel structure to LoadedPrograms.
* Adds cooperative_loading_task.
* Implements cooperative loading in the bank.
* Fixes fork graph in tests.
* Adds LoadingTaskWaiter.
* Environment mismatch needs to just skip the entry.
BankForks has two constructors; one that takes a single Bank (the root)
and one that can take an arbitrary number of Banks plus the root slot.
However, the constructor that accepts multiple banks is unnecessary; it
isn't used in production and is only used in several tests.
So, remove the multi-bank constructor and update unit tests.
Currently, the file is generated when a node drops a block that was
produced by another node. However, it would also be beneficial to see
the account state when a node drops its' own block.
Output the file in this additional failure codepath
* Moves modification of feature accounts from Bank::compute_active_feature_set() into Bank::apply_feature_activations().
* Renames allow_new_activations and newly_activated to include_pending and pending.
* Fix test_compute_active_feature_set.
* add a feature to disable rent collection
* fix a test
* fix a test
* rekey
* should collect rent
* Update runtime/src/bank/fee_distribution.rs
Co-authored-by: Brooks <brooks@prumo.org>
* expand tests to cover both rent collection disabled and enabled
* feedbacks
* reviews - move should collect rent check out of rent collector into bank
* enforce rent_epoch to u64:max when rent collection is disabled
* review feedbacks and fix a test
When rent fee collection is disabled, we won't collect rent for any account. If there are any rent paying accounts, their `rent_epoch` won't change too.
* revise comments
* update rent_epoch for rent exempted account
* rebase
* set rent_epoch in rent collection for rent exempted account
* revert test change
* don't assert
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Brooks <brooks@prumo.org>
* allow test feature to skip rewrites
* hook up cli arg for test skip rewrites, update tests
* fix sanity checker
* add account hash to abi to fix a test
* reviews
* use hashmap to collect skip_rewrites. exclude skip_rewrites from dirty
pubkey set
* accumulate skipped_rewrite in reduce
* mutex
* fmt
* skip hash verify for this test flag
* add skipped rewrites num stat
* skip bank hash verify not account hash verify
* reviews
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
* Add InstalledScheduler for blockstore_processor
* Reverse if clauses
* Add more comments for process_batches()
* Elaborate comment
* Simplify schedule_transaction_executions type
* Split compute budget instruction processing from ComputeBudget struct itself, so CB instructions can be processed elsewhere without involving ComputeBudget
* updated tests
* avoid built ComputeBudget from dated ComputeBudgetLimits in this refactoring PR
* Clean-up program-runtime/src/compute_budget_processor.rs
* Add test for a corner case that deprecated instruction is used to request units greater than max limit;
* Update code to handle the corner case.
* Initialize fork graph in program cache during bank_forks creation
* rename BankForks::new to BankForks::new_rw_arc
* fix compilation
* no need to set fork_graph on insert()
* fix partition tests