Commit Graph

1663 Commits

Author SHA1 Message Date
Lucas Steuernagel b97b3dd4ab
Use BankForks on tests - Part 3 (#34248)
* Add BankForks to core tests

* Refactor functions under DCOU
2023-12-01 13:47:22 -03:00
Andrew Fitzgerald 2294801954
Do not derive Copy for EpochSchedule and Rent (#32767) 2023-12-01 07:57:25 -08:00
Lucas Steuernagel aeb4a348fb
Use BankForks on tests - Part 2 (#34234)
* Use BankForks on tests - Part 2

Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>
2023-11-29 14:28:31 -03:00
Andrew Fitzgerald 40f5870a47
Refactor: check_transactions - allow borrowed transactions (#34232) 2023-11-28 08:24:16 -08:00
Lucas Steuernagel e83276522a
Use `BankForks` on tests - Part 1 (#34206)
---------

Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>
2023-11-27 14:10:46 -03:00
Justin Starry 57ec20704a
clean feature: no_overflow_rent_distribution (#34074) 2023-11-27 06:18:19 +00:00
Alexander Meißner 4ee5078e5f
Refactor - `ExtractedPrograms` (#34205)
* Puts ExtractedPrograms into Arc<Mutex<>>.

* Merges ExtractedPrograms::missing and ExtractedPrograms::unloaded.

* Unifies missing entry insertion in LoadedPrograms::extract().
2023-11-23 09:17:21 +01:00
HaoranYi 57dc7adda1
move PROGRAM_OWNERS to sdk (#34193)
* move PROGRAM_OWNERS to sdk

* Update sdk/src/account.rs

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2023-11-21 09:49:33 -06:00
Lucas Steuernagel a3670054be
Move `RewardInterval` to runtime (#34146)
Move RewardInterval to runtime
2023-11-20 10:17:21 -03:00
Brooks e02f25d5a2
Removes filler accounts (#34115) 2023-11-19 20:36:57 -05:00
Alexander Meißner 6b8545061f
Fix - `Bank::compute_active_feature_set()` and `Bank::apply_feature_activations()` (#34124)
* 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.
2023-11-17 09:54:21 +01:00
Lucas Steuernagel 2c71d21fad
Move load_accounts to runtime (#34017)
* Move load_accounts to runtime

---------

Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>
2023-11-16 18:45:58 -03:00
HaoranYi 60fdd85aed
Add a feature to disable rent collection (#33945)
* 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>
2023-11-16 08:57:49 -06:00
Pankaj Garg bc2c98bfde
Simplify code for bank::load_program() (#34093)
* Simplify code for bank::load_program()

* address review comments
2023-11-15 15:17:14 -08:00
Alexander Meißner ffa462dd3a
Cleanup - Feature gate of `delay_visibility_of_program_deployment` (#34087)
* Cleans up feature gate of delay_visibility_of_program_deployment.

* Removes programs_updated_only_for_global_cache.
2023-11-15 18:29:31 +01:00
Alexander Meißner d93280c287
Cleanup - Feature gate of `limit_max_instruction_trace_length` (#34085)
Cleans up feature gate of limit_max_instruction_trace_length.
2023-11-15 17:51:10 +01:00
Brooks 725ab37bf4
clippy: Replaces .get(0) with .first() (#34048) 2023-11-13 17:22:17 -05:00
Pankaj Garg 59eb55990c
Move filter_executable_program_accounts to bank.rs (#34004) 2023-11-09 14:40:04 -08:00
Alexander Meißner a9509f56b7
Feature - Epoch boundary recompilation phase (#33477)
* Adds LoadedPrograms::upcoming_environments.

* Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune().

* Adds parameter recompile to Bank::load_program().

* Sets latest_root_slot/epoch and environments in Bank::finish_init().

* Removes FEATURES_AFFECTING_RBPF list.

* Adjusts test_feature_activation_loaded_programs_recompilation_phase().
2023-11-09 13:10:59 +01:00
Justin Starry ebe8afb0c3
Burn fees collected into invalid accounts (#33887)
* refactor: create bank::fee_distribution module

* feature: add checks to fee distribution

* refactor: move Bank::deposit fn into test_utils

* feedback

* feedback 2

* add datapoints

* change to datapoint_warn

* typo
2023-11-06 10:02:22 +08:00
Ryo Onodera 136ab21f34
Define InstalledScheduler::wait_for_termination() (#33922)
* Define InstalledScheduler::wait_for_termination()

* Rename to wait_for_scheduler_termination

* Comment wait_for_termination and WaitReason better
2023-10-31 14:33:36 +09:00
Joe C ecd674bd92
revert programify feature gate (#33897) 2023-10-27 18:28:13 +02:00
Jeff Washington (jwash) a18debc34a
allow test feature to skip rewrites (#33851)
* 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>
2023-10-27 09:14:05 -05:00
Ryo Onodera 0873705c1b
Define register_unique_recent_blockhash_for_test (#33880) 2023-10-27 12:30:45 +09:00
Tao Zhu 510b6b949f
Split compute budget instructions process from struct (#33852)
* 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.
2023-10-26 22:12:56 -05:00
Pankaj Garg 78c31aa6b8
Use program cache fork graph in extract() (#33806)
* Use program cache fork graph instead of WorkingSlot trait

* Fix deadlocked tests

* keep WorkingSlot trait for now
2023-10-25 06:04:38 -07:00
Jeff Washington (jwash) b0b4e1f0c0
remove IncludeSlotInHash after feature activation on mnb (#33816)
* remove IncludeSlotInHash after feature activation on mnb

* fix compile errors

* compile errors

* fix tests

* fix test results
2023-10-23 15:12:02 -07:00
Ryo Onodera 5a963529a8
Add BankWithScheduler for upcoming scheduler code (#33704)
* Add BankWithScheduler for upcoming scheduler code

* Remove too confusing insert_without_scheduler()

* Add doc comment as a bonus

* Simplify BankForks::banks()

* Add derive(Debug) on BankWithScheduler
2023-10-21 15:56:43 +09:00
Alexander Meißner a5c7c999e2
Bump solana_rbpf to v0.8.0 (#33679)
* Bumps solana_rbpf to v0.8.0

* Adjustments:
Replaces declare_syscall!() with declare_builtin_function!().
Removes Config::encrypt_runtime_environment.
Simplifies error propagation.
2023-10-20 21:39:50 +02:00
Pankaj Garg 59cb3b57ee
Set a global fork graph in program cache (#33776)
* Set a global fork graph in program cache

* fix deadlock

* review feedback
2023-10-20 08:47:03 -07:00
steviez c98c24bd6d
Revert "Split compute budget instructions process from struct itself … (#33784)
Revert "Split compute budget instructions process from struct itself (#33513)"

This reverts commit c73bebe984. This
was found to be a consensus breaking change.
2023-10-20 15:53:45 +02:00
Tao Zhu c73bebe984
Split compute budget instructions process from struct itself (#33513)
* Split compute budget instruction processing from ComputeBudget struct itself, allow compute_budget_instructions be processed elsewhere without having to instantiate ComputeBudget

* updated tests
2023-10-19 11:10:42 -05:00
Brooks c1353e172c
Removes cap_accounts_data_allocations_per_transaction featurization (#33754) 2023-10-19 07:01:15 -04:00
Jeff Washington (jwash) 69495f4c13
Fix non-determinism in account_hash_ignore_slot on genesis (#33692) 2023-10-16 12:47:07 -07:00
Jeff Washington (jwash) d948e5bf69
ancient shrink on its own cadence (#33712) 2023-10-16 10:06:20 -07:00
Alexander Meißner a3f85aba21
Refactor - LoadedPrograms part 2 (#33694) 2023-10-13 12:59:48 -07:00
Pankaj Garg fd9297775a
Prevent delay_visibility_of_program_deployment feature from cache pruning (#33689) 2023-10-13 14:21:18 +00:00
Sean Young 47511999bb
bank: do not remove trailing 0 bytes from return data (#33639)
This is creating havoc for Solang, as the return data is borsh encoded
and therefore `u64` values like 0x100 get truncated.
2023-10-13 08:00:41 +01:00
Ryo Onodera 53925b6182
Make goto_end_of_slot() take Arc<Bank> (#33650) 2023-10-13 13:08:38 +09:00
Brooks 452fd5d384
Adds `--no-skip-initial-accounts-db-clean` *hidden* CLI flag (#33664) 2023-10-12 13:32:40 -04:00
Brennan b36d051b51
Update hashes per tick with feature gates (#33600)
* Update hashes per tick with feature gates
2023-10-11 09:58:06 -07:00
Alexander Meißner cb695c7b32
Cleanup - Feature Gate of `enable_early_verification_of_account_modifications` (#33579)
Cleans up the feature gate of enable_early_verification_of_account_modifications:
- Removes PreAccount
- Removes InvokeContext::pre_accounts and InvokeContext::rent
- Removes InvokeContext::verify() and InvokeContext::verify_and_update()
- Removes TransactionContext::is_early_verification_of_account_modifications_enabled()
- Removes TransactionAccounts::is_early_verification_of_account_modifications_enabled
- No longer optional: TransactionContext::rent
2023-10-10 17:26:17 +02:00
Ryo Onodera 1704789247
Define tick related helper test methods (#33537)
* Define tick related helper methods

* dcou VoteSimulator

* blacklist ledger-tool for dcou

* fix dcou ci...

* github
2023-10-10 09:23:18 +09:00
Trent Nelson 55f3f203c6
bank: remove ambiguating "helper" method (#33606) 2023-10-09 21:47:21 +00:00
Joe C 25460f76e7
Bank: Add function to replace empty account with upgradeable program on feature activation (#32783)
* replace program account

* modify for all cases

* remove non-data swap

* address tests & conditional feedback

* get the rent involved

* mix in owner & executable

* feature-related cases

* stripped back to feature-specific case only

* added feature

* address initial feedback

* added more lamport checks

* condense tests

* using test_case

* add fail cases to tests

* more cleanup

* add verifiably built program

* update program account state

* cleaned up serializing logic

* use full word capitalization

* rename old & new to dst & src

* swap src and dst in parameters

* add warnings and errors

* rename feature to programify

* test suite description clarity

* remove strings from datapoints

* spell out source and destination

* more verbose comments in account replace functions

* move lamport calculation

* swap lamport check for state check

* move replace functions to helper module

* make replace_account methods fallible

* refactor error handling

* add test for source program state
2023-10-04 19:54:59 +02:00
steviez 5b9a167c51
Add uniform start/stop log lines for background hash verification (#33441)
Add uniform start/stop log lines for background hash verification
2023-09-28 15:13:51 +02:00
Alexander Meißner 7ff797bcef
Refactor - Remove parameter `feature_set` from `load_program_from_bytes()` (#33395)
Replaces parameter feature_set with delay_visibility_of_program_deployment in load_program_from_bytes().
2023-09-25 17:16:31 +02:00
ananas-block 997aa0a3f8
Feat(syscall): add altbn128 g1 & g2 compression (#32870)
* solana-program - altbn128: add g1 & g2 compression

still fixing tests for point of infinity

feat: proof compression syscall working

add rust test to ci

remove prints

added c test

added sycall pricing

* fixed ci checks

* refactored altbn128 and compression
2023-09-25 05:43:34 -07:00
Trent Nelson 1840fd7ab3
Feature - better error codes for tx lamport check (#33343)
Replaces `TransactionError::InstructionError(0, InstructionError::UnbalancedInstruction)` with `TransactionError::UnbalancedTransaction`.

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2023-09-22 23:58:05 +00:00
Pankaj Garg f50342a790
Split vote related code from runtime to its own crate (#32882)
* Move vote related code to its own crate

* Update imports in code and tests

* update programs/sbf/Cargo.lock

* fix check errors

* update abi_digest

* rebase fixes

* fixes after rebase
2023-09-19 10:46:37 -07:00