diff --git a/examples/functions/01_basic_oracle/Cargo.lock b/examples/functions/01_basic_oracle/Cargo.lock index 5d2f3846c..8db76e2c0 100644 --- a/examples/functions/01_basic_oracle/Cargo.lock +++ b/examples/functions/01_basic_oracle/Cargo.lock @@ -4509,7 +4509,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.29.70" +version = "0.29.71" dependencies = [ "anchor-client", "anchor-lang", diff --git a/examples/functions/01_basic_oracle/Cargo.toml b/examples/functions/01_basic_oracle/Cargo.toml index f298aab12..7ade85b32 100644 --- a/examples/functions/01_basic_oracle/Cargo.toml +++ b/examples/functions/01_basic_oracle/Cargo.toml @@ -19,6 +19,6 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -# switchboard-solana = { version = "0.28.43" } +# switchboard-solana = { version = "0.29.70" } switchboard-solana = { path = "../../../rust/switchboard-solana" } bytemuck = "^1" diff --git a/examples/functions/01_basic_oracle/package.json b/examples/functions/01_basic_oracle/package.json index 3fd579592..48d135400 100644 --- a/examples/functions/01_basic_oracle/package.json +++ b/examples/functions/01_basic_oracle/package.json @@ -15,7 +15,7 @@ "@coral-xyz/anchor": "^0.28.0", "@solana/spl-token": "^0.3.6", "@solana/web3.js": "^1.78.0", - "@switchboard-xyz/solana.js": "*" + "@switchboard-xyz/solana.js": "^" }, "devDependencies": { "@types/bn.js": "^5.1.0", @@ -26,4 +26,4 @@ "mocha": "^9.0.3", "ts-mocha": "^10.0.0" } -} +} \ No newline at end of file diff --git a/examples/functions/01_basic_oracle/src/actions/refresh_prices.rs b/examples/functions/01_basic_oracle/src/actions/refresh_prices.rs index 8bd168189..d911c41f1 100644 --- a/examples/functions/01_basic_oracle/src/actions/refresh_prices.rs +++ b/examples/functions/01_basic_oracle/src/actions/refresh_prices.rs @@ -10,14 +10,17 @@ pub struct RefreshPrices<'info> { pub oracle: AccountLoader<'info, MyOracleState>, // We use this to verify the functions enclave state - pub switchboard_function: AccountLoader<'info, FunctionAccountData>, #[account( - // constraint = switchboard_routine.validate_signer( - // switchboard_function.to_account_info().as_ref(), - // enclave_signer.to_account_info().as_ref() - // )? + constraint = function.load()?.validate_routine( + &routine, + &enclave_signer.to_account_info(), + )? )] - pub switchboard_routine: Box>, + pub function: AccountLoader<'info, FunctionAccountData>, + #[account( + has_one = function, + )] + pub routine: Box>, pub enclave_signer: Signer<'info>, } @@ -30,7 +33,7 @@ impl RefreshPrices<'_> { pub fn validate( &self, _ctx: &Context, - _params: &RefreshPricesParams + _params: &RefreshPricesParams, ) -> anchor_lang::Result<()> { Ok(()) } diff --git a/examples/functions/01_basic_oracle/src/actions/set_function.rs b/examples/functions/01_basic_oracle/src/actions/set_function.rs index f31dd9264..820c0492b 100644 --- a/examples/functions/01_basic_oracle/src/actions/set_function.rs +++ b/examples/functions/01_basic_oracle/src/actions/set_function.rs @@ -11,7 +11,11 @@ pub struct SetFunction<'info> { )] pub program: AccountLoader<'info, MyProgramState>, + // Make sure the function has at least one MrEnclave measurement defined. pub switchboard_function: AccountLoader<'info, FunctionAccountData>, + #[account( + constraint = switchboard_routine.function == switchboard_function.key() + )] pub switchboard_routine: Box>, pub authority: Signer<'info>, diff --git a/examples/functions/01_basic_oracle/switchboard-function/Cargo.lock b/examples/functions/01_basic_oracle/switchboard-function/Cargo.lock index 45ada1688..9c401d5ae 100644 --- a/examples/functions/01_basic_oracle/switchboard-function/Cargo.lock +++ b/examples/functions/01_basic_oracle/switchboard-function/Cargo.lock @@ -4717,7 +4717,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.29.70" +version = "0.29.71" dependencies = [ "anchor-client", "anchor-lang", diff --git a/examples/functions/04_randomness_callback/Cargo.lock b/examples/functions/04_randomness_callback/Cargo.lock index e4512dc04..c5bb33a8a 100644 --- a/examples/functions/04_randomness_callback/Cargo.lock +++ b/examples/functions/04_randomness_callback/Cargo.lock @@ -103,64 +103,58 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.66", "quote 1.0.32", - "regex", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", "bs58 0.5.0", "proc-macro2 1.0.66", "quote 1.0.32", - "rustversion", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", + "quote 1.0.32", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", "quote 1.0.32", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.66", "quote 1.0.32", "syn 1.0.109", @@ -168,22 +162,20 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.66", "quote 1.0.32", "syn 1.0.109", ] [[package]] name = "anchor-client" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8434a6bf33efba0c93157f7fa2fafac658cb26ab75396886dcedd87c2a8ad445" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ "anchor-lang", "anyhow", @@ -200,12 +192,23 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", + "quote 1.0.32", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", "proc-macro2 1.0.66", "quote 1.0.32", "syn 1.0.109", @@ -213,9 +216,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.32", @@ -224,9 +227,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -235,6 +238,7 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", "arrayref", "base64 0.13.1", @@ -248,9 +252,9 @@ dependencies = [ [[package]] name = "anchor-spl" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f860599da1c2354e7234c768783049eb42e2f54509ecfc942d2e0076a2da7b" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ "anchor-lang", "solana-program", @@ -261,9 +265,9 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", "bs58 0.5.0", @@ -575,9 +579,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -832,9 +836,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] @@ -1201,6 +1205,19 @@ dependencies = [ "syn 2.0.28", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.0", + "lock_api", + "once_cell", + "parking_lot_core 0.9.8", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -1429,6 +1446,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +dependencies = [ + "serde", +] + [[package]] name = "errno" version = "0.3.2" @@ -2013,6 +2039,15 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2104,9 +2139,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] [[package]] name = "memchr" @@ -2297,6 +2335,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "syn 2.0.28", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -2351,39 +2400,39 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" dependencies = [ - "num_enum_derive 0.5.11", + "num_enum_derive 0.6.1", ] [[package]] name = "num_enum" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" dependencies = [ - "num_enum_derive 0.6.1", + "num_enum_derive 0.7.1", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2 1.0.66", "quote 1.0.32", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "num_enum_derive" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2 1.0.66", @@ -2671,9 +2720,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", "rand 0.8.5", @@ -2902,7 +2951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ "async-compression", - "base64 0.21.2", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -3090,7 +3139,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", ] [[package]] @@ -3214,6 +3263,15 @@ dependencies = [ "syn 2.0.28", ] +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", +] + [[package]] name = "serde_json" version = "1.0.104" @@ -3389,12 +3447,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298accbe9b2bffc391081b94f30ec3dd5bac053bfcd09aa78c06f1f87d33ec1e" +checksum = "5c68b2beaa5b5b4aa9d182568c020c111b9e29e52c7f74cc9eb77cc27f003fa9" dependencies = [ "Inflector", - "base64 0.21.2", + "base64 0.21.5", "bincode", "bs58 0.4.0", "bv", @@ -3407,20 +3465,21 @@ dependencies = [ "solana-sdk", "spl-token", "spl-token-2022", + "spl-token-metadata-interface", "thiserror", "zstd", ] [[package]] name = "solana-address-lookup-table-program" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026db45d6d8a21afe308fab93a40c77d21cb7a0f1f2fe4b99bb7bbcd7028ed7" +checksum = "c0eee296b5ca0955429bd2df3272cb7ba0bb5c5886a4a5fdfe5cde97b5698c21" dependencies = [ "bincode", "bytemuck", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "rustc_version", "serde", @@ -3434,9 +3493,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27f6ef67bb0519da2d7c7dd9f65c8e447a9a1c8330bb032b78d80712472fefd" +checksum = "cdf24f58d924826a9fe4a147b8471de117b3eb330b58286c9c344126f19f7e18" dependencies = [ "chrono", "clap 2.34.0", @@ -3452,9 +3511,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13cf67b2f89d8ce5ce0b8c75baac79dc10b082cf096b149146724182db5506cf" +checksum = "0acc301c1e696f22d0984e6b3be2a2dfb474829e3e1426ea0c6191ad121df3e2" dependencies = [ "async-trait", "bincode", @@ -3485,9 +3544,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4065170279a38c1013fcf9c1776579914e7c30edb831f28dfd59f9d939d90f63" +checksum = "8e4f62294a49dae0338e47503f55bce1d9469ca6555b2bed5547d39dc519c869" dependencies = [ "bincode", "chrono", @@ -3499,9 +3558,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a98001f5293720075b52faa7e05c78c33ffdcc23ed7dea2cad102ed4823d624" +checksum = "0655f6d2541e6b934f701fb6f22a2bbd29211b741447a88b551b7bffff84c1b4" dependencies = [ "async-trait", "bincode", @@ -3520,9 +3579,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee2b96d4150d9ebf55e903014bc332ac64c642837d7f1e6f7b911d709331380" +checksum = "7e77bfd59ad4e64c0f06fbcbe16d58f3a40bdbcc050fb78fc7134a55a5c290b9" dependencies = [ "ahash 0.8.3", "blake3", @@ -3553,9 +3612,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942534eb972f955ed186175495654cabece6261a8ac3211e5791440d40a1ed96" +checksum = "992b866b9f0510fd3c290afe6a37109ae8d15b74fa24e3fb6d164be2971ee94f" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.32", @@ -3565,9 +3624,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1339e1a179e2465e97fd89c2f70d5f00c5644f36c0e547b8ecda414c748dfc2c" +checksum = "0278658cd4fb5405932452bf20f7df496ce8b9e9cf66a7d1c621bbe3b01fe297" dependencies = [ "env_logger", "lazy_static", @@ -3576,9 +3635,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3feab384868634ea5d7a12fc62c001d5785b6a352b7903ad13edbb7d3043f3" +checksum = "4d1650f3e76bedbaa149c73f145dbd605e7020cf77b3f9e24c8918fca4220bc4" dependencies = [ "log", "solana-sdk", @@ -3586,9 +3645,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31c1f2569ea75ee9aa73eedb948b17eabc468e6cd5c1aee4d9cdfaffb0f3d33" +checksum = "7e80d0e32083dde7f76ad8f30c2b71c0efcfce84fa7f6593adf91f4a5cfeb067" dependencies = [ "crossbeam-channel", "gethostname", @@ -3600,9 +3659,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "725a2f7335cc7ec5be356baaf44b0d3211f996b174e2a3b340227e700d26fc55" +checksum = "4d850a46e56a676f654109a7277bd61abb76c7b29b2ca6aa24a4b61194eb9d3b" dependencies = [ "bincode", "clap 3.2.25", @@ -3622,9 +3681,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2048b4890677ec4287a205a0f53d6a9bf2bdbcc7046aeb665b2714e3c1a4e655" +checksum = "32ccdeb24c7e53733e7a929b5e2d717c3f428cb131861946de6065ffccd67228" dependencies = [ "ahash 0.8.3", "bincode", @@ -3649,16 +3708,16 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f81c59ed0b65b403cc5db459dd1214dfab89ccd3ce20aadf98102b072d08562" +checksum = "aa5ac2110c5b927d6114b2d4f32af7f749fde0e6fd8f34777407ce89d66630be" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", "array-bytes", - "base64 0.21.2", + "base64 0.21.5", "bincode", "bitflags 1.3.2", "blake3", @@ -3680,7 +3739,7 @@ dependencies = [ "log", "memoffset 0.9.0", "num-bigint 0.4.3", - "num-derive", + "num-derive 0.3.3", "num-traits", "parking_lot 0.12.1", "rand 0.7.3", @@ -3704,18 +3763,18 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8624325d63e9a643385739c53315d8768aff689dfa9ad06ed1c67aac163ab2" +checksum = "02d1f727139019e6a5872ae3149971f2f7928a4841d27284a8787ab23dddcb10" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "bincode", "eager", "enum-iterator", "itertools", "libc", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "percentage", "rand 0.7.3", @@ -3732,9 +3791,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e10c8caee33c14b74fa2e76f8d8638364303bbf4439e284fddf66b7e3a5acb" +checksum = "8a1406ced27eb3206895467921bc3769679fd2b7948fcadc1916a498a8cb086b" dependencies = [ "crossbeam-channel", "futures-util", @@ -3757,9 +3816,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7173c8eb7b20a1c04838655760ba36e5a4398dc9cd16115a5321c7a56e6a34ff" +checksum = "26c559626657e5ad67b051028d849dbe0c80d605e259fdd7aac9fd985b0ec3ac" dependencies = [ "async-mutex", "async-trait", @@ -3785,9 +3844,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5195e62d9457233f97f30aa678f71b1aaed2200a170e63f0da7d9a3d124aa3" +checksum = "9b576ba60c11f0284bccee36ec472078e7213866a81c3fd34796223a1617ee21" dependencies = [ "lazy_static", "num_cpus", @@ -3795,14 +3854,14 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04b5777335473d24b6edf9ca36129b1f8e07ba34de18e2b8d6285a4e3473260c" +checksum = "ed696d9a9f9497a3d9996b2b4f0610946ddfc8fab0403e4f05a8acee39f4ae48" dependencies = [ "console", "dialoguer", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "parking_lot 0.12.1", "qstring", @@ -3814,12 +3873,12 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d34afb705efdf62ad1a911beffe3c6d599eab2125bd07460e85a424636cb54" +checksum = "dfc1e655345b8f83edb5332b5c29ac803d9fbf239ded75ae83262934f15f6cec" dependencies = [ "async-trait", - "base64 0.21.2", + "base64 0.21.5", "bincode", "bs58 0.4.0", "indicatif", @@ -3840,11 +3899,11 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e28db9b3748bfe7367ef9e9b968be1643f63ab9c360e89681d426d036cf69a" +checksum = "07b3304a4fe120d4882a1449efd8a686d01ca3bd81d3d967d4643f93c722dc26" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "bs58 0.4.0", "jsonrpc-core", "reqwest", @@ -3862,9 +3921,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c9c9f034bf3c931441a0fbb528b8e3bf417a32b70546e5fa0c00cd78559ff5" +checksum = "2c00a55de718e180ad8dc27d90725d97ad14658c7299b8dbe2e909c464a4e434" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -3875,12 +3934,12 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23dbf6da55a2d191956c693d8490dc809799822536aceb11309043e9b622079" +checksum = "dbe17a1ce6082979e7beffb7cadd7051e29d873594622a11a7d0a4c2dd4b7934" dependencies = [ "assert_matches", - "base64 0.21.2", + "base64 0.21.5", "bincode", "bitflags 1.3.2", "borsh 0.10.3", @@ -3900,7 +3959,7 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive", + "num-derive 0.3.3", "num-traits", "num_enum 0.6.1", "pbkdf2 0.11.0", @@ -3928,9 +3987,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7d686e405694cd6510cd77bb87d0eeda64ad3df08d3293278ba47ca78b8e5e" +checksum = "9fe4363d2503a75325ec94aa18b063574edb3454d38840e01c5af477b3b0689d" dependencies = [ "bs58 0.4.0", "proc-macro2 1.0.66", @@ -3941,9 +4000,9 @@ dependencies = [ [[package]] name = "solana-streamer" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e40e74d6ae01dd21dc1a93a2213f8d7e04aea69079092a131ad5bd2d54aa16bc" +checksum = "ca0cac530e3248c7b43306c867e238aad555a9ed89095f0e37a5fef64ff0520e" dependencies = [ "async-channel", "bytes", @@ -3974,9 +4033,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f3a1dae21f002f2d35ddfcc09fb528bc52936bb9fe4aea7bb46b1361998ed7" +checksum = "3bbeb0a2cf605e9d6272917d47873f8b056e9df164efb0853762eb3a8b43004b" dependencies = [ "bincode", "log", @@ -3989,9 +4048,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fffd371a68959dbbbb073198cd93121586da924a8dc493bd624a5ddf40a6742" +checksum = "83cebfa0c1710c74ed8737e65a978393f2a8105f21f544529e2260ac8dbde63d" dependencies = [ "async-trait", "bincode", @@ -4014,14 +4073,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb3b1a35fc4718e758851670a959bb4736a8825f56c7ebfcd6eec892cbd200a" +checksum = "50e2edc23c671221e431712dbf03ca20eee57dc5527935eb745824d7257e314c" dependencies = [ "Inflector", - "base64 0.21.2", + "base64 0.21.5", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bs58 0.4.0", "lazy_static", "log", @@ -4040,9 +4099,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05fd1c52102c716767d32a6936843b0505ad61bad958b34bcff513fe609611e7" +checksum = "41b858f113b49dc57df48999870898363ec7c5262c1aebd70d0a40eabebf7807" dependencies = [ "async-trait", "solana-connection-cache", @@ -4055,9 +4114,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4f9750ce47f0a431338121a3247bd29665d6da5a8ebde8c5320503c98d8adc" +checksum = "27d3a590c0fd2a65eb84d30e7a4daaf1da508855c4533bebacfe2acc949a22c1" dependencies = [ "log", "rustc_version", @@ -4071,13 +4130,13 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258b4c3e62faaed0cd864b02760659e45fb4431a287ee0088ae79af891ae4786" +checksum = "1f485487153d8528769da669e2b174d8fd29c1b5e057dede11b9bea751b63668" dependencies = [ "bincode", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "rustc_version", "serde", @@ -4093,12 +4152,12 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.7" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d04eecf3a7438c95db28b57437e94f09a1e60377183d9bea0c9db84506f504" +checksum = "e0c83eec033c30c95938905374292fb8a3559dd3dfb36d715624e5f8f41b078e" dependencies = [ "aes-gcm-siv", - "base64 0.21.2", + "base64 0.21.5", "bincode", "bytemuck", "byteorder", @@ -4107,7 +4166,7 @@ dependencies = [ "itertools", "lazy_static", "merlin", - "num-derive", + "num-derive 0.3.3", "num-traits", "rand 0.7.3", "serde", @@ -4122,9 +4181,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3082ec3a1d4ef7879eb5b84916d5acde057abd59733eec3647e0ab8885283ef" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" dependencies = [ "byteorder", "combine", @@ -4157,13 +4216,13 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "1.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" dependencies = [ "assert_matches", - "borsh 0.9.3", - "num-derive", + "borsh 0.10.3", + "num-derive 0.4.1", "num-traits", "solana-program", "spl-token", @@ -4171,48 +4230,182 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" +dependencies = [ + "quote 1.0.32", + "spl-discriminator-syn", + "syn 2.0.28", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "sha2 0.10.7", + "syn 2.0.28", + "thiserror", +] + [[package]] name = "spl-memo" -version = "3.0.1" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" dependencies = [ + "num-derive 0.4.1", + "num-traits", "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "sha2 0.10.7", + "syn 2.0.28", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", ] [[package]] name = "spl-token" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.3.3", "num-traits", - "num_enum 0.5.11", + "num_enum 0.6.1", "solana-program", "thiserror", ] [[package]] name = "spl-token-2022" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.4.1", "num-traits", - "num_enum 0.5.11", + "num_enum 0.7.1", "solana-program", "solana-zk-token-sdk", "spl-memo", + "spl-pod", "spl-token", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", "thiserror", ] +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4244,36 +4437,114 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" [[package]] -name = "switchboard-common" -version = "0.8.18" +name = "sval" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15df12a8db7c216a04b4b438f90d50d5335cd38f161b56389c9f5c9d96d0873" + +[[package]] +name = "sval_buffer" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e80556bc8acea0446e574ce542ad6114a76a0237f28a842bc01ca3ea98f479" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d93d2259edb1d7b4316179f0a98c62e3ffc726f47ab200e07cfe382771f57b8" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532f7f882226f7a5a4656f5151224aaebf8217e0d539cb1595b831bace921343" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c9e28848b864786d8b1835f1f0c4c7e65190d9c17b246e5e21cc2457a70b176" +checksum = "76e03bd8aa0ae6ee018f7ae95c9714577687a4415bd1a5f19b26e34695f7e072" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_ref" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ed054f2fb8c2a0ab5d36c1ec57b412919700099fc5e32ad8e7a38b23e1a9e1" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff191c4ff05b67e3844c161021427646cde5d6624597958be158357d9200586" +dependencies = [ + "serde", + "sval", + "sval_buffer", + "sval_fmt", +] + +[[package]] +name = "switchboard-common" +version = "0.11.0" dependencies = [ + "async-trait", + "base64 0.21.5", "envy", + "futures", "getrandom 0.2.10", "hex", + "log", "serde", "serde_json", "sgx-quote", "sha2 0.10.7", + "sha3 0.10.8", ] [[package]] name = "switchboard-solana" -version = "0.28.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0213e971a7eb8910e228a473219e5eee3c799a3365cb33cf2ad482d58044ec4c" +version = "0.29.71" dependencies = [ "anchor-client", "anchor-lang", "anchor-spl", + "base64 0.21.5", "bincode", "bytemuck", "chrono", "cron", + "dashmap", + "futures", "hex", + "kv-log-macro", + "log", "rust_decimal", + "serde", + "serde_json", "sgx-quote", + "sha2 0.10.7", + "solana-account-decoder", "solana-address-lookup-table-program", "solana-client", "solana-program", @@ -4748,6 +5019,42 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +[[package]] +name = "value-bag" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ba39dc791ecb35baad371a3fc04c6eab688c04937d2e0ac6c22b612c0357bf" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e06c10810a57bbf45778d023d432a50a1daa7d185991ae06bcfb6c654d0945" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "vec_map" version = "0.8.2" diff --git a/examples/functions/04_randomness_callback/Cargo.toml b/examples/functions/04_randomness_callback/Cargo.toml index 8821d9e04..7e6a1337d 100644 --- a/examples/functions/04_randomness_callback/Cargo.toml +++ b/examples/functions/04_randomness_callback/Cargo.toml @@ -19,6 +19,6 @@ default = [] [dependencies] bytemuck = "^1" -anchor-spl = "0.28.0" -switchboard-solana = "0.28.43" -# switchboard-solana = { path = "../../../rust/switchboard-solana" } +anchor-spl = "0.29.0" +# switchboard-solana = "0.29.70" +switchboard-solana = { path = "../../../rust/switchboard-solana" } diff --git a/examples/functions/04_randomness_callback/src/lib.rs b/examples/functions/04_randomness_callback/src/lib.rs index caff1c934..150fae39c 100644 --- a/examples/functions/04_randomness_callback/src/lib.rs +++ b/examples/functions/04_randomness_callback/src/lib.rs @@ -6,6 +6,9 @@ pub use utils::*; pub mod error; pub use error::*; +// use std::cell::Ref; +// use std::ops::Deref; + // pub use switchboard_solana::prelude::anchor_lang; // pub use switchboard_solana::prelude::anchor_spl; @@ -26,7 +29,8 @@ pub mod custom_randomness_request { pub fn house_init(ctx: Context, max_guess: u8) -> Result<()> { let mut house = ctx.accounts.house.load_init()?; - house.bump = *ctx.bumps.get("house").unwrap(); + // house.bump = *ctx.bumps.get("house").unwrap(); + house.bump = ctx.bumps.house; house.authority = ctx.accounts.authority.key(); house.function = ctx.accounts.function.key(); house.token_wallet = ctx.accounts.house_token_wallet.key(); @@ -44,7 +48,8 @@ pub mod custom_randomness_request { pub fn user_init(ctx: Context) -> Result<()> { let mut user = ctx.accounts.user.load_init()?; - user.bump = *ctx.bumps.get("user").unwrap(); + // user.bump = *ctx.bumps.get("user").unwrap(); + user.bump = ctx.bumps.user; user.authority = ctx.accounts.payer.key(); user.token_wallet = ctx.accounts.user_token_wallet.key(); @@ -341,10 +346,10 @@ pub struct UserSettle<'info> { // SWITCHBOARD ACCOUNTS pub function: AccountLoader<'info, FunctionAccountData>, #[account( - constraint = request.validate_signer( - &function.to_account_info(), - &enclave_signer.to_account_info() - )? @ RandomnessRequestError::FunctionValidationFailed, + constraint = request.validate_signer( + &function, + &enclave_signer.to_account_info(), + )? )] pub request: Box>, pub enclave_signer: Signer<'info>, diff --git a/examples/functions/04_randomness_callback/switchboard-function/Cargo.lock b/examples/functions/04_randomness_callback/switchboard-function/Cargo.lock index b6a8be752..4762e1c3c 100644 --- a/examples/functions/04_randomness_callback/switchboard-function/Cargo.lock +++ b/examples/functions/04_randomness_callback/switchboard-function/Cargo.lock @@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug", ] @@ -47,7 +47,7 @@ checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" dependencies = [ "aead", "aes", - "cipher 0.3.0", + "cipher", "ctr", "polyval", "subtle", @@ -72,6 +72,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -102,64 +103,58 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5e1a413b311b039d29b61d0dbb401c9dbf04f792497ceca87593454bf6d7dd" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.64", "quote 1.0.29", - "regex", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca9aeaf633c6e2365fed0525dcac68610be58eee5dc69d3b86fe0b1d4b320b9" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", - "bs58 0.4.0", + "bs58 0.5.0", "proc-macro2 1.0.64", "quote 1.0.29", - "rustversion", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788e44f9e8501dabeb6f9229da0f3268fb2ae3208912608ffaa056a72031296f" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2 1.0.64", + "quote 1.0.29", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c4d8c7e4a2605ede6fcdced9690288b2f74e24768619a85229d57e597bc97" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2 1.0.64", "quote 1.0.29", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3b07d5c5d87b5edc72428b447b8e9ee1143b83dd1afc6a6b1d352c6a6164d8" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.64", "quote 1.0.29", "syn 1.0.109", @@ -167,42 +162,53 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22ad0445115dbea5869b1d062da49ae125abed9132fc20c33227f25e42dfa6b" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.64", "quote 1.0.29", "syn 1.0.109", ] [[package]] name = "anchor-client" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c06e06497b5b4f392845e0d04dde8374fd244fa2832dd0e5c27bfd99cb0342" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ "anchor-lang", "anyhow", + "futures", "regex", "serde", "solana-account-decoder", "solana-client", "solana-sdk", "thiserror", + "tokio", "url", ] [[package]] name = "anchor-derive-accounts" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48daeff6781ba2f02961b0ad211feb9a2de75af345d42c62b1a252fd4dfb0724" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", + "quote 1.0.29", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", "proc-macro2 1.0.64", "quote 1.0.29", "syn 1.0.109", @@ -210,9 +216,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe2886f92c4f33ec1b2b8b2b43ca1b9070cf4929e63c7eaaa09a9f2c0d5123" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ "proc-macro2 1.0.64", "quote 1.0.29", @@ -221,9 +227,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbbe5d1c7c057c6d63b4f2f538a320e4a22111126c9966340c3d9490e2f15ed1" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -232,21 +238,23 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", "arrayref", "base64 0.13.1", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bytemuck", + "getrandom 0.2.10", "solana-program", "thiserror", ] [[package]] name = "anchor-spl" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc8066fbd45e0e03edf48342c79265aa34ca76cefeace48ef6c402b6946665" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ "anchor-lang", "solana-program", @@ -257,18 +265,18 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cb31fe143aedb36fc41409ea072aa0b840cbea727e62eb2ff6e7b6cea036ff" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", - "bs58 0.3.1", + "bs58 0.5.0", "heck", "proc-macro2 1.0.64", "quote 1.0.29", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.7", "syn 1.0.109", "thiserror", ] @@ -303,6 +311,129 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint 0.4.3", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.29", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.3", + "num-traits", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.3", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + [[package]] name = "arrayref" version = "0.3.7" @@ -321,6 +452,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + [[package]] name = "asn1-rs" version = "0.5.2" @@ -366,6 +503,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -417,12 +565,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base64" version = "0.12.3" @@ -462,12 +604,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - [[package]] name = "bitmaps" version = "2.1.0" @@ -641,15 +777,18 @@ dependencies = [ [[package]] name = "bs58" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] [[package]] name = "bumpalo" @@ -691,9 +830,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] @@ -771,16 +910,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "2.34.0" @@ -789,7 +918,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags 1.3.2", + "bitflags", "strsim 0.8.0", "textwrap 0.11.0", "unicode-width", @@ -803,7 +932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags 1.3.2", + "bitflags", "clap_lex", "indexmap", "once_cell", @@ -822,19 +951,25 @@ dependencies = [ ] [[package]] -name = "common-multipart-rfc7578" -version = "0.6.0" +name = "combine" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baee326bc603965b0f26583e1ecd7c111c41b49bd92a344897476a352798869" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" dependencies = [ - "bytes", - "futures-core", - "futures-util", - "http", - "mime", - "mime_guess", - "rand 0.8.5", - "thiserror", + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +dependencies = [ + "crossbeam-utils", ] [[package]] @@ -898,15 +1033,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - [[package]] name = "cpufeatures" version = "0.2.9" @@ -1011,7 +1137,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", + "cipher", ] [[package]] @@ -1028,6 +1154,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.64", + "quote 1.0.29", + "strsim 0.10.0", + "syn 2.0.25", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote 1.0.29", + "syn 2.0.25", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -1047,26 +1208,6 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" -[[package]] -name = "data-encoding-macro" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" -dependencies = [ - "data-encoding", - "syn 1.0.109", -] - [[package]] name = "der" version = "0.5.1" @@ -1096,6 +1237,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.109", +] + [[package]] name = "dialoguer" version = "0.10.4" @@ -1128,47 +1280,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "displaydoc" version = "0.2.4" @@ -1203,6 +1314,12 @@ dependencies = [ "syn 0.15.44", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "eager" version = "0.1.0" @@ -1267,39 +1384,27 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ "proc-macro2 1.0.64", "quote 1.0.29", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] -name = "enum_dispatch" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" -dependencies = [ - "once_cell", - "proc-macro2 1.0.64", - "quote 1.0.29", - "syn 2.0.25", -] - -[[package]] -name = "env_logger" -version = "0.9.3" +name = "env_logger" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ @@ -1490,15 +1595,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1546,6 +1642,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "h2" version = "0.3.20" @@ -1565,6 +1672,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1731,19 +1847,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-multipart-rfc7578" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb2cf73e96e9925f4bed948e763aa2901c2f1a3a5f713ee41917433ced6671" -dependencies = [ - "bytes", - "common-multipart-rfc7578", - "futures-core", - "http", - "hyper", -] - [[package]] name = "hyper-rustls" version = "0.23.2" @@ -1780,6 +1883,12 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.4.0" @@ -1818,23 +1927,15 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", - "lazy_static", + "instant", "number_prefix", - "regex", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", + "portable-atomic", + "unicode-width", ] [[package]] @@ -1857,49 +1958,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ipfs-api-backend-hyper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9d131b408b4caafe1e7c00d410a09ad3eb7e3ab68690cf668e86904b2176b4" -dependencies = [ - "async-trait", - "base64 0.13.1", - "bytes", - "futures", - "http", - "hyper", - "hyper-multipart-rfc7578", - "ipfs-api-prelude", - "thiserror", -] - -[[package]] -name = "ipfs-api-prelude" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b74065805db266ba2c6edbd670b23c4714824a955628472b2e46cc9f3a869cb" -dependencies = [ - "async-trait", - "bytes", - "cfg-if", - "common-multipart-rfc7578", - "dirs", - "futures", - "http", - "multiaddr", - "multibase", - "serde", - "serde_json", - "serde_urlencoded", - "thiserror", - "tokio", - "tokio-util", - "tracing", - "typed-builder", - "walkdir", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -1985,7 +2043,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec 0.5.2", - "bitflags 1.3.2", + "bitflags", "cfg-if", "ryu", "static_assertions", @@ -1997,27 +2055,6 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.4.0", - "libc", - "redox_syscall 0.4.1", -] - [[package]] name = "libsecp256k1" version = "0.6.0" @@ -2066,12 +2103,6 @@ dependencies = [ "libsecp256k1-core", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2114,9 +2145,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] @@ -2148,16 +2179,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2195,71 +2216,17 @@ dependencies = [ "winapi", ] -[[package]] -name = "multiaddr" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "log", - "multibase", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" -dependencies = [ - "core2", - "multihash-derive", - "unsigned-varint", -] - -[[package]] -name = "multihash-derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" -dependencies = [ - "proc-macro-crate 1.1.3", - "proc-macro-error", - "proc-macro2 1.0.64", - "quote 1.0.29", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", "libc", - "memoffset 0.6.5", + "memoffset 0.7.1", + "pin-utils", ] [[package]] @@ -2349,6 +2316,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -2403,23 +2381,44 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.11" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.7.1", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2 1.0.64", "quote 1.0.29", - "syn 1.0.109", + "syn 2.0.25", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] @@ -2509,6 +2508,12 @@ dependencies = [ "windows-targets 0.48.1", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -2580,6 +2585,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "polyval" version = "0.5.3" @@ -2592,6 +2603,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2617,30 +2634,6 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2 1.0.64", - "quote 1.0.29", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2 1.0.64", - "quote 1.0.29", - "version_check", -] - [[package]] name = "proc-macro2" version = "0.4.30" @@ -2690,16 +2683,15 @@ dependencies = [ [[package]] name = "quinn" -version = "0.8.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" dependencies = [ "bytes", - "futures-channel", - "futures-util", - "fxhash", + "pin-project-lite", "quinn-proto", "quinn-udp", + "rustc-hash", "rustls", "thiserror", "tokio", @@ -2709,17 +2701,16 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.8.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "fxhash", "rand 0.8.5", "ring", + "rustc-hash", "rustls", "rustls-native-certs", - "rustls-pemfile 0.2.1", "slab", "thiserror", "tinyvec", @@ -2729,16 +2720,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.1.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ - "futures-util", "libc", "quinn-proto", "socket2", - "tokio", "tracing", + "windows-sys 0.42.0", ] [[package]] @@ -2878,9 +2868,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", @@ -2894,7 +2884,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] @@ -2903,27 +2893,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" -dependencies = [ - "getrandom 0.2.10", - "libredox", - "thiserror", + "bitflags", ] [[package]] @@ -2989,7 +2959,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.3", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -3050,14 +3020,23 @@ dependencies = [ [[package]] name = "rpassword" -version = "6.0.1" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", - "serde", - "serde_json", - "winapi", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", ] [[package]] @@ -3078,6 +3057,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -3108,7 +3093,7 @@ version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags 1.3.2", + "bitflags", "errno", "io-lifetimes", "libc", @@ -3135,20 +3120,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "rustls-pemfile" version = "1.0.3" @@ -3170,15 +3146,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "schannel" version = "0.1.22" @@ -3194,6 +3161,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", +] + [[package]] name = "sct" version = "0.7.0" @@ -3216,7 +3203,7 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -3301,15 +3288,25 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.8.26" +name = "serde_with" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ - "indexmap", - "ryu", "serde", - "yaml-rust", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] @@ -3442,12 +3439,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec36d5c2ec5469dacc4fd2bdfcaaf4b253a4814d86d88686d50fd407cf7b3330" +checksum = "5c68b2beaa5b5b4aa9d182568c020c111b9e29e52c7f74cc9eb77cc27f003fa9" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.5", "bincode", "bs58 0.4.0", "bv", @@ -3458,23 +3455,23 @@ dependencies = [ "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", - "solana-vote-program", "spl-token", "spl-token-2022", + "spl-token-metadata-interface", "thiserror", "zstd", ] [[package]] name = "solana-address-lookup-table-program" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf23fb5a4ff0e902bf94fbc63ba51b10b1f86c6bca18574b583ec3baf6383a0b" +checksum = "c0eee296b5ca0955429bd2df3272cb7ba0bb5c5886a4a5fdfe5cde97b5698c21" dependencies = [ "bincode", "bytemuck", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "rustc_version", "serde", @@ -3488,9 +3485,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e6537858df8634c4cf7e9e8a84a9f1967b8983bcb4e4833cad3ae200b7170d" +checksum = "cdf24f58d924826a9fe4a147b8471de117b3eb330b58286c9c344126f19f7e18" dependencies = [ "chrono", "clap 2.34.0", @@ -3504,81 +3501,44 @@ dependencies = [ "url", ] -[[package]] -name = "solana-cli-config" -version = "1.14.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2234deff9765c25fc6189322689d1b702490f4389680dfdef0af582856041844" -dependencies = [ - "dirs-next", - "lazy_static", - "serde", - "serde_derive", - "serde_yaml", - "solana-clap-utils", - "solana-sdk", - "url", -] - [[package]] name = "solana-client" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e706f894fe68d518c125e27a7186d07a56f5b179d67c8fb2cf719cef8e1ee7cd" +checksum = "0acc301c1e696f22d0984e6b3be2a2dfb474829e3e1426ea0c6191ad121df3e2" dependencies = [ - "async-mutex", "async-trait", - "base64 0.13.1", "bincode", - "bs58 0.4.0", - "bytes", - "clap 2.34.0", - "crossbeam-channel", - "enum_dispatch", "futures", "futures-util", "indexmap", "indicatif", - "itertools", - "jsonrpc-core", - "lazy_static", "log", "quinn", - "quinn-proto", "rand 0.7.3", - "rand_chacha 0.2.2", "rayon", - "reqwest", - "rustls", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-clap-utils", - "solana-faucet", + "solana-connection-cache", "solana-measure", "solana-metrics", - "solana-net-utils", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", "solana-sdk", "solana-streamer", - "solana-transaction-status", - "solana-version", - "solana-vote-program", - "spl-token-2022", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", "thiserror", "tokio", - "tokio-stream", - "tokio-tungstenite", - "tungstenite", - "url", ] [[package]] name = "solana-config-program" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c2d438fdfa4f5774c70fb0eeb2325caa073c838a229ef6a876c65c8703294" +checksum = "8e4f62294a49dae0338e47503f55bce1d9469ca6555b2bed5547d39dc519c869" dependencies = [ "bincode", "chrono", @@ -3589,38 +3549,35 @@ dependencies = [ ] [[package]] -name = "solana-faucet" -version = "1.14.16" +name = "solana-connection-cache" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ba3e5e2acc09b2fcb54957d05c0943b194d48f825f879fc2cf5d255e2608b05" +checksum = "0655f6d2541e6b934f701fb6f22a2bbd29211b741447a88b551b7bffff84c1b4" dependencies = [ + "async-trait", "bincode", - "byteorder", - "clap 2.34.0", - "crossbeam-channel", + "futures-util", + "indexmap", "log", - "serde", - "serde_derive", - "solana-clap-utils", - "solana-cli-config", - "solana-logger", + "rand 0.7.3", + "rayon", + "rcgen", + "solana-measure", "solana-metrics", "solana-sdk", - "solana-version", - "spl-memo", "thiserror", "tokio", ] [[package]] name = "solana-frozen-abi" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b4953578272ac0fadec245e85e83ae86454611f0c0a7fff7d906835124bdcf" +checksum = "7e77bfd59ad4e64c0f06fbcbe16d58f3a40bdbcc050fb78fc7134a55a5c290b9" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "blake3", - "block-buffer 0.9.0", + "block-buffer 0.10.4", "bs58 0.4.0", "bv", "byteorder", @@ -3628,7 +3585,6 @@ dependencies = [ "either", "generic-array", "getrandom 0.1.16", - "hashbrown 0.12.3", "im", "lazy_static", "log", @@ -3648,21 +3604,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57892538250428ad3dc3cbe05f6cd75ad14f4f16734fcb91bc7cd5fbb63d6315" +checksum = "992b866b9f0510fd3c290afe6a37109ae8d15b74fa24e3fb6d164be2971ee94f" dependencies = [ "proc-macro2 1.0.64", "quote 1.0.29", "rustc_version", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "solana-logger" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06aa701c49493e93085dd1e800c05475baca15a9d4d527b59794f2ed0b66e055" +checksum = "0278658cd4fb5405932452bf20f7df496ce8b9e9cf66a7d1c621bbe3b01fe297" dependencies = [ "env_logger", "lazy_static", @@ -3671,9 +3627,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7300180957635b33c88bd6844a5dff4f1f5c6352d0861ee7845eab84185aa6a" +checksum = "4d1650f3e76bedbaa149c73f145dbd605e7020cf77b3f9e24c8918fca4220bc4" dependencies = [ "log", "solana-sdk", @@ -3681,9 +3637,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2960981c4bbe9177dafe986542ba11a10afcae320f4201aa809cd5b650e202e1" +checksum = "7e80d0e32083dde7f76ad8f30c2b71c0efcfce84fa7f6593adf91f4a5cfeb067" dependencies = [ "crossbeam-channel", "gethostname", @@ -3695,9 +3651,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31062ce5ddceb92bdb78df2eaf33e9889c1519e8a8d89baa783e2d08a76cfc62" +checksum = "4d850a46e56a676f654109a7277bd61abb76c7b29b2ca6aa24a4b61194eb9d3b" dependencies = [ "bincode", "clap 3.2.25", @@ -3717,11 +3673,11 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b2b84a3d7a24523b9117c0ae4608f1e561ae492638acea2bb2960a0c0c8eb6" +checksum = "32ccdeb24c7e53733e7a929b5e2d717c3f428cb131861946de6065ffccd67228" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bincode", "bv", "caps", @@ -3744,16 +3700,21 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f99052873619df68913cb8e92e28ff251a5483828925e87fa97ba15a9cbad51" +checksum = "aa5ac2110c5b927d6114b2d4f32af7f749fde0e6fd8f34777407ce89d66630be" dependencies = [ - "base64 0.13.1", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "array-bytes", + "base64 0.21.5", "bincode", - "bitflags 1.3.2", + "bitflags", "blake3", + "borsh 0.10.3", "borsh 0.9.3", - "borsh-derive 0.9.3", "bs58 0.4.0", "bv", "bytemuck", @@ -3768,8 +3729,9 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset 0.6.5", - "num-derive", + "memoffset 0.9.0", + "num-bigint 0.4.3", + "num-derive 0.3.3", "num-traits", "parking_lot 0.12.1", "rand 0.7.3", @@ -3793,20 +3755,20 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d57d0b6ef85b50f9ad6b9a75fc9d5051dc26f8b1a4ddf03656e3d603e139eb3" +checksum = "02d1f727139019e6a5872ae3149971f2f7928a4841d27284a8787ab23dddcb10" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "bincode", "eager", "enum-iterator", "itertools", "libc", - "libloading", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", + "percentage", "rand 0.7.3", "rustc_version", "serde", @@ -3815,49 +3777,164 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-sdk", - "thiserror", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1406ced27eb3206895467921bc3769679fd2b7948fcadc1916a498a8cb086b" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c559626657e5ad67b051028d849dbe0c80d605e259fdd7aac9fd985b0ec3ac" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "quinn-udp", + "rcgen", + "rustls", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b576ba60c11f0284bccee36ec472078e7213866a81c3fd34796223a1617ee21" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed696d9a9f9497a3d9996b2b4f0610946ddfc8fab0403e4f05a8acee39f4ae48" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive 0.3.3", + "num-traits", + "parking_lot 0.12.1", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-rpc-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc1e655345b8f83edb5332b5c29ac803d9fbf239ded75ae83262934f15f6cec" +dependencies = [ + "async-trait", + "base64 0.21.5", + "bincode", + "bs58 0.4.0", + "indicatif", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", ] [[package]] -name = "solana-rayon-threadlimit" -version = "1.14.16" +name = "solana-rpc-client-api" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e1d068ba8080ca1e41703c600cc9b263ff7ce26b6811cd83221723ae0d10ae" +checksum = "07b3304a4fe120d4882a1449efd8a686d01ca3bd81d3d967d4643f93c722dc26" dependencies = [ - "lazy_static", - "num_cpus", + "base64 0.21.5", + "bs58 0.4.0", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022", + "thiserror", ] [[package]] -name = "solana-remote-wallet" -version = "1.14.16" +name = "solana-rpc-client-nonce-utils" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661cd486da7419134663f1c3684d71d3fd6d13b8e557da23070f4c920b1d2baa" +checksum = "2c00a55de718e180ad8dc27d90725d97ad14658c7299b8dbe2e909c464a4e434" dependencies = [ - "console", - "dialoguer", - "log", - "num-derive", - "num-traits", - "parking_lot 0.12.1", - "qstring", - "semver", + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", "solana-sdk", "thiserror", - "uriparse", ] [[package]] name = "solana-sdk" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb47da3e18cb669f6ace0b40cee0610e278903783e0c9f7fce1e1beb881a1b7" +checksum = "dbe17a1ce6082979e7beffb7cadd7051e29d873594622a11a7d0a4c2dd4b7934" dependencies = [ "assert_matches", - "base64 0.13.1", + "base64 0.21.5", "bincode", - "bitflags 1.3.2", - "borsh 0.9.3", + "bitflags", + "borsh 0.10.3", "bs58 0.4.0", "bytemuck", "byteorder", @@ -3874,8 +3951,9 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive", + "num-derive 0.3.3", "num-traits", + "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", "rand 0.7.3", @@ -3886,6 +3964,7 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", + "serde_with", "sha2 0.10.7", "sha3 0.10.8", "solana-frozen-abi", @@ -3900,23 +3979,25 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d41a09b9cecd0a4df63c78a192adee99ebf2d3757c19713a68246e1d9789c7c" +checksum = "9fe4363d2503a75325ec94aa18b063574edb3454d38840e01c5af477b3b0689d" dependencies = [ "bs58 0.4.0", "proc-macro2 1.0.64", "quote 1.0.29", "rustversion", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "solana-streamer" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ffb2c6918eda6aa8b18219790b7a4e4d74914aeae97cb1a0e09fdb943b18cc" +checksum = "ca0cac530e3248c7b43306c867e238aad555a9ed89095f0e37a5fef64ff0520e" dependencies = [ + "async-channel", + "bytes", "crossbeam-channel", "futures-util", "histogram", @@ -3929,6 +4010,8 @@ dependencies = [ "percentage", "pkcs8", "quinn", + "quinn-proto", + "quinn-udp", "rand 0.7.3", "rcgen", "rustls", @@ -3940,16 +4023,56 @@ dependencies = [ "x509-parser", ] +[[package]] +name = "solana-thin-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbeb0a2cf605e9d6272917d47873f8b056e9df164efb0853762eb3a8b43004b" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cebfa0c1710c74ed8737e65a978393f2a8105f21f544529e2260ac8dbde63d" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap", + "indicatif", + "log", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + [[package]] name = "solana-transaction-status" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1a6ee396d436ae4ee36350043c3cb34ad66b7515f045c1e5006695559d88ac" +checksum = "50e2edc23c671221e431712dbf03ca20eee57dc5527935eb745824d7257e314c" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.5", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bs58 0.4.0", "lazy_static", "log", @@ -3958,10 +4081,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-address-lookup-table-program", - "solana-measure", - "solana-metrics", "solana-sdk", - "solana-vote-program", "spl-associated-token-account", "spl-memo", "spl-token", @@ -3969,11 +4089,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-udp-client" +version = "1.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b858f113b49dc57df48999870898363ec7c5262c1aebd70d0a40eabebf7807" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + [[package]] name = "solana-version" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d177dc97f7facd8fbc3148f3d44a9ff5bbbc72c1db7e2889dc4911ae641cea8a" +checksum = "27d3a590c0fd2a65eb84d30e7a4daaf1da508855c4533bebacfe2acc949a22c1" dependencies = [ "log", "rustc_version", @@ -3987,13 +4122,13 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6280815d28c90ea8f51c8eb2026258e8693cab5a8456ee7b207a791b20f9c576" +checksum = "1f485487153d8528769da669e2b174d8fd29c1b5e057dede11b9bea751b63668" dependencies = [ "bincode", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "rustc_version", "serde", @@ -4001,6 +4136,7 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-metrics", + "solana-program", "solana-program-runtime", "solana-sdk", "thiserror", @@ -4008,23 +4144,21 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.14.16" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab38abd096769f79fd8e3fe8465070f04742395db724606a5263c8ebc215567" +checksum = "e0c83eec033c30c95938905374292fb8a3559dd3dfb36d715624e5f8f41b078e" dependencies = [ "aes-gcm-siv", - "arrayref", - "base64 0.13.1", + "base64 0.21.5", "bincode", "bytemuck", "byteorder", - "cipher 0.4.4", "curve25519-dalek", "getrandom 0.1.16", "itertools", "lazy_static", "merlin", - "num-derive", + "num-derive 0.3.3", "num-traits", "rand 0.7.3", "serde", @@ -4037,6 +4171,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana_rbpf" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + [[package]] name = "spin" version = "0.5.2" @@ -4055,13 +4208,13 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "1.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc000f0fdf1f12f99d77d398137c1751345b18c88258ce0f99b7872cf6c9bd6" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" dependencies = [ "assert_matches", - "borsh 0.9.3", - "num-derive", + "borsh 0.10.3", + "num-derive 0.4.1", "num-traits", "solana-program", "spl-token", @@ -4069,48 +4222,182 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" +dependencies = [ + "quote 1.0.29", + "spl-discriminator-syn", + "syn 2.0.25", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "sha2 0.10.7", + "syn 2.0.25", + "thiserror", +] + [[package]] name = "spl-memo" -version = "3.0.1" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" +dependencies = [ + "num-derive 0.4.1", + "num-traits", + "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "sha2 0.10.7", + "syn 2.0.25", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" dependencies = [ + "bytemuck", "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", ] [[package]] name = "spl-token" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.3.3", "num-traits", - "num_enum", + "num_enum 0.6.1", "solana-program", "thiserror", ] [[package]] name = "spl-token-2022" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edb869dbe159b018f17fb9bfa67118c30f232d7f54a73742bc96794dff77ed8" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.4.1", "num-traits", - "num_enum", + "num_enum 0.7.1", "solana-program", "solana-zk-token-sdk", "spl-memo", + "spl-pod", "spl-token", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", "thiserror", ] +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4211,7 +4498,7 @@ dependencies = [ [[package]] name = "switchboard-common" -version = "0.10.1" +version = "0.11.0" dependencies = [ "async-trait", "base64 0.21.5", @@ -4219,22 +4506,17 @@ dependencies = [ "futures", "getrandom 0.2.10", "hex", - "ipfs-api-backend-hyper", - "ipfs-api-prelude", - "libc", "log", - "proc-macro2 1.0.64", - "quote 1.0.29", "serde", "serde_json", "sgx-quote", "sha2 0.10.7", - "syn 2.0.25", + "sha3 0.10.8", ] [[package]] name = "switchboard-solana" -version = "0.27.43" +version = "0.29.71" dependencies = [ "anchor-client", "anchor-lang", @@ -4267,8 +4549,9 @@ dependencies = [ [[package]] name = "switchboard-solana-macros" -version = "0.2.0" +version = "0.2.1" dependencies = [ + "dotenvy", "proc-macro2 1.0.64", "quote 1.0.29", "syn 2.0.25", @@ -4613,32 +4896,12 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "typed-builder" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" -dependencies = [ - "proc-macro2 1.0.64", - "quote 1.0.29", - "syn 1.0.109", -] - [[package]] name = "typenum" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.13" @@ -4695,10 +4958,13 @@ dependencies = [ ] [[package]] -name = "unsigned-varint" -version = "0.7.2" +name = "unreachable" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] [[package]] name = "untrusted" @@ -4788,14 +5054,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "walkdir" -version = "2.4.0" +name = "void" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "want" @@ -4959,6 +5221,21 @@ dependencies = [ "windows-targets 0.48.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -5127,15 +5404,6 @@ dependencies = [ "time 0.3.23", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yasna" version = "0.5.2" diff --git a/examples/functions/04_randomness_callback/switchboard-function/Cargo.toml b/examples/functions/04_randomness_callback/switchboard-function/Cargo.toml index 5c86bf12a..ec347bba8 100644 --- a/examples/functions/04_randomness_callback/switchboard-function/Cargo.toml +++ b/examples/functions/04_randomness_callback/switchboard-function/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" [dependencies] tokio = "^1" futures = "0.3" -# switchboard-solana = "0.28.43" +# switchboard-solana = "0.29.70" switchboard-solana = { path = "../../../../rust/switchboard-solana", features = [ "macros", ] } diff --git a/javascript/solana.js/package.json b/javascript/solana.js/package.json index d83cf447c..a34ec1ac3 100644 --- a/javascript/solana.js/package.json +++ b/javascript/solana.js/package.json @@ -175,7 +175,7 @@ "@coral-xyz/borsh": "^0.28.0", "@solana/spl-token": "^0.3.8", "@solana/web3.js": "^1.78.3", - "@switchboard-xyz/common": "^2.3.9", + "@switchboard-xyz/common": "^", "cron-validator": "^1.3.1", "cross-fetch": "^4.0.0", "dotenv": "^16.3.1", diff --git a/rust/switchboard-solana/Cargo.anchor27.lock b/rust/switchboard-solana/Cargo.anchor27.lock index dba9bf2e3..2eed129ec 100644 --- a/rust/switchboard-solana/Cargo.anchor27.lock +++ b/rust/switchboard-solana/Cargo.anchor27.lock @@ -4477,7 +4477,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.27.70" +version = "0.27.71" dependencies = [ "anchor-client", "anchor-lang", diff --git a/rust/switchboard-solana/Cargo.anchor27.toml b/rust/switchboard-solana/Cargo.anchor27.toml index 4b2beaa39..8980f55f7 100644 --- a/rust/switchboard-solana/Cargo.anchor27.toml +++ b/rust/switchboard-solana/Cargo.anchor27.toml @@ -1,6 +1,6 @@ [package] name = "switchboard-solana" -version = "0.27.70" +version = "0.27.71" edition = "2021" resolver = "2" description = "A Rust library to interact with Switchboard accounts." diff --git a/rust/switchboard-solana/Cargo.anchor28.lock b/rust/switchboard-solana/Cargo.anchor28.lock index a13dadb53..761b587e8 100644 --- a/rust/switchboard-solana/Cargo.anchor28.lock +++ b/rust/switchboard-solana/Cargo.anchor28.lock @@ -5115,7 +5115,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.28.70" +version = "0.28.71" dependencies = [ "anchor-client", "anchor-lang", diff --git a/rust/switchboard-solana/Cargo.anchor28.toml b/rust/switchboard-solana/Cargo.anchor28.toml index c7a9a81c8..80cef3c97 100644 --- a/rust/switchboard-solana/Cargo.anchor28.toml +++ b/rust/switchboard-solana/Cargo.anchor28.toml @@ -1,6 +1,6 @@ [package] name = "switchboard-solana" -version = "0.28.70" +version = "0.28.71" edition = "2021" resolver = "2" description = "A Rust library to interact with Switchboard accounts." diff --git a/rust/switchboard-solana/Cargo.lock b/rust/switchboard-solana/Cargo.lock index 630ab5948..a4492740c 100644 --- a/rust/switchboard-solana/Cargo.lock +++ b/rust/switchboard-solana/Cargo.lock @@ -5040,7 +5040,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.29.70" +version = "0.29.71" dependencies = [ "anchor-client", "anchor-lang", diff --git a/rust/switchboard-solana/Cargo.toml b/rust/switchboard-solana/Cargo.toml index 6a611b72e..f22a3cd60 100644 --- a/rust/switchboard-solana/Cargo.toml +++ b/rust/switchboard-solana/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "switchboard-solana" -version = "0.29.70" +version = "0.29.71" edition = "2021" resolver = "2" description = "A Rust library to interact with Switchboard accounts." diff --git a/rust/switchboard-solana/src/attestation_program/accounts/function.rs b/rust/switchboard-solana/src/attestation_program/accounts/function.rs index 52687f3fe..fb3214486 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/function.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/function.rs @@ -371,32 +371,192 @@ impl FunctionAccountData { /// /// # Arguments /// - /// * `function_account_info` - Solana AccountInfo for a FunctionAccountData - /// * `signer` - Solana AccountInfo for a signer - pub fn validate_signer<'a>( - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, - ) -> anchor_lang::Result { + /// * `signer` - Solana AccountInfo for a signer\ + #[deprecated( + since = "0.28.35", + note = "please use a `FunctionRoutineAccountData` for all scheduled executions" + )] + pub fn validate_signer<'a>(&self, signer: &AccountInfo<'a>) -> anchor_lang::Result { // deserialize accounts and verify the owner - let function_loader = - AccountLoader::<'_, FunctionAccountData>::try_from(function_account_info)?; - let func = function_loader.load()?; - // TODO: validate the seeds and bump // validate the enclaves enclave is not empty - if func.enclave.mr_enclave == [0u8; 32] { + if self.enclave.mr_enclave == [0u8; 32] { return Ok(false); } // validate the enclaves delegated signer matches - if func.enclave.enclave_signer != signer.key() { + if self.enclave.enclave_signer != signer.key() { return Ok(false); } // validate the function was verified and it is not expired - Ok(func.enclave.is_verified(&Clock::get()?)) + Ok(self.enclave.is_verified(&Clock::get()?)) + } + + /// Validates that the provided request is assigned to the same `AttestationQueueAccountData` as the function and the + /// provided `enclave_signer` matches the `enclave_signer` stored in the request's `active_request` field. + /// + /// # Arguments + /// + /// * `request` - The `FunctionRequestAccountData` being validated. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. + /// + /// # Errors + /// + /// Returns an error if: + /// * the function and request have different attestation queues + /// * the request's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction + /// + /// # Returns + /// + /// Returns `Ok(true)` if the validation succeeds, `Ok(false)` otherwise. + /// + /// # Examples + /// + /// ```ignore + /// use switchboard_solana::FunctionRequestAccountData; + /// + /// #[derive(Accounts)] + /// pub struct Settle<'info> { + /// // YOUR PROGRAM ACCOUNTS + /// #[account( + /// mut, + /// has_one = switchboard_request, + /// )] + /// pub user: AccountLoader<'info, UserState>, + /// + /// // SWITCHBOARD ACCOUNTS + /// #[account( + /// constraint = function.load()?.validate_request( + /// &request, + /// &enclave_signer.to_account_info() + /// )? + /// )] + /// pub function: AccountLoader<'info, FunctionAccountData>, + /// #[account( + /// has_one = function, + /// )] + /// pub request: Box>, + /// pub enclave_signer: Signer<'info>, + /// } + /// ``` + pub fn validate_request( + &self, + request: &FunctionRequestAccountData, + enclave_signer: &AccountInfo, + ) -> anchor_lang::Result { + if request.attestation_queue != self.attestation_queue { + msg!( + "AttestationQueueMismatch: fn: {}, request: {}", + self.attestation_queue, + request.attestation_queue + ); + return Ok(false); + } + + if request.active_request.enclave_signer != enclave_signer.key() { + msg!( + "SignerMismatch: expected {}, received {}", + request.active_request.enclave_signer, + enclave_signer.key() + ); + return Ok(false); + } + + // Verify the enclave signer signed the transaction + if enclave_signer.signer_key().is_none() { + msg!( + "enclave_signer ({}) did not sign the transaction", + enclave_signer.key() + ); + return Ok(false); + } + + Ok(true) + } + + /// Validates that the provided routine is assigned to the same `AttestationQueueAccountData` as the function and the + /// provided `enclave_signer` matches the `enclave_signer` stored in the routine's `enclave_signer` field. + /// + /// # Arguments + /// + /// * `routine` - The `FunctionRoutineAccountData` being validated. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. + /// + /// # Errors + /// + /// Returns an error if: + /// * the function and routine have different attestation queues + /// * the routine's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction + /// + /// # Returns + /// + /// Returns `Ok(true)` if the validation succeeds, `Ok(false)` otherwise. + /// + /// # Examples + /// + /// ```ignore + /// use switchboard_solana::FunctionRoutineAccountData; + /// + /// #[derive(Accounts)] + /// pub struct Settle<'info> { + /// // YOUR PROGRAM ACCOUNTS + /// #[account( + /// mut, + /// has_one = switchboard_routine, + /// )] + /// pub user: AccountLoader<'info, UserState>, + /// + /// // SWITCHBOARD ACCOUNTS + /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, + /// #[account( + /// constraint = switchboard_routine.validate_signer( + /// &switchboard_function.to_account_info(), + /// &enclave_signer.to_account_info() + /// )? + /// )] + /// pub switchboard_routine: Box>, + /// pub enclave_signer: Signer<'info>, + /// } + /// ``` + pub fn validate_routine( + &self, + routine: &FunctionRoutineAccountData, + enclave_signer: &AccountInfo, + ) -> anchor_lang::Result { + if routine.attestation_queue != self.attestation_queue { + msg!( + "AttestationQueueMismatch: fn: {}, routine: {}", + self.attestation_queue, + routine.attestation_queue + ); + return Ok(false); + } + + // validate the enclaves delegated signer matches + if routine.enclave_signer != enclave_signer.key() { + msg!( + "EnclaveSignerMismatch: expected {}, received {}", + routine.enclave_signer, + enclave_signer.key() + ); + return Ok(false); + } + + // Verify the enclave signer signed the transaction + if enclave_signer.signer_key().is_none() { + msg!( + "enclave_signer ({}) did not sign the transaction", + enclave_signer.key() + ); + return Ok(false); + } + + Ok(true) } #[deprecated( diff --git a/rust/switchboard-solana/src/attestation_program/accounts/request.anchor27.rs b/rust/switchboard-solana/src/attestation_program/accounts/request.anchor27.rs index 130b770a3..373061180 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/request.anchor27.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/request.anchor27.rs @@ -146,8 +146,6 @@ where _ebuf: deserialize_round_ebuf_slice(buf)?, }) } - - } // #[account] @@ -297,8 +295,6 @@ where _ebuf: deserialize_ebuf_slice(buf)?, }) } - - } impl anchor_lang::AccountSerialize for FunctionRequestAccountData { @@ -391,18 +387,22 @@ impl FunctionRequestAccountData { true } - /// Validates the given `signer` account against the `function_account_info` and the `active_request` - /// stored in this `FunctionRequestAccountData`. + /// Validates that the provided request is assigned to the same `AttestationQueueAccountData` as the function and the + /// provided `enclave_signer` matches the `enclave_signer` stored in the request's `active_request` field. /// /// # Arguments /// - /// * `function_account_info` - The `AccountInfo` of the function account. - /// * `signer` - The `AccountInfo` of the account to validate. + /// * `request` - The `FunctionRequestAccountData` being validated. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. /// /// # Errors /// - /// Returns an error if the function account data cannot be loaded or if the `signer` account does not match - /// the expected `enclave_signer` stored in the `active_request`. + /// Returns an error if: + /// * the function cannot be deserialized + /// * the function is not assigned to the request + /// * the function and request have different attestation queues + /// * the request's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction /// /// # Returns /// @@ -426,7 +426,7 @@ impl FunctionRequestAccountData { /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, /// #[account( /// constraint = switchboard_request.validate_signer( - /// &switchboard_function.to_account_info(), + /// &switchboard_function, /// &enclave_signer.to_account_info() /// )? /// )] @@ -436,12 +436,9 @@ impl FunctionRequestAccountData { /// ``` pub fn validate_signer<'a>( &self, - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, + function_loader: &AccountLoader<'a, FunctionAccountData>, + enclave_signer: &AccountInfo<'a>, ) -> anchor_lang::Result { - let function_loader = - AccountLoader::<'a, FunctionAccountData>::try_from(function_account_info)?; - if self.function != function_loader.key() { msg!( "FunctionMismatch: expected {}, received {}", @@ -451,19 +448,9 @@ impl FunctionRequestAccountData { return Ok(false); } - function_loader.load()?; // check owner/discriminator - - // validate the enclaves delegated signer matches - if self.active_request.enclave_signer != signer.key() { - msg!( - "SignerMismatch: expected {}, received {}", - self.active_request.enclave_signer, - signer.key() - ); - return Ok(false); - } + let func = function_loader.load()?; // check owner/discriminator - Ok(true) + func.validate_request(self, enclave_signer) } } diff --git a/rust/switchboard-solana/src/attestation_program/accounts/request.anchor28.rs b/rust/switchboard-solana/src/attestation_program/accounts/request.anchor28.rs index 567eabec4..344fdafd0 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/request.anchor28.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/request.anchor28.rs @@ -236,18 +236,22 @@ impl FunctionRequestAccountData { true } - /// Validates the given `signer` account against the `function_account_info` and the `active_request` - /// stored in this `FunctionRequestAccountData`. + /// Validates that the provided request is assigned to the same `AttestationQueueAccountData` as the function and the + /// provided `enclave_signer` matches the `enclave_signer` stored in the request's `active_request` field. /// /// # Arguments /// - /// * `function_account_info` - The `AccountInfo` of the function account. - /// * `signer` - The `AccountInfo` of the account to validate. + /// * `request` - The `FunctionRequestAccountData` being validated. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. /// /// # Errors /// - /// Returns an error if the function account data cannot be loaded or if the `signer` account does not match - /// the expected `enclave_signer` stored in the `active_request`. + /// Returns an error if: + /// * the function cannot be deserialized + /// * the function is not assigned to the request + /// * the function and request have different attestation queues + /// * the request's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction /// /// # Returns /// @@ -271,7 +275,7 @@ impl FunctionRequestAccountData { /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, /// #[account( /// constraint = switchboard_request.validate_signer( - /// &switchboard_function.to_account_info(), + /// &switchboard_function, /// &enclave_signer.to_account_info() /// )? /// )] @@ -281,33 +285,21 @@ impl FunctionRequestAccountData { /// ``` pub fn validate_signer<'a>( &self, - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, + function_loader: &AccountLoader<'a, FunctionAccountData>, + enclave_signer: &AccountInfo<'a>, ) -> anchor_lang::Result { - if self.function != function_account_info.key() { + if self.function != function_loader.key() { msg!( "FunctionMismatch: expected {}, received {}", self.function, - function_account_info.key() + function_loader.key() ); return Ok(false); } - let function_loader = - AccountLoader::<'_, FunctionAccountData>::try_from(function_account_info)?; - function_loader.load()?; // check owner/discriminator + let func = function_loader.load()?; // check owner/discriminator - // validate the enclaves delegated signer matches - if self.active_request.enclave_signer != signer.key() { - msg!( - "SignerMismatch: expected {}, received {}", - self.active_request.enclave_signer, - signer.key() - ); - return Ok(false); - } - - Ok(true) + func.validate_request(self, enclave_signer) } } diff --git a/rust/switchboard-solana/src/attestation_program/accounts/request.rs b/rust/switchboard-solana/src/attestation_program/accounts/request.rs index 29176a368..e840338ca 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/request.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/request.rs @@ -427,18 +427,22 @@ impl FunctionRequestAccountData { true } - /// Validates the given `signer` account against the `function_account_info` and the `active_request` - /// stored in this `FunctionRequestAccountData`. + /// Validates that the provided request is assigned to the same `AttestationQueueAccountData` as the function and the + /// provided `enclave_signer` matches the `enclave_signer` stored in the request's `active_request` field. /// /// # Arguments /// - /// * `function_account_info` - The `AccountInfo` of the function account. - /// * `signer` - The `AccountInfo` of the account to validate. + /// * `request` - The `FunctionRequestAccountData` being validated. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. /// /// # Errors /// - /// Returns an error if the function account data cannot be loaded or if the `signer` account does not match - /// the expected `enclave_signer` stored in the `active_request`. + /// Returns an error if: + /// * the function cannot be deserialized + /// * the function is not assigned to the request + /// * the function and request have different attestation queues + /// * the request's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction /// /// # Returns /// @@ -462,7 +466,7 @@ impl FunctionRequestAccountData { /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, /// #[account( /// constraint = switchboard_request.validate_signer( - /// &switchboard_function.to_account_info(), + /// &switchboard_function, /// &enclave_signer.to_account_info() /// )? /// )] @@ -472,12 +476,9 @@ impl FunctionRequestAccountData { /// ``` pub fn validate_signer<'a>( &self, - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, + function_loader: &AccountLoader<'a, FunctionAccountData>, + enclave_signer: &AccountInfo<'a>, ) -> anchor_lang::Result { - let function_loader = - AccountLoader::<'a, FunctionAccountData>::try_from(function_account_info)?; - if self.function != function_loader.key() { msg!( "FunctionMismatch: expected {}, received {}", @@ -487,19 +488,9 @@ impl FunctionRequestAccountData { return Ok(false); } - function_loader.load()?; // check owner/discriminator - - // validate the enclaves delegated signer matches - if self.active_request.enclave_signer != signer.key() { - msg!( - "SignerMismatch: expected {}, received {}", - self.active_request.enclave_signer, - signer.key() - ); - return Ok(false); - } + let func = function_loader.load()?; // check owner/discriminator - Ok(true) + func.validate_request(self, enclave_signer) } } diff --git a/rust/switchboard-solana/src/attestation_program/accounts/routine.anchor28.rs b/rust/switchboard-solana/src/attestation_program/accounts/routine.anchor28.rs index 74fbf24f4..e64a236ea 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/routine.anchor28.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/routine.anchor28.rs @@ -282,18 +282,22 @@ impl FunctionRoutineAccountData { self.is_disabled.into() } - /// Validates the given `signer` account against the `function_account_info` and the enclave_signer + /// Validates the given `signer` account against the `function_loader` and the enclave_signer /// stored in this `FunctionRoutineAccountData`. /// /// # Arguments /// - /// * `function_account_info` - The `AccountInfo` of the function account. - /// * `signer` - The `AccountInfo` of the account to validate. + /// * `function_loader` - The `AccountLoader` of the function account to validate. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. /// /// # Errors /// - /// Returns an error if the function account data cannot be loaded or if the `signer` account does not match - /// the expected `enclave_signer`. + /// Returns an error if: + /// * the function cannot be deserialized + /// * the routine is not assigned to the function + /// * the function and routine have different attestation queues + /// * the routine's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction /// /// # Returns /// @@ -317,7 +321,7 @@ impl FunctionRoutineAccountData { /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, /// #[account( /// constraint = switchboard_routine.validate_signer( - /// &switchboard_function.to_account_info(), + /// &switchboard_function, /// &enclave_signer.to_account_info() /// )? /// )] @@ -327,42 +331,21 @@ impl FunctionRoutineAccountData { /// ``` pub fn validate_signer<'a>( &self, - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, + function_loader: &AccountLoader<'a, FunctionAccountData>, + enclave_signer: &AccountInfo<'a>, ) -> anchor_lang::Result { - if self.function != function_account_info.key() { + if self.function != function_loader.key() { msg!( "FunctionMismatch: expected {}, received {}", self.function, - function_account_info.key() + function_loader.key() ); return Ok(false); } - let function_loader = - AccountLoader::<'_, FunctionAccountData>::try_from(function_account_info)?; let func = function_loader.load()?; // check owner/discriminator - if self.attestation_queue != func.attestation_queue { - msg!( - "QueueMismatch: expected {}, received {}", - self.attestation_queue, - func.attestation_queue - ); - return Ok(false); - } - - // validate the enclaves delegated signer matches - if self.enclave_signer != signer.key() { - msg!( - "SignerMismatch: expected {}, received {}", - self.enclave_signer, - signer.key() - ); - return Ok(false); - } - - Ok(true) + func.validate_routine(self, enclave_signer) } pub fn get_name(&self) -> String { diff --git a/rust/switchboard-solana/src/attestation_program/accounts/routine.rs b/rust/switchboard-solana/src/attestation_program/accounts/routine.rs index 2117993a0..09085e123 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/routine.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/routine.rs @@ -286,18 +286,22 @@ impl FunctionRoutineAccountData { self.is_disabled.into() } - /// Validates the given `signer` account against the `function_account_info` and the enclave_signer + /// Validates the given `signer` account against the `function_loader` and the enclave_signer /// stored in this `FunctionRoutineAccountData`. /// /// # Arguments /// - /// * `function_account_info` - The `AccountInfo` of the function account. - /// * `signer` - The `AccountInfo` of the account to validate. + /// * `function_loader` - The `AccountLoader` of the function account to validate. + /// * `enclave_signer` - The `AccountInfo` of the enclave signer to validate. /// /// # Errors /// - /// Returns an error if the function account data cannot be loaded or if the `signer` account does not match - /// the expected `enclave_signer`. + /// Returns an error if: + /// * the function cannot be deserialized + /// * the routine is not assigned to the function + /// * the function and routine have different attestation queues + /// * the routine's verified signer does not match the provided `enclave_signer` + /// * the `enclave_signer` did not sign the transaction /// /// # Returns /// @@ -321,7 +325,7 @@ impl FunctionRoutineAccountData { /// pub switchboard_function: AccountLoader<'info, FunctionAccountData>, /// #[account( /// constraint = switchboard_routine.validate_signer( - /// &switchboard_function.to_account_info(), + /// &switchboard_function, /// &enclave_signer.to_account_info() /// )? /// )] @@ -331,12 +335,9 @@ impl FunctionRoutineAccountData { /// ``` pub fn validate_signer<'a>( &self, - function_account_info: &'a AccountInfo<'a>, - signer: &AccountInfo<'a>, + function_loader: &AccountLoader<'a, FunctionAccountData>, + enclave_signer: &AccountInfo<'a>, ) -> anchor_lang::Result { - let function_loader = - AccountLoader::<'a, FunctionAccountData>::try_from(function_account_info)?; - if self.function != function_loader.key() { msg!( "FunctionMismatch: expected {}, received {}", @@ -348,26 +349,7 @@ impl FunctionRoutineAccountData { let func = function_loader.load()?; // check owner/discriminator - if self.attestation_queue != func.attestation_queue { - msg!( - "QueueMismatch: expected {}, received {}", - self.attestation_queue, - func.attestation_queue - ); - return Ok(false); - } - - // validate the enclaves delegated signer matches - if self.enclave_signer != signer.key() { - msg!( - "SignerMismatch: expected {}, received {}", - self.enclave_signer, - signer.key() - ); - return Ok(false); - } - - Ok(true) + func.validate_routine(self, enclave_signer) } pub fn get_name(&self) -> String {