diff --git a/.buildkite/solana-private.sh b/.buildkite/solana-private.sh
old mode 100644
new mode 100755
index 20a510a9c9cbac..bb1ac9d5dbc774
--- a/.buildkite/solana-private.sh
+++ b/.buildkite/solana-private.sh
@@ -8,10 +8,8 @@
#
set -e
-# NAME=$(buildkite-agent meta-data get name)
cd "$(dirname "$0")"/..
source ci/_
-sudo chmod 0777 ci/buildkite-solana-private.sh
_ ci/buildkite-solana-private.sh pipeline.yml
echo +++ pipeline
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 17cc728e68bd17..c348d69acbe4ea 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -69,7 +69,7 @@ jobs:
needs:
- check
if: >
- github.repository == 'solana-labs/solana' &&
+ github.repository == 'anza-xyz/agave' &&
needs.check.outputs.continue == 1
# the name is used by .mergify.yml as well
name: build & deploy docs
@@ -79,9 +79,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
- node-version: 16
+ node-version: 22
- name: Build
working-directory: docs
diff --git a/.github/workflows/downstream-project-anchor.yml b/.github/workflows/downstream-project-anchor.yml
index a7768f6a1c433b..33ecc632f0b7d5 100644
--- a/.github/workflows/downstream-project-anchor.yml
+++ b/.github/workflows/downstream-project-anchor.yml
@@ -13,11 +13,10 @@ on:
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
- - "cargo-build-bpf"
- - "cargo-test-bpf"
- "cargo-build-sbf"
- "cargo-test-sbf"
- "scripts/build-downstream-anchor-projects.sh"
+ - "scripts/patch-spl-crates-for-anchor.sh"
- ".github/scripts/purge-ubuntu-runner.sh"
- ".github/scripts/downstream-project-spl-install-deps.sh"
- ".github/workflows/downstream-project-anchor.yml"
diff --git a/.github/workflows/downstream-project-spl.yml b/.github/workflows/downstream-project-spl.yml
index 8d3baf25949e99..d2065f178fd5a5 100644
--- a/.github/workflows/downstream-project-spl.yml
+++ b/.github/workflows/downstream-project-spl.yml
@@ -13,8 +13,6 @@ on:
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
- - "cargo-build-bpf"
- - "cargo-test-bpf"
- "cargo-build-sbf"
- "cargo-test-sbf"
- "ci/downstream-projects/run-spl.sh"
diff --git a/.gitignore b/.gitignore
index 995129e50d16cc..3127645a259560 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ target/
*.log
log-*.txt
log-*/
+!log-collector/
!log-analyzer/*
# intellij files
diff --git a/.mergify.yml b/.mergify.yml
index 23469b3f055882..d50fd5e1e277ba 100644
--- a/.mergify.yml
+++ b/.mergify.yml
@@ -64,7 +64,7 @@ pull_request_rules:
- check-success=clippy-nightly (macos-latest)
- check-success=clippy-nightly (macos-latest-large)
- or:
- - -files~=(\.rs|Cargo\.toml|Cargo\.lock|cargo-build-bpf|cargo-test-bpf|cargo-build-sbf|cargo-test-sbf|ci/downstream-projects/run-spl\.sh|\.github/workflows/downstream-project-spl\.yml)$
+ - -files~=(\.rs|Cargo\.toml|Cargo\.lock|cargo-build-sbf|cargo-test-sbf|ci/downstream-projects/run-spl\.sh|\.github/workflows/downstream-project-spl\.yml)$
- and:
- status-success=cargo-test-sbf (token/program)
- status-success=cargo-test-sbf (instruction-padding/program, token/program-2022, token/program-2022-test)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f08a16889b81b..1da9bd05f68b70 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,21 +14,36 @@ Release channels have their own copy of this changelog:
## [2.1.0] - Unreleased
+* Breaking:
+ * SDK:
+ * `cargo-build-sbf` and `cargo-build-bpf` have been deprecated for two years and have now been definitely removed.
+ Use `cargo-build-sbf` and `cargo-test-sbf` instead.
+ * Stake:
+ * removed the unreleased `redelegate` instruction processor and CLI commands (#2213)
* Changes
* SDK: removed the `respan` macro. This was marked as "internal use only" and was no longer used internally.
## [2.0.0]
* Breaking
- * SDK: Support for Borsh v0.9 removed, please use v1 or v0.10 (#1440)
- * SDK: `Copy` is no longer derived on `Rent` and `EpochSchedule`, please switch to using `clone()` (solana-labs#32767)
- * SDK: deprecated SyncClient trait methods removed
+ * SDK:
+ * Support for Borsh v0.9 removed, please use v1 or v0.10 (#1440)
+ * `Copy` is no longer derived on `Rent` and `EpochSchedule`, please switch to using `clone()` (solana-labs#32767)
+ * `solana-sdk`: deprecated symbols removed
+ * `solana-program`: deprecated symbols removed
* RPC: obsolete and deprecated v1 endpoints are removed. These endpoints are:
confirmTransaction, getSignatureStatus, getSignatureConfirmation, getTotalSupply,
getConfirmedSignaturesForAddress, getConfirmedBlock, getConfirmedBlocks, getConfirmedBlocksWithLimit,
getConfirmedTransaction, getConfirmedSignaturesForAddress2, getRecentBlockhash, getFees,
getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot getStakeActivation
- * `--enable-rpc-obsolete_v1_7` flag removed
* Deprecated methods are removed from `RpcClient` and `RpcClient::nonblocking`
+ * `solana-client`: deprecated re-exports removed; please import `solana-connection-cache`, `solana-quic-client`, or `solana-udp-client` directly
+ * Deprecated arguments removed from `agave-validator`:
+ * `--enable-rpc-obsolete_v1_7` (#1886)
+ * `--accounts-db-caching-enabled` (#2063)
+ * `--accounts-db-index-hashing` (#2063)
+ * `--no-accounts-db-index-hashing` (#2063)
+ * `--incremental-snapshots` (#2148)
+ * `--halt-on-known-validators-accounts-hash-mismatch` (#2157)
* Changes
* `central-scheduler` as default option for `--block-production-method` (#34891)
* `solana-rpc-client-api`: `RpcFilterError` depends on `base64` version 0.22, so users may need to upgrade to `base64` version 0.22
diff --git a/Cargo.lock b/Cargo.lock
index 8e13c3ccd8a785..d9175d0d9c0682 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -186,6 +186,7 @@ dependencies = [
"solana-geyser-plugin-manager",
"solana-gossip",
"solana-ledger",
+ "solana-log-collector",
"solana-logger",
"solana-measure",
"solana-program-runtime",
@@ -216,6 +217,16 @@ dependencies = [
"solana-version",
]
+[[package]]
+name = "agave-transaction-view"
+version = "2.1.0"
+dependencies = [
+ "agave-transaction-view",
+ "bincode",
+ "criterion",
+ "solana-sdk",
+]
+
[[package]]
name = "agave-validator"
version = "2.1.0"
@@ -565,9 +576,9 @@ checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c"
[[package]]
name = "arrayref"
-version = "0.3.7"
+version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
+checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a"
[[package]]
name = "arrayvec"
@@ -703,13 +714,13 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.80"
+version = "0.1.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
+checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -862,7 +873,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -1019,7 +1030,7 @@ dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
"syn_derive",
]
@@ -1136,9 +1147,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce"
[[package]]
name = "bytemuck"
-version = "1.16.1"
+version = "1.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e"
+checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83"
dependencies = [
"bytemuck_derive",
]
@@ -1151,7 +1162,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -1162,9 +1173,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
-version = "1.6.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
[[package]]
name = "bytesize"
@@ -1768,7 +1779,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -1779,7 +1790,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -1841,7 +1852,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -1965,7 +1976,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -2071,7 +2082,7 @@ checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -2341,7 +2352,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -2528,17 +2539,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "goblin"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c955ab4e0ad8c843ea653a3d143048b87490d9be56bd7132a435c2407846ac8f"
-dependencies = [
- "log",
- "plain",
- "scroll",
-]
-
[[package]]
name = "h2"
version = "0.3.26"
@@ -2551,7 +2551,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"slab",
"tokio",
"tokio-util 0.7.11",
@@ -2744,9 +2744,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.29"
+version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33"
+checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
@@ -2906,9 +2906,9 @@ dependencies = [
[[package]]
name = "index_list"
-version = "0.2.12"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cb725b6505e51229de32027e0cfcd9db29da4d89156f9747b0a5195643fa3e1"
+checksum = "4e6ba961c14e98151cd6416dd3685efe786a94c38bc1a535c06ceff0a1600813"
[[package]]
name = "indexmap"
@@ -2922,9 +2922,9 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.2.6"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
+checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
dependencies = [
"equivalent",
"hashbrown 0.14.3",
@@ -3339,9 +3339,9 @@ dependencies = [
[[package]]
name = "lz4"
-version = "1.25.0"
+version = "1.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91"
+checksum = "958b4caa893816eea05507c20cfe47574a43d9a697138a7872990bba8a0ece68"
dependencies = [
"libc",
"lz4-sys",
@@ -3349,9 +3349,9 @@ dependencies = [
[[package]]
name = "lz4-sys"
-version = "1.9.5"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3"
+checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868"
dependencies = [
"cc",
"libc",
@@ -3640,7 +3640,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -3697,23 +3697,23 @@ dependencies = [
[[package]]
name = "num_enum"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
+checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
+checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -3775,9 +3775,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
-version = "0.10.64"
+version = "0.10.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f"
+checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
dependencies = [
"bitflags 2.6.0",
"cfg-if 1.0.0",
@@ -3807,18 +3807,18 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
[[package]]
name = "openssl-src"
-version = "300.1.6+3.1.4"
+version = "300.3.1+3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085"
+checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.101"
+version = "0.9.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff"
+checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
dependencies = [
"cc",
"libc",
@@ -4075,12 +4075,6 @@ version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f"
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
[[package]]
name = "plotters"
version = "0.3.4"
@@ -4344,7 +4338,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -4948,20 +4942,6 @@ name = "scroll"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da"
-dependencies = [
- "scroll_derive",
-]
-
-[[package]]
-name = "scroll_derive"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
[[package]]
name = "sct"
@@ -5034,9 +5014,9 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.203"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
+checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
dependencies = [
"serde_derive",
]
@@ -5052,22 +5032,23 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.203"
+version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
+checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
name = "serde_json"
-version = "1.0.119"
+version = "1.0.122"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8eddb61f0697cc3989c5d64b452f5488e2b8a60fd7d5076a3045076ffef8cb0"
+checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
dependencies = [
"itoa",
+ "memchr",
"ryu",
"serde",
]
@@ -5112,7 +5093,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -5133,7 +5114,7 @@ version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"itoa",
"ryu",
"serde",
@@ -5162,7 +5143,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -5469,6 +5450,7 @@ dependencies = [
"solana-measure",
"solana-net-utils",
"solana-rpc-client",
+ "solana-rpc-client-api",
"solana-runtime",
"solana-sdk",
"solana-streamer",
@@ -5482,6 +5464,7 @@ dependencies = [
name = "solana-accounts-db"
version = "2.1.0"
dependencies = [
+ "ahash 0.8.10",
"assert_matches",
"bincode",
"blake3",
@@ -5494,7 +5477,7 @@ dependencies = [
"dashmap",
"ed25519-dalek",
"index_list",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"itertools 0.12.1",
"lazy_static",
"libsecp256k1",
@@ -5521,6 +5504,7 @@ dependencies = [
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-inline-spl",
+ "solana-lattice-hash",
"solana-logger",
"solana-measure",
"solana-metrics",
@@ -5528,7 +5512,7 @@ dependencies = [
"solana-rayon-threadlimit",
"solana-sdk",
"solana-stake-program",
- "solana-svm",
+ "solana-svm-transaction",
"solana-vote-program",
"static_assertions",
"strum",
@@ -5549,6 +5533,7 @@ dependencies = [
"num-derive",
"num-traits",
"rustc_version 0.4.0",
+ "solana-log-collector",
"solana-program",
"solana-program-runtime",
"solana-sdk",
@@ -5566,6 +5551,13 @@ dependencies = [
"solana-sdk",
]
+[[package]]
+name = "solana-atomic-u64"
+version = "2.1.0"
+dependencies = [
+ "parking_lot 0.12.3",
+]
+
[[package]]
name = "solana-banking-bench"
version = "2.1.0"
@@ -5710,6 +5702,23 @@ dependencies = [
"solana-sdk",
]
+[[package]]
+name = "solana-bn254"
+version = "2.1.0"
+dependencies = [
+ "ark-bn254",
+ "ark-ec",
+ "ark-ff",
+ "ark-serialize",
+ "array-bytes",
+ "bytemuck",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "solana-program",
+ "thiserror",
+]
+
[[package]]
name = "solana-bpf-loader-program"
version = "2.1.0"
@@ -5722,12 +5731,16 @@ dependencies = [
"memoffset 0.9.1",
"rand 0.8.5",
"scopeguard",
+ "solana-bn254",
"solana-compute-budget",
"solana-curve25519",
+ "solana-log-collector",
"solana-measure",
"solana-poseidon",
+ "solana-program-memory",
"solana-program-runtime",
"solana-sdk",
+ "solana-timings",
"solana-type-overrides",
"solana-vote",
"solana_rbpf",
@@ -5767,11 +5780,24 @@ dependencies = [
]
[[package]]
-name = "solana-cargo-build-bpf"
+name = "solana-builtins-default-costs"
version = "2.1.0"
dependencies = [
+ "ahash 0.8.10",
+ "lazy_static",
"log",
- "solana-logger",
+ "rand 0.8.5",
+ "rustc_version 0.4.0",
+ "solana-address-lookup-table-program",
+ "solana-bpf-loader-program",
+ "solana-compute-budget-program",
+ "solana-config-program",
+ "solana-frozen-abi",
+ "solana-loader-v4-program",
+ "solana-sdk",
+ "solana-stake-program",
+ "solana-system-program",
+ "solana-vote-program",
]
[[package]]
@@ -5795,10 +5821,6 @@ dependencies = [
"tar",
]
-[[package]]
-name = "solana-cargo-test-bpf"
-version = "2.1.0"
-
[[package]]
name = "solana-cargo-test-sbf"
version = "2.1.0"
@@ -5877,6 +5899,8 @@ dependencies = [
"solana-client",
"solana-compute-budget",
"solana-config-program",
+ "solana-connection-cache",
+ "solana-decode-error",
"solana-faucet",
"solana-loader-v4-program",
"solana-logger",
@@ -5956,7 +5980,7 @@ dependencies = [
"dashmap",
"futures 0.3.30",
"futures-util",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"indicatif",
"log",
"quinn",
@@ -6033,9 +6057,11 @@ dependencies = [
"chrono",
"serde",
"serde_derive",
+ "solana-log-collector",
"solana-logger",
"solana-program-runtime",
"solana-sdk",
+ "solana-short-vec",
]
[[package]]
@@ -6046,7 +6072,7 @@ dependencies = [
"bincode",
"crossbeam-channel",
"futures-util",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"indicatif",
"log",
"rand 0.8.5",
@@ -6066,6 +6092,7 @@ name = "solana-core"
version = "2.1.0"
dependencies = [
"ahash 0.8.10",
+ "anyhow",
"arrayvec",
"assert_matches",
"base64 0.22.1",
@@ -6101,11 +6128,14 @@ dependencies = [
"serial_test",
"solana-accounts-db",
"solana-bloom",
+ "solana-builtins-default-costs",
"solana-client",
"solana-compute-budget",
+ "solana-connection-cache",
"solana-core",
"solana-cost-model",
"solana-entry",
+ "solana-fee",
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-geyser-plugin-manager",
@@ -6123,12 +6153,15 @@ dependencies = [
"solana-rpc",
"solana-rpc-client-api",
"solana-runtime",
+ "solana-runtime-transaction",
"solana-sanitize",
"solana-sdk",
"solana-send-transaction-service",
+ "solana-short-vec",
"solana-stake-program",
"solana-streamer",
"solana-svm",
+ "solana-timings",
"solana-tpu-client",
"solana-transaction-status",
"solana-turbine",
@@ -6158,19 +6191,16 @@ dependencies = [
"itertools 0.12.1",
"lazy_static",
"log",
+ "rand 0.8.5",
"rustc_version 0.4.0",
- "solana-address-lookup-table-program",
- "solana-bpf-loader-program",
+ "solana-builtins-default-costs",
"solana-compute-budget",
- "solana-compute-budget-program",
- "solana-config-program",
"solana-frozen-abi",
"solana-frozen-abi-macro",
- "solana-loader-v4-program",
"solana-logger",
"solana-metrics",
+ "solana-runtime-transaction",
"solana-sdk",
- "solana-stake-program",
"solana-system-program",
"solana-vote-program",
"static_assertions",
@@ -6188,6 +6218,14 @@ dependencies = [
"thiserror",
]
+[[package]]
+name = "solana-decode-error"
+version = "2.1.0"
+dependencies = [
+ "num-derive",
+ "num-traits",
+]
+
[[package]]
name = "solana-define-syscall"
version = "2.1.0"
@@ -6205,6 +6243,7 @@ dependencies = [
"serde",
"solana-bench-tps",
"solana-client",
+ "solana-connection-cache",
"solana-core",
"solana-faucet",
"solana-gossip",
@@ -6291,6 +6330,14 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "solana-fee"
+version = "2.1.0"
+dependencies = [
+ "solana-sdk",
+ "solana-svm-transaction",
+]
+
[[package]]
name = "solana-frozen-abi"
version = "2.1.0"
@@ -6319,7 +6366,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc_version 0.4.0",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -6393,7 +6440,7 @@ dependencies = [
"clap 2.33.3",
"crossbeam-channel",
"flate2",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"itertools 0.12.1",
"log",
"lru",
@@ -6421,9 +6468,11 @@ dependencies = [
"solana-net-utils",
"solana-perf",
"solana-rayon-threadlimit",
+ "solana-rpc-client",
"solana-runtime",
"solana-sanitize",
"solana-sdk",
+ "solana-short-vec",
"solana-streamer",
"solana-tpu-client",
"solana-version",
@@ -6439,8 +6488,7 @@ name = "solana-inline-spl"
version = "2.1.0"
dependencies = [
"bytemuck",
- "rustc_version 0.4.0",
- "solana-sdk",
+ "solana-program",
]
[[package]]
@@ -6460,6 +6508,18 @@ dependencies = [
"tiny-bip39",
]
+[[package]]
+name = "solana-lattice-hash"
+version = "2.1.0"
+dependencies = [
+ "base64 0.22.1",
+ "blake3",
+ "bytemuck",
+ "criterion",
+ "rand 0.8.5",
+ "rand_chacha 0.3.1",
+]
+
[[package]]
name = "solana-ledger"
version = "2.1.0"
@@ -6486,6 +6546,7 @@ dependencies = [
"num_cpus",
"num_enum",
"prost",
+ "qualifier_attr",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rayon",
@@ -6515,6 +6576,7 @@ dependencies = [
"solana-storage-bigtable",
"solana-storage-proto",
"solana-svm",
+ "solana-timings",
"solana-transaction-status",
"solana-vote",
"solana-vote-program",
@@ -6539,6 +6601,7 @@ dependencies = [
"bincode",
"log",
"solana-compute-budget",
+ "solana-log-collector",
"solana-measure",
"solana-program-runtime",
"solana-sdk",
@@ -6599,6 +6662,13 @@ dependencies = [
"solana-version",
]
+[[package]]
+name = "solana-log-collector"
+version = "2.1.0"
+dependencies = [
+ "log",
+]
+
[[package]]
name = "solana-logger"
version = "2.1.0"
@@ -6658,6 +6728,13 @@ dependencies = [
"thiserror",
]
+[[package]]
+name = "solana-msg"
+version = "2.1.0"
+dependencies = [
+ "solana-define-syscall",
+]
+
[[package]]
name = "solana-net-shaper"
version = "2.1.0"
@@ -6686,7 +6763,6 @@ dependencies = [
"solana-logger",
"solana-sdk",
"solana-version",
- "static_assertions",
"tokio",
"url 2.5.2",
]
@@ -6713,7 +6789,7 @@ version = "2.1.0"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
"toml 0.8.12",
]
@@ -6744,6 +6820,7 @@ dependencies = [
"solana-metrics",
"solana-rayon-threadlimit",
"solana-sdk",
+ "solana-short-vec",
"solana-vote-program",
"test-case",
]
@@ -6802,10 +6879,6 @@ version = "2.1.0"
dependencies = [
"anyhow",
"arbitrary",
- "ark-bn254",
- "ark-ec",
- "ark-ff",
- "ark-serialize",
"array-bytes",
"assert_matches",
"base64 0.22.1",
@@ -6832,6 +6905,7 @@ dependencies = [
"num-derive",
"num-traits",
"parking_lot 0.12.3",
+ "qualifier_attr",
"rand 0.8.5",
"rustc_version 0.4.0",
"serde",
@@ -6841,17 +6915,31 @@ dependencies = [
"serial_test",
"sha2 0.10.8",
"sha3 0.10.8",
+ "solana-atomic-u64",
+ "solana-decode-error",
"solana-define-syscall",
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-logger",
+ "solana-msg",
+ "solana-program-memory",
"solana-sanitize",
"solana-sdk-macro",
+ "solana-secp256k1-recover",
+ "solana-short-vec",
"static_assertions",
"thiserror",
"wasm-bindgen",
]
+[[package]]
+name = "solana-program-memory"
+version = "2.1.0"
+dependencies = [
+ "num-traits",
+ "solana-define-syscall",
+]
+
[[package]]
name = "solana-program-runtime"
version = "2.1.0"
@@ -6859,7 +6947,6 @@ dependencies = [
"assert_matches",
"base64 0.22.1",
"bincode",
- "eager",
"enum-iterator",
"itertools 0.12.1",
"libc",
@@ -6873,10 +6960,12 @@ dependencies = [
"solana-compute-budget",
"solana-frozen-abi",
"solana-frozen-abi-macro",
+ "solana-log-collector",
"solana-logger",
"solana-measure",
"solana-metrics",
"solana-sdk",
+ "solana-timings",
"solana-type-overrides",
"solana-vote",
"solana_rbpf",
@@ -6903,12 +6992,14 @@ dependencies = [
"solana-bpf-loader-program",
"solana-compute-budget",
"solana-inline-spl",
+ "solana-log-collector",
"solana-logger",
"solana-program-runtime",
"solana-runtime",
"solana-sdk",
"solana-stake-program",
"solana-svm",
+ "solana-timings",
"solana-vote-program",
"solana_rbpf",
"test-case",
@@ -7092,6 +7183,7 @@ dependencies = [
"anyhow",
"base64 0.22.1",
"bs58",
+ "const_format",
"jsonrpc-core",
"reqwest",
"reqwest-middleware",
@@ -7138,6 +7230,7 @@ dependencies = [
"serde_json",
"solana-account-decoder",
"solana-client",
+ "solana-connection-cache",
"solana-logger",
"solana-pubsub-client",
"solana-rpc",
@@ -7205,6 +7298,7 @@ dependencies = [
"solana-compute-budget-program",
"solana-config-program",
"solana-cost-model",
+ "solana-fee",
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-inline-spl",
@@ -7216,10 +7310,12 @@ dependencies = [
"solana-program-runtime",
"solana-rayon-threadlimit",
"solana-runtime",
+ "solana-runtime-transaction",
"solana-sdk",
"solana-stake-program",
"solana-svm",
"solana-system-program",
+ "solana-timings",
"solana-transaction-status",
"solana-version",
"solana-vote",
@@ -7256,9 +7352,6 @@ dependencies = [
[[package]]
name = "solana-sanitize"
version = "2.1.0"
-dependencies = [
- "thiserror",
-]
[[package]]
name = "solana-sdk"
@@ -7304,13 +7397,18 @@ dependencies = [
"sha2 0.10.8",
"sha3 0.10.8",
"siphasher",
+ "solana-bn254",
+ "solana-decode-error",
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-logger",
"solana-program",
+ "solana-program-memory",
"solana-sanitize",
"solana-sdk",
"solana-sdk-macro",
+ "solana-secp256k1-recover",
+ "solana-short-vec",
"static_assertions",
"thiserror",
"tiny-bip39",
@@ -7325,7 +7423,21 @@ dependencies = [
"bs58",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
+]
+
+[[package]]
+name = "solana-secp256k1-recover"
+version = "2.1.0"
+dependencies = [
+ "anyhow",
+ "borsh 1.5.1",
+ "libsecp256k1",
+ "rustc_version 0.4.0",
+ "solana-define-syscall",
+ "solana-frozen-abi",
+ "solana-frozen-abi-macro",
+ "thiserror",
]
[[package]]
@@ -7341,6 +7453,7 @@ dependencies = [
"crossbeam-channel",
"log",
"solana-client",
+ "solana-connection-cache",
"solana-logger",
"solana-measure",
"solana-metrics",
@@ -7349,6 +7462,19 @@ dependencies = [
"solana-tpu-client",
]
+[[package]]
+name = "solana-short-vec"
+version = "2.1.0"
+dependencies = [
+ "assert_matches",
+ "bincode",
+ "rustc_version 0.4.0",
+ "serde",
+ "serde_json",
+ "solana-frozen-abi",
+ "solana-frozen-abi-macro",
+]
+
[[package]]
name = "solana-stake-accounts"
version = "2.1.0"
@@ -7376,6 +7502,7 @@ dependencies = [
"rustc_version 0.4.0",
"solana-compute-budget",
"solana-config-program",
+ "solana-log-collector",
"solana-logger",
"solana-program-runtime",
"solana-sdk",
@@ -7457,7 +7584,7 @@ dependencies = [
"futures 0.3.30",
"futures-util",
"histogram",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"itertools 0.12.1",
"libc",
"log",
@@ -7492,26 +7619,34 @@ dependencies = [
"log",
"percentage",
"prost",
+ "qualifier_attr",
"rand 0.8.5",
"rustc_version 0.4.0",
"serde",
"serde_derive",
+ "shuttle",
"solana-bpf-loader-program",
"solana-compute-budget",
"solana-compute-budget-program",
+ "solana-fee",
"solana-frozen-abi",
"solana-frozen-abi-macro",
"solana-loader-v4-program",
+ "solana-log-collector",
"solana-logger",
"solana-measure",
"solana-metrics",
"solana-program-runtime",
+ "solana-runtime-transaction",
"solana-sdk",
"solana-svm",
"solana-svm-conformance",
+ "solana-svm-transaction",
"solana-system-program",
+ "solana-timings",
"solana-type-overrides",
"solana-vote",
+ "thiserror",
]
[[package]]
@@ -7523,6 +7658,13 @@ dependencies = [
"prost-types",
]
+[[package]]
+name = "solana-svm-transaction"
+version = "2.1.0"
+dependencies = [
+ "solana-sdk",
+]
+
[[package]]
name = "solana-system-program"
version = "2.1.0"
@@ -7533,6 +7675,7 @@ dependencies = [
"serde",
"serde_derive",
"solana-compute-budget",
+ "solana-log-collector",
"solana-logger",
"solana-program-runtime",
"solana-sdk",
@@ -7551,7 +7694,6 @@ dependencies = [
"serde_json",
"solana-accounts-db",
"solana-cli-output",
- "solana-client",
"solana-compute-budget",
"solana-core",
"solana-geyser-plugin-manager",
@@ -7562,6 +7704,7 @@ dependencies = [
"solana-program-test",
"solana-rpc",
"solana-rpc-client",
+ "solana-rpc-client-api",
"solana-runtime",
"solana-sdk",
"solana-streamer",
@@ -7583,6 +7726,15 @@ dependencies = [
"solana-sdk",
]
+[[package]]
+name = "solana-timings"
+version = "2.1.0"
+dependencies = [
+ "eager",
+ "enum-iterator",
+ "solana-sdk",
+]
+
[[package]]
name = "solana-tokens"
version = "2.1.0"
@@ -7594,7 +7746,7 @@ dependencies = [
"console",
"csv",
"ctrlc",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"indicatif",
"pickledb",
"serde",
@@ -7645,7 +7797,7 @@ dependencies = [
"async-trait",
"bincode",
"futures-util",
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"indicatif",
"log",
"rayon",
@@ -7691,7 +7843,6 @@ dependencies = [
name = "solana-transaction-metrics-tracker"
version = "2.1.0"
dependencies = [
- "Inflector",
"base64 0.22.1",
"bincode",
"lazy_static",
@@ -7699,6 +7850,7 @@ dependencies = [
"rand 0.8.5",
"solana-perf",
"solana-sdk",
+ "solana-short-vec",
]
[[package]]
@@ -7810,9 +7962,9 @@ dependencies = [
"scopeguard",
"solana-ledger",
"solana-logger",
- "solana-program-runtime",
"solana-runtime",
"solana-sdk",
+ "solana-timings",
"solana-unified-scheduler-logic",
"vec_extract_if_polyfill",
]
@@ -7901,10 +8053,10 @@ dependencies = [
"solana-ledger",
"solana-logger",
"solana-program",
- "solana-program-runtime",
"solana-runtime",
"solana-sdk",
"solana-streamer",
+ "solana-timings",
"solana-vote-program",
"tempfile",
]
@@ -7916,6 +8068,7 @@ dependencies = [
"bytemuck",
"num-derive",
"num-traits",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
"solana-zk-sdk",
@@ -7928,9 +8081,7 @@ dependencies = [
"bs58",
"clap 3.2.23",
"dirs-next",
- "num_cpus",
"solana-clap-v3-utils",
- "solana-cli-config",
"solana-remote-wallet",
"solana-sdk",
"solana-version",
@@ -7977,6 +8128,7 @@ dependencies = [
"curve25519-dalek",
"num-derive",
"num-traits",
+ "solana-log-collector",
"solana-program-runtime",
"solana-sdk",
"solana-zk-token-sdk",
@@ -8026,20 +8178,20 @@ dependencies = [
[[package]]
name = "solana_rbpf"
-version = "0.8.1"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06beab07f4104d6ad70d47baa67ad1bcd501a2345a983e20c389bade7c72305e"
+checksum = "381f595f78accb55aeea018a90e3acf6048f960d932002737d249e3294bd58fe"
dependencies = [
"byteorder",
"combine",
"gdbstub",
- "goblin",
"hash32",
"libc",
"log",
"rand 0.8.5",
"rustc-demangle",
"scroll",
+ "shuttle",
"thiserror",
"winapi 0.3.9",
]
@@ -8091,7 +8243,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750"
dependencies = [
"quote",
"spl-discriminator-syn",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8103,7 +8255,7 @@ dependencies = [
"proc-macro2",
"quote",
"sha2 0.10.8",
- "syn 2.0.68",
+ "syn 2.0.72",
"thiserror",
]
@@ -8162,7 +8314,7 @@ dependencies = [
"proc-macro2",
"quote",
"sha2 0.10.8",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8350,9 +8502,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.68"
+version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
+checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
@@ -8368,7 +8520,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8554,7 +8706,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8566,7 +8718,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
"test-case-core",
]
@@ -8587,22 +8739,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "thiserror"
-version = "1.0.61"
+version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
+checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.61"
+version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
+checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8739,7 +8891,7 @@ source = "git+https://github.com/anza-xyz/solana-tokio.git?rev=7cf47705faacf7bf0
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -8869,7 +9021,7 @@ version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"toml_datetime",
"winnow 0.5.16",
]
@@ -8880,7 +9032,7 @@ version = "0.22.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.3.0",
"serde",
"serde_spanned",
"toml_datetime",
@@ -8983,7 +9135,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -9292,7 +9444,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
"wasm-bindgen-shared",
]
@@ -9326,7 +9478,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -9676,7 +9828,7 @@ checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
@@ -9696,7 +9848,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.68",
+ "syn 2.0.72",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 02ab28a0acea10..de49b9b8ac1016 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ members = [
"bench-tps",
"bloom",
"bucket_map",
+ "builtins-default-costs",
"cargo-registry",
"clap-utils",
"clap-v3-utils",
@@ -37,6 +38,7 @@ members = [
"download-utils",
"entry",
"faucet",
+ "fee",
"frozen-abi",
"frozen-abi/macro",
"genesis",
@@ -47,10 +49,12 @@ members = [
"inline-spl",
"install",
"keygen",
+ "lattice-hash",
"ledger",
"ledger-tool",
"local-cluster",
"log-analyzer",
+ "log-collector",
"logger",
"measure",
"memory-management",
@@ -96,15 +100,18 @@ members = [
"runtime-transaction",
"sanitize",
"sdk",
- "sdk/cargo-build-bpf",
+ "sdk/atomic-u64",
"sdk/cargo-build-sbf",
- "sdk/cargo-test-bpf",
"sdk/cargo-test-sbf",
+ "sdk/decode-error",
"sdk/gen-headers",
"sdk/macro",
+ "sdk/msg",
"sdk/package-metadata-macro",
"sdk/program",
+ "sdk/program-memory",
"send-transaction-service",
+ "short-vec",
"stake-accounts",
"storage-bigtable",
"storage-bigtable/build-proto",
@@ -112,14 +119,17 @@ members = [
"streamer",
"svm",
"svm-conformance",
+ "svm-transaction",
"test-validator",
"thin-client",
+ "timings",
"tokens",
"tps-client",
"tpu-client",
"transaction-dos",
"transaction-metrics-tracker",
"transaction-status",
+ "transaction-view",
"turbine",
"type-overrides",
"udp-client",
@@ -150,6 +160,7 @@ edition = "2021"
[workspace.dependencies]
Inflector = "0.11.4"
+agave-transaction-view = { path = "transaction-view", version = "=2.1.0" }
aquamarine = "0.3.3"
aes-gcm-siv = "0.11.1"
ahash = "0.8.10"
@@ -160,13 +171,13 @@ ark-ec = "0.4.0"
ark-ff = "0.4.0"
ark-serialize = "0.4.0"
array-bytes = "=1.4.1"
-arrayref = "0.3.7"
+arrayref = "0.3.8"
arrayvec = "0.7.4"
assert_cmd = "2.0"
assert_matches = "1.5.0"
async-channel = "1.9.0"
async-mutex = "1.4.0"
-async-trait = "0.1.80"
+async-trait = "0.1.81"
atty = "0.2.11"
backoff = "0.4.0"
base64 = "0.22.1"
@@ -178,10 +189,10 @@ bs58 = "0.5.1"
bv = "0.11.1"
byte-unit = "4.0.19"
bytecount = "0.6.8"
-bytemuck = "1.16.1"
+bytemuck = "1.16.3"
bytemuck_derive = "1.7.0"
byteorder = "1.5.0"
-bytes = "1.6"
+bytes = "1.7"
bzip2 = "0.4.4"
caps = "0.5.5"
cargo_metadata = "0.15.4"
@@ -231,11 +242,11 @@ histogram = "0.6.9"
hmac = "0.12.1"
http = "0.2.12"
humantime = "2.0.1"
-hyper = "0.14.29"
+hyper = "0.14.30"
hyper-proxy = "0.9.1"
im = "15.1.0"
-index_list = "0.2.12"
-indexmap = "2.2.6"
+index_list = "0.2.13"
+indexmap = "2.3.0"
indicatif = "0.17.8"
itertools = "0.12.1"
jemallocator = { package = "tikv-jemallocator", version = "0.4.1", features = [
@@ -260,7 +271,7 @@ libsecp256k1 = { version = "0.6.0", default-features = false, features = [
light-poseidon = "0.2.0"
log = "0.4.22"
lru = "0.7.7"
-lz4 = "1.25.0"
+lz4 = "1.26.0"
memmap2 = "0.5.10"
memoffset = "0.9"
merlin = "3"
@@ -272,7 +283,7 @@ num-bigint = "0.4.6"
num-derive = "0.4"
num-traits = "0.2"
num_cpus = "1.16.0"
-num_enum = "0.7.2"
+num_enum = "0.7.3"
openssl = "0.10"
parking_lot = "0.12"
pbkdf2 = { version = "0.11.0", default-features = false }
@@ -307,10 +318,10 @@ rustls = { version = "0.21.12", default-features = false, features = ["quic"] }
scopeguard = "1.2.0"
semver = "1.0.23"
seqlock = "0.2.0"
-serde = "1.0.203" # must match the serde_derive version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
+serde = "1.0.204" # must match the serde_derive version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
serde_bytes = "0.11.15"
-serde_derive = "1.0.203" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
-serde_json = "1.0.119"
+serde_derive = "1.0.204" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
+serde_json = "1.0.122"
serde_with = { version = "2.3.3", default-features = false }
serde_yaml = "0.9.34"
serial_test = "2.0.0"
@@ -326,13 +337,16 @@ soketto = "0.7"
solana-account-decoder = { path = "account-decoder", version = "=2.1.0" }
solana-accounts-db = { path = "accounts-db", version = "=2.1.0" }
solana-address-lookup-table-program = { path = "programs/address-lookup-table", version = "=2.1.0" }
+solana-atomic-u64 = { path = "sdk/atomic-u64", version = "=2.1.0" }
solana-banks-client = { path = "banks-client", version = "=2.1.0" }
solana-banks-interface = { path = "banks-interface", version = "=2.1.0" }
solana-banks-server = { path = "banks-server", version = "=2.1.0" }
solana-bench-tps = { path = "bench-tps", version = "=2.1.0" }
solana-bloom = { path = "bloom", version = "=2.1.0" }
+solana-bn254 = { path = "curves/bn254", version = "=2.1.0" }
solana-bpf-loader-program = { path = "programs/bpf_loader", version = "=2.1.0" }
solana-bucket-map = { path = "bucket_map", version = "=2.1.0" }
+solana-builtins-default-costs = { path = "builtins-default-costs", version = "=2.1.0" }
agave-cargo-registry = { path = "cargo-registry", version = "=2.1.0" }
solana-clap-utils = { path = "clap-utils", version = "=2.1.0" }
solana-clap-v3-utils = { path = "clap-v3-utils", version = "=2.1.0" }
@@ -347,10 +361,12 @@ solana-connection-cache = { path = "connection-cache", version = "=2.1.0", defau
solana-core = { path = "core", version = "=2.1.0" }
solana-cost-model = { path = "cost-model", version = "=2.1.0" }
solana-curve25519 = { path = "curves/curve25519", version = "=2.1.0" }
+solana-decode-error = { path = "sdk/decode-error", version = "=2.1.0" }
solana-define-syscall = { path = "define-syscall", version = "=2.1.0" }
solana-download-utils = { path = "download-utils", version = "=2.1.0" }
solana-entry = { path = "entry", version = "=2.1.0" }
solana-faucet = { path = "faucet", version = "=2.1.0" }
+solana-fee = { path = "fee", version = "=2.1.0" }
solana-frozen-abi = { path = "frozen-abi", version = "=2.1.0" }
solana-frozen-abi-macro = { path = "frozen-abi/macro", version = "=2.1.0" }
solana-tps-client = { path = "tps-client", version = "=2.1.0" }
@@ -360,13 +376,16 @@ agave-geyser-plugin-interface = { path = "geyser-plugin-interface", version = "=
solana-geyser-plugin-manager = { path = "geyser-plugin-manager", version = "=2.1.0" }
solana-gossip = { path = "gossip", version = "=2.1.0" }
solana-inline-spl = { path = "inline-spl", version = "=2.1.0" }
+solana-lattice-hash = { path = "lattice-hash", version = "=2.1.0" }
solana-ledger = { path = "ledger", version = "=2.1.0" }
solana-loader-v4-program = { path = "programs/loader-v4", version = "=2.1.0" }
solana-local-cluster = { path = "local-cluster", version = "=2.1.0" }
+solana-log-collector = { path = "log-collector", version = "=2.1.0" }
solana-logger = { path = "logger", version = "=2.1.0" }
solana-measure = { path = "measure", version = "=2.1.0" }
solana-merkle-tree = { path = "merkle-tree", version = "=2.1.0" }
solana-metrics = { path = "metrics", version = "=2.1.0" }
+solana-msg = { path = "sdk/msg", version = "=2.1.0" }
solana-net-utils = { path = "net-utils", version = "=2.1.0" }
solana-nohash-hasher = "0.2.1"
solana-notifier = { path = "notifier", version = "=2.1.0" }
@@ -374,7 +393,8 @@ solana-package-metadata-macro = { path = "sdk/package-metadata-macro", version =
solana-perf = { path = "perf", version = "=2.1.0" }
solana-poh = { path = "poh", version = "=2.1.0" }
solana-poseidon = { path = "poseidon", version = "=2.1.0" }
-solana-program = { path = "sdk/program", version = "=2.1.0" }
+solana-program = { path = "sdk/program", version = "=2.1.0", default-features = false }
+solana-program-memory = { path = "sdk/program-memory", version = "=2.1.0" }
solana-program-runtime = { path = "program-runtime", version = "=2.1.0" }
solana-program-test = { path = "program-test", version = "=2.1.0" }
solana-pubsub-client = { path = "pubsub-client", version = "=2.1.0" }
@@ -382,6 +402,7 @@ solana-quic-client = { path = "quic-client", version = "=2.1.0" }
solana-rayon-threadlimit = { path = "rayon-threadlimit", version = "=2.1.0" }
solana-remote-wallet = { path = "remote-wallet", version = "=2.1.0", default-features = false }
solana-sanitize = { path = "sanitize", version = "=2.1.0" }
+solana-timings = { path = "timings", version = "=2.1.0" }
solana-unified-scheduler-logic = { path = "unified-scheduler-logic", version = "=2.1.0" }
solana-unified-scheduler-pool = { path = "unified-scheduler-pool", version = "=2.1.0" }
solana-rpc = { path = "rpc", version = "=2.1.0" }
@@ -392,13 +413,16 @@ solana-runtime = { path = "runtime", version = "=2.1.0" }
solana-runtime-transaction = { path = "runtime-transaction", version = "=2.1.0" }
solana-sdk = { path = "sdk", version = "=2.1.0" }
solana-sdk-macro = { path = "sdk/macro", version = "=2.1.0" }
+solana-secp256k1-recover = { path = "curves/secp256k1-recover", version = "=2.1.0", default-features = false }
solana-send-transaction-service = { path = "send-transaction-service", version = "=2.1.0" }
+solana-short-vec = { path = "short-vec", version = "=2.1.0" }
solana-stake-program = { path = "programs/stake", version = "=2.1.0" }
solana-storage-bigtable = { path = "storage-bigtable", version = "=2.1.0" }
solana-storage-proto = { path = "storage-proto", version = "=2.1.0" }
solana-streamer = { path = "streamer", version = "=2.1.0" }
solana-svm = { path = "svm", version = "=2.1.0" }
solana-svm-conformance = { path = "svm-conformance", version = "=2.1.0" }
+solana-svm-transaction = { path = "svm-transaction", version = "=2.1.0" }
solana-system-program = { path = "programs/system", version = "=2.1.0" }
solana-test-validator = { path = "test-validator", version = "=2.1.0" }
solana-thin-client = { path = "thin-client", version = "=2.1.0" }
@@ -417,7 +441,7 @@ solana-zk-keygen = { path = "zk-keygen", version = "=2.1.0" }
solana-zk-sdk = { path = "zk-sdk", version = "=2.1.0" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=2.1.0" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=2.1.0" }
-solana_rbpf = "=0.8.1"
+solana_rbpf = "=0.8.2"
spl-associated-token-account = "=4.0.0"
spl-instruction-padding = "0.2"
spl-memo = "=5.0.0"
@@ -440,7 +464,7 @@ tar = "0.4.41"
tarpc = "0.29.0"
tempfile = "3.10.1"
test-case = "3.3.1"
-thiserror = "1.0.61"
+thiserror = "1.0.63"
tiny-bip39 = "0.8.2"
# Update solana-tokio patch below when updating this version
tokio = "1.29.1"
diff --git a/RELEASE.md b/RELEASE.md
index 14cc160ed8bef4..a862a0e4106ceb 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -61,6 +61,11 @@ There are three release channels that map to branches as follows:
## Steps to Create a Branch
+### Major release branch
+1. If the new branch will be the first branch of a new major release check that
+all eligible deprecated symbols have been removed. Our policy is to deprecate
+for at least one full minor version before removal.
+
### Create the new branch
1. Check out the latest commit on `master` branch:
```
diff --git a/account-decoder/src/parse_token.rs b/account-decoder/src/parse_token.rs
index 41a7eb44f9e14f..878d738fe03367 100644
--- a/account-decoder/src/parse_token.rs
+++ b/account-decoder/src/parse_token.rs
@@ -26,37 +26,6 @@ pub fn is_known_spl_token_id(program_id: &Pubkey) -> bool {
*program_id == spl_token::id() || *program_id == spl_token_2022::id()
}
-// A helper function to convert spl_token::native_mint::id() as spl_sdk::pubkey::Pubkey to
-// solana_sdk::pubkey::Pubkey
-#[deprecated(
- since = "1.16.0",
- note = "Pubkey conversions no longer needed. Please use spl_token::native_mint::id() directly"
-)]
-pub fn spl_token_native_mint() -> Pubkey {
- Pubkey::new_from_array(spl_token::native_mint::id().to_bytes())
-}
-
-// The program id of the `spl_token_native_mint` account
-#[deprecated(
- since = "1.16.0",
- note = "Pubkey conversions no longer needed. Please use spl_token::id() directly"
-)]
-pub fn spl_token_native_mint_program_id() -> Pubkey {
- spl_token::id()
-}
-
-// A helper function to convert a solana_sdk::pubkey::Pubkey to spl_sdk::pubkey::Pubkey
-#[deprecated(since = "1.16.0", note = "Pubkey conversions no longer needed")]
-pub fn spl_token_pubkey(pubkey: &Pubkey) -> SplTokenPubkey {
- SplTokenPubkey::new_from_array(pubkey.to_bytes())
-}
-
-// A helper function to convert a spl_sdk::pubkey::Pubkey to solana_sdk::pubkey::Pubkey
-#[deprecated(since = "1.16.0", note = "Pubkey conversions no longer needed")]
-pub fn pubkey_from_spl_token(pubkey: &SplTokenPubkey) -> Pubkey {
- Pubkey::new_from_array(pubkey.to_bytes())
-}
-
#[deprecated(since = "2.0.0", note = "Use `parse_token_v2` instead")]
pub fn parse_token(
data: &[u8],
diff --git a/accounts-cluster-bench/Cargo.toml b/accounts-cluster-bench/Cargo.toml
index 8ff7cc12b26276..5593de62c802f9 100644
--- a/accounts-cluster-bench/Cargo.toml
+++ b/accounts-cluster-bench/Cargo.toml
@@ -17,13 +17,13 @@ solana-account-decoder = { workspace = true }
solana-clap-utils = { workspace = true }
solana-cli-config = { workspace = true }
solana-client = { workspace = true }
-solana-faucet = { workspace = true }
solana-gossip = { workspace = true }
solana-inline-spl = { workspace = true }
solana-logger = { workspace = true }
solana-measure = { workspace = true }
solana-net-utils = { workspace = true }
solana-rpc-client = { workspace = true, features = ["default"] }
+solana-rpc-client-api = { workspace = true }
solana-runtime = { workspace = true }
solana-sdk = { workspace = true }
solana-streamer = { workspace = true }
@@ -34,6 +34,7 @@ spl-token = { workspace = true, features = ["no-entrypoint"] }
[dev-dependencies]
solana-accounts-db = { workspace = true }
solana-core = { workspace = true, features = ["dev-context-only-utils"] }
+solana-faucet = { workspace = true }
solana-local-cluster = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-test-validator = { workspace = true }
diff --git a/accounts-cluster-bench/src/main.rs b/accounts-cluster-bench/src/main.rs
index 9e84456011e023..6c8a15dc69db69 100644
--- a/accounts-cluster-bench/src/main.rs
+++ b/accounts-cluster-bench/src/main.rs
@@ -8,11 +8,12 @@ use {
hidden_unless_forced, input_parsers::pubkey_of, input_validators::is_url_or_moniker,
},
solana_cli_config::{ConfigInput, CONFIG_FILE},
- solana_client::{rpc_request::TokenAccountsFilter, transaction_executor::TransactionExecutor},
+ solana_client::transaction_executor::TransactionExecutor,
solana_gossip::gossip_service::discover,
solana_inline_spl::token,
solana_measure::measure::Measure,
solana_rpc_client::rpc_client::RpcClient,
+ solana_rpc_client_api::request::TokenAccountsFilter,
solana_sdk::{
commitment_config::CommitmentConfig,
hash::Hash,
diff --git a/accounts-db/Cargo.toml b/accounts-db/Cargo.toml
index bf12964211d123..eada1ee5e3375e 100644
--- a/accounts-db/Cargo.toml
+++ b/accounts-db/Cargo.toml
@@ -10,6 +10,7 @@ license = { workspace = true }
edition = { workspace = true }
[dependencies]
+ahash = { workspace = true }
bincode = { workspace = true }
blake3 = { workspace = true }
bv = { workspace = true, features = ["serde"] }
@@ -39,13 +40,14 @@ solana-bucket-map = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
solana-inline-spl = { workspace = true }
+solana-lattice-hash = { workspace = true }
solana-measure = { workspace = true }
solana-metrics = { workspace = true }
solana-nohash-hasher = { workspace = true }
solana-rayon-threadlimit = { workspace = true }
solana-sdk = { workspace = true }
solana-stake-program = { workspace = true, optional = true }
-solana-svm = { workspace = true }
+solana-svm-transaction = { workspace = true }
solana-vote-program = { workspace = true, optional = true }
static_assertions = { workspace = true }
tar = { workspace = true }
@@ -69,7 +71,6 @@ solana-accounts-db = { path = ".", features = ["dev-context-only-utils"] }
solana-compute-budget = { workspace = true }
solana-logger = { workspace = true }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
-solana-svm = { workspace = true, features = ["dev-context-only-utils"] }
static_assertions = { workspace = true }
strum = { workspace = true, features = ["derive"] }
strum_macros = { workspace = true }
@@ -82,12 +83,15 @@ targets = ["x86_64-unknown-linux-gnu"]
rustc_version = { workspace = true }
[features]
-dev-context-only-utils = ["dep:qualifier_attr", "dep:solana-stake-program", "dep:solana-vote-program"]
+dev-context-only-utils = [
+ "dep:qualifier_attr",
+ "dep:solana-stake-program",
+ "dep:solana-vote-program",
+]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"solana-sdk/frozen-abi",
- "solana-svm/frozen-abi",
"solana-vote-program/frozen-abi",
]
@@ -102,3 +106,7 @@ harness = false
[[bench]]
name = "bench_serde"
harness = false
+
+[[bench]]
+name = "bench_lock_accounts"
+harness = false
diff --git a/accounts-db/accounts-hash-cache-tool/src/main.rs b/accounts-db/accounts-hash-cache-tool/src/main.rs
index 3f7b3db3702b9c..ed0159c3d81b92 100644
--- a/accounts-db/accounts-hash-cache-tool/src/main.rs
+++ b/accounts-db/accounts-hash-cache-tool/src/main.rs
@@ -7,13 +7,13 @@ use {
memmap2::Mmap,
solana_accounts_db::{
parse_cache_hash_data_filename, CacheHashDataFileEntry, CacheHashDataFileHeader,
+ ParsedCacheHashDataFilename,
},
std::{
cmp::Ordering,
collections::HashMap,
- fs::{self, File},
+ fs::{self, File, Metadata},
io::{self, BufReader, Read},
- iter,
mem::size_of,
num::Saturating,
path::{Path, PathBuf},
@@ -303,49 +303,15 @@ fn do_diff_dirs(
dir2: impl AsRef,
then_diff_files: bool,
) -> Result<(), String> {
- let get_files_in = |dir: &Path| {
- let mut files = Vec::new();
- let entries = fs::read_dir(dir)?;
- for entry in entries {
- let path = entry?.path();
- let meta = fs::metadata(&path)?;
- if meta.is_file() {
- let path = fs::canonicalize(path)?;
- files.push((path, meta));
- }
- }
- Ok::<_, io::Error>(files)
- };
- let parse_files = |files: &[(PathBuf, _)]| {
- files
- .iter()
- .map(|(file, _)| {
- Path::file_name(file)
- .and_then(parse_cache_hash_data_filename)
- .ok_or_else(|| format!("failed to parse '{}'", file.display()))
- })
- .collect::, String>>()
- };
- let parse_and_sort_files_in = |dir: &Path| {
- let files = get_files_in(dir)
- .map_err(|err| format!("failed to get files in '{}': {err}", dir.display()))?;
- let parsed_files = parse_files(&files)?;
- let mut combined: Vec<_> = iter::zip(files, parsed_files).collect();
- combined.sort_unstable_by(|a, b| {
- a.1.slot_range_start
- .cmp(&b.1.slot_range_start)
- .then_with(|| a.1.slot_range_end.cmp(&b.1.slot_range_end))
- });
- Ok::<_, String>(combined)
- };
-
let _timer = ElapsedOnDrop {
message: "diffing directories took ".to_string(),
start: Instant::now(),
};
- let files1 = parse_and_sort_files_in(dir1.as_ref())?;
- let files2 = parse_and_sort_files_in(dir2.as_ref())?;
+ let files1 = get_cache_files_in(dir1)
+ .map_err(|err| format!("failed to get cache files in dir1: {err}"))?;
+ let files2 = get_cache_files_in(dir2)
+ .map_err(|err| format!("failed to get cache files in dir2: {err}"))?;
let mut uniques1 = Vec::new();
let mut uniques2 = Vec::new();
@@ -355,7 +321,11 @@ fn do_diff_dirs(
while idx1.0 < files1.len() && idx2.0 < files2.len() {
let file1 = &files1[idx1.0];
let file2 = &files2[idx2.0];
- match file1.1.slot_range_start.cmp(&file2.1.slot_range_start) {
+ match file1
+ .parsed
+ .slot_range_start
+ .cmp(&file2.parsed.slot_range_start)
+ {
Ordering::Less => {
// file1 is an older slot range than file2, so note it and advance idx1
uniques1.push(file1);
@@ -367,7 +337,11 @@ fn do_diff_dirs(
idx2 += 1;
}
Ordering::Equal => {
- match file1.1.slot_range_end.cmp(&file2.1.slot_range_end) {
+ match file1
+ .parsed
+ .slot_range_end
+ .cmp(&file2.parsed.slot_range_end)
+ {
Ordering::Less => {
// file1 is a smaller slot range than file2, so note it and advance idx1
uniques1.push(file1);
@@ -382,20 +356,20 @@ fn do_diff_dirs(
// slot ranges match, so compare the files and advance both idx1 and idx2
let is_equal = || {
// if the files have different sizes, they are not equal
- if file1.0 .1.len() != file2.0 .1.len() {
+ if file1.metadata.len() != file2.metadata.len() {
return false;
}
// if the parsed file names have different hashes, they are not equal
- if file1.1.hash != file2.1.hash {
+ if file1.parsed.hash != file2.parsed.hash {
return false;
}
// if the file headers have different entry counts, they are not equal
- let Ok((mmap1, header1)) = map_file(&file1.0 .0, false) else {
+ let Ok((mmap1, header1)) = map_file(&file1.path, false) else {
return false;
};
- let Ok((mmap2, header2)) = map_file(&file2.0 .0, false) else {
+ let Ok((mmap2, header2)) = map_file(&file2.path, false) else {
return false;
};
if header1.count != header2.count {
@@ -431,13 +405,13 @@ fn do_diff_dirs(
uniques2.push(file);
}
- let do_print = |entries: &[&((PathBuf, _), _)]| {
+ let do_print = |entries: &[&CacheFileInfo]| {
let count_width = (entries.len() as f64).log10().ceil() as usize;
if entries.is_empty() {
println!("(none)");
} else {
for (i, entry) in entries.iter().enumerate() {
- println!("{i:count_width$}: '{}'", entry.0 .0.display());
+ println!("{i:count_width$}: '{}'", entry.path.display());
}
}
};
@@ -454,18 +428,18 @@ fn do_diff_dirs(
for (i, (file1, file2)) in mismatches.iter().enumerate() {
println!(
"{i:count_width$}: '{}', '{}'",
- file1.0 .0.display(),
- file2.0 .0.display(),
+ file1.path.display(),
+ file2.path.display(),
);
}
if then_diff_files {
for (file1, file2) in &mismatches {
println!(
"Differences between '{}' and '{}':",
- file1.0 .0.display(),
- file2.0 .0.display(),
+ file1.path.display(),
+ file2.path.display(),
);
- if let Err(err) = do_diff_files(&file1.0 .0, &file2.0 .0) {
+ if let Err(err) = do_diff_files(&file1.path, &file2.path) {
eprintln!("Error: failed to diff files: {err}");
}
}
@@ -475,6 +449,51 @@ fn do_diff_dirs(
Ok(())
}
+/// Returns all the cache hash data files in `dir`, sorted in ascending slot-and-bin-range order
+fn get_cache_files_in(dir: impl AsRef) -> Result, io::Error> {
+ fn get_files_in(dir: impl AsRef) -> Result, io::Error> {
+ let mut files = Vec::new();
+ let entries = fs::read_dir(dir)?;
+ for entry in entries {
+ let path = entry?.path();
+ let meta = fs::metadata(&path)?;
+ if meta.is_file() {
+ let path = fs::canonicalize(path)?;
+ files.push((path, meta));
+ }
+ }
+ Ok(files)
+ }
+
+ let files = get_files_in(&dir).map_err(|err| {
+ io::Error::other(format!(
+ "failed to get files in '{}': {err}",
+ dir.as_ref().display(),
+ ))
+ })?;
+ let mut cache_files: Vec<_> = files
+ .into_iter()
+ .filter_map(|file| {
+ Path::file_name(&file.0)
+ .and_then(parse_cache_hash_data_filename)
+ .map(|parsed_file_name| CacheFileInfo {
+ path: file.0,
+ metadata: file.1,
+ parsed: parsed_file_name,
+ })
+ })
+ .collect();
+ cache_files.sort_unstable_by(|a, b| {
+ a.parsed
+ .slot_range_start
+ .cmp(&b.parsed.slot_range_start)
+ .then_with(|| a.parsed.slot_range_end.cmp(&b.parsed.slot_range_end))
+ .then_with(|| a.parsed.bin_range_start.cmp(&b.parsed.bin_range_start))
+ .then_with(|| a.parsed.bin_range_end.cmp(&b.parsed.bin_range_end))
+ });
+ Ok(cache_files)
+}
+
/// Scan file with `reader` and apply `user_fn` to each entry
///
/// NOTE: `reader`'s cursor must already be at the first entry; i.e. *past* the header.
@@ -557,6 +576,14 @@ fn open_file(
Ok((reader, header))
}
+#[derive(Debug)]
+struct CacheFileInfo {
+ path: PathBuf,
+ metadata: Metadata,
+ parsed: ParsedCacheHashDataFilename,
+}
+
+#[derive(Debug)]
struct ElapsedOnDrop {
message: String,
start: Instant,
diff --git a/accounts-db/benches/bench_accounts_file.rs b/accounts-db/benches/bench_accounts_file.rs
index 284bcffeadfab7..6fe87523cf18f1 100644
--- a/accounts-db/benches/bench_accounts_file.rs
+++ b/accounts-db/benches/bench_accounts_file.rs
@@ -1,14 +1,25 @@
#![allow(clippy::arithmetic_side_effects)]
use {
criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput},
+ rand::{distributions::WeightedIndex, prelude::*},
+ rand_chacha::ChaChaRng,
solana_accounts_db::{
- append_vec::{self, AppendVec},
- tiered_storage::hot::HotStorageWriter,
+ accounts_file::StorageAccess,
+ append_vec::{self, AppendVec, SCAN_BUFFER_SIZE_WITHOUT_DATA},
+ tiered_storage::{
+ file::TieredReadableFile,
+ hot::{HotStorageReader, HotStorageWriter},
+ },
},
solana_sdk::{
- account::AccountSharedData, clock::Slot, pubkey::Pubkey,
+ account::{AccountSharedData, ReadableAccount},
+ clock::Slot,
+ pubkey::Pubkey,
+ rent::Rent,
rent_collector::RENT_EXEMPT_RENT_EPOCH,
+ system_instruction::MAX_PERMITTED_DATA_LENGTH,
},
+ std::{iter, mem::ManuallyDrop},
};
const ACCOUNTS_COUNTS: [usize; 4] = [
@@ -87,5 +98,118 @@ fn bench_write_accounts_file(c: &mut Criterion) {
}
}
-criterion_group!(benches, bench_write_accounts_file);
+fn bench_scan_pubkeys(c: &mut Criterion) {
+ let mut group = c.benchmark_group("scan_pubkeys");
+ let temp_dir = tempfile::tempdir().unwrap();
+
+ // distribution of account data sizes to use when creating accounts
+ // 3% of accounts have no data
+ // 75% of accounts are 165 bytes (a token account)
+ // 20% of accounts are 200 bytes (a stake account)
+ // 1% of accounts are 256 kibibytes (pathological case for the scan buffer)
+ // 1% of accounts are 10 mebibytes (the max size for an account)
+ let data_sizes = [
+ 0,
+ 165,
+ 200,
+ SCAN_BUFFER_SIZE_WITHOUT_DATA,
+ MAX_PERMITTED_DATA_LENGTH as usize,
+ ];
+ let weights = [3, 75, 20, 1, 1];
+ let distribution = WeightedIndex::new(weights).unwrap();
+
+ let rent = Rent::default();
+ let rent_minimum_balances: Vec<_> = data_sizes
+ .iter()
+ .map(|data_size| rent.minimum_balance(*data_size))
+ .collect();
+
+ for accounts_count in ACCOUNTS_COUNTS {
+ group.throughput(Throughput::Elements(accounts_count as u64));
+ let mut rng = ChaChaRng::seed_from_u64(accounts_count as u64);
+
+ let pubkeys: Vec<_> = iter::repeat_with(Pubkey::new_unique)
+ .take(accounts_count)
+ .collect();
+ let accounts: Vec<_> = iter::repeat_with(|| {
+ let index = distribution.sample(&mut rng);
+ AccountSharedData::new_rent_epoch(
+ rent_minimum_balances[index],
+ data_sizes[index],
+ &Pubkey::default(),
+ RENT_EXEMPT_RENT_EPOCH,
+ )
+ })
+ .take(pubkeys.len())
+ .collect();
+ let storable_accounts: Vec<_> = iter::zip(&pubkeys, &accounts).collect();
+
+ // create an append vec file
+ let append_vec_path = temp_dir.path().join(format!("append_vec_{accounts_count}"));
+ _ = std::fs::remove_file(&append_vec_path);
+ let file_size = accounts
+ .iter()
+ .map(|account| append_vec::aligned_stored_size(account.data().len()))
+ .sum();
+ let append_vec = AppendVec::new(append_vec_path, true, file_size);
+ let stored_accounts_info = append_vec
+ .append_accounts(&(Slot::MAX, storable_accounts.as_slice()), 0)
+ .unwrap();
+ assert_eq!(stored_accounts_info.offsets.len(), accounts_count);
+ append_vec.flush().unwrap();
+ // Open append vecs for reading here, outside of the bench function, so we don't open lots
+ // of file handles and run out/crash. We also need to *not* remove the backing file in
+ // these new append vecs because that would cause double-free (or triple-free here).
+ // Wrap the append vecs in ManuallyDrop to *not* remove the backing file on drop.
+ let append_vec_mmap = ManuallyDrop::new(
+ AppendVec::new_from_file(append_vec.path(), append_vec.len(), StorageAccess::Mmap)
+ .unwrap()
+ .0,
+ );
+ let append_vec_file = ManuallyDrop::new(
+ AppendVec::new_from_file(append_vec.path(), append_vec.len(), StorageAccess::File)
+ .unwrap()
+ .0,
+ );
+
+ // create a hot storage file
+ let hot_storage_path = temp_dir
+ .path()
+ .join(format!("hot_storage_{accounts_count}"));
+ _ = std::fs::remove_file(&hot_storage_path);
+ let mut hot_storage_writer = HotStorageWriter::new(&hot_storage_path).unwrap();
+ let stored_accounts_info = hot_storage_writer
+ .write_accounts(&(Slot::MAX, storable_accounts.as_slice()), 0)
+ .unwrap();
+ assert_eq!(stored_accounts_info.offsets.len(), accounts_count);
+ hot_storage_writer.flush().unwrap();
+ // Similar to the append vec case above, open the hot storage for reading here.
+ let hot_storage_file = TieredReadableFile::new(&hot_storage_path).unwrap();
+ let hot_storage_reader = HotStorageReader::new(hot_storage_file).unwrap();
+
+ group.bench_function(BenchmarkId::new("append_vec_mmap", accounts_count), |b| {
+ b.iter(|| {
+ let mut count = 0;
+ append_vec_mmap.scan_pubkeys(|_| count += 1);
+ assert_eq!(count, accounts_count);
+ });
+ });
+ group.bench_function(BenchmarkId::new("append_vec_file", accounts_count), |b| {
+ b.iter(|| {
+ let mut count = 0;
+ append_vec_file.scan_pubkeys(|_| count += 1);
+ assert_eq!(count, accounts_count);
+ });
+ });
+ group.bench_function(BenchmarkId::new("hot_storage", accounts_count), |b| {
+ b.iter(|| {
+ let mut count = 0;
+ hot_storage_reader.scan_pubkeys(|_| count += 1).unwrap();
+ assert_eq!(count, accounts_count);
+ });
+ });
+ }
+}
+
+criterion_group!(benches, bench_write_accounts_file, bench_scan_pubkeys);
criterion_main!(benches);
diff --git a/accounts-db/benches/bench_hashing.rs b/accounts-db/benches/bench_hashing.rs
index 78df86a97f5168..3ee18a5a1ff09b 100644
--- a/accounts-db/benches/bench_hashing.rs
+++ b/accounts-db/benches/bench_hashing.rs
@@ -24,7 +24,7 @@ const DATA_SIZES: [usize; 6] = [
/// part of computing an account's hash.
///
/// Ensure this constant stays in sync with the value of `META_SIZE` in
-/// AccountsDb::hash_account_data().
+/// AccountsDb::hash_account_helper().
const META_SIZE: usize = 81;
fn bench_hash_account(c: &mut Criterion) {
@@ -37,9 +37,12 @@ fn bench_hash_account(c: &mut Criterion) {
let num_bytes = META_SIZE.checked_add(data_size).unwrap();
group.throughput(Throughput::Bytes(num_bytes as u64));
let account = AccountSharedData::new(lamports, data_size, &owner);
- group.bench_function(BenchmarkId::new("data_size", data_size), |b| {
+ group.bench_function(BenchmarkId::new("blake3", data_size), |b| {
b.iter(|| AccountsDb::hash_account(&account, &address));
});
+ group.bench_function(BenchmarkId::new("lattice", data_size), |b| {
+ b.iter(|| AccountsDb::lt_hash_account(&account, &address));
+ });
}
}
diff --git a/accounts-db/benches/bench_lock_accounts.rs b/accounts-db/benches/bench_lock_accounts.rs
new file mode 100644
index 00000000000000..d34166fa7e7844
--- /dev/null
+++ b/accounts-db/benches/bench_lock_accounts.rs
@@ -0,0 +1,96 @@
+use {
+ criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput},
+ itertools::iproduct,
+ solana_accounts_db::{accounts::Accounts, accounts_db::AccountsDb},
+ solana_sdk::{
+ instruction::{AccountMeta, Instruction},
+ pubkey::Pubkey,
+ system_program,
+ transaction::{SanitizedTransaction, Transaction, MAX_TX_ACCOUNT_LOCKS},
+ },
+ std::sync::Arc,
+};
+
+// simultaneous transactions locked
+const BATCH_SIZES: [usize; 3] = [1, 32, 64];
+
+// locks acquired per transaction
+const LOCK_COUNTS: [usize; 2] = [2, 64];
+
+// total transactions per run
+const TOTAL_TRANSACTIONS: usize = 1024;
+
+fn create_test_transactions(lock_count: usize, read_conflicts: bool) -> Vec {
+ // keys available to be shared between transactions, depending on mode
+ // currently, we test batches with no conflicts and batches with reader/reader conflicts
+ // in the future with SIMD83, we will also test reader/writer and writer/writer conflicts
+ let shared_pubkeys: Vec<_> = (0..lock_count).map(|_| Pubkey::new_unique()).collect();
+ let mut transactions = vec![];
+
+ for _ in 0..TOTAL_TRANSACTIONS {
+ let mut account_metas = vec![];
+
+ #[allow(clippy::needless_range_loop)]
+ for i in 0..lock_count {
+ // `lock_accounts()` distinguishes writable from readonly, so give transactions an even split
+ // signer doesnt matter for locking but `sanitize()` expects to see at least one
+ let account_meta = if i == 0 {
+ AccountMeta::new(Pubkey::new_unique(), true)
+ } else if i % 2 == 0 {
+ AccountMeta::new(Pubkey::new_unique(), false)
+ } else if read_conflicts {
+ AccountMeta::new_readonly(shared_pubkeys[i], false)
+ } else {
+ AccountMeta::new_readonly(Pubkey::new_unique(), false)
+ };
+
+ account_metas.push(account_meta);
+ }
+
+ let instruction = Instruction::new_with_bincode(system_program::id(), &(), account_metas);
+ let transaction = Transaction::new_with_payer(&[instruction], None);
+
+ transactions.push(SanitizedTransaction::from_transaction_for_tests(
+ transaction,
+ ));
+ }
+
+ transactions
+}
+
+fn bench_entry_lock_accounts(c: &mut Criterion) {
+ let mut group = c.benchmark_group("bench_lock_accounts");
+
+ for (batch_size, lock_count, read_conflicts) in
+ iproduct!(BATCH_SIZES, LOCK_COUNTS, [false, true])
+ {
+ let name = format!(
+ "batch_size_{batch_size}_locks_count_{lock_count}{}",
+ if read_conflicts {
+ "_read_conflicts"
+ } else {
+ ""
+ }
+ );
+
+ let accounts_db = AccountsDb::new_single_for_tests();
+ let accounts = Accounts::new(Arc::new(accounts_db));
+
+ let transactions = create_test_transactions(lock_count, read_conflicts);
+ group.throughput(Throughput::Elements(transactions.len() as u64));
+ let transaction_batches: Vec<_> = transactions.chunks(batch_size).collect();
+
+ group.bench_function(name.as_str(), move |b| {
+ b.iter(|| {
+ for batch in &transaction_batches {
+ let results =
+ accounts.lock_accounts(black_box(batch.iter()), MAX_TX_ACCOUNT_LOCKS);
+ accounts.unlock_accounts(batch.iter().zip(&results));
+ }
+ })
+ });
+ }
+}
+
+criterion_group!(benches, bench_entry_lock_accounts);
+criterion_main!(benches);
diff --git a/accounts-db/src/account_storage.rs b/accounts-db/src/account_storage.rs
index b9852e5439d980..738d7d958e9ce2 100644
--- a/accounts-db/src/account_storage.rs
+++ b/accounts-db/src/account_storage.rs
@@ -61,7 +61,7 @@ impl AccountStorage {
lookup_in_map()
.or_else(|| {
self.shrink_in_progress_map.get(&slot).and_then(|entry| {
- (entry.value().append_vec_id() == store_id).then(|| Arc::clone(entry.value()))
+ (entry.value().id() == store_id).then(|| Arc::clone(entry.value()))
})
})
.or_else(lookup_in_map)
@@ -151,7 +151,7 @@ impl AccountStorage {
.insert(
slot,
AccountStorageReference {
- id: store.append_vec_id(),
+ id: store.id(),
storage: store,
}
)
@@ -248,11 +248,11 @@ impl<'a> Drop for ShrinkInProgress<'a> {
self.slot,
AccountStorageReference {
storage: Arc::clone(&self.new_store),
- id: self.new_store.append_vec_id()
+ id: self.new_store.id()
}
)
.map(|store| store.id),
- Some(self.old_store.append_vec_id())
+ Some(self.old_store.id())
);
// The new store can be removed from 'shrink_in_progress_map'
@@ -489,25 +489,19 @@ pub(crate) mod tests {
);
let shrinking_in_progress = storage.shrinking_in_progress(slot, sample.clone());
assert!(storage.map.contains_key(&slot));
- assert_eq!(
- id_to_shrink,
- storage.map.get(&slot).unwrap().storage.append_vec_id()
- );
+ assert_eq!(id_to_shrink, storage.map.get(&slot).unwrap().storage.id());
assert_eq!(
(slot, id_shrunk),
storage
.shrink_in_progress_map
.iter()
.next()
- .map(|r| (*r.key(), r.value().append_vec_id()))
+ .map(|r| (*r.key(), r.value().id()))
.unwrap()
);
drop(shrinking_in_progress);
assert!(storage.map.contains_key(&slot));
- assert_eq!(
- id_shrunk,
- storage.map.get(&slot).unwrap().storage.append_vec_id()
- );
+ assert_eq!(id_shrunk, storage.map.get(&slot).unwrap().storage.id());
assert!(storage.shrink_in_progress_map.is_empty());
storage.shrinking_in_progress(slot, sample);
}
@@ -536,7 +530,7 @@ pub(crate) mod tests {
// verify data structures during and after shrink and then with subsequent shrink call
let storage = AccountStorage::default();
let sample = storage.get_test_storage();
- let id = sample.append_vec_id();
+ let id = sample.id();
let missing_id = 9999;
let slot = sample.slot();
// id is missing since not in maps at all
diff --git a/accounts-db/src/account_storage/meta.rs b/accounts-db/src/account_storage/meta.rs
index 5a6d0ad19c22af..338f821cd9e211 100644
--- a/accounts-db/src/account_storage/meta.rs
+++ b/accounts-db/src/account_storage/meta.rs
@@ -66,15 +66,6 @@ impl<'storage> StoredAccountMeta<'storage> {
}
}
- pub fn write_version(&self) -> StoredMetaWriteVersion {
- match self {
- Self::AppendVec(av) => av.write_version(),
- // Hot account does not support this API as it does not
- // use a write version.
- Self::Hot(_) => StoredMetaWriteVersion::default(),
- }
- }
-
pub fn meta(&self) -> &StoredMeta {
match self {
Self::AppendVec(av) => av.meta(),
diff --git a/accounts-db/src/accounts.rs b/accounts-db/src/accounts.rs
index 1f87be1ae86e44..bb8656648c23c9 100644
--- a/accounts-db/src/accounts.rs
+++ b/accounts-db/src/accounts.rs
@@ -8,33 +8,23 @@ use {
ancestors::Ancestors,
storable_accounts::StorableAccounts,
},
+ ahash::{AHashMap, AHashSet},
dashmap::DashMap,
log::*,
solana_sdk::{
account::{AccountSharedData, ReadableAccount},
- account_utils::StateMut,
address_lookup_table::{self, error::AddressLookupError, state::AddressLookupTable},
clock::{BankId, Slot},
- message::{
- v0::{LoadedAddresses, MessageAddressTableLookup},
- SanitizedMessage,
- },
- nonce::{
- state::{DurableNonce, Versions as NonceVersions},
- State as NonceState,
- },
+ message::v0::{LoadedAddresses, MessageAddressTableLookup},
pubkey::Pubkey,
slot_hashes::SlotHashes,
- transaction::{Result, SanitizedTransaction, TransactionAccountLocks, TransactionError},
+ transaction::{Result, SanitizedTransaction, TransactionError},
transaction_context::TransactionAccount,
},
- solana_svm::{
- account_loader::TransactionLoadResult, nonce_info::NonceInfo,
- rollback_accounts::RollbackAccounts, transaction_results::TransactionExecutionResult,
- },
+ solana_svm_transaction::svm_message::SVMMessage,
std::{
cmp::Reverse,
- collections::{hash_map, BinaryHeap, HashMap, HashSet},
+ collections::{hash_map, BinaryHeap, HashSet},
ops::RangeBounds,
sync::{
atomic::{AtomicUsize, Ordering},
@@ -45,11 +35,10 @@ use {
pub type PubkeyAccountSlot = (Pubkey, AccountSharedData, Slot);
-#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
#[derive(Debug, Default)]
pub struct AccountLocks {
- write_locks: HashSet,
- readonly_locks: HashMap,
+ write_locks: AHashSet,
+ readonly_locks: AHashMap,
}
impl AccountLocks {
@@ -98,8 +87,27 @@ impl AccountLocks {
}
}
+struct TransactionAccountLocksIterator<'a, T: SVMMessage> {
+ transaction: &'a T,
+}
+
+impl<'a, T: SVMMessage> TransactionAccountLocksIterator<'a, T> {
+ pub(crate) fn new(transaction: &'a T) -> Self {
+ Self { transaction }
+ }
+
+ pub(crate) fn accounts_with_is_writable(
+ &self,
+ ) -> impl Iterator- + Clone {
+ self.transaction
+ .account_keys()
+ .iter()
+ .enumerate()
+ .map(|(index, key)| (key, self.transaction.is_writable(index)))
+ }
+}
+
/// This structure handles synchronization for db
-#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
#[derive(Debug)]
pub struct Accounts {
/// Single global AccountsDb
@@ -553,31 +561,27 @@ impl Accounts {
self.accounts_db.store_uncached(slot, &[(pubkey, account)]);
}
- fn lock_account(
+ fn lock_account<'a>(
&self,
account_locks: &mut AccountLocks,
- writable_keys: Vec<&Pubkey>,
- readonly_keys: Vec<&Pubkey>,
+ keys: impl Iterator
- + Clone,
) -> Result<()> {
- for k in writable_keys.iter() {
- if account_locks.is_locked_write(k) || account_locks.is_locked_readonly(k) {
- debug!("Writable account in use: {:?}", k);
- return Err(TransactionError::AccountInUse);
- }
- }
- for k in readonly_keys.iter() {
- if account_locks.is_locked_write(k) {
+ for (k, writable) in keys.clone() {
+ if writable {
+ if account_locks.is_locked_write(k) || account_locks.is_locked_readonly(k) {
+ debug!("Writable account in use: {:?}", k);
+ return Err(TransactionError::AccountInUse);
+ }
+ } else if account_locks.is_locked_write(k) {
debug!("Read-only account in use: {:?}", k);
return Err(TransactionError::AccountInUse);
}
}
- for k in writable_keys {
- account_locks.write_locks.insert(*k);
- }
-
- for k in readonly_keys {
- if !account_locks.lock_readonly(k) {
+ for (k, writable) in keys {
+ if writable {
+ account_locks.write_locks.insert(*k);
+ } else if !account_locks.lock_readonly(k) {
account_locks.insert_new_readonly(k);
}
}
@@ -585,17 +589,17 @@ impl Accounts {
Ok(())
}
- fn unlock_account(
+ fn unlock_account<'a>(
&self,
account_locks: &mut AccountLocks,
- writable_keys: Vec<&Pubkey>,
- readonly_keys: Vec<&Pubkey>,
+ keys: impl Iterator
- ,
) {
- for k in writable_keys {
- account_locks.unlock_write(k);
- }
- for k in readonly_keys {
- account_locks.unlock_readonly(k);
+ for (k, writable) in keys {
+ if writable {
+ account_locks.unlock_write(k);
+ } else {
+ account_locks.unlock_readonly(k);
+ }
}
}
@@ -607,8 +611,12 @@ impl Accounts {
txs: impl Iterator
- ,
tx_account_lock_limit: usize,
) -> Vec> {
+ // Validate the account locks, then get iterator if successful validation.
let tx_account_locks_results: Vec> = txs
- .map(|tx| tx.get_account_locks(tx_account_lock_limit))
+ .map(|tx| {
+ SanitizedTransaction::validate_account_locks(tx.message(), tx_account_lock_limit)
+ .map(|_| TransactionAccountLocksIterator::new(tx))
+ })
.collect();
self.lock_accounts_inner(tx_account_locks_results)
}
@@ -620,10 +628,15 @@ impl Accounts {
results: impl Iterator
- >,
tx_account_lock_limit: usize,
) -> Vec> {
+ // Validate the account locks, then get iterator if successful validation.
let tx_account_locks_results: Vec> = txs
.zip(results)
.map(|(tx, result)| match result {
- Ok(()) => tx.get_account_locks(tx_account_lock_limit),
+ Ok(()) => SanitizedTransaction::validate_account_locks(
+ tx.message(),
+ tx_account_lock_limit,
+ )
+ .map(|_| TransactionAccountLocksIterator::new(tx)),
Err(err) => Err(err),
})
.collect();
@@ -633,17 +646,15 @@ impl Accounts {
#[must_use]
fn lock_accounts_inner(
&self,
- tx_account_locks_results: Vec>,
+ tx_account_locks_results: Vec>>,
) -> Vec> {
let account_locks = &mut self.account_locks.lock().unwrap();
tx_account_locks_results
.into_iter()
.map(|tx_account_locks_result| match tx_account_locks_result {
- Ok(tx_account_locks) => self.lock_account(
- account_locks,
- tx_account_locks.writable,
- tx_account_locks.readonly,
- ),
+ Ok(tx_account_locks) => {
+ self.lock_account(account_locks, tx_account_locks.accounts_with_is_writable())
+ }
Err(err) => Err(err),
})
.collect()
@@ -652,39 +663,33 @@ impl Accounts {
/// Once accounts are unlocked, new transactions that modify that state can enter the pipeline
pub fn unlock_accounts<'a>(
&self,
- txs_and_results: impl Iterator
- )>,
+ txs_and_results: impl Iterator
- )> + Clone,
) {
- let keys: Vec<_> = txs_and_results
- .filter(|(_, res)| res.is_ok())
- .map(|(tx, _)| tx.get_account_locks_unchecked())
- .collect();
- if keys.is_empty() {
+ if !txs_and_results.clone().any(|(_, res)| res.is_ok()) {
return;
}
let mut account_locks = self.account_locks.lock().unwrap();
debug!("bank unlock accounts");
- keys.into_iter().for_each(|keys| {
- self.unlock_account(&mut account_locks, keys.writable, keys.readonly);
- });
+ for (tx, res) in txs_and_results {
+ if res.is_ok() {
+ let tx_account_locks = TransactionAccountLocksIterator::new(tx.message());
+ self.unlock_account(
+ &mut account_locks,
+ tx_account_locks.accounts_with_is_writable(),
+ );
+ }
+ }
}
/// Store the accounts into the DB
- // allow(clippy) needed for various gating flags
- #[allow(clippy::too_many_arguments)]
- pub fn store_cached(
+ pub fn store_cached<'a>(
&self,
- slot: Slot,
- txs: &[SanitizedTransaction],
- res: &[TransactionExecutionResult],
- loaded: &mut [TransactionLoadResult],
- durable_nonce: &DurableNonce,
- lamports_per_signature: u64,
+ accounts: impl StorableAccounts<'a>,
+ transactions: &'a [Option<&'a SanitizedTransaction>],
) {
- let (accounts_to_store, transactions) =
- self.collect_accounts_to_store(txs, res, loaded, durable_nonce, lamports_per_signature);
self.accounts_db
- .store_cached_inline_update_index((slot, &accounts_to_store[..]), Some(&transactions));
+ .store_cached_inline_update_index(accounts, Some(transactions));
}
pub fn store_accounts_cached<'a>(&self, accounts: impl StorableAccounts<'a>) {
@@ -695,153 +700,22 @@ impl Accounts {
pub fn add_root(&self, slot: Slot) -> AccountsAddRootTiming {
self.accounts_db.add_root(slot)
}
-
- #[allow(clippy::too_many_arguments)]
- fn collect_accounts_to_store<'a>(
- &self,
- txs: &'a [SanitizedTransaction],
- execution_results: &'a [TransactionExecutionResult],
- load_results: &'a mut [TransactionLoadResult],
- durable_nonce: &DurableNonce,
- lamports_per_signature: u64,
- ) -> (
- Vec<(&'a Pubkey, &'a AccountSharedData)>,
- Vec