Commit Graph

4640 Commits

Author SHA1 Message Date
Tyera dd8e1f4c73
Remove overly restrictive check_account_access for partitioned epoch rewards (#631)
* Remove rewards-interval-related check_account_access implementation

* Move RewardsInterval to tests module

* Update test to new StakeProgram functionality
2024-04-09 21:55:45 -06:00
Lucas Steuernagel 4753a8aefa
Move `add_builtin` to SVM (#547) 2024-04-09 16:55:09 -03:00
Lucas Steuernagel e01670135f
Remove `must_replace` parameter from `add_builtin_account` (#662) 2024-04-08 17:57:15 -03:00
HaoranYi 287d0d2582
Remove reclaim param for store_accounts_frozen (#618)
remove reclaim param for store_accounts_frozen

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-04-08 14:28:13 -05:00
Joe C 03ef611f0c
program-runtime: hoist `RuntimeConfig` up to SVM (#630)
program-runtime: hoist `RuntimeConfig` out into SVM
2024-04-07 10:45:57 -05:00
Tyera 9253c465d1
Persist EpochRewards sysvar (#572)
* Persist EpochRewards sysvar between reward intervals

* Adjust initial EpochRewards balance to ensure it is not debited out of existence

* Set EpochRewards::active = false at end of distribution

* Fix tests

* Extend test to 2 epochs, assert sysvar still exists

* Stop adjusting EpochRewards balance based on rewards

* Fix tests

* Review suggestions
2024-04-05 10:13:50 -06:00
Alexander Meißner 55c05c5ea5
Fix - `FailedVerification` and `Closed` tombstones (#419)
* Only the verifier can cause FailedVerification, everything else is Closed

* Removes the environments parameter from load_program_accounts().

* cargo fmt

* Simplify invocation of deployed program

* Attempt to invoke a program before it is deployed

* Attempt to invoke a buffer before it is used in a deployment

* Escalates Option return value of load_program_accounts() to load_program_with_pubkey().

* Review feedback
2024-04-05 13:03:18 +02:00
Ryo Onodera 0b9c6379b3
Introduce SchedulingStateMachine for unified scheduler (#129)
* Introduce SchedulingStateMachine

* Apply all typo fixes from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* Update word wrapping

* Clarify Token::assume_exclusive_mutating_thread()

* Use slice instead of &Vec<_>

* Improve non-const explanation

* Document consecutive readonly rescheduling opt.

* Make test_gradual_locking terminate for miri

* Avoid unnecessary Task::clone()

* Rename: lock_{status,result} and no attempt_...()

* Add safety comment for get_account_locks_unchecked

* Reduce and comment about Page::blocked_tasks cap.

* Document SchedulingStateMachine::schedule_task()

* Add justification of closure in create_task

* Use the From trait for PageUsage

* Replace unneeded if-let with .expect()

* Add helpful comments for peculiar crossbeam usage

* Fix typo

* Make bug-bounty-exempt statement more clear

* Add test_enfoced_get_account_locks_verification

* Fix typos...

* Big rename: Page => UsageQueue

* Document UsageQueueLoader

* Various minor cleanings for beautifier diff

* Ensure reinitialize() is maintained for new fields

* Remove uneeded impl Send for TokenCell & doc upd.

* Apply typo fixes from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* Merge similar tests into one

* Remove test_debug

* Remove assertions of task_index()

* Fix UB in TokenCell

* Make schedule_task doc comment simpler

* Document deschedule_task

* Simplify unlock_usage_queue() args

* Add comment for try_unblock() -> None

* Switch to Option<Usage> for fewer assert!s

* Add assert_matches!() to UsageQueue methods

* Add panicking test case for ::reinitialize()

* Use UsageFromTask

* Rename: LockAttempt => LockContext

* Move locking and unlocking methods to usage queue

* Remove outdated comment...

* Remove redundant fn: pop_unblocked_usage_from_task

* Document the index of task

* Clarifty comment a bit

* Update .current_usage inside try_lock()

* Use inspect_err to simplify code

* fix ci...

* Use ()...

* Rename: schedule{,_next}_unblocked_task()

* Rename: {try_lock,unlock}_{for_task,usage_queues}

* Test solana-unified-scheduler-logic under miri

* Test UB to illustrate limitation of TokenCell

* Test UB of using multiple tokens at the same time

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-04-05 08:58:33 +09:00
Joe C 87fc227b51
Runtime: Core BPF Migration: Setup migration configurations (#525)
* runtime: builtins: add `core_bpf_migration_config` to prototypes

* runtime: builtins: set up test builtins

* macro-ize builtin testing
2024-04-04 18:20:20 -05:00
Tao Zhu bc81153d60
Add function to reward with full priority fee and burnt transaction fee (#566)
* refactor shareble code into its own function; update and add tests

* add function to reward with full prio fee and burnt transaction fee
2024-04-04 14:06:08 -05:00
Tyera f4307ad2d3
Move remaining bits; partitioned epoch-rewards reorg, 5 of 5 (#553)
* Move epoch_rewards_hasher into submodule

* Move unit test into epoch_rewards_hasher sub-submodule

* Move integration-like tests into submodule

* Move compare functionality into sub-submodule
2024-04-03 23:20:49 +00:00
Tyera 72c526b2bb
Move calculation methods; partitioned epoch-rewards reorg, 4 of 5 (#529)
* Add calculation sub-submodule

* Move calculation methods into sub-submodule

* Move unit tests into calculation sub-submodule
2024-04-03 14:01:00 -06:00
Tyera 5d53389fe4
Move distribution methods; partitioned epoch-rewards reorg, 3 of 5 (#528)
* Add distribution sub-submodule

* Move distribution methods to sub-submodule

* Move unit tests into distribution sub-submodule
2024-04-02 19:13:39 -06:00
Brooks 4247a8a546
Archives storages directly (#503) 2024-04-02 18:43:38 +00:00
Jeff Washington (jwash) ccb09866b5
stop requiring data allocation to check for rent (#543) 2024-04-02 13:25:43 -05:00
Lucas Steuernagel 9f8a478c51
Use `&str` instead of `String` in `add_builtin` (#539) 2024-04-02 14:36:13 -03:00
Brooks 01855eda43
Sets write version to 0 when storing accounts (#476) 2024-04-02 11:27:23 -04:00
Brooks a37b85c210
Reverts incorrectly renamed comment (#537) 2024-04-02 09:45:34 -04:00
Tyera 16c684ef9f
Move sysvar submodule; reorg partitioned epoch rewards runtime code, 2 of 5 (#520)
* Add sysvar sub-submodule

* Move sysvar methods to sub-submodule

* Move unit test to sysvar sub-submodule

* Add new partitioned_epoch_rewards::sysvar method

* Remove superfluous method
2024-04-02 01:41:48 +00:00
Tyera c29a2392fc
Reorganize partitioned epoch rewards runtime code, 1 of 5 (#511)
* Add bank::partitioned_epoch_rewards submodule

* Move helper structs and types to submodule

* Move partitioned-rewards-specific Bank methods to submodule

* Move unit tests into submodule

* Update BankAbiTestWrapperNewer frozen_abi hash
2024-04-01 18:05:57 -06:00
Joe C 3f17532b11
Runtime: Core BPF Migration: Path to migrate a builtin to Core BPF (#408)
* runtime: core_bpf_migration: add migration path

* runtime: core_bpf_migration: add tests for migration path

* comments

* function name

* rent lamports

* bank operations ordering

* make migration method a bank method

* update deployment slot to current slot

* invoke loader deploy directly
2024-04-01 16:30:23 -05:00
Yueh-Hsuan Chiang a5aee48722
Rename append vec to accounts file for CurrentAncientAppendVec (#447) 2024-04-01 15:54:14 -05:00
Brooks bc7b27472f
Refactors storage flushing when taking a snapshot (#485) 2024-04-01 13:27:29 -04:00
sakridge e0e659680a
Remove duplicated token ids and use a shared inline-spl crate (#456) 2024-04-01 14:31:04 +02:00
Jeff Washington (jwash) 18c32aba35
disable read cache while populating stakes cache on load (#482)
* dsiable read cache while populating stakes cache on load

* use struct with drop as api

* use LoadHint

* remove disable_read_cache_updates_count

* add comment

* fmt
2024-03-29 15:20:38 -05:00
Brooks d5c0c0b1c2
Removes support for loading snapshots with > 1 append vec per slot (#474) 2024-03-28 16:32:17 -04:00
Brooks 182d27f718
Checks if bank snapshot is loadable before fastbooting (#343) 2024-03-28 11:14:23 -04:00
Tyera ecb4f62887
Simd 118: extend EpochRewards sysvar (#428)
* Update EpochRewards sysvar

* Update Clone trait

* Update doctests

* Update bank to new sysvar fields

* Update runtime tests

* Update syscall test

* Update tests

* Clean up doctest EpochRewards construction
2024-03-27 19:24:06 -06:00
Kirill Fomichev ba9c25c41e
prioritization fee cache: remove lru crate (#30) 2024-03-27 11:09:17 -06:00
Kirill Fomichev 80d3200f4a
prioritization fee cache: remove not required locks (#272)
* prioritization fee cache: remove not required locks

* update HashMap to BTreeMap

* fix clippy

* add type alias

* apply name change

* check that cache is empty

* remove sleep

* remove outdated commented tests

* fmt

* extra warn
2024-03-26 17:19:26 -06:00
Joe C 3627038541
Runtime: Core BPF Migration: Struct for loading and checking source BPF program accounts (#332)
* runtime: core_bpf_migration: add source_bpf_upgradeable config

* runtime: core_bpf_migration: add source_bpf_upgradeable config tests

* renamings

* bincode error

* drop `total_size`
2024-03-26 07:05:10 -05:00
Pankaj Garg 5cfb6e860d
SVM: Move sysvar_cache related functions and tests to SVM (#402) 2024-03-22 19:45:34 -07:00
Tyera 6e6acce798
Clarify TargetProgramBuiltin code docs (#403)
* Update comments

* Nitty variable name update
2024-03-22 23:44:38 +00:00
Pankaj Garg 9a447ab6bd
SVM: bank to use program cache from transaction_processor (#397) 2024-03-22 14:05:20 -07:00
Yueh-Hsuan Chiang 977b1b836f
Rename AppendVecId to AccountsFileId (#383)
#### Problem
The current AppendVecId actually refers to an accounts file id.

#### Summary of Changes
Rename AppendVecId to AccountsFileId.

#### Test Plan
Build
2024-03-22 11:25:30 -07:00
Joe C 62d49f123a
Runtime: Core BPF Migration: Struct for loading and checking builtin program accounts (#331)
* runtime: core_bpf_migration: add builtin config

* runtime: core_bpf_migration: add builtin config tests

* some renaming feedback
2024-03-22 11:25:10 -05:00
Joe C f799c9ff67
Runtime: Expose builtin program IDs to crate (#318)
* runtime: bank: rename `builtin_programs` to `builtin_program_ids`

* runtime: snapshot minimizer: use builtin IDs from bank
2024-03-22 11:24:49 -05:00
Pankaj Garg 91b1ee3df6
Fix: deploy program on last slot of epoch during environment change (#101)
* Fix: deploy program on last slot of epoch during environment change

* solana-runtime: deploy at last epoch slot test

* disable deployment of sol_alloc_free

* Move tx-batch-constructor to its own function

* use new_from_cache

---------

Co-authored-by: Alessandro Decina <alessandro.d@gmail.com>
2024-03-22 07:43:28 -07:00
Tao Zhu 1e08e90498
Add functions to collect executed transactions fee in details; (#178)
* Add functions to collect executed transactions fee in details;

* remove unnecessary derive attributes

* change function name from add to accumulate; remove collector_fee_details from PartialEq

* add AbiExample

* add test

* share function to withdraw errored transaction

* more tests
2024-03-21 04:33:35 +00:00
Alessandro Decina 981881544c
runtime: do fewer syscalls in remap_append_vec_file (#336)
* runtime: do fewer syscalls in remap_append_vec_file

Use renameat2(src, dest, NOREPLACE) as an atomic version of if
statx(dest).is_err() { rename(src, dest) }.

We have high inode contention during storage rebuild and this saves 1
fs syscall for each appendvec.

* Address review feedback
2024-03-21 14:28:23 +11:00
Joe C f194f70e68
Runtime: Refactor builtins module (#304)
* runtime: builtins: move to new bank submodule

* runtime: builtins: change `feature_id` to `enable_feature_id`

* runtime: builtins: add stateless builtins
2024-03-20 20:46:38 -05:00
Alessandro Decina ade90354a1
runtime: use str::split instead of regex to parse appendvec filenames (#323) 2024-03-21 09:14:16 +11:00
Dmitri Makarov 09ae5872b3
Rename LoadedPrograms to ProgramCache for readability (#339) 2024-03-20 15:26:45 -04:00
HaoranYi 0f8f8cd970
Revert deprecate executable feature (#309)
* revert deprecate executable feature

* add native loader account transfer test

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-20 10:54:15 -05:00
Pankaj Garg aba8ce5f3e
Move code to check_program_modification_slot out of SVM (#329)
* Move code to check_program_modification_slot out of SVM

* add documentation for the public function
2024-03-20 05:39:07 -07:00
Pankaj Garg cc3afa5588
Remove public visibility of program cache from bank (#279) 2024-03-17 15:29:20 -07:00
Brooks 5c1df15e92
Removes the storage recycler (#118) 2024-03-11 15:38:34 -04:00
Jeff Washington (jwash) 158c4e05d5
remove dead code (#176) 2024-03-11 12:21:51 -05:00
Brooks 0e12172ddd
Moves accounts benches into accounts-db crate (#164) 2024-03-11 11:34:08 -04:00
Dmitri Makarov d88050cda3
SVM: Add doc comments, restrict visibility of some xfaces to crate (#136) 2024-03-08 14:04:07 -05:00