* Prevent new RentPaying state created by paying fees (#23358)
* Add failing test
* Check fee-payer rent-state change on load
* Add more test cases
* Review comments
(cherry picked from commit 36484f4f08)
# Conflicts:
# runtime/src/account_rent_state.rs
* Fix conflicts
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Skip adding builtins if they will be removed (#23233)
* Add failing test for precompile transition
* Skip adding builtins if they will be removed
* cargo clean
* nits
* fix abi check
* remove workaround
Co-authored-by: Jack May <jack@solana.com>
(cherry picked from commit 1719d2349f)
# Conflicts:
# runtime/src/bank.rs
# runtime/src/builtins.rs
* resolve conflicts
Co-authored-by: Justin Starry <justin@solana.com>
Co-authored-by: Jack May <jack@solana.com>
* Add simulation detection countermeasure (#22880)
* Add simulation detection countermeasures
* Add program and test using TestValidator
* Remove incinerator deposit
* Remove incinerator
* Update Cargo.lock
* Add more features to simulation bank
* Update Cargo.lock per rebase
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
(cherry picked from commit c42b80f099)
# Conflicts:
# programs/bpf/Cargo.lock
# programs/bpf/Cargo.toml
* Update Cargo.lock
Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* - estimate a program cost as 2 standard deviation above mean
- replaced get_average / get_mode with get_default to assign max units to unknown program
(cherry picked from commit a25ac1c988)
# Conflicts:
# runtime/src/cost_model.rs
* use EMA in place of Welford
(cherry picked from commit 6587dbfa47)
* 1. Persist to blockstore less frequently;
2. reduce alpha for EMA to 1 percent to have roughly 200 data points for estimatio
(cherry picked from commit 7aa1fb4e24)
# Conflicts:
# core/src/cost_update_service.rs
# core/src/tvu.rs
# runtime/src/cost_model.rs
* fix tests after merge
(cherry picked from commit ba2d83f580)
* fix merge
Co-authored-by: Tao Zhu <tao@solana.com>
* Reject close of active vote accounts (#22651)
* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
(cherry picked from commit 75563f6c7b)
# Conflicts:
# programs/vote/src/vote_processor.rs
# sdk/src/feature_set.rs
* Resolve merge conflicts
Co-authored-by: Will Hickey <csu_hickey@yahoo.com>
Co-authored-by: Will Hickey <will.hickey@solana.com>
* Set the correct root in block commitment cache initialization
* clean up test
* bump
(cherry picked from commit d9c259a231)
Co-authored-by: Justin Starry <justin@solana.com>
* spl-associated-token-account: Add feature for new program
* Address feedback
(cherry picked from commit fc21af4e6e)
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* Prevent rent-paying account creation (#22292)
* Fixup typo
* Add new feature
* Add new TransactionError
* Add framework for checking account state before and after transaction processing
* Fail transactions that leave new rent-paying accounts
* Only check rent-state of writable tx accounts
* Review comments: combine process_result success behavior; log and metrics before feature activation
* Fix tests that assume rent-exempt accounts are okay
* Remove test no longer relevant
* Remove native/sysvar special case
* Move metrics submission to report legacy->legacy rent paying transitions as well
(cherry picked from commit 637e366b18)
# Conflicts:
# runtime/src/bank.rs
# runtime/src/lib.rs
* Fix conflicts and rework for TransactionRefCells
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* optimizes ReadOnlyAccountsCache LRU eviction implementation (#22403)
ReadOnlyAccountsCache is using a background thread, table scan and sort
to implement LRU eviction policy:
https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L66-L73https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L186-L191https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L222
DashMap internally locks each shard when accessed; so a table scan in
the background thread can create a lot of lock contention.
This commit adds an index-list queue containing cached keys in the order
that they are accessed. Each hash-map entry also includes its index into
this queue.
When an item is first entered into the cache, it is added to the end of
the queue. Also each time an entry is looked up from the cache it is
moved to the end of queue. As a result, items in the queue are always
sorted in the order that they have last been accessed. When doing LRU
eviction, cache entries are evicted from the front of the queue.
Using index-list, all queue operations above are O(1) with low overhead
and so above achieves an efficient implementation of LRU cache eviction
policy.
(cherry picked from commit a49ef49f87)
# Conflicts:
# Cargo.lock
# programs/bpf/Cargo.lock
# runtime/Cargo.toml
# runtime/src/accounts_db.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>