* 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>
* bank: prime new executor cache entry use-counts
(cherry picked from commit 4ce48307bb)
* --amend
(cherry picked from commit ad3cb0bc93)
Co-authored-by: Trent Nelson <trent@solana.com>
* move `ExecuteTimings` from `runtime::bank` to `program_runtime::timings`
(cherry picked from commit 7d32909e17)
# Conflicts:
# core/Cargo.toml
# ledger/Cargo.toml
# programs/bpf/Cargo.lock
* Add execute metrics
(cherry picked from commit b25e4a200b)
* Add metrics for executor creation
(cherry picked from commit 848b6dfbdd)
* Add helper macro for `AddAssign`ing with saturating arithmetic
(cherry picked from commit deb9344e49)
* Use saturating_add_assign macro
(cherry picked from commit 72fc6096a0)
* Consolidate process instruction execution timings to own struct
(cherry picked from commit 390ef0fbcd)
Co-authored-by: Trent Nelson <trent@solana.com>
Co-authored-by: Carl Lin <carl@solana.com>
* Make ledger-tool analyze-storage use Blockstore::open()
Opening a large ledger may require setting a larger open file descriptor
limit. Blockstore::open() does this whereas the underlying Database
object that analyze-storage was opening does not.
* Move key_size call lookup to take advantage of traits
* Fix typo where analyze worked on wrong column
* Make analyze-storage analyze all columns
(cherry picked from commit 9f1f64e384)
Co-authored-by: steviez <steven@solana.com>
* Split up local cluster tests into separate CI steps (#22295)
* Split up local cluster tests into separate CI steps
* Update buildkite-pipeline.sh
(cherry picked from commit 0e1afcbb26)
# Conflicts:
# local-cluster/tests/local_cluster.rs
* resolve conflicts
Co-authored-by: Justin Starry <justin@solana.com>
* Update address map proposal to improve dev experience
* another revision to match implementation
(cherry picked from commit 0224a8b127)
Co-authored-by: Justin Starry <justin@solana.com>
* Update tests to demonstrate that program id account info for CPI is optional
* Clean up comments that say that program id account info is required
(cherry picked from commit ec7536faf6)
Co-authored-by: Justin Starry <justin@solana.com>
Flip iter operations to keep associated address/header/packets together
Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.
Additionally, compute total_size inline to avoid running through packets
a second time.
(cherry picked from commit 20b61e28b6)
Co-authored-by: steviez <steven@solana.com>
* removes epoch_authorized_voters from VoteTracker (#22192)
https://github.com/solana-labs/solana/pull/22169
verifies authorized-voter early on in vote-listener pipeline; and so
VoteTracker no longer needs to maintain and check for epoch authorized
voters.
(cherry picked from commit 69d71f8f86)
# Conflicts:
# core/src/cluster_info_vote_listener.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>