* Ensure blocks do not exceed the max accounts data size during Replay Stage (#23422)
(cherry picked from commit 3c6840050c)
# Conflicts:
# runtime/src/bank.rs
* fix conflicts
Co-authored-by: Brooks Prumo <brooks@solana.com>
* Fix incorrect nonoverlapping test in sol_memcpy (#21007)
Thanks!
(cherry picked from commit df2b448993)
# Conflicts:
# programs/bpf_loader/src/syscalls.rs
# sdk/program/src/program_stubs.rs
# sdk/src/feature_set.rs
* resolve conflicts
Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Jack May <jack@solana.com>
This change prevents zero-cost computation of hash functions on
unbound number of zero-length slices of data. The cost for each slice
is at least equal to the base cost of a memory operation, but could be
more for longer slices.
(cherry picked from commit 0a3a18744f)
* 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>
* Bumps solana_rbpf to v0.2.22
* Adjusts vm::Config and feature gates.
(cherry picked from commit 96c88d1a5e)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* 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>
* Clean up before credits_auto_rewind
* Use `=` intead of `|=` for mutable bool
(cherry picked from commit 545c97f903)
Co-authored-by: Ryo Onodera <ryoqun@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>