diff --git a/Cargo.lock b/Cargo.lock index 8b3a119838d3e3..2ec45ead5226a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,7 @@ dependencies = [ "log", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -206,7 +206,7 @@ dependencies = [ "solana-version", "solana-vote-program", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", "tikv-jemallocator", "tokio", ] @@ -309,7 +309,7 @@ dependencies = [ "spl-token-2022", "symlink", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tikv-jemallocator", "tokio", ] @@ -324,12 +324,14 @@ dependencies = [ "solana-clap-utils", "solana-cli-config", "solana-cli-output", + "solana-hash", "solana-logger", "solana-metrics", + "solana-native-token", "solana-notifier", + "solana-pubkey", "solana-rpc-client", "solana-rpc-client-api", - "solana-sdk", "solana-version", ] @@ -3180,9 +3182,9 @@ dependencies = [ [[package]] name = "index_list" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de7dd2746e29d9e4df6219ff1b954fe684b7ec01b028a1d4d7f3b38a7e20e763" +checksum = "fa38453685e5fe724fd23ff6c1a158c1e2ca21ce0c2718fa11e96e70e99fd4de" [[package]] name = "indexmap" @@ -3308,9 +3310,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -4696,7 +4698,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.19", "socket2 0.5.8", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", ] @@ -4716,7 +4718,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.4", + "thiserror 2.0.6", "tinyvec", "tracing", "web-time", @@ -5852,7 +5854,7 @@ dependencies = [ "spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -5985,7 +5987,7 @@ dependencies = [ "tar", "tempfile", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6002,7 +6004,7 @@ dependencies = [ "solana-program", "solana-program-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6060,7 +6062,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "tarpc", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-serde", ] @@ -6150,7 +6152,7 @@ dependencies = [ "solana-version", "spl-instruction-padding", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6198,7 +6200,7 @@ dependencies = [ "serde_derive", "serde_json", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6235,7 +6237,7 @@ dependencies = [ "solana-type-overrides", "solana_rbpf", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6282,9 +6284,11 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-frozen-abi", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program", @@ -6346,7 +6350,7 @@ dependencies = [ "solana-signature", "solana-signer", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "uriparse", "url 2.5.4", @@ -6377,7 +6381,7 @@ dependencies = [ "solana-signer", "solana-zk-token-sdk", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "uriparse", "url 2.5.4", @@ -6441,7 +6445,7 @@ dependencies = [ "spl-memo", "tempfile", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", ] @@ -6501,20 +6505,34 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", "solana-net-utils", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6676,7 +6694,7 @@ dependencies = [ "solana-net-utils", "solana-time-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6720,10 +6738,12 @@ dependencies = [ "serial_test", "slab", "solana-accounts-db", + "solana-address-lookup-table-program", "solana-bloom", "solana-builtins-default-costs", "solana-client", "solana-compute-budget", + "solana-compute-budget-program", "solana-connection-cache", "solana-core", "solana-cost-model", @@ -6757,6 +6777,7 @@ dependencies = [ "solana-streamer", "solana-svm", "solana-svm-transaction", + "solana-system-program", "solana-timings", "solana-tls-utils", "solana-tpu-client", @@ -6767,6 +6788,7 @@ dependencies = [ "solana-vote", "solana-vote-program", "solana-wen-restart", + "spl-memo", "static_assertions", "strum", "strum_macros", @@ -6775,7 +6797,7 @@ dependencies = [ "systemstat", "tempfile", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "trees", ] @@ -6831,7 +6853,7 @@ dependencies = [ "bytemuck_derive", "curve25519-dalek 4.1.3", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6943,14 +6965,25 @@ dependencies = [ "rand 0.8.5", "rayon", "serde", + "solana-hash", + "solana-keypair", "solana-logger", "solana-measure", "solana-merkle-tree", + "solana-message", "solana-metrics", + "solana-packet", "solana-perf", + "solana-pubkey", "solana-rayon-threadlimit", + "solana-reserved-account-keys", "solana-runtime-transaction", - "solana-sdk", + "solana-sha256-hasher", + "solana-signature", + "solana-signer", + "solana-system-transaction", + "solana-transaction", + "solana-transaction-error", ] [[package]] @@ -6976,6 +7009,15 @@ dependencies = [ "solana-sysvar-id", ] +[[package]] +name = "solana-epoch-rewards-hasher" +version = "2.2.0" +dependencies = [ + "siphasher", + "solana-hash", + "solana-pubkey", +] + [[package]] name = "solana-epoch-schedule" version = "2.2.0" @@ -7005,12 +7047,22 @@ dependencies = [ "serde_derive", "solana-clap-utils", "solana-cli-config", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-logger", + "solana-message", "solana-metrics", - "solana-sdk", + "solana-native-token", + "solana-packet", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-system-transaction", + "solana-transaction", "solana-version", "spl-memo", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7105,7 +7157,7 @@ dependencies = [ "sha2 0.10.8", "solana-frozen-abi-macro", "solana-logger", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7176,7 +7228,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7234,7 +7286,7 @@ dependencies = [ "solana-vote-program", "static_assertions", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7320,8 +7372,13 @@ dependencies = [ "solana-clap-v3-utils", "solana-cli-config", "solana-derivation-path", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", "solana-remote-wallet", - "solana-sdk", + "solana-seed-derivable", + "solana-signer", "solana-version", "tempfile", "tiny-bip39", @@ -7443,7 +7500,7 @@ dependencies = [ "tar", "tempfile", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "trees", @@ -7619,7 +7676,7 @@ dependencies = [ "solana-cluster-type", "solana-sha256-hasher", "solana-time-utils", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7809,7 +7866,7 @@ dependencies = [ "solana-poh", "solana-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7847,7 +7904,7 @@ dependencies = [ "ark-bn254", "light-poseidon", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7955,7 +8012,7 @@ dependencies = [ "solana-system-interface", "solana-sysvar", "solana-sysvar-id", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", ] @@ -8046,7 +8103,7 @@ dependencies = [ "solana-type-overrides", "solana_rbpf", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8081,7 +8138,7 @@ dependencies = [ "solana-vote-program", "solana_rbpf", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -8137,7 +8194,7 @@ dependencies = [ "solana-pubkey", "solana-rpc-client-api", "solana-signature", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "tokio-tungstenite", @@ -8165,16 +8222,16 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-net-utils", + "solana-packet", "solana-perf", "solana-pubkey", "solana-quic-definitions", "solana-rpc-client-api", - "solana-sdk", "solana-signer", "solana-streamer", "solana-tls-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -8209,7 +8266,7 @@ dependencies = [ "semver 1.0.23", "solana-derivation-path", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", "uriparse", ] @@ -8318,7 +8375,7 @@ dependencies = [ "spl-token-2022", "stream-cancel", "symlink", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.13", ] @@ -8397,7 +8454,7 @@ dependencies = [ "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8425,7 +8482,7 @@ dependencies = [ "solana-signer", "solana-system-interface", "solana-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -8538,7 +8595,7 @@ dependencies = [ "solana-svm-transaction", "solana-system-program", "solana-timings", - "solana-transaction-status", + "solana-transaction-status-client-types", "solana-version", "solana-vote", "solana-vote-program", @@ -8553,7 +8610,7 @@ dependencies = [ "tar", "tempfile", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -8573,7 +8630,7 @@ dependencies = [ "solana-sdk", "solana-sdk-ids", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8618,7 +8675,6 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3", - "siphasher", "solana-account", "solana-bn254", "solana-client-traits", @@ -8629,6 +8685,7 @@ dependencies = [ "solana-derivation-path", "solana-ed25519-program", "solana-epoch-info", + "solana-epoch-rewards-hasher", "solana-feature-set", "solana-fee-structure", "solana-frozen-abi", @@ -8672,7 +8729,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "static_assertions", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "wasm-bindgen", ] @@ -8735,7 +8792,7 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-program", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8986,7 +9043,7 @@ dependencies = [ "solana-sdk", "solana-storage-proto", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tonic", "zstd", @@ -9051,7 +9108,7 @@ dependencies = [ "solana-tls-utils", "solana-transaction-error", "solana-transaction-metrics-tracker", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.13", "x509-parser", @@ -9102,7 +9159,7 @@ dependencies = [ "solana-type-overrides", "solana_rbpf", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9352,7 +9409,7 @@ dependencies = [ "spl-associated-token-account", "spl-token", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9373,7 +9430,7 @@ dependencies = [ "solana-tpu-client", "solana-transaction-status", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9404,7 +9461,7 @@ dependencies = [ "solana-signer", "solana-transaction", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -9428,7 +9485,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-tpu-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.13", ] @@ -9538,11 +9595,14 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", + "solana-hash", + "solana-keypair", "solana-packet", "solana-perf", - "solana-sdk", + "solana-pubkey", "solana-short-vec", "solana-signature", + "solana-system-transaction", ] [[package]] @@ -9570,7 +9630,7 @@ dependencies = [ "spl-token-confidential-transfer-proof-extraction", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9591,7 +9651,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9633,7 +9693,7 @@ dependencies = [ "solana-tls-utils", "static_assertions", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -9658,7 +9718,7 @@ dependencies = [ "solana-packet", "solana-streamer", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -9731,7 +9791,7 @@ dependencies = [ "solana-frozen-abi-macro", "solana-sdk", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9754,7 +9814,7 @@ dependencies = [ "solana-program-runtime", "solana-sdk", "test-case", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -9807,12 +9867,14 @@ dependencies = [ "clap 3.2.23", "dirs-next", "solana-clap-v3-utils", + "solana-pubkey", "solana-remote-wallet", - "solana-sdk", + "solana-seed-derivable", + "solana-signer", "solana-version", "solana-zk-token-sdk", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", ] @@ -9847,7 +9909,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "wasm-bindgen", "zeroize", @@ -9913,7 +9975,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "zeroize", ] @@ -10621,11 +10683,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.4", + "thiserror-impl 2.0.6", ] [[package]] @@ -10641,9 +10703,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -10834,9 +10896,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -11345,9 +11407,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -11356,13 +11418,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -11383,9 +11444,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11393,9 +11454,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -11406,9 +11467,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" diff --git a/Cargo.toml b/Cargo.toml index 21684e6126f9d1..697c4c9fdc3d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,7 @@ members = [ "sdk/ed25519-program", "sdk/epoch-info", "sdk/epoch-rewards", + "sdk/epoch-rewards-hasher", "sdk/epoch-schedule", "sdk/feature-gate-interface", "sdk/feature-set", @@ -332,14 +333,14 @@ humantime = "2.0.1" hyper = "0.14.31" hyper-proxy = "0.9.1" im = "15.1.0" -index_list = "0.2.14" +index_list = "0.2.15" indexmap = "2.7.0" indicatif = "0.17.9" itertools = "0.12.1" jemallocator = { package = "tikv-jemallocator", version = "0.6.0", features = [ "unprefixed_malloc_on_supported_platforms", ] } -js-sys = "0.3.74" +js-sys = "0.3.76" json5 = "0.4.1" jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" @@ -471,6 +472,7 @@ solana-entry = { path = "entry", version = "=2.2.0" } solana-program-entrypoint = { path = "sdk/program-entrypoint", version = "=2.2.0" } solana-epoch-info = { path = "sdk/epoch-info", version = "=2.2.0" } solana-epoch-rewards = { path = "sdk/epoch-rewards", version = "=2.2.0" } +solana-epoch-rewards-hasher = { path = "sdk/epoch-rewards-hasher", version = "=2.2.0" } solana-epoch-schedule = { path = "sdk/epoch-schedule", version = "=2.2.0" } solana-faucet = { path = "faucet", version = "=2.2.0" } solana-feature-gate-interface = { path = "sdk/feature-gate-interface", version = "=2.2.0" } @@ -628,12 +630,12 @@ tar = "0.4.43" tarpc = "0.29.0" tempfile = "3.14.0" test-case = "3.3.1" -thiserror = "2.0.4" +thiserror = "2.0.6" tiny-bip39 = "0.8.2" # Update solana-tokio patch below when updating this version tokio = "1.29.1" tokio-serde = "0.8" -tokio-stream = "0.1.16" +tokio-stream = "0.1.17" tokio-tungstenite = "0.20.1" tokio-util = "0.7" toml = "0.8.12" diff --git a/accounts-cluster-bench/src/main.rs b/accounts-cluster-bench/src/main.rs index 1c7b2ffb361f52..258e471303edab 100644 --- a/accounts-cluster-bench/src/main.rs +++ b/accounts-cluster-bench/src/main.rs @@ -256,6 +256,7 @@ pub enum RpcBench { TokenAccountsByOwner, Supply, TokenAccountsByDelegate, + AccountInfo, FirstAvailableBlock, } @@ -269,6 +270,7 @@ impl FromStr for RpcBench { fn from_str(s: &str) -> Result { match s { + "account-info" => Ok(RpcBench::AccountInfo), "first-available-block" => Ok(RpcBench::FirstAvailableBlock), "slot" => Ok(RpcBench::Slot), "supply" => Ok(RpcBench::Supply), @@ -392,6 +394,35 @@ fn run_rpc_bench_loop( break; } match rpc_bench { + RpcBench::AccountInfo => { + let start: u64 = max_closed.load(Ordering::Relaxed); + let end: u64 = max_created.load(Ordering::Relaxed); + let seed_range = start..end; + if seed_range.is_empty() { + info!("get_account_info: No accounts have yet been created; skipping"); + continue; + } + let seed = thread_rng().gen_range(seed_range).to_string(); + let account_pubkey = + Pubkey::create_with_seed(base_keypair_pubkey, &seed, program_id).unwrap(); + let mut rpc_time = Measure::start("rpc-get-account-info"); + match client.get_account(&account_pubkey) { + Ok(_account) => { + rpc_time.stop(); + stats.success += 1; + stats.total_success_time_us += rpc_time.as_us(); + } + Err(e) => { + rpc_time.stop(); + stats.total_errors_time_us += rpc_time.as_us(); + stats.errors += 1; + if last_error.elapsed().as_secs() > 2 { + info!("get_account_info error: {:?}", e); + last_error = Instant::now(); + } + } + } + } RpcBench::FirstAvailableBlock => { let mut rpc_time = Measure::start("rpc-get-first-available-block"); match client.get_first_available_block() { diff --git a/builtins-default-costs/Cargo.toml b/builtins-default-costs/Cargo.toml index bdd29a267280b5..9c0a1e0753a799 100644 --- a/builtins-default-costs/Cargo.toml +++ b/builtins-default-costs/Cargo.toml @@ -17,11 +17,13 @@ solana-address-lookup-table-program = { workspace = true } solana-bpf-loader-program = { workspace = true } solana-compute-budget-program = { workspace = true } solana-config-program = { workspace = true } +solana-feature-set = { workspace = true } solana-frozen-abi = { workspace = true, optional = true, features = [ "frozen-abi", ] } solana-loader-v4-program = { workspace = true } -solana-sdk = { workspace = true } +solana-pubkey = { workspace = true } +solana-sdk-ids = { workspace = true } solana-stake-program = { workspace = true } solana-system-program = { workspace = true } solana-vote-program = { workspace = true } diff --git a/builtins-default-costs/benches/builtin_instruction_costs.rs b/builtins-default-costs/benches/builtin_instruction_costs.rs index 4aeee4b51c8f78..71618852be5ef5 100644 --- a/builtins-default-costs/benches/builtin_instruction_costs.rs +++ b/builtins-default-costs/benches/builtin_instruction_costs.rs @@ -3,10 +3,12 @@ extern crate test; use { rand::Rng, solana_builtins_default_costs::get_builtin_instruction_cost, - solana_sdk::{ + solana_feature_set::FeatureSet, + solana_pubkey::Pubkey, + solana_sdk_ids::{ address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, - compute_budget, ed25519_program, feature_set::FeatureSet, loader_v4, pubkey::Pubkey, - secp256k1_program, + compute_budget, config, ed25519_program, loader_v4, secp256k1_program, stake, + system_program, vote, }, test::Bencher, }; @@ -20,12 +22,12 @@ const NUM_TRANSACTIONS_PER_ITER: usize = 1024; fn setup(all_features_enabled: bool) -> BenchSetup { let pubkeys: [Pubkey; 12] = [ - solana_stake_program::id(), - solana_config_program::id(), - solana_vote_program::id(), - solana_system_program::id(), + stake::id(), + config::id(), + vote::id(), + system_program::id(), compute_budget::id(), - address_lookup_table::program::id(), + address_lookup_table::id(), bpf_loader_upgradeable::id(), bpf_loader_deprecated::id(), bpf_loader::id(), diff --git a/builtins-default-costs/src/lib.rs b/builtins-default-costs/src/lib.rs index 2e167c667cc84d..3150e799c42969 100644 --- a/builtins-default-costs/src/lib.rs +++ b/builtins-default-costs/src/lib.rs @@ -3,13 +3,12 @@ use { ahash::AHashMap, lazy_static::lazy_static, - solana_sdk::{ + solana_feature_set::{self as feature_set, FeatureSet}, + solana_pubkey::Pubkey, + solana_sdk_ids::{ address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, - compute_budget, ed25519_program, - feature_set::{self, FeatureSet}, - loader_v4, - pubkey::Pubkey, - secp256k1_program, + compute_budget, config, ed25519_program, loader_v4, secp256k1_program, stake, + system_program, vote, }, }; @@ -36,28 +35,28 @@ lazy_static! { /// https://github.com/solana-labs/solana/issues/29595. static ref BUILTIN_INSTRUCTION_COSTS: AHashMap = [ ( - solana_stake_program::id(), + stake::id(), BuiltinCost { native_cost: solana_stake_program::stake_instruction::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some(feature_set::migrate_stake_program_to_core_bpf::id()), }, ), ( - solana_config_program::id(), + config::id(), BuiltinCost { native_cost: solana_config_program::config_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some(feature_set::migrate_config_program_to_core_bpf::id()), }, ), ( - solana_vote_program::id(), + vote::id(), BuiltinCost { native_cost: solana_vote_program::vote_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: None, }, ), ( - solana_system_program::id(), + system_program::id(), BuiltinCost { native_cost: solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: None, @@ -71,7 +70,7 @@ lazy_static! { }, ), ( - address_lookup_table::program::id(), + address_lookup_table::id(), BuiltinCost { native_cost: solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some( diff --git a/client/Cargo.toml b/client/Cargo.toml index 36cab356c05104..986a926fd87761 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -20,17 +20,31 @@ indicatif = { workspace = true } log = { workspace = true } quinn = { workspace = true } rayon = { workspace = true } +solana-account = { workspace = true } +solana-client-traits = { workspace = true } +solana-commitment-config = { workspace = true } solana-connection-cache = { workspace = true } +solana-epoch-info = { workspace = true } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } solana-measure = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } solana-pubsub-client = { workspace = true } solana-quic-client = { workspace = true } +solana-quic-definitions = { workspace = true } solana-rpc-client = { workspace = true, features = ["default"] } solana-rpc-client-api = { workspace = true } solana-rpc-client-nonce-utils = { workspace = true } -solana-sdk = { workspace = true, features = ["openssl-vendored"] } +solana-signature = { workspace = true } +solana-signer = { workspace = true } solana-streamer = { workspace = true } solana-thin-client = { workspace = true } +solana-time-utils = { workspace = true } solana-tpu-client = { workspace = true, features = ["default"] } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } solana-udp-client = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/client/src/connection_cache.rs b/client/src/connection_cache.rs index 28cc60a18075b3..10b3bbb9ecd609 100644 --- a/client/src/connection_cache.rs +++ b/client/src/connection_cache.rs @@ -8,12 +8,12 @@ use { NewConnectionConfig, }, }, + solana_keypair::Keypair, + solana_pubkey::Pubkey, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, - solana_sdk::{ - pubkey::Pubkey, quic::NotifyKeyUpdate, signature::Keypair, - transport::Result as TransportResult, - }, + solana_quic_definitions::NotifyKeyUpdate, solana_streamer::streamer::StakedNodes, + solana_transaction_error::TransportResult, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::{ net::{IpAddr, Ipv4Addr, SocketAddr}, @@ -201,8 +201,8 @@ mod tests { super::*, crate::connection_cache::ConnectionCache, crossbeam_channel::unbounded, + solana_keypair::Keypair, solana_net_utils::bind_to_localhost, - solana_sdk::signature::Keypair, solana_streamer::{ quic::{QuicServerParams, SpawnServerResult}, streamer::StakedNodes, diff --git a/client/src/nonblocking/tpu_client.rs b/client/src/nonblocking/tpu_client.rs index 5e71eae36bd6e4..e49aff1b254f19 100644 --- a/client/src/nonblocking/tpu_client.rs +++ b/client/src/nonblocking/tpu_client.rs @@ -5,15 +5,13 @@ use { ConnectionCache as BackendConnectionCache, ConnectionManager, ConnectionPool, NewConnectionConfig, }, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::nonblocking::rpc_client::RpcClient, - solana_sdk::{ - message::Message, - signers::Signers, - transaction::{Transaction, TransactionError}, - transport::Result as TransportResult, - }, + solana_signer::signers::Signers, solana_tpu_client::nonblocking::tpu_client::{Result, TpuClient as BackendTpuClient}, + solana_transaction::Transaction, + solana_transaction_error::{TransactionError, TransportResult}, std::sync::Arc, }; diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index eb7153316702cf..6d357180ef6770 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -6,6 +6,8 @@ use { bincode::serialize, dashmap::DashMap, futures_util::future::join_all, + solana_hash::Hash, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::spinner::{self, SendTransactionProgress}, solana_rpc_client_api::{ @@ -14,14 +16,11 @@ use { request::{RpcError, RpcResponseErrorData, MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS}, response::RpcSimulateTransactionResult, }, - solana_sdk::{ - hash::Hash, - message::Message, - signature::{Signature, SignerError}, - signers::Signers, - transaction::{Transaction, TransactionError}, - }, + solana_signature::Signature, + solana_signer::{signers::Signers, SignerError}, solana_tpu_client::tpu_client::{Result, TpuSenderError}, + solana_transaction::Transaction, + solana_transaction_error::TransactionError, std::{ sync::{ atomic::{AtomicU64, AtomicUsize, Ordering}, diff --git a/client/src/thin_client.rs b/client/src/thin_client.rs index 596c9a13a6dbd3..1df00ae45cb52b 100644 --- a/client/src/thin_client.rs +++ b/client/src/thin_client.rs @@ -5,24 +5,23 @@ #[allow(deprecated)] use { crate::connection_cache::{dispatch, ConnectionCache}, + solana_account::Account, + solana_client_traits::{AsyncClient, Client, SyncClient}, + solana_commitment_config::CommitmentConfig, + solana_epoch_info::EpochInfo, + solana_hash::Hash, + solana_instruction::Instruction, + solana_keypair::Keypair, + solana_message::Message, + solana_pubkey::Pubkey, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::rpc_client::RpcClient, solana_rpc_client_api::config::RpcProgramAccountsConfig, - solana_sdk::{ - account::Account, - client::{AsyncClient, Client, SyncClient}, - commitment_config::CommitmentConfig, - epoch_info::EpochInfo, - hash::Hash, - instruction::Instruction, - message::Message, - pubkey::Pubkey, - signature::{Keypair, Signature}, - signers::Signers, - transaction::{self, Transaction, VersionedTransaction}, - transport::Result as TransportResult, - }, + solana_signature::Signature, + solana_signer::signers::Signers, solana_thin_client::thin_client::ThinClient as BackendThinClient, + solana_transaction::{versioned::VersionedTransaction, Transaction}, + solana_transaction_error::{TransactionResult, TransportResult}, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::{net::SocketAddr, sync::Arc, time::Duration}, }; @@ -214,13 +213,13 @@ impl SyncClient for ThinClient { dispatch!(fn get_signature_status( &self, signature: &Signature - ) -> TransportResult>>); + ) -> TransportResult>>); dispatch!(fn get_signature_status_with_commitment( &self, signature: &Signature, commitment_config: CommitmentConfig - ) -> TransportResult>>); + ) -> TransportResult>>); dispatch!(fn get_slot(&self) -> TransportResult); diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index 893761637ce64d..695138f7234ebd 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -4,15 +4,13 @@ use { ConnectionCache as BackendConnectionCache, ConnectionManager, ConnectionPool, NewConnectionConfig, }, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::rpc_client::RpcClient, - solana_sdk::{ - message::Message, - signers::Signers, - transaction::{Transaction, TransactionError}, - transport::Result as TransportResult, - }, + solana_signer::signers::Signers, solana_tpu_client::tpu_client::{Result, TpuClient as BackendTpuClient}, + solana_transaction::Transaction, + solana_transaction_error::{TransactionError, TransportResult}, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::sync::Arc, }; diff --git a/client/src/transaction_executor.rs b/client/src/transaction_executor.rs index c85aa21f8bb555..23354818777788 100644 --- a/client/src/transaction_executor.rs +++ b/client/src/transaction_executor.rs @@ -1,12 +1,12 @@ #![allow(clippy::arithmetic_side_effects)] use { log::*, + solana_commitment_config::CommitmentConfig, solana_measure::measure::Measure, solana_rpc_client::rpc_client::RpcClient, - solana_sdk::{ - commitment_config::CommitmentConfig, signature::Signature, timing::timestamp, - transaction::Transaction, - }, + solana_signature::Signature, + solana_time_utils::timestamp, + solana_transaction::Transaction, std::{ net::SocketAddr, sync::{ diff --git a/core/Cargo.toml b/core/Cargo.toml index 8f400b02c108ea..a9045d02dd09ed 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -107,6 +107,8 @@ fs_extra = { workspace = true } serde_json = { workspace = true } serial_test = { workspace = true } # See order-crates-for-publishing.py for using this unusual `path = "."` +solana-address-lookup-table-program = { workspace = true } +solana-compute-budget-program = { workspace = true } solana-core = { path = ".", features = ["dev-context-only-utils"] } solana-cost-model = { workspace = true, features = ["dev-context-only-utils"] } solana-ledger = { workspace = true, features = ["dev-context-only-utils"] } @@ -116,10 +118,12 @@ solana-poh = { workspace = true, features = ["dev-context-only-utils"] } solana-program-runtime = { workspace = true } solana-sdk = { workspace = true, features = ["dev-context-only-utils"] } solana-stake-program = { workspace = true } +solana-system-program = { workspace = true } solana-unified-scheduler-pool = { workspace = true, features = [ "dev-context-only-utils", ] } solana-vote = { workspace = true, features = ["dev-context-only-utils"] } +spl-memo = { workspace = true, features = ["no-entrypoint"] } static_assertions = { workspace = true } systemstat = { workspace = true } test-case = { workspace = true } diff --git a/core/tests/scheduler_cost_adjustment.rs b/core/tests/scheduler_cost_adjustment.rs new file mode 100644 index 00000000000000..b93b80485fa1d6 --- /dev/null +++ b/core/tests/scheduler_cost_adjustment.rs @@ -0,0 +1,561 @@ +#![cfg(test)] +use { + solana_compute_budget::compute_budget_limits::{ + DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT, MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT, + }, + solana_cost_model::cost_model::CostModel, + solana_feature_set::{self as feature_set}, + solana_runtime::{bank::Bank, bank_forks::BankForks}, + solana_runtime_transaction::runtime_transaction::RuntimeTransaction, + solana_sdk::{ + account::{Account, AccountSharedData}, + bpf_loader, + clock::MAX_PROCESSING_AGE, + compute_budget::ComputeBudgetInstruction, + genesis_config::{create_genesis_config, GenesisConfig}, + instruction::{Instruction, InstructionError}, + message::Message, + native_token::sol_to_lamports, + pubkey::Pubkey, + rent::Rent, + signature::{Keypair, Signer}, + system_instruction::{self}, + transaction::{Result, Transaction, TransactionError}, + }, + solana_svm::transaction_processor::ExecutionRecordingConfig, + solana_timings::ExecuteTimings, + std::sync::{Arc, RwLock}, +}; + +#[derive(Debug, Eq, PartialEq)] +struct TestResult { + // execution cost adjustment (eg estimated_execution_cost - + // actual_execution_cost) if *committed* successfully; Which always the case for our tests + cost_adjustment: i64, + // Ok(()) if transaction executed successfully, otherwise error + execution_status: Result<()>, +} + +#[allow(dead_code)] +struct TestSetup { + genesis_config: GenesisConfig, + mint_keypair: Keypair, + bank: Bank, + bank_forks: Arc>, + amount: u64, +} + +impl TestSetup { + fn new() -> Self { + let (mut genesis_config, mint_keypair) = create_genesis_config(sol_to_lamports(1.)); + genesis_config.rent = Rent::default(); + let (bank, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config); + let bank = Bank::new_from_parent( + bank, + &Pubkey::new_unique(), + genesis_config.epoch_schedule.get_first_slot_in_epoch(1), + ); + + let amount = genesis_config.rent.minimum_balance(0); + + Self { + genesis_config, + mint_keypair, + bank, + bank_forks, + amount, + } + } + + fn install_memo_program_account(&mut self) { + self.bank.store_account( + &spl_memo::id(), + &AccountSharedData::from(Account { + lamports: u64::MAX, + // borrows memo elf for executing memo ix in order to set up test condition + data: include_bytes!("../../program-test/src/programs/spl_memo-3.0.0.so").to_vec(), + owner: bpf_loader::id(), + executable: true, + rent_epoch: 0, + }), + ); + } + + fn execute_test_transaction( + &mut self, + ixs: &[Instruction], + is_simd_170_enabled: bool, + ) -> TestResult { + if is_simd_170_enabled { + self.bank + .activate_feature(&feature_set::reserve_minimal_cus_for_builtin_instructions::id()); + } else { + self.bank.deactivate_feature( + &feature_set::reserve_minimal_cus_for_builtin_instructions::id(), + ); + } + + let tx = Transaction::new( + &[&self.mint_keypair], + Message::new(ixs, Some(&self.mint_keypair.pubkey())), + self.genesis_config.hash(), + ); + + let estimated_execution_cost = CostModel::calculate_cost( + &RuntimeTransaction::from_transaction_for_tests(tx.clone()), + &self.bank.feature_set, + ) + .programs_execution_cost(); + + let batch = self.bank.prepare_batch_for_tests(vec![tx]); + let commit_result = self + .bank + .load_execute_and_commit_transactions( + &batch, + MAX_PROCESSING_AGE, + false, + ExecutionRecordingConfig::new_single_setting(false), + &mut ExecuteTimings::default(), + None, + ) + .0 + .remove(0); + + match commit_result { + Ok(committed_tx) => TestResult { + cost_adjustment: (estimated_execution_cost as i64) + .saturating_sub(committed_tx.executed_units as i64), + execution_status: committed_tx.status, + }, + Err(err) => { + unreachable!( + "All test Transactions should be well-formatted for execution and commit, err: '{}'", err + ); + } + } + } + + fn transfer_ix(&self) -> Instruction { + system_instruction::transfer( + &self.mint_keypair.pubkey(), + &Pubkey::new_unique(), + self.amount, + ) + } + + fn set_cu_limit_ix(&self, cu_limit: u32) -> Instruction { + ComputeBudgetInstruction::set_compute_unit_limit(cu_limit) + } + + fn set_cu_price_ix(&self, cu_price: u64) -> Instruction { + ComputeBudgetInstruction::set_compute_unit_price(cu_price) + } + + fn memo_ix(&self) -> (Instruction, u32) { + // construct a memo instruction that would consume more CU than DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT + let memo = "The quick brown fox jumped over the lazy dog. ".repeat(22) + "!"; + let memo_ix = spl_memo::build_memo(memo.as_bytes(), &[]); + let memo_ix_cost = 356_963; + + (memo_ix, memo_ix_cost) + } + + fn create_lookup_table_ix(&self) -> Instruction { + let (create_lookup_table_ix, _lookup_table_address) = + solana_sdk::address_lookup_table::instruction::create_lookup_table( + Pubkey::new_unique(), + self.mint_keypair.pubkey(), + 0, + ); + + create_lookup_table_ix + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_cu_limit_too_low() { + let mut test_setup = TestSetup::new(); + let cu_limit = 1; + + // A simple transfer ix, and request cu-limit to 1 cu + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate requested CU Limit `1` + // VM Execution: consume `1` CU, then fail + // Result: 0 adjustment + ( + true, + TestResult { + cost_adjustment: 0, + execution_status: Err(TransactionError::InstructionError( + 0, + InstructionError::ComputationalBudgetExceeded, + )), + }, + ), + // pre #3799: + // Cost model: ignores requested CU Limit due to without bpf ixs, reserve CUs for `system` and + // `compute-budget` programs: (150 + 150) = 300; + // Compute budget: allocate CU Meter to requested CU Limit `1`. + // VM execution: consumed `1` CU, then fail + // Result: adjustment = 300 - 1 = 299; + ( + false, + TestResult { + cost_adjustment: 299, + execution_status: Err(TransactionError::InstructionError( + 0, + InstructionError::ComputationalBudgetExceeded, + )), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[ + test_setup.transfer_ix(), + test_setup.set_cu_limit_ix(cu_limit), + ], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_cu_limit_high() { + let mut test_setup = TestSetup::new(); + let cu_limit: u32 = 500_000; + + // A simple transfer ix, and request cu-limit to more than needed + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate requested CU Limit `500_000` + // VM Execution: consume CUs for `system` and `compute-budget` programs, then success + // Result: adjustment = 500_000 - 150 -150 + ( + true, + TestResult { + cost_adjustment: cu_limit as i64 + - solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS as i64 + - solana_compute_budget_program::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: ignores requested CU Limit due to without bpf ixs, reserve CUs for `system` and + // `compute-budget` programs: (150 + 150) = 300; + // Compute budget: allocate CU Meter to requested CU Limit `500_000`. + // VM Execution: consume CUs for `system` and `compute-budget` programs, then success + // Result: adjustment = 300 - 150 -150 = 0; + ( + false, + TestResult { + cost_adjustment: 0, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[ + test_setup.transfer_ix(), + test_setup.set_cu_limit_ix(cu_limit), + ], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_memo_no_cu_limit() { + let mut test_setup = TestSetup::new(); + test_setup.install_memo_program_account(); + let (memo_ix, memo_ix_cost) = test_setup.memo_ix(); + + // A simple transfer ix, and a bpf ix (memo_ix) that needs 356_963 CUs + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate CU for 1 builtin and 1 non-builtin + // (3_000 + 200_000) = 203_000 CUs (note: less than memo_ix needs) + // VM Execution: consume all allocated CUs, then fail + // Result: no adjustment + ( + true, + TestResult { + cost_adjustment: 0, + execution_status: Err(TransactionError::InstructionError( + 1, + InstructionError::ProgramFailedToComplete, + )), + }, + ), + // pre #3799: + // Cost model: reserve CUs for `system` and default 200K for bpf ix + // (150 + 200_000) = 200_150 CUs + // Compute budget: allocate default 200K CUs for non-compute-budget ixs: + // (2 * 200_000) = 400_000 (note: more than memo_ix needs) + // VM Execution: consume CUs for `system` and bpf programs, then success + // Result: adjustment = 200_150 - (150 + 356_963) = -156_963 CUs + // Note: negative adjustment means adjust-up. + ( + false, + TestResult { + cost_adjustment: DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT as i64 + - memo_ix_cost as i64, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[test_setup.transfer_ix(), memo_ix.clone()], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_memo_and_cu_limit() { + let mut test_setup = TestSetup::new(); + test_setup.install_memo_program_account(); + let (memo_ix, memo_ix_cost) = test_setup.memo_ix(); + // request exact amount CUs needed to execute a transafer, compute_budget and a memo ix + let cu_limit = memo_ix_cost + + solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS as u32 + + solana_compute_budget_program::DEFAULT_COMPUTE_UNITS as u32; + + // A simple transfer ix, and a bpf ix (memo_ix) that needs 356_963 CUs, + // and a compute-budget instruction that requests exact amount CUs. + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate requested CUs + // VM Execution: consume all allocated CUs, then succeed + // Result: no adjustment + ( + true, + TestResult { + cost_adjustment: 0, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: reserve requested CUs because there are bpf ix + // Compute budget: allocate requested CUs, + // VM Execution: consume all allocated CUs, then succeed, + // Result: no adjustment + ( + false, + TestResult { + cost_adjustment: 0, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[ + test_setup.transfer_ix(), + memo_ix.clone(), + test_setup.set_cu_limit_ix(cu_limit) + ], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_alt_no_cu_limit() { + let mut test_setup = TestSetup::new(); + + // A address-lookup-table ix only, that CPIs into System instructions + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate default CU for 1 builtin + // VM Execution: consume CUs for 1 ATL and 3 System (CPI-ed 3 times), then succeed + // Result: adjustment = 3_000 - 750 - 3 * 150 = 1,800 + ( + true, + TestResult { + cost_adjustment: MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT as i64 + - solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS as i64 + - 3 * solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: reserve 750 CU for ATL instruction, + // Compute budget: allocate 200K CU for one non-compute-budget instruction + // VM Execution: consumeed CU for 1 ATL and 3 System, then succeed, + // Result: adjustment = 750 - (750 + 3 * 150) = -450 + // Note negative adjustment means adjust-up + ( + false, + TestResult { + cost_adjustment: -3 + * solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[test_setup.create_lookup_table_ix(),], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_cost_adjustment_with_alt_and_cu_limit_high() { + let mut test_setup = TestSetup::new(); + let cu_limit = 500_000; + let tx_execution_cost = solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS + + 3 * solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS + + solana_compute_budget_program::DEFAULT_COMPUTE_UNITS; + + // A address-lookup-table ix only, that CPIs into System instructions; and a compute-budget + // instruction requests enough CU Limit + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate requested CUs + // VM Execution: consume CUs for 1 ATL and 3 System (CPI-ed 3 times) and 1 Compute Budget, then succeed + // Result: adjustment = 500_000 - 750 - 3 * 150 -150 = 498_650 + ( + true, + TestResult { + cost_adjustment: cu_limit as i64 - tx_execution_cost as i64, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: ignores requested CU limit because no bpf instruction, instead + // reserve CUs for 1 ATL instruction and 1 Compute Budget instruction, + // Compute budget: allocate reuested CUs, + // VM Execution: consume CUs for 1 ATL and 3 System (CPI-ed 3 times) and 1 Compute Budget, then succeed + // Result: adjustment = (ATL + CB) - (ATL + 3 * System + CB) = -3 * 150 = -450 + // Note negative adjustment means adjust-up + ( + false, + TestResult { + cost_adjustment: -3 + * solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[ + test_setup.create_lookup_table_ix(), + test_setup.set_cu_limit_ix(cu_limit), + ], + is_simd_170_enabled + ) + ); + } +} + +#[test] +fn test_builtin_ix_set_cu_price_only() { + let mut test_setup = TestSetup::new(); + let mut cu_price = 1; + + // single Compute Budget instruction to set CU Price + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate default CU for one builtin ix + // VM Execution: consume CUs for 1 Compute Budget, then succeed + // Result: adjustment = 3_000 - 150 = 2_850 + ( + true, + TestResult { + cost_adjustment: MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT as i64 + - solana_compute_budget_program::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: reserved CU for 1 compute budget instruction, + // Compute budget: allocate zero CU because there is zero non-compute-budget instructions, + // VM Execution: no budget to execute, fail. + // Result: adjustment = 150 - 0 = 150 + ( + false, + TestResult { + cost_adjustment: solana_compute_budget_program::DEFAULT_COMPUTE_UNITS as i64, + execution_status: Err(TransactionError::InstructionError( + 0, + InstructionError::ComputationalBudgetExceeded, + )), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[test_setup.set_cu_price_ix(cu_price)], + is_simd_170_enabled + ) + ); + cu_price += 1; + } +} + +#[allow(clippy::explicit_counter_loop)] +#[test] +fn test_builtin_ix_precompiled() { + let mut test_setup = TestSetup::new(); + let data = [0_u8, 1_u8]; + let mut index = 0; + + // single precompiled instruction + for (is_simd_170_enabled, expected) in [ + // post #3799: + // Cost model & Compute budget: reserve/allocate default CU for one builtin ix + // VM Execution: consume 0 from CU-meter + // Result: adjustment = 3_000 + ( + true, + TestResult { + cost_adjustment: MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT as i64, + execution_status: Ok(()), + }, + ), + // pre #3799: + // Cost model: reserved 0 CU because precompiles are builtin with native_cost set to `0`. + // Compute budget: allocate zero CU because there is no non-compute-budget instructions, + // VM Execution: nothing to execute; + // Result: no adjustment + ( + false, + TestResult { + cost_adjustment: 0, + execution_status: Ok(()), + }, + ), + ] { + assert_eq!( + expected, + test_setup.execute_test_transaction( + &[Instruction::new_with_bincode( + solana_sdk::secp256k1_program::id(), + &data[index], + vec![] + )], + is_simd_170_enabled + ) + ); + index += 1; + } +} diff --git a/entry/Cargo.toml b/entry/Cargo.toml index 75c429d35f8e80..413d2ba6e4053e 100644 --- a/entry/Cargo.toml +++ b/entry/Cargo.toml @@ -18,18 +18,29 @@ log = { workspace = true } rand = { workspace = true } rayon = { workspace = true } serde = { workspace = true } +solana-hash = { workspace = true } solana-measure = { workspace = true } solana-merkle-tree = { workspace = true } solana-metrics = { workspace = true } +solana-packet = { workspace = true } solana-perf = { workspace = true } solana-rayon-threadlimit = { workspace = true } solana-runtime-transaction = { workspace = true } -solana-sdk = { workspace = true } +solana-sha256-hasher = { workspace = true } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } +solana-keypair = { workspace = true } solana-logger = { workspace = true } +solana-message = { workspace = true } solana-perf = { workspace = true, features = ["dev-context-only-utils"] } +solana-pubkey = { workspace = true } +solana-reserved-account-keys = { workspace = true } +solana-signature = { workspace = true } +solana-signer = { workspace = true } +solana-system-transaction = { workspace = true } [lib] crate-type = ["lib"] diff --git a/entry/benches/entry_sigverify.rs b/entry/benches/entry_sigverify.rs index 7df8eb017ff8b5..a4488af586f71e 100644 --- a/entry/benches/entry_sigverify.rs +++ b/entry/benches/entry_sigverify.rs @@ -2,16 +2,17 @@ extern crate test; use { solana_entry::entry::{self, VerifyRecyclers}, + solana_hash::Hash, + solana_message::SimpleAddressLoader, solana_perf::test_tx::test_tx, + solana_reserved_account_keys::ReservedAccountKeys, solana_runtime_transaction::runtime_transaction::RuntimeTransaction, - solana_sdk::{ - hash::Hash, - reserved_account_keys::ReservedAccountKeys, - transaction::{ - MessageHash, Result, SanitizedTransaction, SimpleAddressLoader, - TransactionVerificationMode, VersionedTransaction, - }, + solana_transaction::{ + sanitized::{MessageHash, SanitizedTransaction}, + versioned::VersionedTransaction, + TransactionVerificationMode, }, + solana_transaction_error::TransactionResult as Result, std::sync::Arc, test::Bencher, }; diff --git a/entry/src/entry.rs b/entry/src/entry.rs index 456a7f793413e5..ee1e7eb2c706b4 100644 --- a/entry/src/entry.rs +++ b/entry/src/entry.rs @@ -10,9 +10,11 @@ use { rand::{thread_rng, Rng}, rayon::{prelude::*, ThreadPool}, serde::{Deserialize, Serialize}, + solana_hash::Hash, solana_measure::measure::Measure, solana_merkle_tree::MerkleTree, solana_metrics::*, + solana_packet::Meta, solana_perf::{ cuda_runtime::PinnedVec, packet::{Packet, PacketBatch, PacketBatchRecycler, PACKETS_PER_BATCH}, @@ -22,14 +24,10 @@ use { }, solana_rayon_threadlimit::get_max_thread_count, solana_runtime_transaction::transaction_with_meta::TransactionWithMeta, - solana_sdk::{ - hash::Hash, - packet::Meta, - transaction::{ - Result, Transaction, TransactionError, TransactionVerificationMode, - VersionedTransaction, - }, + solana_transaction::{ + versioned::VersionedTransaction, Transaction, TransactionVerificationMode, }, + solana_transaction_error::{TransactionError, TransactionResult as Result}, std::{ cmp, ffi::OsStr, @@ -684,7 +682,7 @@ impl EntrySlice for [Entry] { simd_len: usize, thread_pool: &ThreadPool, ) -> EntryVerificationState { - use solana_sdk::hash::HASH_BYTES; + use solana_hash::HASH_BYTES; let now = Instant::now(); let genesis = [Entry { num_hashes: 0, @@ -976,19 +974,21 @@ pub fn thread_pool_for_benches() -> ThreadPool { mod tests { use { super::*, + solana_hash::Hash, + solana_keypair::Keypair, + solana_message::SimpleAddressLoader, solana_perf::test_tx::{test_invalid_tx, test_tx}, + solana_pubkey::Pubkey, + solana_reserved_account_keys::ReservedAccountKeys, solana_runtime_transaction::runtime_transaction::RuntimeTransaction, - solana_sdk::{ - hash::{hash, Hash}, - pubkey::Pubkey, - reserved_account_keys::ReservedAccountKeys, - signature::{Keypair, Signer}, - system_transaction, - transaction::{ - MessageHash, Result, SanitizedTransaction, SimpleAddressLoader, - VersionedTransaction, - }, + solana_sha256_hasher::hash, + solana_signer::Signer, + solana_system_transaction as system_transaction, + solana_transaction::{ + sanitized::{MessageHash, SanitizedTransaction}, + versioned::VersionedTransaction, }, + solana_transaction_error::TransactionResult as Result, }; #[test] @@ -1142,7 +1142,7 @@ mod tests { fn test_transaction_signing() { let thread_pool = thread_pool_for_tests(); - use solana_sdk::signature::Signature; + use solana_signature::Signature; let zero = Hash::default(); let keypair = Keypair::new(); diff --git a/entry/src/poh.rs b/entry/src/poh.rs index 9bf6be66a0594f..2573c596053b86 100644 --- a/entry/src/poh.rs +++ b/entry/src/poh.rs @@ -1,7 +1,8 @@ //! The `Poh` module provides an object for generating a Proof of History. use { log::*, - solana_sdk::hash::{hash, hashv, Hash}, + solana_hash::Hash, + solana_sha256_hasher::{hash, hashv}, std::time::{Duration, Instant}, }; @@ -129,7 +130,8 @@ mod tests { use { crate::poh::{Poh, PohEntry}, assert_matches::assert_matches, - solana_sdk::hash::{hash, hashv, Hash}, + solana_hash::Hash, + solana_sha256_hasher::{hash, hashv}, std::time::Duration, }; diff --git a/faucet/Cargo.toml b/faucet/Cargo.toml index cc88839bc03f7e..0b1dc6de1500f9 100644 --- a/faucet/Cargo.toml +++ b/faucet/Cargo.toml @@ -19,14 +19,27 @@ serde = { workspace = true } serde_derive = { workspace = true } solana-clap-utils = { workspace = true } solana-cli-config = { workspace = true } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } solana-logger = { workspace = true } +solana-message = { workspace = true } solana-metrics = { workspace = true } -solana-sdk = { workspace = true } +solana-native-token = { workspace = true } +solana-packet = { workspace = true } +solana-pubkey = { workspace = true } +solana-signer = { workspace = true } +solana-system-interface = { workspace = true } +solana-system-transaction = { workspace = true } +solana-transaction = { workspace = true } solana-version = { workspace = true } spl-memo = { workspace = true, features = ["no-entrypoint"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +[dev-dependencies] +solana-pubkey = { workspace = true, features = ["rand"] } + [lib] crate-type = ["lib"] name = "solana_faucet" diff --git a/faucet/src/bin/faucet.rs b/faucet/src/bin/faucet.rs index 56cc7542623185..acfe578de9f1a7 100644 --- a/faucet/src/bin/faucet.rs +++ b/faucet/src/bin/faucet.rs @@ -6,7 +6,7 @@ use { faucet::{run_faucet, Faucet, FAUCET_PORT}, socketaddr, }, - solana_sdk::signature::read_keypair_file, + solana_keypair::read_keypair_file, std::{ collections::HashSet, net::{IpAddr, Ipv4Addr, SocketAddr}, diff --git a/faucet/src/faucet.rs b/faucet/src/faucet.rs index cf864dc84adf05..20b03eaeb2de3e 100644 --- a/faucet/src/faucet.rs +++ b/faucet/src/faucet.rs @@ -10,18 +10,17 @@ use { crossbeam_channel::{unbounded, Sender}, log::*, serde_derive::{Deserialize, Serialize}, + solana_hash::Hash, + solana_instruction::Instruction, + solana_keypair::Keypair, + solana_message::Message, solana_metrics::datapoint_info, - solana_sdk::{ - hash::Hash, - instruction::Instruction, - message::Message, - native_token::lamports_to_sol, - packet::PACKET_DATA_SIZE, - pubkey::Pubkey, - signature::{Keypair, Signer}, - system_instruction, - transaction::Transaction, - }, + solana_native_token::lamports_to_sol, + solana_packet::PACKET_DATA_SIZE, + solana_pubkey::Pubkey, + solana_signer::Signer, + solana_system_interface::instruction::transfer, + solana_transaction::Transaction, std::{ collections::{HashMap, HashSet}, io::{Read, Write}, @@ -218,8 +217,7 @@ impl Faucet { } self.check_time_request_limit(lamports, to)?; - let transfer_instruction = - system_instruction::transfer(&mint_pubkey, &to, lamports); + let transfer_instruction = transfer(&mint_pubkey, &to, lamports); let message = Message::new(&[transfer_instruction], Some(&mint_pubkey)); Ok(FaucetTransaction::Airdrop(Transaction::new( &[&self.faucet_keypair], @@ -492,7 +490,7 @@ impl LimitByTime for Pubkey { #[cfg(test)] mod tests { - use {super::*, solana_sdk::system_instruction::SystemInstruction, std::time::Duration}; + use {super::*, solana_system_interface::instruction::SystemInstruction, std::time::Duration}; #[test] fn test_check_time_request_limit() { @@ -649,7 +647,7 @@ mod tests { #[test] fn test_process_faucet_request() { - let to = solana_sdk::pubkey::new_rand(); + let to = solana_pubkey::new_rand(); let blockhash = Hash::new_from_array(to.to_bytes()); let lamports = 50; let req = FaucetRequest::GetAirdrop { @@ -661,7 +659,7 @@ mod tests { let req = serialize(&req).unwrap(); let keypair = Keypair::new(); - let expected_instruction = system_instruction::transfer(&keypair.pubkey(), &to, lamports); + let expected_instruction = transfer(&keypair.pubkey(), &to, lamports); let message = Message::new(&[expected_instruction], Some(&keypair.pubkey())); let expected_tx = Transaction::new(&[&keypair], message, blockhash); let expected_bytes = serialize(&expected_tx).unwrap(); diff --git a/faucet/src/faucet_mock.rs b/faucet/src/faucet_mock.rs index 74c740cac831ce..076aa3e16057fa 100644 --- a/faucet/src/faucet_mock.rs +++ b/faucet/src/faucet_mock.rs @@ -1,8 +1,9 @@ use { - solana_sdk::{ - hash::Hash, pubkey::Pubkey, signature::Keypair, system_transaction, - transaction::Transaction, - }, + solana_hash::Hash, + solana_keypair::Keypair, + solana_pubkey::Pubkey, + solana_system_transaction::transfer, + solana_transaction::Transaction, std::{ io::{Error, ErrorKind}, net::SocketAddr, @@ -19,9 +20,9 @@ pub fn request_airdrop_transaction( Err(Error::new(ErrorKind::Other, "Airdrop failed")) } else { let key = Keypair::new(); - let to = solana_sdk::pubkey::new_rand(); + let to = solana_pubkey::new_rand(); let blockhash = Hash::default(); - let tx = system_transaction::transfer(&key, &to, lamports, blockhash); + let tx = transfer(&key, &to, lamports, blockhash); Ok(tx) } } diff --git a/faucet/tests/local-faucet.rs b/faucet/tests/local-faucet.rs index 1a8be90ecf5ce9..dc86d0c665ea61 100644 --- a/faucet/tests/local-faucet.rs +++ b/faucet/tests/local-faucet.rs @@ -1,21 +1,20 @@ use { solana_faucet::faucet::{request_airdrop_transaction, run_local_faucet}, - solana_sdk::{ - hash::Hash, - message::Message, - signature::{Keypair, Signer}, - system_instruction, - transaction::Transaction, - }, + solana_hash::Hash, + solana_keypair::Keypair, + solana_message::Message, + solana_signer::Signer, + solana_system_interface::instruction::transfer, + solana_transaction::Transaction, }; #[test] fn test_local_faucet() { let keypair = Keypair::new(); - let to = solana_sdk::pubkey::new_rand(); + let to = solana_pubkey::new_rand(); let lamports = 50; let blockhash = Hash::new_from_array(to.to_bytes()); - let create_instruction = system_instruction::transfer(&keypair.pubkey(), &to, lamports); + let create_instruction = transfer(&keypair.pubkey(), &to, lamports); let message = Message::new(&[create_instruction], Some(&keypair.pubkey())); let expected_tx = Transaction::new(&[&keypair], message, blockhash); diff --git a/keygen/Cargo.toml b/keygen/Cargo.toml index 93c5e4f2e4f064..311d799027dcdf 100644 --- a/keygen/Cargo.toml +++ b/keygen/Cargo.toml @@ -18,12 +18,18 @@ serde_json = { workspace = true } solana-clap-v3-utils = { workspace = true } solana-cli-config = { workspace = true } solana-derivation-path = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } solana-remote-wallet = { workspace = true, features = ["default"] } -solana-sdk = { workspace = true } +solana-seed-derivable = { workspace = true } +solana-signer = { workspace = true } solana-version = { workspace = true } tiny-bip39 = { workspace = true } [dev-dependencies] +solana-pubkey = { workspace = true, features = ["rand"] } tempfile = { workspace = true } [[bin]] diff --git a/keygen/src/keygen.rs b/keygen/src/keygen.rs index 6f0b9ff93adc18..1450a13f44d863 100644 --- a/keygen/src/keygen.rs +++ b/keygen/src/keygen.rs @@ -26,16 +26,15 @@ use { DisplayError, }, solana_cli_config::{Config, CONFIG_FILE}, - solana_remote_wallet::remote_wallet::RemoteWalletManager, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - message::Message, - pubkey::Pubkey, - signature::{ - keypair_from_seed, keypair_from_seed_and_derivation_path, write_keypair, - write_keypair_file, Keypair, Signer, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_keypair::{ + keypair_from_seed, seed_derivable::keypair_from_seed_and_derivation_path, write_keypair, + write_keypair_file, Keypair, }, + solana_message::Message, + solana_pubkey::Pubkey, + solana_remote_wallet::remote_wallet::RemoteWalletManager, + solana_signer::Signer, std::{ collections::HashSet, error, @@ -50,7 +49,7 @@ use { }; mod smallest_length_44_public_key { - use solana_sdk::pubkey::Pubkey; + use solana_pubkey::Pubkey; pub(super) static PUBKEY: Pubkey = Pubkey::from_str_const("21111111111111111111111111111111111111111111"); @@ -1156,7 +1155,7 @@ mod tests { #[test] fn test_read_write_pubkey() -> Result<(), std::boxed::Box> { let filename = "test_pubkey.json"; - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); write_pubkey_file(filename, pubkey)?; let read = read_pubkey_file(filename)?; assert_eq!(read, pubkey); diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 29d9aa591f4948..9fc59127686aaa 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -70,7 +70,7 @@ dependencies = [ "log", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -142,7 +142,7 @@ dependencies = [ "solana-version", "solana-vote-program", "symlink", - "thiserror 2.0.4", + "thiserror 2.0.6", "tikv-jemallocator", "tokio", ] @@ -2523,9 +2523,9 @@ dependencies = [ [[package]] name = "index_list" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de7dd2746e29d9e4df6219ff1b954fe684b7ec01b028a1d4d7f3b38a7e20e763" +checksum = "fa38453685e5fe724fd23ff6c1a158c1e2ca21ce0c2718fa11e96e70e99fd4de" [[package]] name = "indexmap" @@ -2640,9 +2640,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -3980,7 +3980,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.19", "socket2 0.5.8", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", ] @@ -4000,7 +4000,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.4", + "thiserror 2.0.6", "tinyvec", "tracing", "web-time", @@ -4928,7 +4928,7 @@ dependencies = [ "spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -4998,7 +4998,7 @@ dependencies = [ "static_assertions", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5015,7 +5015,7 @@ dependencies = [ "solana-program", "solana-program-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5035,7 +5035,7 @@ dependencies = [ "solana-program", "solana-sdk", "tarpc", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-serde", ] @@ -5103,7 +5103,7 @@ dependencies = [ "ark-serialize", "bytemuck", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5136,7 +5136,7 @@ dependencies = [ "solana-timings", "solana-type-overrides", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5168,8 +5168,10 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program", @@ -5196,7 +5198,7 @@ dependencies = [ "solana-seed-phrase", "solana-signature", "solana-signer", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "uriparse", "url 2.5.4", @@ -5255,19 +5257,33 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5376,7 +5392,7 @@ dependencies = [ "solana-metrics", "solana-time-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5462,7 +5478,7 @@ dependencies = [ "sys-info", "sysctl", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "trees", ] @@ -5504,7 +5520,7 @@ dependencies = [ "bytemuck_derive", "curve25519-dalek 4.1.3", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5562,13 +5578,17 @@ dependencies = [ "rand 0.8.5", "rayon", "serde", + "solana-hash", "solana-measure", "solana-merkle-tree", "solana-metrics", + "solana-packet", "solana-perf", "solana-rayon-threadlimit", "solana-runtime-transaction", - "solana-sdk", + "solana-sha256-hasher", + "solana-transaction", + "solana-transaction-error", ] [[package]] @@ -5591,6 +5611,15 @@ dependencies = [ "solana-sysvar-id", ] +[[package]] +name = "solana-epoch-rewards-hasher" +version = "2.2.0" +dependencies = [ + "siphasher", + "solana-hash", + "solana-pubkey", +] + [[package]] name = "solana-epoch-schedule" version = "2.2.0" @@ -5615,12 +5644,22 @@ dependencies = [ "serde_derive", "solana-clap-utils", "solana-cli-config", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-logger", + "solana-message", "solana-metrics", - "solana-sdk", + "solana-native-token", + "solana-packet", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-system-transaction", + "solana-transaction", "solana-version", "spl-memo", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5721,7 +5760,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5771,7 +5810,7 @@ dependencies = [ "solana-vote", "solana-vote-program", "static_assertions", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5936,7 +5975,7 @@ dependencies = [ "strum_macros", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "trees", @@ -6020,7 +6059,7 @@ dependencies = [ "solana-cluster-type", "solana-sha256-hasher", "solana-time-utils", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6138,7 +6177,7 @@ dependencies = [ "solana-metrics", "solana-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6156,7 +6195,7 @@ dependencies = [ "ark-bn254", "light-poseidon", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6255,7 +6294,7 @@ dependencies = [ "solana-system-interface", "solana-sysvar", "solana-sysvar-id", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", ] @@ -6341,7 +6380,7 @@ dependencies = [ "solana-transaction-context", "solana-type-overrides", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6374,7 +6413,7 @@ dependencies = [ "solana-timings", "solana-vote-program", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6420,7 +6459,7 @@ dependencies = [ "solana-pubkey", "solana-rpc-client-api", "solana-signature", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "tokio-tungstenite", @@ -6453,7 +6492,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6487,7 +6526,7 @@ dependencies = [ "semver", "solana-derivation-path", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", "uriparse", ] @@ -6582,7 +6621,7 @@ dependencies = [ "spl-token", "spl-token-2022", "stream-cancel", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.1", ] @@ -6649,7 +6688,7 @@ dependencies = [ "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6664,7 +6703,7 @@ dependencies = [ "solana-pubkey", "solana-rpc-client", "solana-sdk-ids", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6736,7 +6775,7 @@ dependencies = [ "solana-svm-transaction", "solana-system-program", "solana-timings", - "solana-transaction-status", + "solana-transaction-status-client-types", "solana-version", "solana-vote", "solana-vote-program", @@ -6750,7 +6789,7 @@ dependencies = [ "symlink", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -6766,7 +6805,7 @@ dependencies = [ "solana-sdk", "solana-sdk-ids", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7304,7 +7343,6 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3", - "siphasher", "solana-account", "solana-bn254", "solana-client-traits", @@ -7315,6 +7353,7 @@ dependencies = [ "solana-derivation-path", "solana-ed25519-program", "solana-epoch-info", + "solana-epoch-rewards-hasher", "solana-feature-set", "solana-fee-structure", "solana-inflation", @@ -7352,7 +7391,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", ] @@ -7396,7 +7435,7 @@ dependencies = [ "borsh 1.5.3", "libsecp256k1 0.6.0", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7585,7 +7624,7 @@ dependencies = [ "solana-sdk", "solana-storage-proto", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tonic", "zstd", @@ -7645,7 +7684,7 @@ dependencies = [ "solana-tls-utils", "solana-transaction-error", "solana-transaction-metrics-tracker", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.1", "x509-parser", @@ -7677,7 +7716,7 @@ dependencies = [ "solana-system-program", "solana-timings", "solana-type-overrides", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7895,7 +7934,7 @@ dependencies = [ "solana-signer", "solana-transaction", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7916,7 +7955,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-tpu-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.1", ] @@ -8009,7 +8048,7 @@ dependencies = [ "spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8030,7 +8069,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8069,7 +8108,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "static_assertions", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -8091,7 +8130,7 @@ dependencies = [ "solana-net-utils", "solana-streamer", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -8148,7 +8187,7 @@ dependencies = [ "serde_derive", "solana-sdk", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8166,7 +8205,7 @@ dependencies = [ "solana-program", "solana-program-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -8233,7 +8272,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", "zeroize", ] @@ -8283,7 +8322,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "zeroize", ] @@ -8912,11 +8951,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.4", + "thiserror-impl 2.0.6", ] [[package]] @@ -8932,9 +8971,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -9125,9 +9164,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -9590,9 +9629,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -9601,13 +9640,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.87", @@ -9628,9 +9666,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9638,9 +9676,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -9651,9 +9689,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" diff --git a/quic-client/Cargo.toml b/quic-client/Cargo.toml index 3337a17950c869..9190ce00705f0e 100644 --- a/quic-client/Cargo.toml +++ b/quic-client/Cargo.toml @@ -38,5 +38,5 @@ tokio = { workspace = true, features = ["full"] } crossbeam-channel = { workspace = true } solana-logger = { workspace = true } solana-net-utils = { workspace = true, features = ["dev-context-only-utils"] } +solana-packet = { workspace = true } solana-perf = { workspace = true } -solana-sdk = { workspace = true } diff --git a/quic-client/tests/quic_client.rs b/quic-client/tests/quic_client.rs index 65cf3d2fffa6ac..d23e4e9deece98 100644 --- a/quic-client/tests/quic_client.rs +++ b/quic-client/tests/quic_client.rs @@ -4,10 +4,11 @@ mod tests { crossbeam_channel::{unbounded, Receiver}, log::*, solana_connection_cache::connection_cache_stats::ConnectionCacheStats, + solana_keypair::Keypair, solana_net_utils::bind_to_localhost, + solana_packet::PACKET_DATA_SIZE, solana_perf::packet::PacketBatch, solana_quic_client::nonblocking::quic_client::QuicLazyInitializedEndpoint, - solana_sdk::{packet::PACKET_DATA_SIZE, signature::Keypair}, solana_streamer::{ quic::{QuicServerParams, SpawnServerResult}, streamer::StakedNodes, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b7eefcea5a76b2..dea9431a851f17 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -81,7 +81,7 @@ solana-svm-rent-collector = { workspace = true } solana-svm-transaction = { workspace = true } solana-system-program = { workspace = true } solana-timings = { workspace = true } -solana-transaction-status = { workspace = true } +solana-transaction-status-client-types = { workspace = true } solana-version = { workspace = true } solana-vote = { workspace = true } solana-vote-program = { workspace = true } diff --git a/runtime/src/bank/bank_hash_details.rs b/runtime/src/bank/bank_hash_details.rs index 7ee2879c95fbb0..43a35a78241045 100644 --- a/runtime/src/bank/bank_hash_details.rs +++ b/runtime/src/bank/bank_hash_details.rs @@ -24,7 +24,7 @@ use { transaction_context::TransactionReturnData, }, solana_svm::transaction_commit_result::CommittedTransaction, - solana_transaction_status::UiInstruction, + solana_transaction_status_client_types::UiInstruction, std::str::FromStr, }; diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 56c09d745d4364..05d955899eb461 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -115,7 +115,6 @@ serde_json = { workspace = true, optional = true } serde_with = { workspace = true, features = ["macros"] } sha2 = { workspace = true } sha3 = { workspace = true, optional = true } -siphasher = { workspace = true } solana-account = { workspace = true, features = ["bincode"] } solana-bn254 = { workspace = true } solana-client-traits = { workspace = true, optional = true } @@ -132,6 +131,7 @@ solana-decode-error = { workspace = true } solana-derivation-path = { workspace = true } solana-ed25519-program = { workspace = true, optional = true } solana-epoch-info = { workspace = true, features = ["serde"] } +solana-epoch-rewards-hasher = { workspace = true } solana-feature-set = { workspace = true } solana-fee-structure = { workspace = true, features = ["serde"] } solana-frozen-abi = { workspace = true, optional = true, features = [ diff --git a/sdk/epoch-rewards-hasher/Cargo.toml b/sdk/epoch-rewards-hasher/Cargo.toml new file mode 100644 index 00000000000000..7e6d3677c11c14 --- /dev/null +++ b/sdk/epoch-rewards-hasher/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "solana-epoch-rewards-hasher" +description = "Solana epoch rewards hasher." +documentation = "https://docs.rs/solana-epoch-rewards-hasher" +version = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = { workspace = true } + +[dependencies] +siphasher = { workspace = true } +solana-hash = { workspace = true } +solana-pubkey = { workspace = true } + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[lints] +workspace = true diff --git a/sdk/src/epoch_rewards_hasher.rs b/sdk/epoch-rewards-hasher/src/lib.rs similarity index 98% rename from sdk/src/epoch_rewards_hasher.rs rename to sdk/epoch-rewards-hasher/src/lib.rs index 6a5d315f0370ba..a9e910058856c7 100644 --- a/sdk/src/epoch_rewards_hasher.rs +++ b/sdk/epoch-rewards-hasher/src/lib.rs @@ -1,8 +1,4 @@ -use { - siphasher::sip::SipHasher13, - solana_sdk::{hash::Hash, pubkey::Pubkey}, - std::hash::Hasher, -}; +use {siphasher::sip::SipHasher13, solana_hash::Hash, solana_pubkey::Pubkey, std::hash::Hasher}; #[derive(Debug, Clone)] pub struct EpochRewardsHasher { diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index ac7f74fd95a9e2..ec09dffb703dca 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -64,7 +64,6 @@ pub use solana_program::{borsh, borsh0_10, borsh1}; pub use solana_signer::signers; pub mod entrypoint; pub mod entrypoint_deprecated; -pub mod epoch_rewards_hasher; pub mod example_mocks; pub mod exit; pub mod feature; @@ -123,6 +122,11 @@ pub use solana_derivation_path as derivation_path; pub use solana_ed25519_program as ed25519_instruction; #[deprecated(since = "2.2.0", note = "Use `solana-epoch-info` crate instead")] pub use solana_epoch_info as epoch_info; +#[deprecated( + since = "2.2.0", + note = "Use `solana-epoch-rewards-hasher` crate instead" +)] +pub use solana_epoch_rewards_hasher as epoch_rewards_hasher; #[deprecated(since = "2.1.0", note = "Use `solana-feature-set` crate instead")] pub use solana_feature_set as feature_set; #[deprecated(since = "2.2.0", note = "Use `solana-fee-structure` crate instead")] diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index b3c445209bb16c..d1e2947d3c4879 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -70,7 +70,7 @@ dependencies = [ "log", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -2433,9 +2433,9 @@ dependencies = [ [[package]] name = "index_list" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de7dd2746e29d9e4df6219ff1b954fe684b7ec01b028a1d4d7f3b38a7e20e763" +checksum = "fa38453685e5fe724fd23ff6c1a158c1e2ca21ce0c2718fa11e96e70e99fd4de" [[package]] name = "indexmap" @@ -2550,9 +2550,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -3871,7 +3871,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.19", "socket2", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", ] @@ -3891,7 +3891,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.4", + "thiserror 2.0.6", "tinyvec", "tracing", "web-time", @@ -4779,7 +4779,7 @@ dependencies = [ "spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -4849,7 +4849,7 @@ dependencies = [ "static_assertions", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -4866,7 +4866,7 @@ dependencies = [ "solana-program", "solana-program-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -4886,7 +4886,7 @@ dependencies = [ "solana-program", "solana-sdk", "tarpc", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-serde", ] @@ -4954,7 +4954,7 @@ dependencies = [ "ark-serialize", "bytemuck", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -4987,7 +4987,7 @@ dependencies = [ "solana-timings", "solana-type-overrides", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5019,8 +5019,10 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program", @@ -5047,7 +5049,7 @@ dependencies = [ "solana-seed-phrase", "solana-signature", "solana-signer", - "thiserror 2.0.4", + "thiserror 2.0.6", "tiny-bip39", "uriparse", "url 2.5.4", @@ -5106,19 +5108,33 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5227,7 +5243,7 @@ dependencies = [ "solana-metrics", "solana-time-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5313,7 +5329,7 @@ dependencies = [ "sys-info", "sysctl", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "trees", ] @@ -5355,7 +5371,7 @@ dependencies = [ "bytemuck_derive", "curve25519-dalek 4.1.3", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5403,13 +5419,17 @@ dependencies = [ "rand 0.8.5", "rayon", "serde", + "solana-hash", "solana-measure", "solana-merkle-tree", "solana-metrics", + "solana-packet", "solana-perf", "solana-rayon-threadlimit", "solana-runtime-transaction", - "solana-sdk", + "solana-sha256-hasher", + "solana-transaction", + "solana-transaction-error", ] [[package]] @@ -5432,6 +5452,15 @@ dependencies = [ "solana-sysvar-id", ] +[[package]] +name = "solana-epoch-rewards-hasher" +version = "2.2.0" +dependencies = [ + "siphasher", + "solana-hash", + "solana-pubkey", +] + [[package]] name = "solana-epoch-schedule" version = "2.2.0" @@ -5456,12 +5485,22 @@ dependencies = [ "serde_derive", "solana-clap-utils", "solana-cli-config", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-logger", + "solana-message", "solana-metrics", - "solana-sdk", + "solana-native-token", + "solana-packet", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-system-transaction", + "solana-transaction", "solana-version", "spl-memo", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5541,7 +5580,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -5591,7 +5630,7 @@ dependencies = [ "solana-vote", "solana-vote-program", "static_assertions", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5756,7 +5795,7 @@ dependencies = [ "strum_macros", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "trees", @@ -5840,7 +5879,7 @@ dependencies = [ "solana-cluster-type", "solana-sha256-hasher", "solana-time-utils", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5958,7 +5997,7 @@ dependencies = [ "solana-metrics", "solana-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -5976,7 +6015,7 @@ dependencies = [ "ark-bn254", "light-poseidon", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6075,7 +6114,7 @@ dependencies = [ "solana-system-interface", "solana-sysvar", "solana-sysvar-id", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", ] @@ -6161,7 +6200,7 @@ dependencies = [ "solana-transaction-context", "solana-type-overrides", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6194,7 +6233,7 @@ dependencies = [ "solana-timings", "solana-vote-program", "solana_rbpf", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6240,7 +6279,7 @@ dependencies = [ "solana-pubkey", "solana-rpc-client-api", "solana-signature", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-stream", "tokio-tungstenite", @@ -6273,7 +6312,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -6307,7 +6346,7 @@ dependencies = [ "semver", "solana-derivation-path", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", "uriparse", ] @@ -6402,7 +6441,7 @@ dependencies = [ "spl-token", "spl-token-2022", "stream-cancel", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.12", ] @@ -6469,7 +6508,7 @@ dependencies = [ "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6484,7 +6523,7 @@ dependencies = [ "solana-pubkey", "solana-rpc-client", "solana-sdk-ids", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6556,7 +6595,7 @@ dependencies = [ "solana-svm-transaction", "solana-system-program", "solana-timings", - "solana-transaction-status", + "solana-transaction-status-client-types", "solana-version", "solana-vote", "solana-vote-program", @@ -6570,7 +6609,7 @@ dependencies = [ "symlink", "tar", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "zstd", ] @@ -6586,7 +6625,7 @@ dependencies = [ "solana-sdk", "solana-sdk-ids", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6625,7 +6664,6 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3", - "siphasher", "solana-account", "solana-bn254", "solana-client-traits", @@ -6636,6 +6674,7 @@ dependencies = [ "solana-derivation-path", "solana-ed25519-program", "solana-epoch-info", + "solana-epoch-rewards-hasher", "solana-feature-set", "solana-fee-structure", "solana-inflation", @@ -6673,7 +6712,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", ] @@ -6717,7 +6756,7 @@ dependencies = [ "borsh 1.5.3", "libsecp256k1", "solana-define-syscall", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -6906,7 +6945,7 @@ dependencies = [ "solana-sdk", "solana-storage-proto", "solana-transaction-status", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tonic", "zstd", @@ -6966,7 +7005,7 @@ dependencies = [ "solana-tls-utils", "solana-transaction-error", "solana-transaction-metrics-tracker", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.12", "x509-parser", @@ -6997,7 +7036,7 @@ dependencies = [ "solana-system-program", "solana-timings", "solana-type-overrides", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7233,7 +7272,7 @@ dependencies = [ "solana-signer", "solana-transaction", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7254,7 +7293,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-tpu-client", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-util 0.7.12", ] @@ -7347,7 +7386,7 @@ dependencies = [ "spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7368,7 +7407,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7407,7 +7446,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "static_assertions", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7429,7 +7468,7 @@ dependencies = [ "solana-net-utils", "solana-streamer", "solana-transaction-error", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", ] @@ -7486,7 +7525,7 @@ dependencies = [ "serde_derive", "solana-sdk", "solana-svm-transaction", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7504,7 +7543,7 @@ dependencies = [ "solana-program", "solana-program-runtime", "solana-sdk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -7571,7 +7610,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "wasm-bindgen", "zeroize", ] @@ -7621,7 +7660,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.4", + "thiserror 2.0.6", "zeroize", ] @@ -8244,11 +8283,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.4", + "thiserror-impl 2.0.6", ] [[package]] @@ -8264,9 +8303,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -8435,9 +8474,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -8887,9 +8926,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -8898,13 +8937,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.87", @@ -8925,9 +8963,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8935,9 +8973,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -8948,9 +8986,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" diff --git a/transaction-metrics-tracker/Cargo.toml b/transaction-metrics-tracker/Cargo.toml index 3d6c28396a245c..cdebb328609964 100644 --- a/transaction-metrics-tracker/Cargo.toml +++ b/transaction-metrics-tracker/Cargo.toml @@ -22,7 +22,10 @@ solana-short-vec = { workspace = true } solana-signature = { workspace = true } [dev-dependencies] -solana-sdk = { workspace = true } +solana-hash = { workspace = true } +solana-keypair = { workspace = true } +solana-pubkey = { workspace = true, features = ["rand"] } +solana-system-transaction = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/transaction-metrics-tracker/src/lib.rs b/transaction-metrics-tracker/src/lib.rs index 4b72b22ddf9c74..8426b159f79133 100644 --- a/transaction-metrics-tracker/src/lib.rs +++ b/transaction-metrics-tracker/src/lib.rs @@ -54,12 +54,8 @@ pub fn get_signature_from_packet(packet: &Packet) -> Result<&[u8; SIGNATURE_BYTE #[cfg(test)] mod tests { use { - super::*, - solana_sdk::{ - hash::Hash, - signature::{Keypair, Signature}, - system_transaction, - }, + super::*, solana_hash::Hash, solana_keypair::Keypair, solana_signature::Signature, + solana_system_transaction as system_transaction, }; #[test] @@ -72,7 +68,7 @@ mod tests { // Use a valid transaction, it should succeed let tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), ); @@ -116,7 +112,7 @@ mod tests { // Use a valid transaction which is not matched let tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), ); @@ -127,7 +123,7 @@ mod tests { // Now simulate a txn matching the signature mask let mut tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), ); diff --git a/watchtower/Cargo.toml b/watchtower/Cargo.toml index 4088ee7d9b51ab..9f6da967079258 100644 --- a/watchtower/Cargo.toml +++ b/watchtower/Cargo.toml @@ -16,12 +16,14 @@ log = { workspace = true } solana-clap-utils = { workspace = true } solana-cli-config = { workspace = true } solana-cli-output = { workspace = true } +solana-hash = { workspace = true } solana-logger = { workspace = true } solana-metrics = { workspace = true } +solana-native-token = { workspace = true } solana-notifier = { workspace = true } +solana-pubkey = { workspace = true } solana-rpc-client = { workspace = true } solana-rpc-client-api = { workspace = true } -solana-sdk = { workspace = true } solana-version = { workspace = true } [package.metadata.docs.rs] diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index 11dd70e27285dc..7a29fe8a4eae1f 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -10,15 +10,13 @@ use { input_validators::{is_parsable, is_pubkey_or_keypair, is_url, is_valid_percentage}, }, solana_cli_output::display::format_labeled_address, + solana_hash::Hash, solana_metrics::{datapoint_error, datapoint_info}, + solana_native_token::{sol_to_lamports, Sol}, solana_notifier::{NotificationType, Notifier}, + solana_pubkey::Pubkey, solana_rpc_client::rpc_client::RpcClient, solana_rpc_client_api::{client_error, response::RpcVoteAccountStatus}, - solana_sdk::{ - hash::Hash, - native_token::{sol_to_lamports, Sol}, - pubkey::Pubkey, - }, std::{ collections::HashMap, error, diff --git a/zk-keygen/Cargo.toml b/zk-keygen/Cargo.toml index cdda986d0c0153..fac3785608e31f 100644 --- a/zk-keygen/Cargo.toml +++ b/zk-keygen/Cargo.toml @@ -21,13 +21,15 @@ clap = { version = "3.1.5", features = ["cargo", "derive"] } dirs-next = { workspace = true } solana-clap-v3-utils = { workspace = true } solana-remote-wallet = { workspace = true, features = ["default"] } -solana-sdk = { workspace = true } +solana-seed-derivable = { workspace = true } +solana-signer = { workspace = true } solana-version = { workspace = true } solana-zk-token-sdk = { workspace = true } thiserror = { workspace = true } tiny-bip39 = { workspace = true } [dev-dependencies] +solana-pubkey = { workspace = true, features = ["rand"] } tempfile = { workspace = true } [[bin]] diff --git a/zk-keygen/src/main.rs b/zk-keygen/src/main.rs index 5ae1f72242e992..e63522038b98b8 100644 --- a/zk-keygen/src/main.rs +++ b/zk-keygen/src/main.rs @@ -14,7 +14,8 @@ use { }, DisplayError, }, - solana_sdk::signer::{EncodableKey, SeedDerivable}, + solana_seed_derivable::SeedDerivable, + solana_signer::EncodableKey, solana_zk_token_sdk::encryption::{auth_encryption::AeKey, elgamal::ElGamalKeypair}, std::{error, str::FromStr}, thiserror::Error, @@ -337,7 +338,7 @@ impl FromStr for KeyType { mod tests { use { super::*, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, tempfile::{tempdir, TempDir}, };