From 35029683c8c838c9bb65d6ae06133d634891d084 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Thu, 27 Mar 2025 18:05:14 +0100 Subject: [PATCH 01/31] XC-288: Add getAccountInfo RPC method --- Cargo.lock | 325 ++++++++++--------------- Cargo.toml | 2 + canister/Cargo.toml | 2 + canister/src/candid_rpc/mod.rs | 15 +- canister/src/main.rs | 14 ++ canister/src/metrics/mod.rs | 2 + canister/src/rpc_client/mod.rs | 22 +- canister/src/rpc_client/sol_rpc/mod.rs | 14 +- libs/types/Cargo.toml | 2 + libs/types/src/lib.rs | 2 +- libs/types/src/solana/mod.rs | 92 +++++++ 11 files changed, 282 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72a6c5d9..983dc6a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.22" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a194f9d963d8099596278594b3107448656ba73831c9d8c783e613ce86da64" +checksum = "c0cf008e5e1a9e9e22a7d3c9a4992e21a350290069e36d8fb72304ed17e8f2d2" dependencies = [ "brotli", "flate2", @@ -363,9 +363,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.7.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" +checksum = "675f87afced0413c9bb02843499dbbd3882a237645883f71a2b59644a6d2f753" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -405,11 +405,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.7" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" dependencies = [ - "borsh-derive 1.5.7", + "borsh-derive 1.5.5", "cfg_aliases", ] @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.7" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" dependencies = [ "once_cell", "proc-macro-crate 3.3.0", @@ -515,9 +515,9 @@ checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "bytemuck_derive" -version = "1.9.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff22c2722516255d1823ce3cc4bc0b154dbc9364be5c905d6baa6eccbbc8774" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", @@ -680,9 +680,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -1065,9 +1065,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.1" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -1347,18 +1347,18 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "five8_const" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26dec3da8bc3ef08f2c04f61eab298c3ab334523e55f076354d6d6f613799a7b" +checksum = "72b4f62f0f8ca357f93ae90c8c2dd1041a1f665fde2f889ea9b1787903829015" dependencies = [ "five8_core", ] [[package]] name = "five8_core" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" +checksum = "94474d15a76982be62ca8a39570dccce148d98c238ebb7408b0a21b2c4bdddc4" [[package]] name = "fixedbitset" @@ -1537,11 +1537,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", - "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", - "wasm-bindgen", ] [[package]] @@ -1837,8 +1835,8 @@ dependencies = [ "http 1.3.1", "hyper 1.6.0", "hyper-util", - "rustls 0.23.25", - "rustls-native-certs", + "rustls 0.23.23", + "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", "tokio-rustls 0.26.2", @@ -2040,9 +2038,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] name = "icu_normalizer" @@ -2064,9 +2062,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] name = "icu_properties" @@ -2085,9 +2083,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] name = "icu_provider" @@ -2208,18 +2206,16 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jni" -version = "0.21.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ "cesu8", - "cfg-if", "combine", "jni-sys", "log", "thiserror 1.0.69", "walkdir", - "windows-sys 0.45.0", ] [[package]] @@ -2400,9 +2396,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "logos" @@ -2950,7 +2946,7 @@ dependencies = [ "hex", "ic-certification", "ic-transport-types", - "reqwest 0.12.15", + "reqwest 0.12.14", "schemars", "serde", "serde_bytes", @@ -2986,7 +2982,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.24", + "zerocopy 0.8.23", ] [[package]] @@ -3085,36 +3081,34 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.7" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", - "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.25", + "rustls 0.23.23", "socket2", "thiserror 2.0.12", "tokio", "tracing", - "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.10" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", - "getrandom 0.3.2", - "rand 0.9.0", + "getrandom 0.2.15", + "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.23.25", + "rustls 0.23.23", "rustls-pki-types", "rustls-platform-verifier", "slab", @@ -3126,9 +3120,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.11" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "541d0f57c6ec747a90738a52741d3221f7960e8ac2f0ff4b1a63680e033b4ab5" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ "cfg_aliases", "libc", @@ -3177,17 +3171,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", - "zerocopy 0.8.24", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -3208,16 +3191,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", -] - [[package]] name = "rand_core" version = "0.5.1" @@ -3236,15 +3209,6 @@ dependencies = [ "getrandom 0.2.15", ] -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.2", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -3402,9 +3366,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.15" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "base64 0.22.1", "bytes", @@ -3427,8 +3391,8 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.25", - "rustls-native-certs", + "rustls 0.23.23", + "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -3511,9 +3475,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ "bitflags 2.9.0", "errno", @@ -3536,18 +3500,31 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.25" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.1", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "schannel", + "security-framework 2.11.1", +] + [[package]] name = "rustls-native-certs" version = "0.8.1" @@ -3557,7 +3534,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.2.0", ] [[package]] @@ -3589,23 +3566,23 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.5.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5467026f437b4cb2a533865eaa73eb840019a0916f4b9ec563c6e617e086c9" +checksum = "a4c7dc240fec5517e6c4eab3310438636cfe6391dfc345ba013109909a90d136" dependencies = [ - "core-foundation 0.10.0", + "core-foundation 0.9.4", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.25", - "rustls-native-certs", + "rustls 0.23.23", + "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", - "rustls-webpki 0.103.1", - "security-framework", + "rustls-webpki 0.102.8", + "security-framework 2.11.1", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -3626,9 +3603,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.1" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -3717,6 +3694,20 @@ dependencies = [ "untrusted", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.0", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "num-bigint 0.4.6", + "security-framework-sys", +] + [[package]] name = "security-framework" version = "3.2.0" @@ -4031,7 +4022,9 @@ dependencies = [ "serde_bytes", "serde_json", "sol_rpc_types", + "solana-account-info", "solana-clock", + "solana-pubkey", "thiserror 2.0.12", "tower", "tower-http", @@ -4085,6 +4078,8 @@ dependencies = [ "ic-cdk", "regex", "serde", + "solana-account-info", + "solana-pubkey", "strum 0.27.1", "thiserror 2.0.12", "url", @@ -4195,7 +4190,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "borsh 0.10.4", - "borsh 1.5.7", + "borsh 1.5.5", ] [[package]] @@ -4450,7 +4445,7 @@ name = "solana-hash" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "borsh 1.5.7", + "borsh 1.5.5", "bs58", "bytemuck", "bytemuck_derive", @@ -4480,7 +4475,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "bincode", - "borsh 1.5.7", + "borsh 1.5.5", "num-traits", "serde", "serde_derive", @@ -4724,7 +4719,7 @@ dependencies = [ "bincode", "blake3", "borsh 0.10.4", - "borsh 1.5.7", + "borsh 1.5.5", "bs58", "bytemuck", "console_error_panic_hook", @@ -4809,7 +4804,7 @@ name = "solana-program-error" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "borsh 1.5.7", + "borsh 1.5.5", "num-traits", "serde", "serde_derive", @@ -4847,7 +4842,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "borsh 0.10.4", - "borsh 1.5.7", + "borsh 1.5.5", "bs58", "bytemuck", "bytemuck_derive", @@ -4902,7 +4897,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.25", + "rustls 0.23.23", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -5207,7 +5202,7 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.25", + "rustls 0.23.23", "smallvec", "socket2", "solana-keypair", @@ -5325,7 +5320,7 @@ name = "solana-tls-utils" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "rustls 0.23.25", + "rustls 0.23.23", "solana-keypair", "solana-pubkey", "solana-signer", @@ -5526,9 +5521,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.20" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601f9201feb9b09c00266478bf459952b9ef9a6b94edb2f21eba14ab681a60a9" +checksum = "d9156ebd5870ef293bfb43f91c7a74528d363ec0d424afe24160ed5a4343d08a" dependencies = [ "cc", "cfg-if", @@ -5697,9 +5692,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ "fastrand", "getrandom 0.3.2", @@ -5780,9 +5775,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "itoa", @@ -5795,15 +5790,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.22" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -5888,7 +5883,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.25", + "rustls 0.23.23", "tokio", ] @@ -6446,9 +6441,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" [[package]] name = "windows-registry" @@ -6463,9 +6458,9 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" dependencies = [ "windows-link", ] @@ -6479,15 +6474,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6515,21 +6501,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -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-targets" version = "0.48.5" @@ -6577,12 +6548,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6601,12 +6566,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6625,12 +6584,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6661,12 +6614,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6685,12 +6632,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6709,12 +6650,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6733,12 +6668,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -6856,11 +6785,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.24" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" dependencies = [ - "zerocopy-derive 0.8.24", + "zerocopy-derive 0.8.23", ] [[package]] @@ -6876,9 +6805,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.24" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" dependencies = [ "proc-macro2", "quote", @@ -6959,18 +6888,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.4" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.15+zstd.1.5.7" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index b532ae82..06b3f007 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,7 @@ solana-program = "2.2.0" solana-pubkey = "2.2.0" solana-signature = "2.2.0" solana-transaction = { version = "2.2.0", features = ["bincode"] } +solana-account-info = "2.2.0" strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" @@ -81,6 +82,7 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] } # when they are built for wasm32-unknown-unknown target. For this reason, we # are using forked version of the relevant repositories. [patch.crates-io] +solana-account-info = { git = "https://github.com/lpahlavi/agave.git" } solana-client = { git = "https://github.com/lpahlavi/agave.git" } solana-clock = { git = "https://github.com/lpahlavi/agave.git" } solana-hash = { git = "https://github.com/lpahlavi/agave.git" } diff --git a/canister/Cargo.toml b/canister/Cargo.toml index 6a274949..75fe268e 100644 --- a/canister/Cargo.toml +++ b/canister/Cargo.toml @@ -36,6 +36,8 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_bytes = { workspace = true } +solana-account-info = { workspace = true } +solana-pubkey = { workspace = true } tower = { workspace = true } tower-http = { workspace = true, features = ["set-header", "util"] } url = { workspace = true } diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index 5610531f..d69133ba 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -8,9 +8,10 @@ use crate::{ use canhttp::multi::ReductionError; use serde::Serialize; use sol_rpc_types::{ - GetSlotParams, MultiRpcResult, RpcAccess, RpcAuth, RpcConfig, RpcResult, RpcSource, RpcSources, - SupportedRpcProvider, + GetAccountInfoParams, GetSlotParams, MultiRpcResult, RpcAccess, RpcAuth, RpcConfig, RpcResult, + RpcSource, RpcSources, SupportedRpcProvider, }; +use solana_account_info::AccountInfo; use solana_clock::Slot; use std::fmt::Debug; @@ -63,6 +64,16 @@ impl CandidRpcClient { }) } + pub async fn get_account_info( + &self, + params: GetAccountInfoParams, + ) -> MultiRpcResult { + process_result( + RpcMethod::GetAccountInfo, + self.client.get_account_info(params).await, + ) + } + pub async fn get_slot(&self, params: GetSlotParams) -> MultiRpcResult { process_result(RpcMethod::GetSlot, self.client.get_slot(params).await) } diff --git a/canister/src/main.rs b/canister/src/main.rs index 16920a94..d27a6810 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -17,6 +17,7 @@ use sol_rpc_types::{ }; use solana_clock::Slot; use std::str::FromStr; +use solana_account_info::AccountInfo; pub fn require_api_key_principal_or_controller() -> Result<(), String> { let caller = ic_cdk::caller(); @@ -74,6 +75,19 @@ async fn update_api_keys(api_keys: Vec<(SupportedRpcProviderId, Option)> } } +#[update(name = "getAccountInfo")] +#[candid_method(rename = "getAccountInfo")] +async fn get_account_info( + source: RpcSources, + config: Option, + params: Option, +) -> MultiRpcResult { + match CandidRpcClient::new(source, config) { + Ok(client) => client.get_slot(params.unwrap_or_default()).await.into(), + Err(err) => Err(err).into(), + } +} + #[update(name = "getSlot")] #[candid_method(rename = "getSlot")] async fn get_slot( diff --git a/canister/src/metrics/mod.rs b/canister/src/metrics/mod.rs index c65848f3..73c4893b 100644 --- a/canister/src/metrics/mod.rs +++ b/canister/src/metrics/mod.rs @@ -141,6 +141,7 @@ pub struct Metrics { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RpcMethod { + GetAccountInfo, GetSlot, Generic, } @@ -148,6 +149,7 @@ pub enum RpcMethod { impl RpcMethod { fn name(self) -> &'static str { match self { + RpcMethod::GetAccountInfo => "getAccountInfo", RpcMethod::GetSlot => "getSlot", RpcMethod::Generic => "generic", } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index a652fcb2..167e50ed 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -19,10 +19,9 @@ use canlog::log; use ic_cdk::api::management_canister::http_request::TransformContext; use serde::{de::DeserializeOwned, Serialize}; use sol_rpc_types::{ - ConsensusStrategy, GetSlotParams, JsonRpcError, ProviderError, RpcConfig, RpcError, RpcSource, - RpcSources, + ConsensusStrategy, GetAccountInfoParams, GetSlotParams, JsonRpcError, ProviderError, RpcConfig, + RpcError, RpcSource, RpcSources, }; -use solana_clock::Slot; use std::{collections::BTreeSet, fmt::Debug}; use tower::ServiceExt; @@ -138,7 +137,7 @@ impl SolRpcClient { } /// Query the Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method. - pub async fn get_slot(&self, params: GetSlotParams) -> ReducedResult { + pub async fn get_slot(&self, params: GetSlotParams) -> ReducedResult { self.parallel_call( "getSlot", vec![params], @@ -149,6 +148,21 @@ impl SolRpcClient { .reduce(self.reduction_strategy()) } + /// Query the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo) RPC method. + pub async fn get_account_info( + &self, + params: GetAccountInfoParams, + ) -> ReducedResult { + self.parallel_call( + "getAccountInfo", + vec![params], + self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), + &Some(ResponseTransform::GetAccountInfo), + ) + .await + .reduce(self.reduction_strategy()) + } + pub async fn raw_request( &self, request: JsonRpcRequest, diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 97b320cc..9a2275f6 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -9,6 +9,7 @@ use ic_cdk::{ }; use minicbor::{Decode, Encode}; use serde::{de::DeserializeOwned, Serialize}; +use solana_account_info::AccountInfo; use solana_clock::Slot; use std::{fmt, fmt::Debug}; @@ -31,8 +32,10 @@ pub const MAX_PAYLOAD_SIZE: u64 = HTTP_MAX_SIZE - HEADER_SIZE_LIMIT; #[derive(Debug, Decode, Encode)] pub enum ResponseTransform { #[n(0)] - GetSlot, + GetAccountInfo, #[n(1)] + GetSlot, + #[n(2)] Raw, } @@ -40,7 +43,7 @@ impl ResponseTransform { fn apply(&self, body_bytes: &mut Vec) { use serde_json::{from_slice, to_vec, Value}; - fn redact_response(body: &mut Vec) + fn canonicalize_json_rpc_response(body: &mut Vec) where T: Serialize + DeserializeOwned, { @@ -51,18 +54,19 @@ impl ResponseTransform { *body = to_vec(&response).expect("BUG: failed to serialize response"); } - fn canonicalize(text: &[u8]) -> Option> { + fn canonicalize_raw(text: &[u8]) -> Option> { let json = from_slice::(text).ok()?; to_vec(&json).ok() } match self { + Self::GetAccountInfo => canonicalize_json_rpc_response::(body_bytes), // TODO XC-292: Add rounding to the response transform and // add a unit test simulating consensus when the providers // return slightly differing results. - Self::GetSlot => redact_response::(body_bytes), + Self::GetSlot => canonicalize_json_rpc_response::(body_bytes), Self::Raw => { - if let Some(bytes) = canonicalize(body_bytes) { + if let Some(bytes) = canonicalize_raw(body_bytes) { *body_bytes = bytes } } diff --git a/libs/types/Cargo.toml b/libs/types/Cargo.toml index 72412e4a..dfe0d45b 100644 --- a/libs/types/Cargo.toml +++ b/libs/types/Cargo.toml @@ -20,3 +20,5 @@ serde = { workspace = true } strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } +solana-account-info = { workspace = true } +solana-pubkey = { workspace = true } diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index ef72aa00..982ddd5d 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -15,4 +15,4 @@ pub use rpc_client::{ RegexString, RegexSubstitution, RpcAccess, RpcAuth, RpcConfig, RpcEndpoint, RpcError, RpcResult, RpcSource, RpcSources, SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; -pub use solana::{CommitmentLevel, GetSlotParams}; +pub use solana::{AccountInfo, CommitmentLevel, GetAccountInfoParams, GetSlotParams, Pubkey}; diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index c373d0e9..f74c70d9 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -1,6 +1,8 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; +use std::cell::RefCell; use std::fmt::Debug; +use std::rc::Rc; /// The parameters for a Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method call. #[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] @@ -12,6 +14,21 @@ pub struct GetSlotParams { pub min_context_slot: Option, } +/// The parameters for a Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getAccountInfo) RPC method call. +#[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] +pub struct GetAccountInfoParams { + /// The request returns the slot that has reached this or the default commitment level. + pub commitment: Option, + /// Encoding format for Account data. + pub encoding: Option, + /// Request a slice of the account's data. + #[serde(rename = "dataSlice")] + pub data_slice: Option, + /// The minimum slot that the request can be evaluated at. + #[serde(rename = "minContextSlot")] + pub min_context_slot: Option, +} + /// [Commitment levels](https://solana.com/docs/rpc#configuring-state-commitment) in Solana, /// representing finality guarantees of transactions and memory queries. #[derive(Debug, Clone, Deserialize, Serialize, CandidType)] @@ -26,3 +43,78 @@ pub enum CommitmentLevel { #[serde(rename = "finalized")] Finalized, } + +/// Encoding for the return value of the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo) RPC method. +#[derive(Debug, Clone, Deserialize, Serialize, CandidType)] +pub enum GetAccountInfoEncoding { + /// The account data is base-58 encoded. Limited to less than 129 bytes of data. + #[serde(rename = "base58")] + Base58, + /// The account data is base-64 encoded. + #[serde(rename = "base64")] + Base64, + /// Account data is first compressed using [Zstandard](http://facebook.github.io/zstd/) and the + /// result is then base-64 encoded. + #[serde(rename = "base64+zstd")] + Base64ZStd, + /// The encoding attempts to use program-specific state parsers to return more human-readable + /// and explicit account state data. If [`JsonParsed`] is requested but a parser cannot be + /// found, the fallback is [`Base64`] encoding. + #[serde(rename = "jsonParsed")] + JsonParsed, +} + +/// Represents a slice of the return value of the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getAccountInfo) RPC method. +#[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] +pub struct DataSlice { + /// Number of bytes to return. + length: usize, + /// Byte offset from which to start reading. + offset: usize, +} + +/// Solana Ed25519 [public key](`https://solana.com/docs/references/terminology#public-key-pubkey`). +#[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] +pub struct Pubkey(pub [u8; 32]); + +impl From for Pubkey { + fn from(pubkey: solana_pubkey::Pubkey) -> Self { + Pubkey(pubkey.to_bytes()) + } +} + +/// Solana [account](https://solana.com/docs/references/terminology#account) information. +#[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] +pub struct AccountInfo { + /// Public key of the account + pub key: Pubkey, + /// The lamports in the account. Modifiable by programs. + pub lamports: u64, + /// The data held in this account. Modifiable by programs. + pub data: Vec, + /// Program that owns this account + pub owner: Pubkey, + /// The epoch at which this account will next owe rent + pub rent_epoch: u64, + /// Was the transaction signed by this account's public key? + pub is_signer: bool, + /// Is the account writable? + pub is_writable: bool, + /// This account's data contains a loaded program (and is now read-only) + pub executable: bool, +} + +impl<'a> From> for AccountInfo { + fn from(account_info: solana_account_info::AccountInfo<'a>) -> Self { + AccountInfo { + key: account_info.key.clone().into(), + lamports: **account_info.lamports.borrow(), + data: account_info.data.borrow().to_vec(), + owner: account_info.owner.clone().into(), + rent_epoch: account_info.rent_epoch, + is_signer: account_info.is_signer, + is_writable: account_info.is_writable, + executable: account_info.executable, + } + } +} From 6b0f223bfe43ee0f73f73a26312cd4c2a1f69f2d Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Thu, 27 Mar 2025 21:09:11 +0100 Subject: [PATCH 02/31] XC-288: Fix errors --- Cargo.lock | 7 +- Cargo.toml | 4 +- canister/Cargo.toml | 3 +- canister/sol_rpc_canister.did | 46 +++++++++++++ canister/src/candid_rpc/mod.rs | 19 +++--- canister/src/http/mod.rs | 3 +- canister/src/main.rs | 20 +++--- canister/src/memory/mod.rs | 6 +- canister/src/rpc_client/mod.rs | 15 +++-- canister/src/rpc_client/sol_rpc/mod.rs | 5 +- .../tests/solana_test_validator.rs | 5 ++ libs/client/Cargo.toml | 2 + libs/client/src/lib.rs | 33 ++++++++- libs/types/Cargo.toml | 2 +- libs/types/src/lib.rs | 2 +- libs/types/src/solana/mod.rs | 67 +++++++++++-------- 16 files changed, 172 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 983dc6a9..217eb9bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3999,6 +3999,7 @@ name = "sol_rpc_canister" version = "0.1.0" dependencies = [ "assert_matches", + "bincode", "candid", "candid_parser", "canhttp", @@ -4022,7 +4023,7 @@ dependencies = [ "serde_bytes", "serde_json", "sol_rpc_types", - "solana-account-info", + "solana-account", "solana-clock", "solana-pubkey", "thiserror 2.0.12", @@ -4041,7 +4042,9 @@ dependencies = [ "ic-cdk", "serde", "sol_rpc_types", + "solana-account", "solana-clock", + "solana-pubkey", ] [[package]] @@ -4078,7 +4081,7 @@ dependencies = [ "ic-cdk", "regex", "serde", - "solana-account-info", + "solana-account", "solana-pubkey", "strum 0.27.1", "thiserror 2.0.12", diff --git a/Cargo.toml b/Cargo.toml index 06b3f007..02d4add6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ solana-program = "2.2.0" solana-pubkey = "2.2.0" solana-signature = "2.2.0" solana-transaction = { version = "2.2.0", features = ["bincode"] } -solana-account-info = "2.2.0" +solana-account = "2.2.0" strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" @@ -82,7 +82,7 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] } # when they are built for wasm32-unknown-unknown target. For this reason, we # are using forked version of the relevant repositories. [patch.crates-io] -solana-account-info = { git = "https://github.com/lpahlavi/agave.git" } +solana-account = { git = "https://github.com/lpahlavi/agave.git" } solana-client = { git = "https://github.com/lpahlavi/agave.git" } solana-clock = { git = "https://github.com/lpahlavi/agave.git" } solana-hash = { git = "https://github.com/lpahlavi/agave.git" } diff --git a/canister/Cargo.toml b/canister/Cargo.toml index 75fe268e..31b49741 100644 --- a/canister/Cargo.toml +++ b/canister/Cargo.toml @@ -36,13 +36,14 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_bytes = { workspace = true } -solana-account-info = { workspace = true } +solana-account = { workspace = true, features = ["serde"] } solana-pubkey = { workspace = true } tower = { workspace = true } tower-http = { workspace = true, features = ["set-header", "util"] } url = { workspace = true } zeroize = { workspace = true } thiserror = { workspace = true } +bincode = "1.3.3" [dev-dependencies] candid_parser = { workspace = true } diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index edc76822..8f1e0f85 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -125,6 +125,49 @@ type RejectionCode = variant { CanisterReject; }; +// Represents the encoding of the return value of the `getAccountInfo` Solana RPC method. +type GetAccountInfoEncoding = variant { + base58; + base64; + // base64+zstd; + jsonParsed; +}; + +// Represents a slice of the return value of the `getAccountInfo` Solana RPC method. +type DataSlice = record { + length: nat64; + offset: nat64; +}; + +// The parameters for a call to the `getAccountInfo` Solana RPC method. +type GetAccountInfoParams = record { + commitment: opt CommitmentLevel; + encoding: opt GetAccountInfoEncoding; + dataSlice: opt DataSlice; + minContextSlot: opt nat64; +}; + +// A Solana Ed25519 public key. +type Pubkey = vec nat8; + +// Solana account info. +type AccountInfo = record { + lamports: nat64; + data: vec nat8; + owner: Pubkey; + executable: bool; + rent_epoch: nat64; +}; + +// Represents the result of a call to the `getAccountInfo` Solana RPC method. +type GetAccountInfoResult = variant { Ok : AccountInfo; Err : RpcError }; + +// Represents an aggregated result from multiple RPC calls to the `getAccountInfo` Solana RPC method. +type MultiGetAccountInfoResult = variant { + Consistent : GetAccountInfoResult; + Inconsistent : vec record { RpcSource; GetAccountInfoResult }; +}; + // Represents a Solana slot type Slot = nat64; @@ -212,6 +255,9 @@ service : (InstallArgs,) -> { // The caller is the controller or a principal specified in `InstallArgs::manage_api_keys`. updateApiKeys : (vec record { SupportedProvider; opt text }) -> (); + // Call the Solana `getAccountInfo` RPC method and return the resulting slot. + getAccountInfo : (RpcSources, opt RpcConfig, Pubkey, opt GetAccountInfoParams) -> (MultiGetAccountInfoResult); + // Call the Solana `getSlot` RPC method and return the resulting slot. getSlot : (RpcSources, opt RpcConfig, opt GetSlotParams) -> (MultiGetSlotResult); diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index d69133ba..683da389 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -8,11 +8,9 @@ use crate::{ use canhttp::multi::ReductionError; use serde::Serialize; use sol_rpc_types::{ - GetAccountInfoParams, GetSlotParams, MultiRpcResult, RpcAccess, RpcAuth, RpcConfig, RpcResult, - RpcSource, RpcSources, SupportedRpcProvider, + Account, GetAccountInfoParams, GetSlotParams, MultiRpcResult, Pubkey, RpcAccess, RpcAuth, + RpcConfig, RpcResult, RpcSource, RpcSources, Slot, SupportedRpcProvider, }; -use solana_account_info::AccountInfo; -use solana_clock::Slot; use std::fmt::Debug; fn process_result(method: RpcMethod, result: ReducedResult) -> MultiRpcResult { @@ -66,25 +64,28 @@ impl CandidRpcClient { pub async fn get_account_info( &self, - params: GetAccountInfoParams, - ) -> MultiRpcResult { + pubkey: Pubkey, + params: Option, + ) -> MultiRpcResult { process_result( RpcMethod::GetAccountInfo, - self.client.get_account_info(params).await, + self.client.get_account_info(pubkey.into(), params).await, ) + .map(Account::from) } - pub async fn get_slot(&self, params: GetSlotParams) -> MultiRpcResult { + pub async fn get_slot(&self, params: Option) -> MultiRpcResult { process_result(RpcMethod::GetSlot, self.client.get_slot(params).await) } pub async fn raw_request( &self, request: canhttp::http::json::JsonRpcRequest, - ) -> MultiRpcResult + ) -> MultiRpcResult where I: Serialize + Clone + Debug, { process_result(RpcMethod::Generic, self.client.raw_request(request).await) + .map(|value| value.to_string()) } } diff --git a/canister/src/http/mod.rs b/canister/src/http/mod.rs index 9f6302f4..3cc5abf0 100644 --- a/canister/src/http/mod.rs +++ b/canister/src/http/mod.rs @@ -5,8 +5,7 @@ use crate::{ constants::{COLLATERAL_CYCLES_PER_NODE, CONTENT_TYPE_VALUE}, http::errors::HttpClientError, logs::Priority, - memory::next_request_id, - memory::{read_state, State}, + memory::{next_request_id, read_state, State}, metrics::{MetricRpcHost, MetricRpcMethod}, }; use canhttp::{ diff --git a/canister/src/main.rs b/canister/src/main.rs index d27a6810..5949bf53 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -12,12 +12,10 @@ use sol_rpc_canister::{ providers::{get_provider, PROVIDERS}, }; use sol_rpc_types::{ - GetSlotParams, MultiRpcResult, RpcAccess, RpcConfig, RpcError, RpcSources, - SupportedRpcProvider, SupportedRpcProviderId, + Account, GetAccountInfoParams, GetSlotParams, MultiRpcResult, Pubkey, RpcAccess, RpcConfig, + RpcError, RpcSources, Slot, SupportedRpcProvider, SupportedRpcProviderId, }; -use solana_clock::Slot; use std::str::FromStr; -use solana_account_info::AccountInfo; pub fn require_api_key_principal_or_controller() -> Result<(), String> { let caller = ic_cdk::caller(); @@ -80,10 +78,11 @@ async fn update_api_keys(api_keys: Vec<(SupportedRpcProviderId, Option)> async fn get_account_info( source: RpcSources, config: Option, - params: Option, -) -> MultiRpcResult { + pubkey: Pubkey, + params: Option, +) -> MultiRpcResult { match CandidRpcClient::new(source, config) { - Ok(client) => client.get_slot(params.unwrap_or_default()).await.into(), + Ok(client) => client.get_account_info(pubkey, params).await, Err(err) => Err(err).into(), } } @@ -96,7 +95,7 @@ async fn get_slot( params: Option, ) -> MultiRpcResult { match CandidRpcClient::new(source, config) { - Ok(client) => client.get_slot(params.unwrap_or_default()).await, + Ok(client) => client.get_slot(params).await, Err(err) => Err(err).into(), } } @@ -118,10 +117,7 @@ async fn request( } }; match CandidRpcClient::new(source, config) { - Ok(client) => client - .raw_request(request) - .await - .map(|value| value.to_string()), + Ok(client) => client.raw_request(request).await, Err(err) => Err(err).into(), } } diff --git a/canister/src/memory/mod.rs b/canister/src/memory/mod.rs index 04a0d15d..0cda4fa5 100644 --- a/canister/src/memory/mod.rs +++ b/canister/src/memory/mod.rs @@ -1,8 +1,10 @@ #[cfg(test)] mod tests; -use crate::metrics::Metrics; -use crate::types::{ApiKey, OverrideProvider}; +use crate::{ + metrics::Metrics, + types::{ApiKey, OverrideProvider}, +}; use candid::{Deserialize, Principal}; use canhttp::http::json::Id; use canlog::LogFilter; diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 167e50ed..8c9764bd 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -137,7 +137,10 @@ impl SolRpcClient { } /// Query the Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method. - pub async fn get_slot(&self, params: GetSlotParams) -> ReducedResult { + pub async fn get_slot( + &self, + params: Option, + ) -> ReducedResult { self.parallel_call( "getSlot", vec![params], @@ -151,11 +154,15 @@ impl SolRpcClient { /// Query the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo) RPC method. pub async fn get_account_info( &self, - params: GetAccountInfoParams, - ) -> ReducedResult { + pubkey: solana_pubkey::Pubkey, + params: Option, + ) -> ReducedResult { self.parallel_call( "getAccountInfo", - vec![params], + serde_json::Value::Array(vec![ + serde_json::to_value(pubkey).expect("BUG: could not serialize pubkey"), + serde_json::to_value(params).expect("BUG: could not serialize params"), + ]), self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), ) diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 9a2275f6..f5e0e7e5 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -9,7 +9,6 @@ use ic_cdk::{ }; use minicbor::{Decode, Encode}; use serde::{de::DeserializeOwned, Serialize}; -use solana_account_info::AccountInfo; use solana_clock::Slot; use std::{fmt, fmt::Debug}; @@ -60,7 +59,9 @@ impl ResponseTransform { } match self { - Self::GetAccountInfo => canonicalize_json_rpc_response::(body_bytes), + Self::GetAccountInfo => { + canonicalize_json_rpc_response::(body_bytes) + } // TODO XC-292: Add rounding to the response transform and // add a unit test simulating consensus when the providers // return slightly differing results. diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 9a9c3348..9825bbec 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -34,6 +34,11 @@ async fn should_get_slot() { setup.setup.drop().await; } +#[tokio::test(flavor = "multi_thread")] +async fn should_get_account_info() { + // TODO XC-288 +} + pub struct Setup { solana_client: SolanaRpcClient, setup: sol_rpc_int_tests::Setup, diff --git a/libs/client/Cargo.toml b/libs/client/Cargo.toml index 0274ca87..49c2d410 100644 --- a/libs/client/Cargo.toml +++ b/libs/client/Cargo.toml @@ -16,4 +16,6 @@ candid = { workspace = true } ic-cdk = { workspace = true } serde = { workspace = true } solana-clock = { workspace = true } +solana-account = { workspace = true } +solana-pubkey = { workspace = true } sol_rpc_types = { path = "../types" } \ No newline at end of file diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index d93cb37d..04ba7185 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -8,9 +8,12 @@ use candid::{utils::ArgumentEncoder, CandidType, Principal}; use ic_cdk::api::call::RejectionCode; use serde::de::DeserializeOwned; use sol_rpc_types::{ - GetSlotParams, RpcConfig, RpcSources, SupportedRpcProvider, SupportedRpcProviderId, + GetAccountInfoParams, GetSlotParams, RpcConfig, RpcSources, SupportedRpcProvider, + SupportedRpcProviderId, }; +use solana_account::Account; use solana_clock::Slot; +use solana_pubkey::Pubkey; /// Abstract the canister runtime so that the client code can be reused: /// * in production using `ic_cdk`, @@ -119,6 +122,34 @@ impl SolRpcClient { .unwrap() } + /// Call `getAccountInfo` on the SOL RPC canister. + pub async fn get_account_info( + &self, + pubkey: Pubkey, + params: GetAccountInfoParams, + ) -> sol_rpc_types::MultiRpcResult { + self.runtime + .update_call::<( + RpcSources, + Option, + sol_rpc_types::Pubkey, + GetAccountInfoParams, + ), sol_rpc_types::MultiRpcResult>( + self.sol_rpc_canister, + "getAccountInfo", + ( + self.rpc_sources.clone(), + self.rpc_config.clone(), + pubkey.into(), + params, + ), + 10_000_000_000, + ) + .await + .expect("Client error: failed to call `getAccountInfo`") + .map(Account::from) + } + /// Call `getSlot` on the SOL RPC canister. pub async fn get_slot( &self, diff --git a/libs/types/Cargo.toml b/libs/types/Cargo.toml index dfe0d45b..5b3f92d3 100644 --- a/libs/types/Cargo.toml +++ b/libs/types/Cargo.toml @@ -20,5 +20,5 @@ serde = { workspace = true } strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } -solana-account-info = { workspace = true } +solana-account = { workspace = true } solana-pubkey = { workspace = true } diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index 982ddd5d..21fae737 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -15,4 +15,4 @@ pub use rpc_client::{ RegexString, RegexSubstitution, RpcAccess, RpcAuth, RpcConfig, RpcEndpoint, RpcError, RpcResult, RpcSource, RpcSources, SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; -pub use solana::{AccountInfo, CommitmentLevel, GetAccountInfoParams, GetSlotParams, Pubkey}; +pub use solana::{Account, CommitmentLevel, GetAccountInfoParams, GetSlotParams, Pubkey, Slot}; diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index f74c70d9..d01e88bd 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -1,8 +1,9 @@ use candid::CandidType; use serde::{Deserialize, Serialize}; -use std::cell::RefCell; use std::fmt::Debug; -use std::rc::Rc; + +/// A Solana [slot](https://solana.com/docs/references/terminology#slot). +pub type Slot = u64; /// The parameters for a Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method call. #[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] @@ -53,10 +54,11 @@ pub enum GetAccountInfoEncoding { /// The account data is base-64 encoded. #[serde(rename = "base64")] Base64, - /// Account data is first compressed using [Zstandard](http://facebook.github.io/zstd/) and the - /// result is then base-64 encoded. - #[serde(rename = "base64+zstd")] - Base64ZStd, + // TODO XC-288 + // /// Account data is first compressed using [Zstandard](http://facebook.github.io/zstd/) and the + // /// result is then base-64 encoded. + // #[serde(rename = "base64+zstd")] + // Base64ZStd, /// The encoding attempts to use program-specific state parsers to return more human-readable /// and explicit account state data. If [`JsonParsed`] is requested but a parser cannot be /// found, the fallback is [`Base64`] encoding. @@ -68,9 +70,9 @@ pub enum GetAccountInfoEncoding { #[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] pub struct DataSlice { /// Number of bytes to return. - length: usize, + length: u64, // TODO XC-288: Is this correct for usize? /// Byte offset from which to start reading. - offset: usize, + offset: u64, // TODO XC-288: Is this correct for usize? } /// Solana Ed25519 [public key](`https://solana.com/docs/references/terminology#public-key-pubkey`). @@ -83,38 +85,47 @@ impl From for Pubkey { } } +impl From for solana_pubkey::Pubkey { + fn from(pubkey: Pubkey) -> Self { + solana_pubkey::Pubkey::from(pubkey.0) + } +} + /// Solana [account](https://solana.com/docs/references/terminology#account) information. #[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] -pub struct AccountInfo { - /// Public key of the account - pub key: Pubkey, +pub struct Account { /// The lamports in the account. Modifiable by programs. pub lamports: u64, /// The data held in this account. Modifiable by programs. pub data: Vec, /// Program that owns this account pub owner: Pubkey, - /// The epoch at which this account will next owe rent - pub rent_epoch: u64, - /// Was the transaction signed by this account's public key? - pub is_signer: bool, - /// Is the account writable? - pub is_writable: bool, /// This account's data contains a loaded program (and is now read-only) pub executable: bool, + /// The epoch at which this account will next owe rent + pub rent_epoch: u64, +} + +impl From for Account { + fn from(account: solana_account::Account) -> Self { + Account { + lamports: account.lamports, + data: account.data, + owner: account.owner.into(), + executable: account.executable, + rent_epoch: account.rent_epoch, + } + } } -impl<'a> From> for AccountInfo { - fn from(account_info: solana_account_info::AccountInfo<'a>) -> Self { - AccountInfo { - key: account_info.key.clone().into(), - lamports: **account_info.lamports.borrow(), - data: account_info.data.borrow().to_vec(), - owner: account_info.owner.clone().into(), - rent_epoch: account_info.rent_epoch, - is_signer: account_info.is_signer, - is_writable: account_info.is_writable, - executable: account_info.executable, +impl From for solana_account::Account { + fn from(account: Account) -> Self { + solana_account::Account { + lamports: account.lamports, + data: account.data, + owner: account.owner.into(), + executable: account.executable, + rent_epoch: account.rent_epoch, } } } From 31969f551c5fd13e263bd3eb346911c1878448a8 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:12:19 +0100 Subject: [PATCH 03/31] XC-288: Add integration tests and fix response transform --- Cargo.lock | 27 +++++++++++++- Cargo.toml | 5 ++- canister/Cargo.toml | 2 ++ canister/sol_rpc_canister.did | 2 +- canister/src/rpc_client/mod.rs | 7 ++-- canister/src/rpc_client/sol_rpc/mod.rs | 22 +++++++++++- integration_tests/Cargo.toml | 2 ++ .../tests/solana_test_validator.rs | 36 +++++++++++++++++-- libs/client/src/lib.rs | 4 +-- libs/types/src/lib.rs | 5 ++- libs/types/src/solana/mod.rs | 9 +++-- 11 files changed, 101 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 217eb9bc..b3b5748e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -602,7 +602,7 @@ dependencies = [ [[package]] name = "canhttp" version = "0.1.0" -source = "git+https://github.com/dfinity/evm-rpc-canister?rev=b976abe57379be7d2649f6a31522d0bb25c5f455#b976abe57379be7d2649f6a31522d0bb25c5f455" +source = "git+https://github.com/dfinity/evm-rpc-canister?branch=lpahlavi%2Fjson-rpc-response-map-method-v2#ec70414ad2a4c185a9cbb35f64edcea554a0240a" dependencies = [ "assert_matches", "ciborium", @@ -3834,6 +3834,27 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_tuple" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9b739e59a0e07b7a73bc11c3dcd6abf790d0f54042b67a422d4bd1f6cf6c0" +dependencies = [ + "serde", + "serde_tuple_macros", +] + +[[package]] +name = "serde_tuple_macros" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e87546e85c5047d03b454d12ee25266fc269a461a4029956ca58d246b9aefae" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4022,8 +4043,10 @@ dependencies = [ "serde", "serde_bytes", "serde_json", + "serde_tuple", "sol_rpc_types", "solana-account", + "solana-account-decoder-client-types", "solana-clock", "solana-pubkey", "thiserror 2.0.12", @@ -4067,7 +4090,9 @@ dependencies = [ "sol_rpc_canister", "sol_rpc_client", "sol_rpc_types", + "solana-account", "solana-client", + "solana-pubkey", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 02d4add6..a20e38d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ assert_matches = "1.5.0" async-trait = "0.1.88" candid = "0.10.13" candid_parser = "0.1.4" -canhttp = { git = "https://github.com/dfinity/evm-rpc-canister", rev = "b976abe57379be7d2649f6a31522d0bb25c5f455" } +canhttp = { git = "https://github.com/dfinity/evm-rpc-canister", branch = "lpahlavi/json-rpc-response-map-method-v2" } ciborium = "0.2.2" # Transitive dependency of ic-ed25519 # See https://forum.dfinity.org/t/module-imports-function-wbindgen-describe-from-wbindgen-placeholder-that-is-not-exported-by-the-runtime/11545/8 @@ -58,6 +58,7 @@ regex = "1.11.1" serde = { version = "1.0.219", features = ["derive"] } serde_bytes = "0.11.17" serde_json = "1.0.140" +serde_tuple = "1.1.0" solana-clock = "2.2.0" solana-client = "2.2.0" solana-hash = "2.2.0" @@ -69,6 +70,7 @@ solana-pubkey = "2.2.0" solana-signature = "2.2.0" solana-transaction = { version = "2.2.0", features = ["bincode"] } solana-account = "2.2.0" +solana-account-decoder-client-types = { version = "2.2.0", features = ["zstd"] } strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" @@ -83,6 +85,7 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] } # are using forked version of the relevant repositories. [patch.crates-io] solana-account = { git = "https://github.com/lpahlavi/agave.git" } +solana-account-decoder-client-types = { git = "https://github.com/lpahlavi/agave.git" } solana-client = { git = "https://github.com/lpahlavi/agave.git" } solana-clock = { git = "https://github.com/lpahlavi/agave.git" } solana-hash = { git = "https://github.com/lpahlavi/agave.git" } diff --git a/canister/Cargo.toml b/canister/Cargo.toml index 31b49741..18dce605 100644 --- a/canister/Cargo.toml +++ b/canister/Cargo.toml @@ -36,7 +36,9 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_bytes = { workspace = true } +serde_tuple = { workspace = true } solana-account = { workspace = true, features = ["serde"] } +solana-account-decoder-client-types = { workspace = true, features = ["zstd"] } solana-pubkey = { workspace = true } tower = { workspace = true } tower-http = { workspace = true, features = ["set-header", "util"] } diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index 8f1e0f85..a767139f 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -129,7 +129,7 @@ type RejectionCode = variant { type GetAccountInfoEncoding = variant { base58; base64; - // base64+zstd; + "base64+zstd"; jsonParsed; }; diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 8c9764bd..087667c2 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -159,10 +159,7 @@ impl SolRpcClient { ) -> ReducedResult { self.parallel_call( "getAccountInfo", - serde_json::Value::Array(vec![ - serde_json::to_value(pubkey).expect("BUG: could not serialize pubkey"), - serde_json::to_value(params).expect("BUG: could not serialize params"), - ]), + (pubkey.to_string(), params), self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), ) @@ -179,7 +176,7 @@ impl SolRpcClient { { self.parallel_call( request.method(), - request.params(), + &[request.params()], self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::Raw), ) diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index f5e0e7e5..d9035050 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -9,6 +9,9 @@ use ic_cdk::{ }; use minicbor::{Decode, Encode}; use serde::{de::DeserializeOwned, Serialize}; +use serde_json::from_value; +use solana_account::Account; +use solana_account_decoder_client_types::UiAccount; use solana_clock::Slot; use std::{fmt, fmt::Debug}; @@ -42,6 +45,21 @@ impl ResponseTransform { fn apply(&self, body_bytes: &mut Vec) { use serde_json::{from_slice, to_vec, Value}; + fn canonicalize_get_account_info_response(body: &mut Vec) -> Option> + where + T: Debug + Serialize + DeserializeOwned, + { + let response = from_slice::>(body) + .ok()? + .map(|result| { + from_value::(result["value"].clone()) + .unwrap() + .decode::() + .unwrap() + }); + to_vec(&response).ok() + } + fn canonicalize_json_rpc_response(body: &mut Vec) where T: Serialize + DeserializeOwned, @@ -60,7 +78,9 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { - canonicalize_json_rpc_response::(body_bytes) + if let Some(bytes) = canonicalize_get_account_info_response::(body_bytes) { + *body_bytes = bytes + } } // TODO XC-292: Add rounding to the response transform and // add a unit test simulating consensus when the providers diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index e3b8235a..251da2c3 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -22,6 +22,8 @@ serde_json = { workspace = true } sol_rpc_canister = { path = "../canister" } sol_rpc_client = { path = "../libs/client" } sol_rpc_types = { path = "../libs/types" } +solana-account = { workspace = true } +solana-pubkey = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 9825bbec..103c74d1 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -6,9 +6,13 @@ use futures::future; use pocket_ic::PocketIcBuilder; use sol_rpc_client::SolRpcClient; use sol_rpc_int_tests::PocketIcLiveModeRuntime; -use sol_rpc_types::{InstallArgs, MultiRpcResult, OverrideProvider, RegexSubstitution}; +use sol_rpc_types::{ + GetAccountInfoEncoding, GetAccountInfoParams, InstallArgs, MultiRpcResult, OverrideProvider, + RegexSubstitution, +}; use solana_client::rpc_client::RpcClient as SolanaRpcClient; -use std::future::Future; +use solana_pubkey::Pubkey; +use std::{future::Future, str::FromStr}; #[tokio::test(flavor = "multi_thread")] async fn should_get_slot() { @@ -36,7 +40,33 @@ async fn should_get_slot() { #[tokio::test(flavor = "multi_thread")] async fn should_get_account_info() { - // TODO XC-288 + let setup = Setup::new().await; + let pubkey = Pubkey::from_str("11111111111111111111111111111111").unwrap(); + + let (sol_res, ic_res) = setup + .compare_client( + |sol| sol.get_account(&pubkey).expect("Failed to get account"), + |ic| async move { + match ic + .get_account_info( + pubkey, + Some(GetAccountInfoParams { + encoding: Some(GetAccountInfoEncoding::Base64ZStd), + ..GetAccountInfoParams::default() + }), + ) + .await + { + MultiRpcResult::Consistent(Ok(account)) => account, + result => panic!("Failed to get account, received: {:?}", result), + } + }, + ) + .await; + + assert_eq!(sol_res, ic_res); + + setup.setup.drop().await; } pub struct Setup { diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 04ba7185..68b8419d 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -126,14 +126,14 @@ impl SolRpcClient { pub async fn get_account_info( &self, pubkey: Pubkey, - params: GetAccountInfoParams, + params: Option, ) -> sol_rpc_types::MultiRpcResult { self.runtime .update_call::<( RpcSources, Option, sol_rpc_types::Pubkey, - GetAccountInfoParams, + Option, ), sol_rpc_types::MultiRpcResult>( self.sol_rpc_canister, "getAccountInfo", diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index 21fae737..98806ba7 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -15,4 +15,7 @@ pub use rpc_client::{ RegexString, RegexSubstitution, RpcAccess, RpcAuth, RpcConfig, RpcEndpoint, RpcError, RpcResult, RpcSource, RpcSources, SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; -pub use solana::{Account, CommitmentLevel, GetAccountInfoParams, GetSlotParams, Pubkey, Slot}; +pub use solana::{ + Account, CommitmentLevel, DataSlice, GetAccountInfoEncoding, GetAccountInfoParams, + GetSlotParams, Pubkey, Slot, +}; diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index d01e88bd..49be55cd 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -54,11 +54,10 @@ pub enum GetAccountInfoEncoding { /// The account data is base-64 encoded. #[serde(rename = "base64")] Base64, - // TODO XC-288 - // /// Account data is first compressed using [Zstandard](http://facebook.github.io/zstd/) and the - // /// result is then base-64 encoded. - // #[serde(rename = "base64+zstd")] - // Base64ZStd, + /// Account data is first compressed using [Zstandard](http://facebook.github.io/zstd/) and the + /// result is then base-64 encoded. + #[serde(rename = "base64+zstd")] + Base64ZStd, /// The encoding attempts to use program-specific state parsers to return more human-readable /// and explicit account state data. If [`JsonParsed`] is requested but a parser cannot be /// found, the fallback is [`Base64`] encoding. From 3457958420271b105fe3e55cd7e9da1f2f124f43 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:16:22 +0100 Subject: [PATCH 04/31] XC-288: Remove unused dependencies --- Cargo.lock | 367 ++++++++++++++++++--------------- Cargo.toml | 3 - canister/Cargo.toml | 4 - canister/src/rpc_client/mod.rs | 2 +- 4 files changed, 205 insertions(+), 171 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3b5748e..b1917cbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cf008e5e1a9e9e22a7d3c9a4992e21a350290069e36d8fb72304ed17e8f2d2" +checksum = "59a194f9d963d8099596278594b3107448656ba73831c9d8c783e613ce86da64" dependencies = [ "brotli", "flate2", @@ -363,9 +363,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675f87afced0413c9bb02843499dbbd3882a237645883f71a2b59644a6d2f753" +checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -405,11 +405,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ - "borsh-derive 1.5.5", + "borsh-derive 1.5.7", "cfg_aliases", ] @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate 3.3.0", @@ -515,9 +515,9 @@ checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "bytemuck_derive" -version = "1.8.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", @@ -680,9 +680,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "jobserver", "libc", @@ -1065,9 +1065,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" dependencies = [ "powerfmt", ] @@ -1309,9 +1309,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ "event-listener 5.4.0", "pin-project-lite", @@ -1347,18 +1347,18 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "five8_const" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b4f62f0f8ca357f93ae90c8c2dd1041a1f665fde2f889ea9b1787903829015" +checksum = "26dec3da8bc3ef08f2c04f61eab298c3ab334523e55f076354d6d6f613799a7b" dependencies = [ "five8_core", ] [[package]] name = "five8_core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94474d15a76982be62ca8a39570dccce148d98c238ebb7408b0a21b2c4bdddc4" +checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" [[package]] name = "fixedbitset" @@ -1537,9 +1537,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -1835,8 +1837,8 @@ dependencies = [ "http 1.3.1", "hyper 1.6.0", "hyper-util", - "rustls 0.23.23", - "rustls-native-certs 0.8.1", + "rustls 0.23.25", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls 0.26.2", @@ -1932,15 +1934,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b5c7628eac357aecda461130f8074468be5aa4d258a002032d82d817f79f1f8" -[[package]] -name = "ic-sha3" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3715f0f4370e8ce6aa9805b81e915ef4420c9dfb5209c71489c27e6f98bd5d65" -dependencies = [ - "sha3", -] - [[package]] name = "ic-stable-structures" version = "0.6.8" @@ -2038,9 +2031,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -2062,9 +2055,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -2083,9 +2076,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -2206,16 +2199,18 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jni" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror 1.0.69", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -2396,9 +2391,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "logos" @@ -2761,9 +2756,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" [[package]] name = "opaque-debug" @@ -2946,7 +2941,7 @@ dependencies = [ "hex", "ic-certification", "ic-transport-types", - "reqwest 0.12.14", + "reqwest 0.12.15", "schemars", "serde", "serde_bytes", @@ -2982,7 +2977,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -3081,34 +3076,36 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" dependencies = [ "bytes", + "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.23", + "rustls 0.23.25", "socket2", "thiserror 2.0.12", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" dependencies = [ "bytes", - "getrandom 0.2.15", - "rand 0.8.5", + "getrandom 0.3.2", + "rand 0.9.0", "ring", "rustc-hash", - "rustls 0.23.23", + "rustls 0.23.25", "rustls-pki-types", "rustls-platform-verifier", "slab", @@ -3120,9 +3117,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "541d0f57c6ec747a90738a52741d3221f7960e8ac2f0ff4b1a63680e033b4ab5" dependencies = [ "cfg_aliases", "libc", @@ -3171,6 +3168,17 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "zerocopy 0.8.24", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -3191,6 +3199,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -3209,6 +3227,15 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.2", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -3366,9 +3393,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ "base64 0.22.1", "bytes", @@ -3391,8 +3418,8 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.23", - "rustls-native-certs 0.8.1", + "rustls 0.23.25", + "rustls-native-certs", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -3475,9 +3502,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags 2.9.0", "errno", @@ -3500,31 +3527,18 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki 0.103.1", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.2.0", - "rustls-pki-types", - "schannel", - "security-framework 2.11.1", -] - [[package]] name = "rustls-native-certs" version = "0.8.1" @@ -3534,7 +3548,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework", ] [[package]] @@ -3566,23 +3580,23 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c7dc240fec5517e6c4eab3310438636cfe6391dfc345ba013109909a90d136" +checksum = "4a5467026f437b4cb2a533865eaa73eb840019a0916f4b9ec563c6e617e086c9" dependencies = [ - "core-foundation 0.9.4", + "core-foundation 0.10.0", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.23", - "rustls-native-certs 0.7.3", + "rustls 0.23.25", + "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.102.8", - "security-framework 2.11.1", + "rustls-webpki 0.103.1", + "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3603,9 +3617,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "ring", "rustls-pki-types", @@ -3694,20 +3708,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.9.0", - "core-foundation 0.9.4", - "core-foundation-sys", - "libc", - "num-bigint 0.4.6", - "security-framework-sys", -] - [[package]] name = "security-framework" version = "3.2.0" @@ -3834,27 +3834,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "serde_tuple" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9b739e59a0e07b7a73bc11c3dcd6abf790d0f54042b67a422d4bd1f6cf6c0" -dependencies = [ - "serde", - "serde_tuple_macros", -] - -[[package]] -name = "serde_tuple_macros" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e87546e85c5047d03b454d12ee25266fc269a461a4029956ca58d246b9aefae" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4020,7 +3999,6 @@ name = "sol_rpc_canister" version = "0.1.0" dependencies = [ "assert_matches", - "bincode", "candid", "candid_parser", "canhttp", @@ -4028,12 +4006,10 @@ dependencies = [ "ciborium", "const_format", "derive_more", - "futures", "hex", "http 1.3.1", "ic-cdk", "ic-metrics-encoder", - "ic-sha3", "ic-stable-structures", "maplit", "minicbor", @@ -4043,7 +4019,6 @@ dependencies = [ "serde", "serde_bytes", "serde_json", - "serde_tuple", "sol_rpc_types", "solana-account", "solana-account-decoder-client-types", @@ -4218,7 +4193,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "borsh 0.10.4", - "borsh 1.5.5", + "borsh 1.5.7", ] [[package]] @@ -4473,7 +4448,7 @@ name = "solana-hash" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "borsh 1.5.5", + "borsh 1.5.7", "bs58", "bytemuck", "bytemuck_derive", @@ -4503,7 +4478,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "bincode", - "borsh 1.5.5", + "borsh 1.5.7", "num-traits", "serde", "serde_derive", @@ -4747,7 +4722,7 @@ dependencies = [ "bincode", "blake3", "borsh 0.10.4", - "borsh 1.5.5", + "borsh 1.5.7", "bs58", "bytemuck", "console_error_panic_hook", @@ -4832,7 +4807,7 @@ name = "solana-program-error" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "borsh 1.5.5", + "borsh 1.5.7", "num-traits", "serde", "serde_derive", @@ -4870,7 +4845,7 @@ version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ "borsh 0.10.4", - "borsh 1.5.5", + "borsh 1.5.7", "bs58", "bytemuck", "bytemuck_derive", @@ -4925,7 +4900,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.23", + "rustls 0.23.25", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -5230,7 +5205,7 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.23", + "rustls 0.23.25", "smallvec", "socket2", "solana-keypair", @@ -5348,7 +5323,7 @@ name = "solana-tls-utils" version = "2.2.0" source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" dependencies = [ - "rustls 0.23.23", + "rustls 0.23.25", "solana-keypair", "solana-pubkey", "solana-signer", @@ -5549,9 +5524,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9156ebd5870ef293bfb43f91c7a74528d363ec0d424afe24160ed5a4343d08a" +checksum = "601f9201feb9b09c00266478bf459952b9ef9a6b94edb2f21eba14ab681a60a9" dependencies = [ "cc", "cfg-if", @@ -5562,9 +5537,9 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ "new_debug_unreachable", "parking_lot", @@ -5720,9 +5695,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ "fastrand", "getrandom 0.3.2", @@ -5803,9 +5778,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.39" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -5818,15 +5793,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -5911,7 +5886,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.23", + "rustls 0.23.25", "tokio", ] @@ -6469,9 +6444,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-registry" @@ -6486,9 +6461,9 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" dependencies = [ "windows-link", ] @@ -6502,6 +6477,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -6529,6 +6513,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +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-targets" version = "0.48.5" @@ -6576,6 +6575,12 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6594,6 +6599,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6612,6 +6623,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6642,6 +6659,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6660,6 +6683,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6678,6 +6707,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6696,6 +6731,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -6813,11 +6854,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -6833,9 +6874,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", @@ -6916,18 +6957,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.3" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index a20e38d5..29c4d199 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,6 @@ ic-canister-log = "0.2.0" ic-cdk = "0.17.1" ic-ed25519 = "0.1.0" ic-metrics-encoder = "1.1" -ic-sha3 = "1.0.0" ic-stable-structures = "0.6.7" ic-test-utilities-load-wasm = { git = "https://github.com/dfinity/ic", tag = "release-2025-01-23_03-04-base" } maplit = "1.0.2" @@ -58,7 +57,6 @@ regex = "1.11.1" serde = { version = "1.0.219", features = ["derive"] } serde_bytes = "0.11.17" serde_json = "1.0.140" -serde_tuple = "1.1.0" solana-clock = "2.2.0" solana-client = "2.2.0" solana-hash = "2.2.0" @@ -75,7 +73,6 @@ strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" tower = "0.5.2" -tower-layer = "0.3.3" tower-http = "0.6.2" url = "2.5" zeroize = { version = "1.8", features = ["zeroize_derive"] } diff --git a/canister/Cargo.toml b/canister/Cargo.toml index 18dce605..b6b1892c 100644 --- a/canister/Cargo.toml +++ b/canister/Cargo.toml @@ -20,12 +20,10 @@ canlog = { path = "../canlog", features = ["derive"] } ciborium = { workspace = true } const_format = { workspace = true } derive_more = { workspace = true } -futures = { workspace = true } hex = { workspace = true } http = { workspace = true } ic-cdk = { workspace = true } ic-metrics-encoder = { workspace = true } -ic-sha3 = { workspace = true } ic-stable-structures = { workspace = true } maplit = { workspace = true } minicbor = { workspace = true } @@ -36,7 +34,6 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_bytes = { workspace = true } -serde_tuple = { workspace = true } solana-account = { workspace = true, features = ["serde"] } solana-account-decoder-client-types = { workspace = true, features = ["zstd"] } solana-pubkey = { workspace = true } @@ -45,7 +42,6 @@ tower-http = { workspace = true, features = ["set-header", "util"] } url = { workspace = true } zeroize = { workspace = true } thiserror = { workspace = true } -bincode = "1.3.3" [dev-dependencies] candid_parser = { workspace = true } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 087667c2..50b45b3a 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -176,7 +176,7 @@ impl SolRpcClient { { self.parallel_call( request.method(), - &[request.params()], + vec![request.params()], self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::Raw), ) From 20e588faff34f1b03e31be9731d6ced913d3f8fe Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:18:23 +0100 Subject: [PATCH 05/31] XC-288: Fix docs --- libs/types/src/solana/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index 49be55cd..4e109a7f 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -59,8 +59,8 @@ pub enum GetAccountInfoEncoding { #[serde(rename = "base64+zstd")] Base64ZStd, /// The encoding attempts to use program-specific state parsers to return more human-readable - /// and explicit account state data. If [`JsonParsed`] is requested but a parser cannot be - /// found, the fallback is [`Base64`] encoding. + /// and explicit account state data. If [`GetAccountInfoEncoding::JsonParsed`] is requested but + /// a parser cannot be found, the fallback is [`GetAccountInfoEncoding::Base64`] encoding. #[serde(rename = "jsonParsed")] JsonParsed, } From d995e977dd7e531f5cd697a53a3e6772da9f241a Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:28:19 +0100 Subject: [PATCH 06/31] XC-288: clippy --- canister/src/rpc_client/mod.rs | 30 +++++++++++++------------- canister/src/rpc_client/sol_rpc/mod.rs | 22 +++++++++---------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 50b45b3a..7737dac9 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -136,21 +136,6 @@ impl SolRpcClient { results } - /// Query the Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method. - pub async fn get_slot( - &self, - params: Option, - ) -> ReducedResult { - self.parallel_call( - "getSlot", - vec![params], - self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), - &Some(ResponseTransform::GetSlot), - ) - .await - .reduce(self.reduction_strategy()) - } - /// Query the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo) RPC method. pub async fn get_account_info( &self, @@ -162,6 +147,21 @@ impl SolRpcClient { (pubkey.to_string(), params), self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), + ) + .await + .reduce(self.reduction_strategy()) + } + + /// Query the Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method. + pub async fn get_slot( + &self, + params: Option, + ) -> ReducedResult { + self.parallel_call( + "getSlot", + vec![params], + self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), + &Some(ResponseTransform::GetSlot), ) .await .reduce(self.reduction_strategy()) diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index d9035050..647b4a73 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -45,10 +45,7 @@ impl ResponseTransform { fn apply(&self, body_bytes: &mut Vec) { use serde_json::{from_slice, to_vec, Value}; - fn canonicalize_get_account_info_response(body: &mut Vec) -> Option> - where - T: Debug + Serialize + DeserializeOwned, - { + fn canonicalize_get_account_info_response(body: &[u8]) -> Option> { let response = from_slice::>(body) .ok()? .map(|result| { @@ -60,15 +57,12 @@ impl ResponseTransform { to_vec(&response).ok() } - fn canonicalize_json_rpc_response(body: &mut Vec) + fn canonicalize_json_rpc_response(body: &[u8]) -> Option> where T: Serialize + DeserializeOwned, { - let response: JsonRpcResponse = match from_slice(body) { - Ok(response) => response, - Err(_) => return, - }; - *body = to_vec(&response).expect("BUG: failed to serialize response"); + let response: JsonRpcResponse = from_slice(body).ok()?; + to_vec(&response).ok() } fn canonicalize_raw(text: &[u8]) -> Option> { @@ -78,14 +72,18 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { - if let Some(bytes) = canonicalize_get_account_info_response::(body_bytes) { + if let Some(bytes) = canonicalize_get_account_info_response(body_bytes) { *body_bytes = bytes } } // TODO XC-292: Add rounding to the response transform and // add a unit test simulating consensus when the providers // return slightly differing results. - Self::GetSlot => canonicalize_json_rpc_response::(body_bytes), + Self::GetSlot => { + if let Some(bytes) = canonicalize_json_rpc_response::(body_bytes) { + *body_bytes = bytes + } + } Self::Raw => { if let Some(bytes) = canonicalize_raw(body_bytes) { *body_bytes = bytes From b70c22ccae0f9cfc99b535f9aa29a92be7d5296f Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:30:43 +0100 Subject: [PATCH 07/31] XC-288: clippy --- canister/src/rpc_client/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 7737dac9..91c199b9 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -148,8 +148,8 @@ impl SolRpcClient { self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), ) - .await - .reduce(self.reduction_strategy()) + .await + .reduce(self.reduction_strategy()) } /// Query the Solana [`getSlot`](https://solana.com/docs/rpc/http/getslot) RPC method. From b192a8851e32d8b1d34aaa9b580577aaadf90342 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 11:59:51 +0100 Subject: [PATCH 08/31] XC-288: streamline canonicalization --- canister/src/rpc_client/sol_rpc/mod.rs | 57 ++++++++++---------------- 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 647b4a73..4267ac58 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -9,7 +9,7 @@ use ic_cdk::{ }; use minicbor::{Decode, Encode}; use serde::{de::DeserializeOwned, Serialize}; -use serde_json::from_value; +use serde_json::{from_slice, from_value, to_vec, Value}; use solana_account::Account; use solana_account_decoder_client_types::UiAccount; use solana_clock::Slot; @@ -43,51 +43,38 @@ pub enum ResponseTransform { impl ResponseTransform { fn apply(&self, body_bytes: &mut Vec) { - use serde_json::{from_slice, to_vec, Value}; - - fn canonicalize_get_account_info_response(body: &[u8]) -> Option> { - let response = from_slice::>(body) - .ok()? - .map(|result| { - from_value::(result["value"].clone()) - .unwrap() - .decode::() - .unwrap() - }); - to_vec(&response).ok() - } - - fn canonicalize_json_rpc_response(body: &[u8]) -> Option> + fn canonicalize_json_rpc_response(body_bytes: &mut Vec, f: impl FnOnce(T) -> R) where T: Serialize + DeserializeOwned, + R: Serialize + DeserializeOwned, { - let response: JsonRpcResponse = from_slice(body).ok()?; - to_vec(&response).ok() - } - - fn canonicalize_raw(text: &[u8]) -> Option> { - let json = from_slice::(text).ok()?; - to_vec(&json).ok() + if let Ok(response) = from_slice::>(body_bytes) { + if let Ok(bytes) = to_vec(&response.map(f)) { + *body_bytes = bytes + } + } } match self { Self::GetAccountInfo => { - if let Some(bytes) = canonicalize_get_account_info_response(body_bytes) { - *body_bytes = bytes - } + canonicalize_json_rpc_response::(body_bytes, |result| { + from_value::(result["value"].clone()) + .unwrap() + .decode::() + .unwrap() + }); } - // TODO XC-292: Add rounding to the response transform and - // add a unit test simulating consensus when the providers - // return slightly differing results. Self::GetSlot => { - if let Some(bytes) = canonicalize_json_rpc_response::(body_bytes) { - *body_bytes = bytes - } + canonicalize_json_rpc_response::( + body_bytes, + // TODO XC-292: Add rounding to the response transform and + // add a unit test simulating consensus when the providers + // return slightly differing results. + std::convert::identity, + ); } Self::Raw => { - if let Some(bytes) = canonicalize_raw(body_bytes) { - *body_bytes = bytes - } + canonicalize_json_rpc_response::(body_bytes, std::convert::identity); } } } From 8a187e25efa332b8346353f7bcef58bc230918b0 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 28 Mar 2025 12:03:38 +0100 Subject: [PATCH 09/31] XC-288: Rename method and add TODO for tests --- canister/src/rpc_client/sol_rpc/mod.rs | 12 ++++++------ canister/src/rpc_client/sol_rpc/tests.rs | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 4267ac58..df626a51 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -43,7 +43,7 @@ pub enum ResponseTransform { impl ResponseTransform { fn apply(&self, body_bytes: &mut Vec) { - fn canonicalize_json_rpc_response(body_bytes: &mut Vec, f: impl FnOnce(T) -> R) + fn canonicalize_response(body_bytes: &mut Vec, f: impl FnOnce(T) -> R) where T: Serialize + DeserializeOwned, R: Serialize + DeserializeOwned, @@ -57,15 +57,15 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { - canonicalize_json_rpc_response::(body_bytes, |result| { + canonicalize_response::(body_bytes, |result| { from_value::(result["value"].clone()) - .unwrap() + .expect("BUG: Unable to deserialize account") .decode::() - .unwrap() + .expect("BUG: Unable to decode account") }); } Self::GetSlot => { - canonicalize_json_rpc_response::( + canonicalize_response::( body_bytes, // TODO XC-292: Add rounding to the response transform and // add a unit test simulating consensus when the providers @@ -74,7 +74,7 @@ impl ResponseTransform { ); } Self::Raw => { - canonicalize_json_rpc_response::(body_bytes, std::convert::identity); + canonicalize_response::(body_bytes, std::convert::identity); } } } diff --git a/canister/src/rpc_client/sol_rpc/tests.rs b/canister/src/rpc_client/sol_rpc/tests.rs index 2fb7efb2..08a3bd68 100644 --- a/canister/src/rpc_client/sol_rpc/tests.rs +++ b/canister/src/rpc_client/sol_rpc/tests.rs @@ -1 +1,2 @@ // TODO XC-292: Add unit tests +// TODO XC-288: Add unit tests From f753c11774a6f976754915bebb1dd8ba5f858978 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 1 Apr 2025 13:38:11 +0200 Subject: [PATCH 10/31] XC-288: Allow option to compile canister without zstd dependency --- Cargo.lock | 32 +++++++++---------- Cargo.toml | 6 ++-- canister/Cargo.toml | 9 +++++- integration_tests/Cargo.toml | 1 - .../tests/solana_test_validator.rs | 2 +- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1917cbc..bbaf19f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,9 +363,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" +checksum = "34a796731680be7931955498a16a10b2270c7762963d5d570fdbfe02dcbf314f" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -602,7 +602,7 @@ dependencies = [ [[package]] name = "canhttp" version = "0.1.0" -source = "git+https://github.com/dfinity/evm-rpc-canister?branch=lpahlavi%2Fjson-rpc-response-map-method-v2#ec70414ad2a4c185a9cbb35f64edcea554a0240a" +source = "git+https://github.com/dfinity/evm-rpc-canister#6cade0c6167da858b8d45700db7de44bf627b207" dependencies = [ "assert_matches", "ciborium", @@ -986,9 +986,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -996,9 +996,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -1010,9 +1010,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -1848,9 +1848,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-channel", @@ -1858,6 +1858,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "hyper 1.6.0", + "libc", "pin-project-lite", "socket2", "tokio", @@ -2756,9 +2757,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -3986,9 +3987,9 @@ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4065,7 +4066,6 @@ dependencies = [ "sol_rpc_canister", "sol_rpc_client", "sol_rpc_types", - "solana-account", "solana-client", "solana-pubkey", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 29c4d199..31e25754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ assert_matches = "1.5.0" async-trait = "0.1.88" candid = "0.10.13" candid_parser = "0.1.4" -canhttp = { git = "https://github.com/dfinity/evm-rpc-canister", branch = "lpahlavi/json-rpc-response-map-method-v2" } +canhttp = { git = "https://github.com/dfinity/evm-rpc-canister", ref = "6cade0c6167da858b8d45700db7de44bf627b207" } ciborium = "0.2.2" # Transitive dependency of ic-ed25519 # See https://forum.dfinity.org/t/module-imports-function-wbindgen-describe-from-wbindgen-placeholder-that-is-not-exported-by-the-runtime/11545/8 @@ -66,9 +66,9 @@ solana-nonce = "2.2.0" solana-program = "2.2.0" solana-pubkey = "2.2.0" solana-signature = "2.2.0" -solana-transaction = { version = "2.2.0", features = ["bincode"] } +solana-transaction = "2.2.0" solana-account = "2.2.0" -solana-account-decoder-client-types = { version = "2.2.0", features = ["zstd"] } +solana-account-decoder-client-types = "2.2.0" strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" diff --git a/canister/Cargo.toml b/canister/Cargo.toml index b6b1892c..8593921a 100644 --- a/canister/Cargo.toml +++ b/canister/Cargo.toml @@ -35,7 +35,7 @@ serde = { workspace = true } serde_json = { workspace = true } serde_bytes = { workspace = true } solana-account = { workspace = true, features = ["serde"] } -solana-account-decoder-client-types = { workspace = true, features = ["zstd"] } +solana-account-decoder-client-types = { workspace = true } solana-pubkey = { workspace = true } tower = { workspace = true } tower-http = { workspace = true, features = ["set-header", "util"] } @@ -46,3 +46,10 @@ thiserror = { workspace = true } [dev-dependencies] candid_parser = { workspace = true } proptest = { workspace = true } + +[features] +# WARNING: Disabling this feature will lead to some functionality not working anymore +# such as decoding of Solana account data in base64+zstd format which in turn might +# lead to some runtime errors. +zstd = ["solana-account-decoder-client-types/zstd"] +default = ["zstd"] diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 251da2c3..a398faed 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -22,7 +22,6 @@ serde_json = { workspace = true } sol_rpc_canister = { path = "../canister" } sol_rpc_client = { path = "../libs/client" } sol_rpc_types = { path = "../libs/types" } -solana-account = { workspace = true } solana-pubkey = { workspace = true } [dev-dependencies] diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 103c74d1..eea94893 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -51,7 +51,7 @@ async fn should_get_account_info() { .get_account_info( pubkey, Some(GetAccountInfoParams { - encoding: Some(GetAccountInfoEncoding::Base64ZStd), + encoding: Some(GetAccountInfoEncoding::Base64), ..GetAccountInfoParams::default() }), ) From 1d551f44c031be56a461125127f3f27e74758387 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Wed, 2 Apr 2025 09:47:25 +0200 Subject: [PATCH 11/31] XC-288: Address review feedback --- Cargo.lock | 4 + canister/scripts/examples.sh | 16 ++ canister/sol_rpc_canister.did | 14 +- canister/src/candid_rpc/mod.rs | 2 +- canister/src/rpc_client/mod.rs | 2 +- canister/src/rpc_client/sol_rpc/mod.rs | 8 +- canister/src/rpc_client/sol_rpc/tests.rs | 41 ++++- integration_tests/Cargo.toml | 1 + .../tests/solana_test_validator.rs | 32 ++-- integration_tests/tests/tests.rs | 60 +++++++ libs/client/Cargo.toml | 3 +- libs/client/src/lib.rs | 29 +++- libs/types/Cargo.toml | 6 +- libs/types/src/lib.rs | 4 +- libs/types/src/solana/mod.rs | 146 ++++++++++++++++-- 15 files changed, 316 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbaf19f1..af3f58fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4042,6 +4042,7 @@ dependencies = [ "serde", "sol_rpc_types", "solana-account", + "solana-account-decoder-client-types", "solana-clock", "solana-pubkey", ] @@ -4066,6 +4067,7 @@ dependencies = [ "sol_rpc_canister", "sol_rpc_client", "sol_rpc_types", + "solana-account-decoder-client-types", "solana-client", "solana-pubkey", "tokio", @@ -4081,7 +4083,9 @@ dependencies = [ "ic-cdk", "regex", "serde", + "serde_json", "solana-account", + "solana-account-decoder-client-types", "solana-pubkey", "strum 0.27.1", "thiserror 2.0.12", diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 3be9d894..54ee65f0 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -24,3 +24,19 @@ GET_SLOT_PARAMS="( opt record { minContextSlot = null; commitment = opt variant { finalized } }, )" dfx canister call sol_rpc getSlot "$GET_SLOT_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1 + +# Get the System Program account into on Mainnet with a 2-out-of-3 strategy +# TODO XC-321: get cycle cost by query method +CYCLES="2B" +GET_ACCOUNT_INFO_PARAMS="( + variant { Default = variant { Mainnet } }, + opt record { + responseConsensus = opt variant { + Threshold = record { min = 2 : nat8; total = opt (3 : nat8) } + }; + responseSizeEstimate = null; + }, + '11111111111111111111111111111111', + opt record { TODO }, +)" +dfx canister call sol_rpc getAccountInfo "$GET_ACCOUNT_INFO_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1 diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index e3646df3..c01672f3 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -152,13 +152,22 @@ type RejectionCode = variant { // Represents the encoding of the return value of the `getAccountInfo` Solana RPC method. type GetAccountInfoEncoding = variant { + // Return the account data encoded in base-58. This is slow and limited to less than 129 bytes of account data. base58; + // Return the account data encoded in base-64. This works for account data of any size. base64; + // Compress the account data using the Zstandard library and return the base64-encoded result. "base64+zstd"; + // Return the data as a JSON string. + // * jsonParsed encoding attempts to use program-specific state parsers to return more human-readable and explicit + // account state data. + // * If jsonParsed is requested but a parser cannot be found, the field falls back to base64 encoding, detectable + // when the data field is type string. jsonParsed; }; -// Represents a slice of the return value of the `getAccountInfo` Solana RPC method. +// Represents a slice of the return value of the `getAccountInfo` Solana RPC method. +// NOTE: Data slicing is only available for base58, base64, or base64+zstd encodings. type DataSlice = record { length: nat64; offset: nat64; @@ -181,7 +190,8 @@ type AccountInfo = record { data: vec nat8; owner: Pubkey; executable: bool; - rent_epoch: nat64; + rentEpoch: nat64; + space: nat64; }; // Represents the result of a call to the `getAccountInfo` Solana RPC method. diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index 89bf342d..2cf81504 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -51,7 +51,7 @@ pub fn hostname(provider: SupportedRpcProvider) -> Option { hostname_from_url(url.as_str()) } -/// Adapt the `EthRpcClient` to the `Candid` interface used by the EVM-RPC canister. +/// Adapt the `SolRpcClient` to the `Candid` interface used by the SOL-RPC canister. pub struct CandidRpcClient { client: SolRpcClient, } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index ef6e391f..db24c01e 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -149,7 +149,7 @@ impl SolRpcClient { &self, pubkey: solana_pubkey::Pubkey, params: Option, - ) -> ReducedResult { + ) -> ReducedResult { self.parallel_call( "getAccountInfo", (pubkey.to_string(), params), diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 3525e01b..28f19734 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -11,7 +11,6 @@ use ic_cdk::{ use minicbor::{Decode, Encode}; use serde::{de::DeserializeOwned, Serialize}; use serde_json::{from_slice, from_value, to_vec, Value}; -use solana_account::Account; use solana_account_decoder_client_types::UiAccount; use solana_clock::Slot; use std::{fmt, fmt::Debug}; @@ -58,11 +57,10 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { - canonicalize_response::(body_bytes, |result| { - from_value::(result["value"].clone()) + canonicalize_response::(body_bytes, |result| { + let value = result["value"].clone(); + from_value::(value) .expect("BUG: Unable to deserialize account") - .decode::() - .expect("BUG: Unable to decode account") }); } Self::GetSlot(rounding_error) => { diff --git a/canister/src/rpc_client/sol_rpc/tests.rs b/canister/src/rpc_client/sol_rpc/tests.rs index 1340f6bb..129562fb 100644 --- a/canister/src/rpc_client/sol_rpc/tests.rs +++ b/canister/src/rpc_client/sol_rpc/tests.rs @@ -1,4 +1,6 @@ use super::*; +use canhttp::http::json::Id; +use solana_account_decoder_client_types::{UiAccountData, UiAccountEncoding}; mod normalization_tests { use super::*; @@ -41,13 +43,48 @@ mod normalization_tests { ); } - fn normalize_result(transform: &ResponseTransform, result: &str) -> String { + #[test] + fn should_normalize_get_account_info_response() { + assert_normalized( + &ResponseTransform::GetAccountInfo, + r#"{ + "context": { "apiVersion": "2.0.15", "slot": 341197053 }, + "value": { + "data": ["1234", "base58"], + "executable": false, + "lamports": 88849814690250, + "owner": "11111111111111111111111111111111", + "rentEpoch": 18446744073709551615, + "space": 0 + } + }"#, + UiAccount { + lamports: 88849814690250, + data: UiAccountData::Binary("1234".to_string(), UiAccountEncoding::Base58), + owner: "11111111111111111111111111111111".to_string(), + executable: false, + rent_epoch: 18446744073709551615, + space: Some(0), + }, + ); + } + + fn assert_normalized(transform: &ResponseTransform, result: &str, expected: T) + where + T: Debug + Serialize + DeserializeOwned, + { + let expected_response = to_vec(&JsonRpcResponse::from_ok(Id::Number(1), expected)).unwrap(); + let normalized_response = normalize_result(transform, result); + assert_eq!(expected_response, normalized_response); + } + + fn normalize_result(transform: &ResponseTransform, result: &str) -> Vec { fn add_envelope(reply: &str) -> Vec { format!("{{\"jsonrpc\": \"2.0\", \"id\": 1, \"result\": {}}}", reply).into_bytes() } let mut response = add_envelope(result); transform.apply(&mut response); - String::from_utf8(response).unwrap() + response } fn assert_normalized_equal(transform: &ResponseTransform, left: &str, right: &str) { diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index a398faed..c84e8410 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -23,6 +23,7 @@ sol_rpc_canister = { path = "../canister" } sol_rpc_client = { path = "../libs/client" } sol_rpc_types = { path = "../libs/types" } solana-pubkey = { workspace = true } +solana-account-decoder-client-types = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index af95e5e8..9d3c2449 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -7,8 +7,7 @@ use pocket_ic::PocketIcBuilder; use sol_rpc_client::SolRpcClient; use sol_rpc_int_tests::PocketIcLiveModeRuntime; use sol_rpc_types::{ - GetAccountInfoEncoding, GetAccountInfoParams, InstallArgs, MultiRpcResult, OverrideProvider, - RegexSubstitution, + GetAccountInfoEncoding, GetAccountInfoParams, InstallArgs, OverrideProvider, RegexSubstitution, }; use solana_client::rpc_client::RpcClient as SolanaRpcClient; use solana_pubkey::Pubkey; @@ -22,10 +21,10 @@ async fn should_get_slot() { .compare_client( |sol| sol.get_slot().expect("Failed to get slot"), |ic| async move { - match ic.get_slot(None, None).await { - MultiRpcResult::Consistent(Ok(slot)) => slot, - result => panic!("Failed to get slot, received: {:?}", result), - } + ic.get_slot(None, None) + .await + .expect_consistent() + .unwrap_or_else(|e| panic!("`getSlot` call failed: {e}")) }, ) .await; @@ -42,24 +41,21 @@ async fn should_get_slot() { async fn should_get_account_info() { let setup = Setup::new().await; let pubkey = Pubkey::from_str("11111111111111111111111111111111").unwrap(); + let config = GetAccountInfoParams { + encoding: Some(GetAccountInfoEncoding::Base64), + ..GetAccountInfoParams::default() + }; let (sol_res, ic_res) = setup .compare_client( |sol| sol.get_account(&pubkey).expect("Failed to get account"), |ic| async move { - match ic - .get_account_info( - pubkey, - Some(GetAccountInfoParams { - encoding: Some(GetAccountInfoEncoding::Base64), - ..GetAccountInfoParams::default() - }), - ) + ic.get_account_info(pubkey, Some(config)) .await - { - MultiRpcResult::Consistent(Ok(account)) => account, - result => panic!("Failed to get account, received: {:?}", result), - } + .expect_consistent() + .unwrap_or_else(|e| panic!("`getAccountInfo` call failed: {e}")) + .decode() + .expect("Failed to decode UiAccount") }, ) .await; diff --git a/integration_tests/tests/tests.rs b/integration_tests/tests/tests.rs index 51cd73fa..10ea6ed0 100644 --- a/integration_tests/tests/tests.rs +++ b/integration_tests/tests/tests.rs @@ -11,6 +11,7 @@ use sol_rpc_types::{ InstallArgs, Mode, ProviderError, RpcAccess, RpcAuth, RpcConfig, RpcEndpoint, RpcError, RpcResult, RpcSource, RpcSources, SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; +use solana_account_decoder_client_types::{UiAccount, UiAccountData, UiAccountEncoding}; use std::str::FromStr; const MOCK_REQUEST_URL: &str = "https://api.devnet.solana.com/"; @@ -140,6 +141,65 @@ mod get_provider_tests { } } +mod get_account_info_tests { + use super::*; + + #[tokio::test] + async fn should_get_account_info() { + for sources in [ + // Use Mainnet providers that do not require API keys + RpcSources::Custom(vec![ + RpcSource::Supported(SupportedRpcProviderId::AlchemyMainnet), + RpcSource::Supported(SupportedRpcProviderId::DrpcMainnet), + RpcSource::Supported(SupportedRpcProviderId::PublicNodeMainnet), + ]), + RpcSources::Default(SolanaCluster::Devnet), + ] { + let setup = Setup::new().await; + let client = setup.client().with_rpc_sources(sources); + let pubkey = + solana_pubkey::Pubkey::from_str("11111111111111111111111111111111").unwrap(); + + let results = client + .mock_sequential_json_rpc_responses::<3>( + 200, + json!({ + "id": 0, + "jsonrpc": "2.0", + "result": { + "context": { "apiVersion": "2.0.15", "slot": 341197053 }, + "value": { + "data": ["1234", "base58"], + "executable": false, + "lamports": 88849814690250u64, + "owner": "11111111111111111111111111111111", + "rentEpoch": 18446744073709551615u64, + "space": 0 + } + }, + }), + ) + .get_account_info(pubkey.into(), None) + .await + .expect_consistent(); + + assert_eq!( + results, + Ok(UiAccount { + lamports: 88849814690250, + data: UiAccountData::Binary("1234".to_string(), UiAccountEncoding::Base58), + owner: "11111111111111111111111111111111".to_string(), + executable: false, + rent_epoch: 18446744073709551615, + space: Some(0), + }) + ); + + setup.drop().await; + } + } +} + mod get_slot_tests { use super::*; diff --git a/libs/client/Cargo.toml b/libs/client/Cargo.toml index 49c2d410..309704d1 100644 --- a/libs/client/Cargo.toml +++ b/libs/client/Cargo.toml @@ -15,7 +15,8 @@ async-trait = { workspace = true } candid = { workspace = true } ic-cdk = { workspace = true } serde = { workspace = true } -solana-clock = { workspace = true } solana-account = { workspace = true } +solana-account-decoder-client-types = { workspace = true } +solana-clock = { workspace = true } solana-pubkey = { workspace = true } sol_rpc_types = { path = "../types" } \ No newline at end of file diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 2723f0e9..5c2145ad 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -11,7 +11,7 @@ use sol_rpc_types::{ GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, RpcConfig, RpcSources, SupportedRpcProvider, SupportedRpcProviderId, }; -use solana_account::Account; +use solana_account_decoder_client_types::UiAccount; use solana_clock::Slot; use solana_pubkey::Pubkey; @@ -123,11 +123,34 @@ impl SolRpcClient { } /// Call `getAccountInfo` on the SOL RPC canister. + /// + /// This method returns a [`solana_account_decoder_client_types::UiAccount`] which contains + /// the whole response from the Solana `getAccountInfo` call. A [`solana_account::Account`] + /// instance may be obtained as follows: + /// ```rust + /// use candid::Principal; + /// use sol_rpc_client::SolRpcClient; + /// use sol_rpc_types::{RpcSources, SolanaCluster}; + /// use std::str::FromStr; + /// + /// let client = SolRpcClient::new_for_ic( + /// Principal::from_text("tghme-zyaaa-aaaar-qarca-cai").unwrap(), + /// RpcSources::Default(SolanaCluster::Mainnet) + /// ); + /// + /// let pubkey = solana_pubkey::Pubkey::from_str("11111111111111111111111111111111"); + /// + /// let account: solana_account::Account = client.get_account_info(pubkey.into(), None) + /// .decode() + /// .expect("Failed to decode UiAccount"); + /// ``` + /// Note, however that [`solana_account::Account`] does not include the `space` field from the + /// response and does not support all account data encoding formats. pub async fn get_account_info( &self, pubkey: Pubkey, params: Option, - ) -> sol_rpc_types::MultiRpcResult { + ) -> sol_rpc_types::MultiRpcResult { self.runtime .update_call::<( RpcSources, @@ -147,7 +170,7 @@ impl SolRpcClient { ) .await .expect("Client error: failed to call `getAccountInfo`") - .map(Account::from) + .map(UiAccount::from) } /// Call `getSlot` on the SOL RPC canister. diff --git a/libs/types/Cargo.toml b/libs/types/Cargo.toml index 5b3f92d3..adcd6037 100644 --- a/libs/types/Cargo.toml +++ b/libs/types/Cargo.toml @@ -17,8 +17,10 @@ derive_more = { workspace = true } ic-cdk = { workspace = true } regex = { workspace = true } serde = { workspace = true } +serde_json = { workspace = true } +solana-account = { workspace = true } +solana-account-decoder-client-types = { workspace = true } +solana-pubkey = { workspace = true } strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } -solana-account = { workspace = true } -solana-pubkey = { workspace = true } diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index 41ba9713..a1f538ad 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -17,6 +17,6 @@ pub use rpc_client::{ SupportedRpcProviderId, }; pub use solana::{ - Account, CommitmentLevel, DataSlice, GetAccountInfoEncoding, GetAccountInfoParams, - GetSlotParams, Pubkey, Slot, + Account, AccountData, AccountEncoding, CommitmentLevel, DataSlice, GetAccountInfoEncoding, + GetAccountInfoParams, GetSlotParams, ParsedAccount, Pubkey, Slot, }; diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index 4e109a7f..8006a19f 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -93,38 +93,154 @@ impl From for solana_pubkey::Pubkey { /// Solana [account](https://solana.com/docs/references/terminology#account) information. #[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] pub struct Account { - /// The lamports in the account. Modifiable by programs. + /// Number of lamports assigned to this account. pub lamports: u64, - /// The data held in this account. Modifiable by programs. - pub data: Vec, - /// Program that owns this account - pub owner: Pubkey, - /// This account's data contains a loaded program (and is now read-only) + /// Data associated with the account. + pub data: AccountData, + /// base-58 encoded Pubkey of the program this account has been assigned to. + pub owner: String, + /// Boolean indicating if the account contains a program (and is strictly read-only). pub executable: bool, - /// The epoch at which this account will next owe rent + /// The epoch at which this account will next owe rent. pub rent_epoch: u64, + /// The data size of the account. + pub space: Option, } -impl From for Account { - fn from(account: solana_account::Account) -> Self { +impl From for Account { + fn from(account: solana_account_decoder_client_types::UiAccount) -> Self { Account { lamports: account.lamports, - data: account.data, - owner: account.owner.into(), + data: account.data.into(), + owner: account.owner, executable: account.executable, rent_epoch: account.rent_epoch, + space: account.space, } } } -impl From for solana_account::Account { +impl From for solana_account_decoder_client_types::UiAccount { fn from(account: Account) -> Self { - solana_account::Account { + solana_account_decoder_client_types::UiAccount { lamports: account.lamports, - data: account.data, - owner: account.owner.into(), + data: account.data.into(), + owner: account.owner, executable: account.executable, rent_epoch: account.rent_epoch, + space: account.space, + } + } +} + +/// Represents the data stored in a Solana [account](https://solana.com/docs/references/terminology#account). +#[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] +pub enum AccountData { + /// The data is formatted as a binary string. This is a legacy format retained for RPC backwards compatibility + LegacyBinary(String), + /// The data is formatted as a JSON [`ParsedAccount`]. + Json(ParsedAccount), + /// The data is formatted as a string containing the account data encoded according to one of + /// the [`AccountEncoding`] formats. + Binary(String, AccountEncoding), +} + +impl From for AccountData { + fn from(data: solana_account_decoder_client_types::UiAccountData) -> Self { + use solana_account_decoder_client_types::UiAccountData; + match data { + UiAccountData::LegacyBinary(value) => Self::LegacyBinary(value), + UiAccountData::Json(value) => Self::Json(value.into()), + UiAccountData::Binary(value, encoding) => Self::Binary(value, encoding.into()), + } + } +} + +impl From for solana_account_decoder_client_types::UiAccountData { + fn from(data: AccountData) -> Self { + use solana_account_decoder_client_types::UiAccountData; + match data { + AccountData::LegacyBinary(value) => UiAccountData::LegacyBinary(value), + AccountData::Json(value) => UiAccountData::Json(value.into()), + AccountData::Binary(value, encoding) => UiAccountData::Binary(value, encoding.into()), + } + } +} + +/// Represents parsed Solana [account](https://solana.com/docs/references/terminology#account) data. +#[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] +pub struct ParsedAccount { + /// The Solana [program](https://solana.com/docs/references/terminology#program) that interprets the data. + pub program: String, + /// The account data parsed a JSON and formatted as a string. + pub parsed: String, + /// The data size of the account. + pub space: u64, +} + +impl From for ParsedAccount { + fn from(account: solana_account_decoder_client_types::ParsedAccount) -> Self { + Self { + program: account.program, + parsed: serde_json::to_string(&account.parsed) + .expect("Unable to convert JSON to string"), + space: account.space, + } + } +} + +impl From for solana_account_decoder_client_types::ParsedAccount { + fn from(account: ParsedAccount) -> Self { + Self { + program: account.program, + parsed: serde_json::from_str(&account.parsed).expect("Unable to parse string as JSON"), + space: account.space, + } + } +} + +/// Represents an encoding format for Solana [account](https://solana.com/docs/references/terminology#account) data. +#[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] +pub enum AccountEncoding { + /// The account data is formatted as a binary string. + #[serde(rename = "binary")] + Binary, // Legacy. Retained for RPC backwards compatibility + /// The account data is formatted as a base-58 string. + #[serde(rename = "base58")] + Base58, + /// The account data is formatted as a base-58 string. + #[serde(rename = "base64")] + Base64, + /// The account data was first compressed using [Zstandard](http://facebook.github.io/zstd/) and the + /// result was then formatted as a base-64 string. + #[serde(rename = "base64+zstd")] + Base64Zstd, + /// The account data is formatted as a JSON string. + #[serde(rename = "jsonParsed")] + JsonParsed, +} + +impl From for AccountEncoding { + fn from(encoding: solana_account_decoder_client_types::UiAccountEncoding) -> Self { + use solana_account_decoder_client_types::UiAccountEncoding; + match encoding { + UiAccountEncoding::Binary => Self::Binary, + UiAccountEncoding::Base58 => Self::Base58, + UiAccountEncoding::Base64 => Self::Base64, + UiAccountEncoding::JsonParsed => Self::JsonParsed, + UiAccountEncoding::Base64Zstd => Self::Base64Zstd, + } + } +} + +impl From for solana_account_decoder_client_types::UiAccountEncoding { + fn from(encoding: AccountEncoding) -> Self { + match encoding { + AccountEncoding::Binary => Self::Binary, + AccountEncoding::Base58 => Self::Base58, + AccountEncoding::Base64 => Self::Base64, + AccountEncoding::JsonParsed => Self::JsonParsed, + AccountEncoding::Base64Zstd => Self::Base64Zstd, } } } From 4aa5eab970ef20e9e81fa0c84c864dcdd23a48e4 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 09:19:32 +0200 Subject: [PATCH 12/31] XC-288: Fix Candid interface --- canister/sol_rpc_canister.did | 46 ++++++++++++++++++++++++-- canister/src/candid_rpc/mod.rs | 6 ++-- canister/src/main.rs | 6 ++-- canister/src/rpc_client/sol_rpc/mod.rs | 3 +- libs/client/src/lib.rs | 2 +- libs/types/src/lib.rs | 2 +- libs/types/src/solana/mod.rs | 16 +++++---- 7 files changed, 63 insertions(+), 18 deletions(-) diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index c01672f3..050b5474 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -186,14 +186,56 @@ type Pubkey = vec nat8; // Solana account info. type AccountInfo = record { + // Number of lamports assigned to this account. lamports: nat64; - data: vec nat8; - owner: Pubkey; + // Data associated with the account. + data: AccountData; + // base-58 encoded Pubkey of the program this account has been assigned to. + owner: text; + // Boolean indicating if the account contains a program (and is strictly read-only). executable: bool; + // The epoch at which this account will next owe rent. rentEpoch: nat64; + // The data size of the account. + space: opt nat64; +}; + +// Represents Solana account data. +type AccountData = variant { + // The data is formatted as a binary string. This is a legacy format retained for RPC backwards compatibility + legacyBinary: text; + // The data is formatted as a JSON `ParsedAccount`. + json: ParsedAccount; + // The data is formatted as a string containing the account data encoded according to one of + // the `AccountEncoding` formats. + binary: record { text; AccountEncoding }; +}; + +// Represents Solana account data parsed as JSON. +type ParsedAccount = record { + // The Solana program that interprets the data. + program: text; + // The account data parsed a JSON and formatted as a string. + parsed: text; + // The data size of the account. space: nat64; }; +// Represents an encoding format for Solana account data. +type AccountEncoding = variant { + // The account data is formatted as a binary string. Legacy. Retained for RPC backwards compatibility. + binary; + // The account data is formatted as a base-58 string. + base58; + // The account data is formatted as a base-64 string. + base64; + // The account data was first compressed using Zstandard and the + // result was then formatted as a base-64 string. + "base64+zstd"; + // The account data is formatted as a JSON string. + jsonParsed; +}; + // Represents the result of a call to the `getAccountInfo` Solana RPC method. type GetAccountInfoResult = variant { Ok : AccountInfo; Err : RpcError }; diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index 2cf81504..0f70b4a5 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -9,7 +9,7 @@ use crate::{ use canhttp::multi::ReductionError; use serde::Serialize; use sol_rpc_types::{ - Account, GetAccountInfoParams, GetSlotParams, MultiRpcResult, Pubkey, RpcAccess, RpcAuth, + AccountInfo, GetAccountInfoParams, GetSlotParams, MultiRpcResult, Pubkey, RpcAccess, RpcAuth, RpcConfig, RpcResult, RpcSource, RpcSources, Slot, SupportedRpcProvider, }; use std::fmt::Debug; @@ -75,12 +75,12 @@ impl CandidRpcClient { &self, pubkey: Pubkey, params: Option, - ) -> MultiRpcResult { + ) -> MultiRpcResult { process_result( RpcMethod::GetAccountInfo, self.client.get_account_info(pubkey.into(), params).await, ) - .map(Account::from) + .map(AccountInfo::from) } pub async fn get_slot(&self, params: Option) -> MultiRpcResult { diff --git a/canister/src/main.rs b/canister/src/main.rs index 722ee859..1242a68c 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -13,8 +13,8 @@ use sol_rpc_canister::{ types::RoundingError, }; use sol_rpc_types::{ - Account, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, MultiRpcResult, Pubkey, RpcAccess, RpcConfig, - RpcError, RpcSources, Slot, SupportedRpcProvider, SupportedRpcProviderId, + AccountInfo, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, MultiRpcResult, Pubkey, + RpcAccess, RpcConfig, RpcError, RpcSources, Slot, SupportedRpcProvider, SupportedRpcProviderId, }; use std::str::FromStr; @@ -81,7 +81,7 @@ async fn get_account_info( config: Option, pubkey: Pubkey, params: Option, -) -> MultiRpcResult { +) -> MultiRpcResult { match CandidRpcClient::new(source, config) { Ok(client) => client.get_account_info(pubkey, params).await, Err(err) => Err(err).into(), diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index 28f19734..a90cd9cd 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -58,8 +58,7 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { canonicalize_response::(body_bytes, |result| { - let value = result["value"].clone(); - from_value::(value) + from_value::(result["value"].clone()) .expect("BUG: Unable to deserialize account") }); } diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 5c2145ad..7bacaca7 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -157,7 +157,7 @@ impl SolRpcClient { Option, sol_rpc_types::Pubkey, Option, - ), sol_rpc_types::MultiRpcResult>( + ), sol_rpc_types::MultiRpcResult>( self.sol_rpc_canister, "getAccountInfo", ( diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index a1f538ad..a03696b1 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -17,6 +17,6 @@ pub use rpc_client::{ SupportedRpcProviderId, }; pub use solana::{ - Account, AccountData, AccountEncoding, CommitmentLevel, DataSlice, GetAccountInfoEncoding, + AccountInfo, AccountData, AccountEncoding, CommitmentLevel, DataSlice, GetAccountInfoEncoding, GetAccountInfoParams, GetSlotParams, ParsedAccount, Pubkey, Slot, }; diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index 8006a19f..2f0ed6fd 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -92,7 +92,7 @@ impl From for solana_pubkey::Pubkey { /// Solana [account](https://solana.com/docs/references/terminology#account) information. #[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] -pub struct Account { +pub struct AccountInfo { /// Number of lamports assigned to this account. pub lamports: u64, /// Data associated with the account. @@ -102,14 +102,15 @@ pub struct Account { /// Boolean indicating if the account contains a program (and is strictly read-only). pub executable: bool, /// The epoch at which this account will next owe rent. + #[serde(rename = "rentEpoch")] pub rent_epoch: u64, /// The data size of the account. pub space: Option, } -impl From for Account { +impl From for AccountInfo { fn from(account: solana_account_decoder_client_types::UiAccount) -> Self { - Account { + AccountInfo { lamports: account.lamports, data: account.data.into(), owner: account.owner, @@ -120,8 +121,8 @@ impl From for Account { } } -impl From for solana_account_decoder_client_types::UiAccount { - fn from(account: Account) -> Self { +impl From for solana_account_decoder_client_types::UiAccount { + fn from(account: AccountInfo) -> Self { solana_account_decoder_client_types::UiAccount { lamports: account.lamports, data: account.data.into(), @@ -137,11 +138,14 @@ impl From for solana_account_decoder_client_types::UiAccount { #[derive(Debug, Clone, Deserialize, Serialize, CandidType, PartialEq)] pub enum AccountData { /// The data is formatted as a binary string. This is a legacy format retained for RPC backwards compatibility + #[serde(rename = "legacyBinary")] LegacyBinary(String), /// The data is formatted as a JSON [`ParsedAccount`]. + #[serde(rename = "json")] Json(ParsedAccount), /// The data is formatted as a string containing the account data encoded according to one of /// the [`AccountEncoding`] formats. + #[serde(rename = "binary")] Binary(String, AccountEncoding), } @@ -208,7 +212,7 @@ pub enum AccountEncoding { /// The account data is formatted as a base-58 string. #[serde(rename = "base58")] Base58, - /// The account data is formatted as a base-58 string. + /// The account data is formatted as a base-64 string. #[serde(rename = "base64")] Base64, /// The account data was first compressed using [Zstandard](http://facebook.github.io/zstd/) and the From 0dacc7ef0c23cf516b45cda1f7f5903b9a280b5a Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 09:31:35 +0200 Subject: [PATCH 13/31] XC-288: Fix doctest --- libs/client/src/lib.rs | 9 +++++++-- libs/types/src/lib.rs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 7bacaca7..c8428139 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -132,17 +132,22 @@ impl SolRpcClient { /// use sol_rpc_client::SolRpcClient; /// use sol_rpc_types::{RpcSources, SolanaCluster}; /// use std::str::FromStr; + /// # async fn main () { /// /// let client = SolRpcClient::new_for_ic( /// Principal::from_text("tghme-zyaaa-aaaar-qarca-cai").unwrap(), /// RpcSources::Default(SolanaCluster::Mainnet) /// ); /// - /// let pubkey = solana_pubkey::Pubkey::from_str("11111111111111111111111111111111"); + /// let pubkey = solana_pubkey::Pubkey::from_str("11111111111111111111111111111111").unwrap(); /// - /// let account: solana_account::Account = client.get_account_info(pubkey.into(), None) + /// let account: solana_account::Account = client.get_account_info(pubkey, None) + /// .await + /// .expect_consistent() + /// .unwrap() /// .decode() /// .expect("Failed to decode UiAccount"); + /// # } /// ``` /// Note, however that [`solana_account::Account`] does not include the `space` field from the /// response and does not support all account data encoding formats. diff --git a/libs/types/src/lib.rs b/libs/types/src/lib.rs index a03696b1..fab915bf 100644 --- a/libs/types/src/lib.rs +++ b/libs/types/src/lib.rs @@ -17,6 +17,6 @@ pub use rpc_client::{ SupportedRpcProviderId, }; pub use solana::{ - AccountInfo, AccountData, AccountEncoding, CommitmentLevel, DataSlice, GetAccountInfoEncoding, + AccountData, AccountEncoding, AccountInfo, CommitmentLevel, DataSlice, GetAccountInfoEncoding, GetAccountInfoParams, GetSlotParams, ParsedAccount, Pubkey, Slot, }; From a6fd508e964bfbd9b1dc2c2444e1a75bee613201 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 09:47:31 +0200 Subject: [PATCH 14/31] XC-288: Fix doctest --- libs/client/src/lib.rs | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index c8428139..1971778e 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -124,33 +124,14 @@ impl SolRpcClient { /// Call `getAccountInfo` on the SOL RPC canister. /// - /// This method returns a [`solana_account_decoder_client_types::UiAccount`] which contains - /// the whole response from the Solana `getAccountInfo` call. A [`solana_account::Account`] - /// instance may be obtained as follows: - /// ```rust - /// use candid::Principal; - /// use sol_rpc_client::SolRpcClient; - /// use sol_rpc_types::{RpcSources, SolanaCluster}; - /// use std::str::FromStr; - /// # async fn main () { - /// - /// let client = SolRpcClient::new_for_ic( - /// Principal::from_text("tghme-zyaaa-aaaar-qarca-cai").unwrap(), - /// RpcSources::Default(SolanaCluster::Mainnet) - /// ); - /// - /// let pubkey = solana_pubkey::Pubkey::from_str("11111111111111111111111111111111").unwrap(); - /// - /// let account: solana_account::Account = client.get_account_info(pubkey, None) - /// .await - /// .expect_consistent() - /// .unwrap() - /// .decode() - /// .expect("Failed to decode UiAccount"); - /// # } - /// ``` + /// This method returns a [`UiAccount`] which contains the whole response from the Solana + /// `getAccountInfo` call. A [`solana_account::Account`] instance may be obtained as using + /// the [`UiAccount::decode`] method. + /// /// Note, however that [`solana_account::Account`] does not include the `space` field from the /// response and does not support all account data encoding formats. + /// + /// [`UiAccount`]: solana_account_decoder_client_types::UiAccount pub async fn get_account_info( &self, pubkey: Pubkey, @@ -232,8 +213,9 @@ impl SolRpcClient { } } +/// Runtime to be used by canisters on the Internet Computer. #[derive(Copy, Clone, Eq, PartialEq, Debug)] -struct IcRuntime {} +pub struct IcRuntime {} #[async_trait] impl Runtime for IcRuntime { From 27278886b752098139312506367f755af14cd923 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 09:49:30 +0200 Subject: [PATCH 15/31] XC-288: Fix trailing space --- libs/client/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 1971778e..153a174a 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -127,7 +127,7 @@ impl SolRpcClient { /// This method returns a [`UiAccount`] which contains the whole response from the Solana /// `getAccountInfo` call. A [`solana_account::Account`] instance may be obtained as using /// the [`UiAccount::decode`] method. - /// + /// /// Note, however that [`solana_account::Account`] does not include the `space` field from the /// response and does not support all account data encoding formats. /// From 966503c32d60319c58e3bcba7a080b449e10a8d6 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 10:08:46 +0200 Subject: [PATCH 16/31] XC-288: Clippy --- canister/scripts/examples.sh | 9 +++++++-- integration_tests/tests/tests.rs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 54ee65f0..33c9b44a 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -36,7 +36,12 @@ GET_ACCOUNT_INFO_PARAMS="( }; responseSizeEstimate = null; }, - '11111111111111111111111111111111', - opt record { TODO }, + \"11111111111111111111111111111111\", + opt record { + commitment = null; + encoding: = base64; + dataSlice = null; + minContextSlot = null; + }, )" dfx canister call sol_rpc getAccountInfo "$GET_ACCOUNT_INFO_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1 diff --git a/integration_tests/tests/tests.rs b/integration_tests/tests/tests.rs index 10ea6ed0..d138220e 100644 --- a/integration_tests/tests/tests.rs +++ b/integration_tests/tests/tests.rs @@ -179,7 +179,7 @@ mod get_account_info_tests { }, }), ) - .get_account_info(pubkey.into(), None) + .get_account_info(pubkey, None) .await .expect_consistent(); From d0335105537a9235532ba10c4d9e2a124b64589a Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 10:16:19 +0200 Subject: [PATCH 17/31] XC-288: Fix end-to-end test Candid encoding --- canister/scripts/examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 33c9b44a..64af8ed8 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -39,7 +39,7 @@ GET_ACCOUNT_INFO_PARAMS="( \"11111111111111111111111111111111\", opt record { commitment = null; - encoding: = base64; + encoding = base64; dataSlice = null; minContextSlot = null; }, From e80c92df833029d34af48f3a528b59b2429af444 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 10:25:12 +0200 Subject: [PATCH 18/31] XC-288: Fix end-to-end test Candid encoding --- canister/scripts/examples.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 64af8ed8..f848bdbd 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -25,7 +25,7 @@ GET_SLOT_PARAMS="( )" dfx canister call sol_rpc getSlot "$GET_SLOT_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1 -# Get the System Program account into on Mainnet with a 2-out-of-3 strategy +# Get the System Program account info on Mainnet with a 2-out-of-3 strategy # TODO XC-321: get cycle cost by query method CYCLES="2B" GET_ACCOUNT_INFO_PARAMS="( @@ -39,7 +39,7 @@ GET_ACCOUNT_INFO_PARAMS="( \"11111111111111111111111111111111\", opt record { commitment = null; - encoding = base64; + encoding = variant{ base64 }; dataSlice = null; minContextSlot = null; }, From 544521439c5169d86f6befccc9beeb7e3b0c080e Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 10:48:53 +0200 Subject: [PATCH 19/31] XC-288: Fix end-to-end test Candid encoding --- canister/scripts/examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index f848bdbd..6ae7b260 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -36,7 +36,7 @@ GET_ACCOUNT_INFO_PARAMS="( }; responseSizeEstimate = null; }, - \"11111111111111111111111111111111\", + vec { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, opt record { commitment = null; encoding = variant{ base64 }; From d8fd0cdc72fd60edece03b8409a67024bba3dc25 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 11:31:26 +0200 Subject: [PATCH 20/31] XC-288: Fix end-to-end test Candid encoding --- canister/scripts/examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 6ae7b260..b821e06e 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -36,7 +36,7 @@ GET_ACCOUNT_INFO_PARAMS="( }; responseSizeEstimate = null; }, - vec { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + vec { 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 }, opt record { commitment = null; encoding = variant{ base64 }; From c2a80997fa873e39bedc7ca6164f24f590201e58 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 11:38:44 +0200 Subject: [PATCH 21/31] XC-288: Fix end-to-end test Candid encoding --- canister/scripts/examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index b821e06e..393ace75 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -39,7 +39,7 @@ GET_ACCOUNT_INFO_PARAMS="( vec { 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 }, opt record { commitment = null; - encoding = variant{ base64 }; + encoding = opt variant{ base64 }; dataSlice = null; minContextSlot = null; }, From eac50afc65bd2ed64a4c8026405b9a0df92da2eb Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 17:14:45 +0200 Subject: [PATCH 22/31] XC-288: Wrap getAccountInfo arguments into single type --- canister/sol_rpc_canister.did | 1 + canister/src/candid_rpc/mod.rs | 25 ++++++++++++++++--- canister/src/main.rs | 5 ++-- canister/src/rpc_client/mod.rs | 14 +++++++---- canister/src/rpc_client/types.rs | 16 ++++++++++++ .../tests/solana_test_validator.rs | 10 +++++--- libs/client/src/lib.rs | 7 +++--- libs/client/src/request/mod.rs | 10 ++++---- libs/types/src/solana/mod.rs | 16 +++++++++++- 9 files changed, 78 insertions(+), 26 deletions(-) create mode 100644 canister/src/rpc_client/types.rs diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index 050b5474..71ab6b3d 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -175,6 +175,7 @@ type DataSlice = record { // The parameters for a call to the `getAccountInfo` Solana RPC method. type GetAccountInfoParams = record { + pubkey: Pubkey; commitment: opt CommitmentLevel; encoding: opt GetAccountInfoEncoding; dataSlice: opt DataSlice; diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index 0f70b4a5..a7842847 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -1,3 +1,4 @@ +use crate::rpc_client::types::GetAccountInfoConfig; use crate::{ add_metric_entry, metrics::RpcMethod, @@ -9,7 +10,7 @@ use crate::{ use canhttp::multi::ReductionError; use serde::Serialize; use sol_rpc_types::{ - AccountInfo, GetAccountInfoParams, GetSlotParams, MultiRpcResult, Pubkey, RpcAccess, RpcAuth, + AccountInfo, GetAccountInfoParams, GetSlotParams, MultiRpcResult, RpcAccess, RpcAuth, RpcConfig, RpcResult, RpcSource, RpcSources, Slot, SupportedRpcProvider, }; use std::fmt::Debug; @@ -73,12 +74,28 @@ impl CandidRpcClient { pub async fn get_account_info( &self, - pubkey: Pubkey, - params: Option, + params: GetAccountInfoParams, ) -> MultiRpcResult { + let (pubkey, config) = if params.commitment.is_none() + && params.encoding.is_none() + && params.data_slice.is_none() + && params.min_context_slot.is_none() + { + (params.pubkey, None) + } else { + ( + params.pubkey, + Some(GetAccountInfoConfig { + commitment: params.commitment, + encoding: params.encoding, + data_slice: params.data_slice, + min_context_slot: params.min_context_slot, + }), + ) + }; process_result( RpcMethod::GetAccountInfo, - self.client.get_account_info(pubkey.into(), params).await, + self.client.get_account_info(pubkey.into(), config).await, ) .map(AccountInfo::from) } diff --git a/canister/src/main.rs b/canister/src/main.rs index 1242a68c..0c70f4ac 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -79,11 +79,10 @@ async fn update_api_keys(api_keys: Vec<(SupportedRpcProviderId, Option)> async fn get_account_info( source: RpcSources, config: Option, - pubkey: Pubkey, - params: Option, + params: GetAccountInfoParams, ) -> MultiRpcResult { match CandidRpcClient::new(source, config) { - Ok(client) => client.get_account_info(pubkey, params).await, + Ok(client) => client.get_account_info(params).await, Err(err) => Err(err).into(), } } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index db24c01e..e02a4d68 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -1,6 +1,7 @@ mod sol_rpc; #[cfg(test)] mod tests; +pub mod types; use crate::{ http::http_client, @@ -8,7 +9,10 @@ use crate::{ memory::read_state, metrics::MetricRpcMethod, providers::{request_builder, resolve_rpc_provider, Providers}, - rpc_client::sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, + rpc_client::{ + sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, + types::GetAccountInfoConfig, + }, types::RoundingError, }; use canhttp::{ @@ -20,8 +24,8 @@ use canlog::log; use ic_cdk::api::management_canister::http_request::TransformContext; use serde::{de::DeserializeOwned, Serialize}; use sol_rpc_types::{ - ConsensusStrategy, GetAccountInfoParams, GetSlotParams, JsonRpcError, ProviderError, RpcConfig, - RpcError, RpcSource, RpcSources, + ConsensusStrategy, GetSlotParams, JsonRpcError, ProviderError, RpcConfig, RpcError, RpcSource, + RpcSources, }; use std::{collections::BTreeSet, fmt::Debug}; use tower::ServiceExt; @@ -148,11 +152,11 @@ impl SolRpcClient { pub async fn get_account_info( &self, pubkey: solana_pubkey::Pubkey, - params: Option, + config: Option, ) -> ReducedResult { self.parallel_call( "getAccountInfo", - (pubkey.to_string(), params), + (pubkey.to_string(), config), self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), ) diff --git a/canister/src/rpc_client/types.rs b/canister/src/rpc_client/types.rs new file mode 100644 index 00000000..050d9276 --- /dev/null +++ b/canister/src/rpc_client/types.rs @@ -0,0 +1,16 @@ +use serde::{Deserialize, Serialize}; +use sol_rpc_types::{CommitmentLevel, DataSlice, GetAccountInfoEncoding}; + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct GetAccountInfoConfig { + /// The request returns the slot that has reached this or the default commitment level. + pub commitment: Option, + /// Encoding format for Account data. + pub encoding: Option, + /// Request a slice of the account's data. + #[serde(rename = "dataSlice")] + pub data_slice: Option, + /// The minimum slot that the request can be evaluated at. + #[serde(rename = "minContextSlot")] + pub min_context_slot: Option, +} \ No newline at end of file diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 75b3415c..64259d1f 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -43,17 +43,19 @@ async fn should_get_slot() { async fn should_get_account_info() { let setup = Setup::new().await; let pubkey = Pubkey::from_str("11111111111111111111111111111111").unwrap(); - // TODO XC-288 Use - let _config = GetAccountInfoParams { + let params = GetAccountInfoParams { + pubkey: pubkey.into(), + commitment: None, encoding: Some(GetAccountInfoEncoding::Base64), - ..GetAccountInfoParams::default() + data_slice: None, + min_context_slot: None, }; let (sol_res, ic_res) = setup .compare_client( |sol| sol.get_account(&pubkey).expect("Failed to get account"), |ic| async move { - ic.get_account_info(pubkey) + ic.get_account_info(params) .send() .await // TODO XC-288 Remove diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index aab1a791..469f7895 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -52,7 +52,6 @@ use sol_rpc_types::{ SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; use solana_clock::Slot; -use solana_pubkey::Pubkey; use std::sync::Arc; /// The principal identifying the productive Solana RPC canister under NNS control. @@ -193,16 +192,16 @@ impl SolRpcClient { // TODO XC-288 This should return a UiAccount (which is not a candid type) pub fn get_account_info( &self, - pubkey: Pubkey, + params: impl Into, ) -> RequestBuilder< R, RpcConfig, - (sol_rpc_types::Pubkey, Option), + GetAccountInfoParams, sol_rpc_types::MultiRpcResult, > { RequestBuilder::new( self.clone(), - GetAccountInfoRequest::new(pubkey.into()), + GetAccountInfoRequest::new(params.into()), 10_000_000_000, ) } diff --git a/libs/client/src/request/mod.rs b/libs/client/src/request/mod.rs index d7a09bd2..31a90ffd 100644 --- a/libs/client/src/request/mod.rs +++ b/libs/client/src/request/mod.rs @@ -21,17 +21,17 @@ pub trait SolRpcRequest { } #[derive(Debug, Clone)] -pub struct GetAccountInfoRequest(sol_rpc_types::Pubkey, Option); +pub struct GetAccountInfoRequest(GetAccountInfoParams); impl GetAccountInfoRequest { - pub fn new(pubkey: sol_rpc_types::Pubkey) -> Self { - Self(pubkey, None) + pub fn new(params: GetAccountInfoParams) -> Self { + Self(params) } } impl SolRpcRequest for GetAccountInfoRequest { type Config = RpcConfig; - type Params = (sol_rpc_types::Pubkey, Option); + type Params = GetAccountInfoParams; type Output = sol_rpc_types::MultiRpcResult; fn rpc_method(&self) -> &str { @@ -39,7 +39,7 @@ impl SolRpcRequest for GetAccountInfoRequest { } fn params(self) -> Self::Params { - (self.0, self.1) + self.0 } } diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index 2f0ed6fd..caeed451 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -16,8 +16,10 @@ pub struct GetSlotParams { } /// The parameters for a Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getAccountInfo) RPC method call. -#[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] +#[derive(Debug, Clone, Deserialize, Serialize, CandidType)] pub struct GetAccountInfoParams { + /// The public key of the account whose info to fetch. + pub pubkey: Pubkey, /// The request returns the slot that has reached this or the default commitment level. pub commitment: Option, /// Encoding format for Account data. @@ -30,6 +32,18 @@ pub struct GetAccountInfoParams { pub min_context_slot: Option, } +impl> From for GetAccountInfoParams { + fn from(pubkey: T) -> Self { + Self { + pubkey: pubkey.into(), + commitment: None, + encoding: None, + data_slice: None, + min_context_slot: None, + } + } +} + /// [Commitment levels](https://solana.com/docs/rpc#configuring-state-commitment) in Solana, /// representing finality guarantees of transactions and memory queries. #[derive(Debug, Clone, Deserialize, Serialize, CandidType)] From 8b8fdd60e86c226bf87c1f70da941e26c72e12b6 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 17:24:49 +0200 Subject: [PATCH 23/31] XC-288: Streamline conversion --- canister/src/candid_rpc/mod.rs | 20 +------------------ canister/src/rpc_client/mod.rs | 6 +++--- canister/src/rpc_client/types.rs | 33 +++++++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index a7842847..71f6a56a 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -1,4 +1,3 @@ -use crate::rpc_client::types::GetAccountInfoConfig; use crate::{ add_metric_entry, metrics::RpcMethod, @@ -76,26 +75,9 @@ impl CandidRpcClient { &self, params: GetAccountInfoParams, ) -> MultiRpcResult { - let (pubkey, config) = if params.commitment.is_none() - && params.encoding.is_none() - && params.data_slice.is_none() - && params.min_context_slot.is_none() - { - (params.pubkey, None) - } else { - ( - params.pubkey, - Some(GetAccountInfoConfig { - commitment: params.commitment, - encoding: params.encoding, - data_slice: params.data_slice, - min_context_slot: params.min_context_slot, - }), - ) - }; process_result( RpcMethod::GetAccountInfo, - self.client.get_account_info(pubkey.into(), config).await, + self.client.get_account_info(params.into()).await, ) .map(AccountInfo::from) } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index e02a4d68..a1921e94 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -3,6 +3,7 @@ mod sol_rpc; mod tests; pub mod types; +use crate::rpc_client::types::GetAccountInfoParams; use crate::{ http::http_client, logs::Priority, @@ -151,12 +152,11 @@ impl SolRpcClient { /// Query the Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getaccountinfo) RPC method. pub async fn get_account_info( &self, - pubkey: solana_pubkey::Pubkey, - config: Option, + params: GetAccountInfoParams, ) -> ReducedResult { self.parallel_call( "getAccountInfo", - (pubkey.to_string(), config), + params, self.response_size_estimate(1024 + HEADER_SIZE_LIMIT), &Some(ResponseTransform::GetAccountInfo), ) diff --git a/canister/src/rpc_client/types.rs b/canister/src/rpc_client/types.rs index 050d9276..d71cf853 100644 --- a/canister/src/rpc_client/types.rs +++ b/canister/src/rpc_client/types.rs @@ -1,6 +1,37 @@ use serde::{Deserialize, Serialize}; use sol_rpc_types::{CommitmentLevel, DataSlice, GetAccountInfoEncoding}; +#[derive(Serialize, Deserialize, Clone, Debug)] +#[serde(into = "(String, Option)")] +pub struct GetAccountInfoParams(pub solana_pubkey::Pubkey, pub Option); + +impl From for GetAccountInfoParams { + fn from(params: sol_rpc_types::GetAccountInfoParams) -> Self { + let config = if params.commitment.is_none() + && params.encoding.is_none() + && params.data_slice.is_none() + && params.min_context_slot.is_none() + { + None + } else { + Some(GetAccountInfoConfig { + commitment: params.commitment, + encoding: params.encoding, + data_slice: params.data_slice, + min_context_slot: params.min_context_slot, + }) + }; + let pubkey: solana_pubkey::Pubkey = params.pubkey.into(); + Self(pubkey, config) + } +} + +impl From for (String, Option) { + fn from(params: GetAccountInfoParams) -> Self { + (params.0.to_string(), params.1) + } +} + #[derive(Debug, Clone, Deserialize, Serialize)] pub struct GetAccountInfoConfig { /// The request returns the slot that has reached this or the default commitment level. @@ -13,4 +44,4 @@ pub struct GetAccountInfoConfig { /// The minimum slot that the request can be evaluated at. #[serde(rename = "minContextSlot")] pub min_context_slot: Option, -} \ No newline at end of file +} From 57283c6a50287c8f69c14a6fc2ba7a7e86233fe1 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 17:46:29 +0200 Subject: [PATCH 24/31] XC-288: Clippy --- canister/src/rpc_client/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index a1921e94..5e0ab8b2 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -10,10 +10,7 @@ use crate::{ memory::read_state, metrics::MetricRpcMethod, providers::{request_builder, resolve_rpc_provider, Providers}, - rpc_client::{ - sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, - types::GetAccountInfoConfig, - }, + rpc_client::sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, types::RoundingError, }; use canhttp::{ From 175c276bf566e631f7b8c44b0fd94b4051cb64b2 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 18:13:03 +0200 Subject: [PATCH 25/31] XC-288: Clippy --- canister/scripts/examples.sh | 2 +- canister/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 393ace75..0f15545a 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -36,8 +36,8 @@ GET_ACCOUNT_INFO_PARAMS="( }; responseSizeEstimate = null; }, - vec { 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 }, opt record { + pubkey = vec { 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 }; commitment = null; encoding = opt variant{ base64 }; dataSlice = null; diff --git a/canister/src/main.rs b/canister/src/main.rs index 0c70f4ac..66d232b8 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -13,8 +13,8 @@ use sol_rpc_canister::{ types::RoundingError, }; use sol_rpc_types::{ - AccountInfo, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, MultiRpcResult, Pubkey, - RpcAccess, RpcConfig, RpcError, RpcSources, Slot, SupportedRpcProvider, SupportedRpcProviderId, + AccountInfo, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, MultiRpcResult, RpcAccess, + RpcConfig, RpcError, RpcSources, Slot, SupportedRpcProvider, SupportedRpcProviderId, }; use std::str::FromStr; From bc64d28b8487e0603461ab085769fe585ec7c5cb Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Fri, 4 Apr 2025 19:45:05 +0200 Subject: [PATCH 26/31] XC-288: Candid --- canister/sol_rpc_canister.did | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index 71ab6b3d..6ce3a8ca 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -334,7 +334,7 @@ service : (InstallArgs,) -> { updateApiKeys : (vec record { SupportedProvider; opt text }) -> (); // Call the Solana `getAccountInfo` RPC method and return the resulting slot. - getAccountInfo : (RpcSources, opt RpcConfig, Pubkey, opt GetAccountInfoParams) -> (MultiGetAccountInfoResult); + getAccountInfo : (RpcSources, opt RpcConfig, GetAccountInfoParams) -> (MultiGetAccountInfoResult); // Call the Solana `getSlot` RPC method and return the resulting slot. getSlot : (RpcSources, opt GetSlotRpcConfig, opt GetSlotParams) -> (MultiGetSlotResult); From b881a8c086cf19cb90ec82417bfcda28cb2cc522 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Mon, 7 Apr 2025 13:18:17 +0200 Subject: [PATCH 27/31] XC-288: Address review feedback --- Cargo.lock | 2 + Cargo.toml | 2 + canister/scripts/examples.sh | 4 +- canister/sol_rpc_canister.did | 4 +- canister/src/candid_rpc/mod.rs | 4 +- canister/src/main.rs | 2 +- .../src/rpc_client/{types.rs => json/mod.rs} | 11 +--- canister/src/rpc_client/mod.rs | 10 ++-- canister/src/rpc_client/sol_rpc/mod.rs | 13 +++-- canister/src/rpc_client/sol_rpc/tests.rs | 56 +++++++++++++++++-- integration_tests/Cargo.toml | 2 + .../tests/solana_test_validator.rs | 55 +++++++++++++++--- integration_tests/tests/tests.rs | 35 +++++++++++- libs/client/src/lib.rs | 26 ++++++--- libs/client/src/request/mod.rs | 53 +++++++++++++----- libs/types/src/solana/mod.rs | 35 +++++++++--- 16 files changed, 243 insertions(+), 71 deletions(-) rename canister/src/rpc_client/{types.rs => json/mod.rs} (78%) diff --git a/Cargo.lock b/Cargo.lock index a0c48d8a..1d4f044d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4068,9 +4068,11 @@ dependencies = [ "sol_rpc_canister", "sol_rpc_client", "sol_rpc_types", + "solana-account", "solana-account-decoder-client-types", "solana-client", "solana-pubkey", + "solana-rpc-client-api", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 420851bf..db66d3d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,6 +69,7 @@ solana-signature = "2.2.0" solana-transaction = "2.2.0" solana-account = "2.2.0" solana-account-decoder-client-types = "2.2.0" +solana-rpc-client-api = "2.2.0" strum = { version = "0.27.0", features = ["derive"] } thiserror = "2.0.12" tokio = "1.44.1" @@ -94,4 +95,5 @@ solana-program = { git = "https://github.com/lpahlavi/agave.git" } solana-pubkey = { git = "https://github.com/lpahlavi/agave.git" } solana-signature = { git = "https://github.com/lpahlavi/agave.git" } solana-transaction = { git = "https://github.com/lpahlavi/agave.git" } +solana-rpc-client-api = { git = "https://github.com/lpahlavi/agave.git" } solana-system-interface = { git = "https://github.com/lpahlavi/solana-program-system.git" } diff --git a/canister/scripts/examples.sh b/canister/scripts/examples.sh index 0f15545a..00ea79ab 100755 --- a/canister/scripts/examples.sh +++ b/canister/scripts/examples.sh @@ -36,8 +36,8 @@ GET_ACCOUNT_INFO_PARAMS="( }; responseSizeEstimate = null; }, - opt record { - pubkey = vec { 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 }; + record { + pubkey = \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"; commitment = null; encoding = opt variant{ base64 }; dataSlice = null; diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index 6ce3a8ca..d031a781 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -175,7 +175,7 @@ type DataSlice = record { // The parameters for a call to the `getAccountInfo` Solana RPC method. type GetAccountInfoParams = record { - pubkey: Pubkey; + pubkey: text; commitment: opt CommitmentLevel; encoding: opt GetAccountInfoEncoding; dataSlice: opt DataSlice; @@ -238,7 +238,7 @@ type AccountEncoding = variant { }; // Represents the result of a call to the `getAccountInfo` Solana RPC method. -type GetAccountInfoResult = variant { Ok : AccountInfo; Err : RpcError }; +type GetAccountInfoResult = variant { Ok : opt AccountInfo; Err : RpcError }; // Represents an aggregated result from multiple RPC calls to the `getAccountInfo` Solana RPC method. type MultiGetAccountInfoResult = variant { diff --git a/canister/src/candid_rpc/mod.rs b/canister/src/candid_rpc/mod.rs index 71f6a56a..2684cd56 100644 --- a/canister/src/candid_rpc/mod.rs +++ b/canister/src/candid_rpc/mod.rs @@ -74,12 +74,12 @@ impl CandidRpcClient { pub async fn get_account_info( &self, params: GetAccountInfoParams, - ) -> MultiRpcResult { + ) -> MultiRpcResult> { process_result( RpcMethod::GetAccountInfo, self.client.get_account_info(params.into()).await, ) - .map(AccountInfo::from) + .map(|maybe_account| maybe_account.map(AccountInfo::from)) } pub async fn get_slot(&self, params: Option) -> MultiRpcResult { diff --git a/canister/src/main.rs b/canister/src/main.rs index 66d232b8..a04b5638 100644 --- a/canister/src/main.rs +++ b/canister/src/main.rs @@ -80,7 +80,7 @@ async fn get_account_info( source: RpcSources, config: Option, params: GetAccountInfoParams, -) -> MultiRpcResult { +) -> MultiRpcResult> { match CandidRpcClient::new(source, config) { Ok(client) => client.get_account_info(params).await, Err(err) => Err(err).into(), diff --git a/canister/src/rpc_client/types.rs b/canister/src/rpc_client/json/mod.rs similarity index 78% rename from canister/src/rpc_client/types.rs rename to canister/src/rpc_client/json/mod.rs index d71cf853..529aca4d 100644 --- a/canister/src/rpc_client/types.rs +++ b/canister/src/rpc_client/json/mod.rs @@ -3,15 +3,11 @@ use sol_rpc_types::{CommitmentLevel, DataSlice, GetAccountInfoEncoding}; #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(into = "(String, Option)")] -pub struct GetAccountInfoParams(pub solana_pubkey::Pubkey, pub Option); +pub struct GetAccountInfoParams(String, Option); impl From for GetAccountInfoParams { fn from(params: sol_rpc_types::GetAccountInfoParams) -> Self { - let config = if params.commitment.is_none() - && params.encoding.is_none() - && params.data_slice.is_none() - && params.min_context_slot.is_none() - { + let config = if params.is_default_config() { None } else { Some(GetAccountInfoConfig { @@ -21,8 +17,7 @@ impl From for GetAccountInfoParams { min_context_slot: params.min_context_slot, }) }; - let pubkey: solana_pubkey::Pubkey = params.pubkey.into(); - Self(pubkey, config) + Self(params.pubkey, config) } } diff --git a/canister/src/rpc_client/mod.rs b/canister/src/rpc_client/mod.rs index 5e0ab8b2..5c0824f6 100644 --- a/canister/src/rpc_client/mod.rs +++ b/canister/src/rpc_client/mod.rs @@ -1,16 +1,18 @@ +pub mod json; mod sol_rpc; #[cfg(test)] mod tests; -pub mod types; -use crate::rpc_client::types::GetAccountInfoParams; use crate::{ http::http_client, logs::Priority, memory::read_state, metrics::MetricRpcMethod, providers::{request_builder, resolve_rpc_provider, Providers}, - rpc_client::sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, + rpc_client::{ + json::GetAccountInfoParams, + sol_rpc::{ResponseSizeEstimate, ResponseTransform, HEADER_SIZE_LIMIT}, + }, types::RoundingError, }; use canhttp::{ @@ -150,7 +152,7 @@ impl SolRpcClient { pub async fn get_account_info( &self, params: GetAccountInfoParams, - ) -> ReducedResult { + ) -> ReducedResult> { self.parallel_call( "getAccountInfo", params, diff --git a/canister/src/rpc_client/sol_rpc/mod.rs b/canister/src/rpc_client/sol_rpc/mod.rs index a90cd9cd..d6b7edb1 100644 --- a/canister/src/rpc_client/sol_rpc/mod.rs +++ b/canister/src/rpc_client/sol_rpc/mod.rs @@ -57,10 +57,15 @@ impl ResponseTransform { match self { Self::GetAccountInfo => { - canonicalize_response::(body_bytes, |result| { - from_value::(result["value"].clone()) - .expect("BUG: Unable to deserialize account") - }); + canonicalize_response::>( + body_bytes, + |result| match result["value"].clone() { + Value::Null => None, + value => Some( + from_value::(value).expect("Unable to deserialize account"), + ), + }, + ); } Self::GetSlot(rounding_error) => { canonicalize_response::(body_bytes, |slot| rounding_error.round(slot)); diff --git a/canister/src/rpc_client/sol_rpc/tests.rs b/canister/src/rpc_client/sol_rpc/tests.rs index 129562fb..93963d30 100644 --- a/canister/src/rpc_client/sol_rpc/tests.rs +++ b/canister/src/rpc_client/sol_rpc/tests.rs @@ -4,6 +4,8 @@ use solana_account_decoder_client_types::{UiAccountData, UiAccountEncoding}; mod normalization_tests { use super::*; + use proptest::proptest; + use serde_json::json; #[test] fn should_normalize_raw_response() { @@ -58,14 +60,54 @@ mod normalization_tests { "space": 0 } }"#, - UiAccount { + Some(UiAccount { lamports: 88849814690250, data: UiAccountData::Binary("1234".to_string(), UiAccountEncoding::Base58), owner: "11111111111111111111111111111111".to_string(), executable: false, rent_epoch: 18446744073709551615, space: Some(0), - }, + }), + ); + } + + proptest! { + #[test] + fn should_ignore_get_account_info_response_context(slot1: u64, slot2: u64) { + assert_normalized_equal( + &ResponseTransform::GetAccountInfo, + json!({ + "context": { "apiVersion": "2.0.15", "slot": slot1 }, + "value": { + "data": ["1234", "base58"], + "executable": false, + "lamports": 88849814690250u64, + "owner": "11111111111111111111111111111111", + "rentEpoch": 18446744073709551615u64, + "space": 0 + } + }).to_string(), + json!({ + "context": { "apiVersion": "2.0.15", "slot": slot2 }, + "value": { + "data": ["1234", "base58"], + "executable": false, + "lamports": 88849814690250u64, + "owner": "11111111111111111111111111111111", + "rentEpoch": 18446744073709551615u64, + "space": 0 + } + }).to_string(), + ); + } + } + + #[test] + fn should_normalize_empty_get_account_info_response() { + assert_normalized( + &ResponseTransform::GetAccountInfo, + r#"{"context": { "apiVersion": "2.0.15", "slot": 341197053 }}"#, + None::, ); } @@ -87,10 +129,14 @@ mod normalization_tests { response } - fn assert_normalized_equal(transform: &ResponseTransform, left: &str, right: &str) { + fn assert_normalized_equal( + transform: &ResponseTransform, + left: impl AsRef, + right: impl AsRef, + ) { assert_eq!( - normalize_result(transform, left), - normalize_result(transform, right) + normalize_result(transform, left.as_ref()), + normalize_result(transform, right.as_ref()) ); } diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index c84e8410..a47a39b7 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -22,8 +22,10 @@ serde_json = { workspace = true } sol_rpc_canister = { path = "../canister" } sol_rpc_client = { path = "../libs/client" } sol_rpc_types = { path = "../libs/types" } +solana-account = { workspace = true } solana-pubkey = { workspace = true } solana-account-decoder-client-types = { workspace = true } +solana-rpc-client-api = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 64259d1f..3b8b1a56 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -10,8 +10,7 @@ use sol_rpc_types::{ GetAccountInfoEncoding, GetAccountInfoParams, InstallArgs, OverrideProvider, RegexSubstitution, }; use solana_account_decoder_client_types::UiAccount; -use solana_client::rpc_client::RpcClient as SolanaRpcClient; -use solana_pubkey::Pubkey; +use solana_client::rpc_client::{RpcClient as SolanaRpcClient, RpcClient}; use std::{future::Future, str::FromStr}; #[tokio::test(flavor = "multi_thread")] @@ -42,9 +41,9 @@ async fn should_get_slot() { #[tokio::test(flavor = "multi_thread")] async fn should_get_account_info() { let setup = Setup::new().await; - let pubkey = Pubkey::from_str("11111111111111111111111111111111").unwrap(); + let pubkey = solana_pubkey::Pubkey::from_str("11111111111111111111111111111111").unwrap(); let params = GetAccountInfoParams { - pubkey: pubkey.into(), + pubkey: pubkey.to_string(), commitment: None, encoding: Some(GetAccountInfoEncoding::Base64), data_slice: None, @@ -53,17 +52,14 @@ async fn should_get_account_info() { let (sol_res, ic_res) = setup .compare_client( - |sol| sol.get_account(&pubkey).expect("Failed to get account"), + |sol| solana_rpc_client_get_account(&pubkey, sol, None), |ic| async move { ic.get_account_info(params) .send() .await - // TODO XC-288 Remove - .map(UiAccount::from) .expect_consistent() .unwrap_or_else(|e| panic!("`getAccountInfo` call failed: {e}")) - .decode() - .expect("Failed to decode UiAccount") + .map(decode_ui_account) }, ) .await; @@ -73,6 +69,47 @@ async fn should_get_account_info() { setup.setup.drop().await; } +#[tokio::test(flavor = "multi_thread")] +async fn should_not_get_account_info() { + let setup = Setup::new().await; + let pubkey = + solana_pubkey::Pubkey::from_str("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").unwrap(); + + let (sol_res, ic_res) = setup + .compare_client( + |sol| solana_rpc_client_get_account(&pubkey, sol, None), + |ic| async move { + ic.get_account_info(pubkey) + .send() + .await + .expect_consistent() + .unwrap_or_else(|e| panic!("`getAccountInfo` call failed: {e}")) + .map(decode_ui_account) + }, + ) + .await; + + assert_eq!(sol_res, ic_res); + + setup.setup.drop().await; +} + +fn solana_rpc_client_get_account( + pubkey: &solana_pubkey::Pubkey, + sol: &RpcClient, + config: Option, +) -> Option { + sol.get_account_with_config(&pubkey, config.unwrap_or_default()) + .expect("Failed to get account") + .value +} + +fn decode_ui_account(account: UiAccount) -> solana_account::Account { + account + .decode::() + .unwrap_or_else(|| panic!("Failed to decode account")) +} + pub struct Setup { solana_client: SolanaRpcClient, setup: sol_rpc_int_tests::Setup, diff --git a/integration_tests/tests/tests.rs b/integration_tests/tests/tests.rs index 8884871e..2961c69f 100644 --- a/integration_tests/tests/tests.rs +++ b/integration_tests/tests/tests.rs @@ -12,7 +12,7 @@ use sol_rpc_types::{ RpcResult, RpcSource, RpcSources, SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, }; use solana_account_decoder_client_types::{UiAccount, UiAccountData, UiAccountEncoding}; -use std::str::FromStr; +use std::{iter::zip, str::FromStr}; const MOCK_REQUEST_URL: &str = "https://api.devnet.solana.com/"; const MOCK_REQUEST_PAYLOAD: &str = r#"{"jsonrpc":"2.0","id":0,"method":"getVersion"}"#; @@ -145,7 +145,6 @@ mod get_provider_tests { mod get_account_info_tests { use super::*; - use std::iter::zip; #[tokio::test] async fn should_get_account_info() { @@ -197,6 +196,38 @@ mod get_account_info_tests { setup.drop().await; } + + #[tokio::test] + async fn should_not_get_account_info() { + let setup = Setup::new().await.with_mock_api_keys().await; + + for (sources, first_id) in zip(rpc_sources(), vec![0_u8, 3, 6]) { + let client = setup.client().with_rpc_sources(sources); + let pubkey = + solana_pubkey::Pubkey::from_str("11111111111111111111111111111111").unwrap(); + + let results = client + .mock_sequential_json_rpc_responses::<3>( + 200, + json!({ + "id": first_id, + "jsonrpc": "2.0", + "result": { + "context": { "apiVersion": "2.0.15", "slot": 341197053 } + }, + }), + ) + .build() + .get_account_info(pubkey) + .send() + .await + .expect_consistent(); + + assert_eq!(results, Ok(None)); + } + + setup.drop().await; + } } mod get_slot_tests { diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 469f7895..4c76c490 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -48,8 +48,8 @@ use candid::{utils::ArgumentEncoder, CandidType, Principal}; use ic_cdk::api::call::RejectionCode; use serde::de::DeserializeOwned; use sol_rpc_types::{ - AccountInfo, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, RpcConfig, RpcSources, - SolanaCluster, SupportedRpcProvider, SupportedRpcProviderId, + GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, RpcConfig, RpcSources, SolanaCluster, + SupportedRpcProvider, SupportedRpcProviderId, }; use solana_clock::Slot; use std::sync::Arc; @@ -189,7 +189,6 @@ impl ClientBuilder { impl SolRpcClient { /// Call `getAccountInfo` on the SOL RPC canister. - // TODO XC-288 This should return a UiAccount (which is not a candid type) pub fn get_account_info( &self, params: impl Into, @@ -197,7 +196,8 @@ impl SolRpcClient { R, RpcConfig, GetAccountInfoParams, - sol_rpc_types::MultiRpcResult, + sol_rpc_types::MultiRpcResult>, + sol_rpc_types::MultiRpcResult>, > { RequestBuilder::new( self.clone(), @@ -214,6 +214,7 @@ impl SolRpcClient { GetSlotRpcConfig, Option, sol_rpc_types::MultiRpcResult, + sol_rpc_types::MultiRpcResult, > { RequestBuilder::new(self.clone(), GetSlotRequest::default(), 10_000_000_000) } @@ -222,7 +223,13 @@ impl SolRpcClient { pub fn raw_request( &self, json_request: serde_json::Value, - ) -> RequestBuilder> { + ) -> RequestBuilder< + R, + RpcConfig, + String, + sol_rpc_types::MultiRpcResult, + sol_rpc_types::MultiRpcResult, + > { RequestBuilder::new( self.clone(), RawRequest::try_from(json_request).expect("Client error: invalid JSON request"), @@ -255,18 +262,18 @@ impl SolRpcClient { .unwrap() } - async fn execute_request( + async fn execute_request( &self, - request: Request, + request: Request, ) -> Output where Config: CandidType + Send, Params: CandidType + Send, - Output: CandidType + DeserializeOwned, + CandidOutput: Into + CandidType + DeserializeOwned, { self.config .runtime - .update_call( + .update_call::<(RpcSources, Option, Params), CandidOutput>( self.config.sol_rpc_canister, &request.rpc_method, (request.rpc_sources, request.rpc_config, request.params), @@ -279,6 +286,7 @@ impl SolRpcClient { request.rpc_method ) }) + .into() } } diff --git a/libs/client/src/request/mod.rs b/libs/client/src/request/mod.rs index 31a90ffd..fe742cf9 100644 --- a/libs/client/src/request/mod.rs +++ b/libs/client/src/request/mod.rs @@ -1,7 +1,9 @@ use crate::{Runtime, SolRpcClient}; use candid::CandidType; use serde::de::DeserializeOwned; -use sol_rpc_types::{GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, RpcConfig, RpcSources}; +use sol_rpc_types::{ + AccountInfo, GetAccountInfoParams, GetSlotParams, GetSlotRpcConfig, RpcConfig, RpcSources, +}; use solana_clock::Slot; /// Solana RPC endpoint supported by the SOL RPC canister. @@ -10,6 +12,8 @@ pub trait SolRpcRequest { type Config; /// The type of parameters taken by this endpoint. type Params; + /// The Candid type returned when executing this request which is then converted to [`Self::Output`]. + type CandidOutput; /// The type returned by this endpoint. type Output; @@ -32,7 +36,9 @@ impl GetAccountInfoRequest { impl SolRpcRequest for GetAccountInfoRequest { type Config = RpcConfig; type Params = GetAccountInfoParams; - type Output = sol_rpc_types::MultiRpcResult; + type CandidOutput = sol_rpc_types::MultiRpcResult>; + type Output = + sol_rpc_types::MultiRpcResult>; fn rpc_method(&self) -> &str { "getAccountInfo" @@ -49,6 +55,7 @@ pub struct GetSlotRequest(Option); impl SolRpcRequest for GetSlotRequest { type Config = GetSlotRpcConfig; type Params = Option; + type CandidOutput = Self::Output; type Output = sol_rpc_types::MultiRpcResult; fn rpc_method(&self) -> &str { @@ -75,6 +82,7 @@ impl TryFrom for RawRequest { impl SolRpcRequest for RawRequest { type Config = RpcConfig; type Params = String; + type CandidOutput = sol_rpc_types::MultiRpcResult; type Output = sol_rpc_types::MultiRpcResult; fn rpc_method(&self) -> &str { @@ -90,19 +98,26 @@ impl SolRpcRequest for RawRequest { /// /// To construct a [`RequestBuilder`], refer to the [`SolRpcClient`] documentation. #[must_use = "RequestBuilder does nothing until you 'send' it"] -pub struct RequestBuilder { +pub struct RequestBuilder { client: SolRpcClient, - request: Request, + request: Request, } -impl RequestBuilder { +impl + RequestBuilder +{ pub(super) fn new( client: SolRpcClient, rpc_request: RpcRequest, cycles: u128, ) -> Self where - RpcRequest: SolRpcRequest, + RpcRequest: SolRpcRequest< + Config = Config, + Params = Params, + CandidOutput = CandidOutput, + Output = Output, + >, Config: From, { let request = Request { @@ -111,9 +126,10 @@ impl RequestBuilder { client, request } } /// Change the amount of cycles to send for that request. @@ -129,19 +145,25 @@ impl RequestBuilder RequestBuilder { +impl + RequestBuilder +{ /// Constructs the [`Request`] and send it using the [`SolRpcClient`]. pub async fn send(self) -> Output where Config: CandidType + Send, Params: CandidType + Send, - Output: CandidType + DeserializeOwned, + CandidOutput: Into + CandidType + DeserializeOwned, { - self.client.execute_request(self.request).await + self.client + .execute_request::(self.request) + .await } } -impl RequestBuilder { +impl + RequestBuilder +{ /// Change the rounding error for `getSlot` request. pub fn with_rounding_error(mut self, rounding_error: u64) -> Self { if let Some(config) = self.request.rpc_config_mut() { @@ -158,16 +180,17 @@ impl RequestBuilder { +pub struct Request { pub(super) rpc_method: String, pub(super) rpc_sources: RpcSources, pub(super) rpc_config: Option, pub(super) params: Params, pub(super) cycles: u128, - pub(super) _marker: std::marker::PhantomData, + pub(super) _candid_marker: std::marker::PhantomData, + pub(super) _output_marker: std::marker::PhantomData, } -impl Request { +impl Request { /// Get a mutable reference to the cycles. #[inline] pub fn cycles_mut(&mut self) -> &mut u128 { diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index caeed451..7897db0d 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -1,3 +1,4 @@ +use crate::MultiRpcResult; use candid::CandidType; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -18,8 +19,8 @@ pub struct GetSlotParams { /// The parameters for a Solana [`getAccountInfo`](https://solana.com/docs/rpc/http/getAccountInfo) RPC method call. #[derive(Debug, Clone, Deserialize, Serialize, CandidType)] pub struct GetAccountInfoParams { - /// The public key of the account whose info to fetch. - pub pubkey: Pubkey, + /// The public key of the account whose info to fetch formatted as a base-58 string. + pub pubkey: String, /// The request returns the slot that has reached this or the default commitment level. pub commitment: Option, /// Encoding format for Account data. @@ -32,10 +33,20 @@ pub struct GetAccountInfoParams { pub min_context_slot: Option, } -impl> From for GetAccountInfoParams { - fn from(pubkey: T) -> Self { +impl GetAccountInfoParams { + /// Returns `true` if all of the optional config parameters are `None` and `false` otherwise. + pub fn is_default_config(&self) -> bool { + self.commitment.is_none() + && self.encoding.is_none() + && self.data_slice.is_none() + && self.min_context_slot.is_none() + } +} + +impl From for GetAccountInfoParams { + fn from(pubkey: solana_pubkey::Pubkey) -> Self { Self { - pubkey: pubkey.into(), + pubkey: pubkey.to_string(), commitment: None, encoding: None, data_slice: None, @@ -119,7 +130,15 @@ pub struct AccountInfo { #[serde(rename = "rentEpoch")] pub rent_epoch: u64, /// The data size of the account. - pub space: Option, + pub space: u64, +} + +impl From>> + for MultiRpcResult> +{ + fn from(result: MultiRpcResult>) -> Self { + result.map(|maybe_account| maybe_account.map(|account| account.into())) + } } impl From for AccountInfo { @@ -130,7 +149,7 @@ impl From for AccountInfo { owner: account.owner, executable: account.executable, rent_epoch: account.rent_epoch, - space: account.space, + space: account.space.unwrap_or_default(), } } } @@ -143,7 +162,7 @@ impl From for solana_account_decoder_client_types::UiAccount { owner: account.owner, executable: account.executable, rent_epoch: account.rent_epoch, - space: account.space, + space: Some(account.space), } } } From accc0b463743ec8633b81a9d992b9b622405224a Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Mon, 7 Apr 2025 13:31:12 +0200 Subject: [PATCH 28/31] XC-288: Clippy --- canister/sol_rpc_canister.did | 2 +- integration_tests/tests/solana_test_validator.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index d031a781..ccc98508 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -198,7 +198,7 @@ type AccountInfo = record { // The epoch at which this account will next owe rent. rentEpoch: nat64; // The data size of the account. - space: opt nat64; + space: nat64; }; // Represents Solana account data. diff --git a/integration_tests/tests/solana_test_validator.rs b/integration_tests/tests/solana_test_validator.rs index 3b8b1a56..8ceca2d9 100644 --- a/integration_tests/tests/solana_test_validator.rs +++ b/integration_tests/tests/solana_test_validator.rs @@ -99,7 +99,7 @@ fn solana_rpc_client_get_account( sol: &RpcClient, config: Option, ) -> Option { - sol.get_account_with_config(&pubkey, config.unwrap_or_default()) + sol.get_account_with_config(pubkey, config.unwrap_or_default()) .expect("Failed to get account") .value } From 51b5bcad993217dafc24b477efc58926c3eb4ed2 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 8 Apr 2025 12:36:13 +0200 Subject: [PATCH 29/31] XC-288: Address review feedback --- canister/sol_rpc_canister.did | 20 +++++++++++--------- canister/src/rpc_client/json/mod.rs | 2 +- libs/types/src/solana/mod.rs | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/canister/sol_rpc_canister.did b/canister/sol_rpc_canister.did index ccc98508..26adaa83 100644 --- a/canister/sol_rpc_canister.did +++ b/canister/sol_rpc_canister.did @@ -169,21 +169,22 @@ type GetAccountInfoEncoding = variant { // Represents a slice of the return value of the `getAccountInfo` Solana RPC method. // NOTE: Data slicing is only available for base58, base64, or base64+zstd encodings. type DataSlice = record { - length: nat64; - offset: nat64; + length: nat32; + offset: nat32; }; // The parameters for a call to the `getAccountInfo` Solana RPC method. type GetAccountInfoParams = record { - pubkey: text; + pubkey: Pubkey; commitment: opt CommitmentLevel; encoding: opt GetAccountInfoEncoding; dataSlice: opt DataSlice; minContextSlot: opt nat64; }; -// A Solana Ed25519 public key. -type Pubkey = vec nat8; +// Address of a Solana account as a base-58 encoded string. +// Example: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" +type Pubkey = text; // Solana account info. type AccountInfo = record { @@ -191,8 +192,8 @@ type AccountInfo = record { lamports: nat64; // Data associated with the account. data: AccountData; - // base-58 encoded Pubkey of the program this account has been assigned to. - owner: text; + // Pubkey of the program this account has been assigned to. + owner: Pubkey; // Boolean indicating if the account contains a program (and is strictly read-only). executable: bool; // The epoch at which this account will next owe rent. @@ -215,8 +216,8 @@ type AccountData = variant { // Represents Solana account data parsed as JSON. type ParsedAccount = record { // The Solana program that interprets the data. - program: text; - // The account data parsed a JSON and formatted as a string. + program: Pubkey; + // The account data parsed as JSON and formatted as a string. parsed: text; // The data size of the account. space: nat64; @@ -238,6 +239,7 @@ type AccountEncoding = variant { }; // Represents the result of a call to the `getAccountInfo` Solana RPC method. +// If the requested account doesn't exist, the `Ok` variant will be null. type GetAccountInfoResult = variant { Ok : opt AccountInfo; Err : RpcError }; // Represents an aggregated result from multiple RPC calls to the `getAccountInfo` Solana RPC method. diff --git a/canister/src/rpc_client/json/mod.rs b/canister/src/rpc_client/json/mod.rs index 529aca4d..48999e9a 100644 --- a/canister/src/rpc_client/json/mod.rs +++ b/canister/src/rpc_client/json/mod.rs @@ -27,7 +27,7 @@ impl From for (String, Option) { } } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct GetAccountInfoConfig { /// The request returns the slot that has reached this or the default commitment level. pub commitment: Option, diff --git a/libs/types/src/solana/mod.rs b/libs/types/src/solana/mod.rs index 7897db0d..7796eb4f 100644 --- a/libs/types/src/solana/mod.rs +++ b/libs/types/src/solana/mod.rs @@ -94,9 +94,9 @@ pub enum GetAccountInfoEncoding { #[derive(Debug, Clone, Default, Deserialize, Serialize, CandidType)] pub struct DataSlice { /// Number of bytes to return. - length: u64, // TODO XC-288: Is this correct for usize? + length: u32, /// Byte offset from which to start reading. - offset: u64, // TODO XC-288: Is this correct for usize? + offset: u32, } /// Solana Ed25519 [public key](`https://solana.com/docs/references/terminology#public-key-pubkey`). @@ -149,7 +149,7 @@ impl From for AccountInfo { owner: account.owner, executable: account.executable, rent_epoch: account.rent_epoch, - space: account.space.unwrap_or_default(), + space: account.space.expect("'space' field should not be null"), } } } From b8f1967a3e61425935261281c3bcb2e96a3dc65d Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 8 Apr 2025 12:55:48 +0200 Subject: [PATCH 30/31] XC-288: Fix patch --- Cargo.lock | 1460 ++++++++++++++++++++++++---------------------------- Cargo.toml | 7 +- 2 files changed, 685 insertions(+), 782 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dab48a76..8b0523db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,20 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "agave-feature-set" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973a83d0d66d1f04647d1146a07736864f0742300b56bf2a5aadf5ce7b22fe47" +dependencies = [ + "ahash", + "solana-epoch-schedule", + "solana-feature-set-interface", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", +] + [[package]] name = "ahash" version = "0.8.11" @@ -268,14 +282,14 @@ dependencies = [ "num 0.4.3", "serde", "serde_json", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", + "solana-message", "solana-nonce", "solana-program", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-pubkey", + "solana-signature", + "solana-transaction", ] [[package]] @@ -4022,10 +4036,10 @@ dependencies = [ "serde_bytes", "serde_json", "sol_rpc_types", - "solana-account 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", + "solana-pubkey", "thiserror 2.0.12", "tower", "tower-http", @@ -4043,10 +4057,10 @@ dependencies = [ "serde", "serde_json", "sol_rpc_types", - "solana-account 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", + "solana-pubkey", ] [[package]] @@ -4069,10 +4083,10 @@ dependencies = [ "sol_rpc_canister", "sol_rpc_client", "sol_rpc_types", - "solana-account 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-account", + "solana-account-decoder-client-types", "solana-client", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-rpc-client-api", "tokio", ] @@ -4088,9 +4102,9 @@ dependencies = [ "regex", "serde", "serde_json", - "solana-account 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-decoder-client-types", + "solana-pubkey", "strum 0.27.1", "thiserror 2.0.12", "url", @@ -4098,165 +4112,116 @@ dependencies = [ [[package]] name = "solana-account" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f949fe4edaeaea78c844023bfc1c898e0b1f5a100f8a8d2d0f85d0a7b090258" dependencies = [ "bincode", "serde", "serde_bytes", "serde_derive", - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", "solana-sysvar", ] -[[package]] -name = "solana-account" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-account-info 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-clock 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sdk-ids 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-account-decoder-client-types" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "base64 0.22.1", - "bs58", - "serde", - "serde_derive", - "serde_json", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "zstd", -] - [[package]] name = "solana-account-decoder-client-types" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c5d7d0f1581d98a869f2569122ded67e0735f3780d787b3e7653bdcd1708a2" dependencies = [ "base64 0.22.1", "bs58", "serde", "serde_derive", "serde_json", - "solana-account 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-account", + "solana-pubkey", "zstd", ] [[package]] name = "solana-account-info" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c17d606a298a205fae325489fbed88ee6dc4463c111672172327e741c8905d" dependencies = [ "bincode", "serde", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-memory 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-account-info" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "solana-program-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-program-memory 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", ] [[package]] name = "solana-address-lookup-table-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1673f67efe870b64a65cb39e6194be5b26527691ce5922909939961a6e6b395" dependencies = [ "bincode", "bytemuck", "serde", "serde_derive", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", "solana-slot-hashes", ] [[package]] name = "solana-atomic-u64" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "parking_lot", -] - -[[package]] -name = "solana-atomic-u64" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52e52720efe60465b052b9e7445a01c17550666beec855cce66f44766697bc2" dependencies = [ "parking_lot", ] [[package]] name = "solana-big-mod-exp" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" dependencies = [ "num-bigint 0.4.6", "num-traits", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-bincode" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "bincode", - "serde", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-define-syscall", ] [[package]] name = "solana-bincode" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a3787b8cf9c9fe3dd360800e8b70982b9e5a8af9e11c354b6665dd4a003adc" dependencies = [ "bincode", "serde", - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-instruction", ] [[package]] name = "solana-blake3-hasher" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0801e25a1b31a14494fc80882a036be0ffd290efc4c2d640bfcca120a4672" dependencies = [ "blake3", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", ] [[package]] name = "solana-borsh" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718333bcd0a1a7aed6655aa66bef8d7fb047944922b2d3a18f49cbc13e73d004" dependencies = [ "borsh 0.10.4", "borsh 1.5.7", @@ -4264,8 +4229,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32a6ae5a74f13425eb0f8503b9a2c0bf59581e98deeee2d0555dfe6f05502c9" dependencies = [ "async-trait", "bincode", @@ -4277,31 +4243,31 @@ dependencies = [ "log", "quinn", "rayon", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", "solana-client-traits", "solana-commitment-config", "solana-connection-cache", "solana-epoch-info", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-message", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", "solana-time-utils", "solana-tpu-client", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", "thiserror 2.0.12", "tokio", @@ -4309,56 +4275,52 @@ dependencies = [ [[package]] name = "solana-client-traits" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f0071874e629f29e0eb3dab8a863e98502ac7aba55b7e0df1803fc5cac72a7" dependencies = [ - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", "solana-commitment-config", "solana-epoch-info", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signature", + "solana-signer", "solana-system-interface", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction", + "solana-transaction-error", ] [[package]] name = "solana-clock" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c2177a1b9fe8326004f1151a5acd124420b737811080b1035df31349e4d892" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", + "solana-sdk-macro", "solana-sysvar-id", ] -[[package]] -name = "solana-clock" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "solana-sdk-macro 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - [[package]] name = "solana-cluster-type" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ace9fea2daa28354d107ea879cff107181d85cd4e0f78a2bedb10e1a428c97e" dependencies = [ - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", ] [[package]] name = "solana-commitment-config" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac49c4dde3edfa832de1697e9bcdb7c3b3f7cb7a1981b7c62526c8bb6700fb73" dependencies = [ "serde", "serde_derive", @@ -4366,8 +4328,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240bc217ca05f3e1d1d88f1cfda14b785a02288a630419e4a0ecd6b4fa5094b7" dependencies = [ "async-trait", "bincode", @@ -4377,45 +4340,30 @@ dependencies = [ "log", "rand 0.8.5", "rayon", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", "solana-measure", "solana-metrics", "solana-net-utils", "solana-time-utils", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", "thiserror 2.0.12", "tokio", ] [[package]] name = "solana-cpi" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc71126edddc2ba014622fc32d0f5e2e78ec6c5a1e0eb511b85618c09e9ea11" dependencies = [ - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", + "solana-define-syscall", + "solana-instruction", + "solana-program-error", + "solana-pubkey", "solana-stable-layout", ] -[[package]] -name = "solana-decode-error" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "num-traits", -] - -[[package]] -name = "solana-decode-error" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "num-traits", -] - [[package]] name = "solana-decode-error" version = "2.2.1" @@ -4427,18 +4375,15 @@ dependencies = [ [[package]] name = "solana-define-syscall" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[package]] -name = "solana-define-syscall" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf784bb2cb3e02cac9801813c30187344228d2ae952534902108f6150573a33d" [[package]] name = "solana-epoch-info" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ef6f0b449290b0b9f32973eefd95af35b01c5c0c34c569f936c34c5b20d77b" dependencies = [ "serde", "serde_derive", @@ -4446,84 +4391,86 @@ dependencies = [ [[package]] name = "solana-epoch-rewards" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b575d3dd323b9ea10bb6fe89bf6bf93e249b215ba8ed7f68f1a3633f384db7" dependencies = [ "serde", "serde_derive", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-sdk-ids", + "solana-sdk-macro", "solana-sysvar-id", ] [[package]] name = "solana-epoch-schedule" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce071fbddecc55d727b1d7ed16a629afe4f6e4c217bc8d00af3b785f6f67ed" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", + "solana-sdk-macro", "solana-sysvar-id", ] [[package]] name = "solana-example-mocks" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84461d56cbb8bb8d539347151e0525b53910102e4bced875d49d5139708e39d3" dependencies = [ "serde", "serde_derive", "solana-address-lookup-table-interface", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", + "solana-hash", + "solana-instruction", "solana-keccak-hasher", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-message", "solana-nonce", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", + "solana-sdk-ids", "solana-system-interface", "thiserror 2.0.12", ] [[package]] name = "solana-feature-gate-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9c7fbf3e58b64a667c5f35e90af580538a95daea7001ff7806c0662d301bdf" dependencies = [ "bincode", "serde", "serde_derive", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", "solana-rent", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", "solana-system-interface", ] [[package]] -name = "solana-feature-set" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +name = "solana-feature-set-interface" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02007757246e40f10aa936dae4fa27efbf8dbd6a59575a12ccc802c1aea6e708" dependencies = [ "ahash", - "lazy_static", - "solana-epoch-schedule", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sha256-hasher 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", ] [[package]] name = "solana-fee-calculator" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89bc408da0fb3812bc3008189d148b4d3e08252c79ad810b245482a3f70cd8d" dependencies = [ "log", "serde", @@ -4532,265 +4479,225 @@ dependencies = [ [[package]] name = "solana-hash" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf7bcb14392900fe02e4e34e90234fbf0c673d4e327888410ba99fa2ba0f4e99" dependencies = [ "borsh 1.5.7", "bs58", "bytemuck", "bytemuck_derive", + "js-sys", "serde", "serde_derive", - "solana-atomic-u64 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-hash" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "bs58", - "serde", - "serde_derive", - "solana-atomic-u64 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-atomic-u64", + "solana-sanitize", + "wasm-bindgen", ] [[package]] name = "solana-inflation" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23eef6a09eb8e568ce6839573e4966850e85e9ce71e6ae1a6c930c1c43947de3" [[package]] name = "solana-inline-spl" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaac98c150932bba4bfbef5b52fae9ef445f767d66ded2f1398382149bc94f69" dependencies = [ "bytemuck", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", ] [[package]] name = "solana-instruction" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce496a475e5062ba5de97215ab39d9c358f9c9df4bb7f3a45a1f1a8bd9065ed" dependencies = [ "bincode", "borsh 1.5.7", + "getrandom 0.2.15", + "js-sys", "num-traits", "serde", "serde_derive", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-instruction" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "num-traits", - "solana-define-syscall 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-define-syscall", + "solana-pubkey", + "wasm-bindgen", ] [[package]] name = "solana-instructions-sysvar" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427f2d0d6dc0bb49f16cef5e7f975180d2e80aab9bdd3b2af68e2d029ec63f43" dependencies = [ "bitflags 2.9.0", - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", "solana-serialize-utils", "solana-sysvar-id", ] [[package]] name = "solana-keccak-hasher" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aeb957fbd42a451b99235df4942d96db7ef678e8d5061ef34c9b34cae12f79" dependencies = [ "sha3", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-keypair" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "bs58", - "ed25519-dalek 1.0.1", - "rand 0.7.3", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-seed-phrase 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", ] [[package]] name = "solana-keypair" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dbb7042c2e0c561afa07242b2099d55c57bd1b1da3b6476932197d84e15e3e4" dependencies = [ "bs58", "ed25519-dalek 1.0.1", "rand 0.7.3", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-seed-phrase 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-signature 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-signer 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-pubkey", + "solana-seed-phrase", + "solana-signature", + "solana-signer", + "wasm-bindgen", ] [[package]] name = "solana-last-restart-slot" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6360ac2fdc72e7463565cd256eedcf10d7ef0c28a1249d261ec168c1b55cdd" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", + "solana-sdk-macro", "solana-sysvar-id", ] [[package]] name = "solana-loader-v2-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ab08006dad78ae7cd30df8eea0539e207d08d91eaefb3e1d49a446e1c49654" dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", ] [[package]] name = "solana-loader-v3-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4be76cfa9afd84ca2f35ebc09f0da0f0092935ccdac0595d98447f259538c2" dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", "solana-system-interface", ] [[package]] name = "solana-loader-v4-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "706a777242f1f39a83e2a96a2a6cb034cb41169c6ecbee2cf09cb873d9659e7e" dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", "solana-system-interface", ] [[package]] name = "solana-measure" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9566e754d9b9bcdee7b4aae38e425d47abf8e4f00057208868cb3ab9bee7feae" [[package]] name = "solana-message" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "268486ba8a294ed22a4d7c1ec05f540c3dbe71cfa7c6c54b6d4d13668d895678" dependencies = [ "bincode", "blake3", "lazy_static", "serde", "serde_derive", - "solana-bincode 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-bincode", + "solana-hash", + "solana-instruction", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", "solana-system-interface", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", + "wasm-bindgen", ] [[package]] -name = "solana-message" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +name = "solana-metrics" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02311660a407de41df2d5ef4e4118dac7b51cfe81a52362314ea51b091ee4150" dependencies = [ - "bincode", - "lazy_static", - "serde", - "serde_derive", - "solana-bincode 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-hash 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sdk-ids 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-short-vec 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-system-interface", - "solana-transaction-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-metrics" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "crossbeam-channel", - "gethostname", + "crossbeam-channel", + "gethostname", "lazy_static", "log", "reqwest 0.11.27", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", "solana-cluster-type", - "solana-sha256-hasher 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sha256-hasher", "solana-time-utils", "thiserror 2.0.12", ] [[package]] name = "solana-msg" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-msg" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36a1a14399afaabc2781a1db09cb14ee4cc4ee5c7a5a3cfcc601811379a8092" dependencies = [ - "solana-define-syscall 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-define-syscall", ] [[package]] name = "solana-native-token" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e9de00960197412e4be3902a6cd35e60817c511137aca6c34c66cd5d4017ec" [[package]] name = "solana-net-utils" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c27f0e0bbb972456ed255f81135378ecff3a380252ced7274fa965461ab99977" dependencies = [ "anyhow", "bincode", @@ -4810,21 +4717,23 @@ dependencies = [ [[package]] name = "solana-nonce" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703e22eb185537e06204a5bd9d509b948f0066f2d1d814a6f475dafb3ddf1325" dependencies = [ "serde", "serde_derive", "solana-fee-calculator", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sha256-hasher 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", ] [[package]] name = "solana-packet" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004f2d2daf407b3ec1a1ca5ec34b3ccdfd6866dd2d3c7d0715004a96e4b6d127" dependencies = [ "bincode", "bitflags 2.9.0", @@ -4836,8 +4745,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97222a3fda48570754ce114e43ca56af34741098c357cb8d3cb6695751e60330" dependencies = [ "ahash", "bincode", @@ -4853,22 +4763,23 @@ dependencies = [ "rand 0.8.5", "rayon", "serde", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-message", "solana-metrics", "solana-packet", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-rayon-threadlimit", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", + "solana-short-vec", + "solana-signature", "solana-time-utils", ] [[package]] name = "solana-program" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "586469467e93ceb79048f8d8e3a619bf61d05396ee7de95cb40280301a589d05" dependencies = [ "bincode", "blake3", @@ -4889,132 +4800,119 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", "solana-address-lookup-table-interface", - "solana-atomic-u64 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-atomic-u64", "solana-big-mod-exp", - "solana-bincode 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-bincode", "solana-blake3-hasher", "solana-borsh", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", "solana-cpi", - "solana-decode-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-decode-error", + "solana-define-syscall", "solana-epoch-rewards", "solana-epoch-schedule", "solana-example-mocks", "solana-feature-gate-interface", "solana-fee-calculator", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", "solana-instructions-sysvar", "solana-keccak-hasher", "solana-last-restart-slot", "solana-loader-v2-interface", "solana-loader-v3-interface", "solana-loader-v4-interface", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-msg 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-message", + "solana-msg", "solana-native-token", "solana-nonce", "solana-program-entrypoint", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-memory 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-program-error", + "solana-program-memory", "solana-program-option", "solana-program-pack", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-rent", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", "solana-secp256k1-recover", "solana-serde-varint", "solana-serialize-utils", - "solana-sha256-hasher 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sha256-hasher", + "solana-short-vec", "solana-slot-hashes", "solana-slot-history", "solana-stable-layout", + "solana-stake-interface", "solana-system-interface", "solana-sysvar", "solana-sysvar-id", "solana-vote-interface", "thiserror 2.0.12", + "wasm-bindgen", ] [[package]] name = "solana-program-entrypoint" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473ffe73c68d93e9f2aa726ad2985fe52760052709aaab188100a42c618060ec" dependencies = [ - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-msg 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", ] [[package]] name = "solana-program-error" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ae2c1a8d0d4ae865882d5770a7ebca92bab9c685e43f0461682c6c05a35bfa" dependencies = [ "borsh 1.5.7", "num-traits", "serde", "serde_derive", - "solana-decode-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-msg 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-program-error" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "num-traits", - "solana-decode-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-msg 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-program-memory" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "num-traits", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-pubkey", ] [[package]] name = "solana-program-memory" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b0268f6c89825fb634a34bd0c3b8fdaeaecfc3728be1d622a8ee6dd577b60d4" dependencies = [ "num-traits", - "solana-define-syscall 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-define-syscall", ] [[package]] name = "solana-program-option" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc677a2e9bc616eda6dbdab834d463372b92848b2bfe4a1ed4e4b4adba3397d0" [[package]] name = "solana-program-pack" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319f0ef15e6e12dc37c597faccb7d62525a509fec5f6975ecb9419efddeb277b" dependencies = [ - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-program-error", ] [[package]] name = "solana-pubkey" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40db1ff5a0f8aea2c158d78ab5f2cf897848964251d1df42fef78efd3c85b863" dependencies = [ "borsh 0.10.4", "borsh 1.5.7", @@ -5023,37 +4921,24 @@ dependencies = [ "bytemuck_derive", "curve25519-dalek 4.1.3", "five8_const", + "getrandom 0.2.15", + "js-sys", "num-traits", "serde", "serde_derive", - "solana-atomic-u64 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-decode-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sha256-hasher 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-pubkey" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "bs58", - "five8_const", - "num-traits", - "serde", - "serde_derive", - "solana-atomic-u64 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-decode-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-define-syscall 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sha256-hasher 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-atomic-u64", + "solana-decode-error", + "solana-define-syscall", + "solana-sanitize", + "solana-sha256-hasher", + "wasm-bindgen", ] [[package]] name = "solana-pubsub-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9633402b60b93f903d37c940a8ce0c1afc790b5a8678aaa8304f9099adf108b" dependencies = [ "crossbeam-channel", "futures-util", @@ -5063,11 +4948,11 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-decoder-client-types", + "solana-clock", + "solana-pubkey", "solana-rpc-client-api", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", "thiserror 2.0.12", "tokio", "tokio-stream", @@ -5078,8 +4963,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826ec34b8d4181f0c46efaa84c6b7992a459ca129f21506656d79a1e62633d4b" dependencies = [ "async-lock", "async-trait", @@ -5091,33 +4977,35 @@ dependencies = [ "quinn-proto", "rustls 0.23.25", "solana-connection-cache", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", "solana-measure", "solana-metrics", "solana-net-utils", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-quic-definitions", "solana-rpc-client-api", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signer", "solana-streamer", "solana-tls-utils", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", "thiserror 2.0.12", "tokio", ] [[package]] name = "solana-quic-definitions" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e606feac5110eb5d8afaa43ccaeea3ec49ccec36773387930b5ba545e745aea2" dependencies = [ - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", ] [[package]] name = "solana-rayon-threadlimit" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "423c912a1a68455fe4ed5175cf94eb8965e061cd257973c9a5659e2bf4ea8371" dependencies = [ "lazy_static", "num_cpus", @@ -5125,20 +5013,22 @@ dependencies = [ [[package]] name = "solana-rent" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1aea8fdea9de98ca6e8c2da5827707fb3842833521b528a713810ca685d2480" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", + "solana-sdk-macro", "solana-sysvar-id", ] [[package]] name = "solana-reward-info" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18205b69139b1ae0ab8f6e11cdcb627328c0814422ad2482000fa2ca54ae4a2f" dependencies = [ "serde", "serde_derive", @@ -5146,8 +5036,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3313bc969e1a8681f19a74181d301e5f91e5cc5a60975fb42e793caa9768f22e" dependencies = [ "async-trait", "base64 0.22.1", @@ -5161,21 +5052,21 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", "solana-commitment-config", "solana-epoch-info", "solana-epoch-schedule", "solana-feature-gate-interface", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", + "solana-message", + "solana-pubkey", "solana-rpc-client-api", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "tokio", @@ -5183,8 +5074,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc3276b526100d0f55a7d1db2366781acdc75ce9fe4a9d1bc9c85a885a503f8" dependencies = [ "anyhow", "base64 0.22.1", @@ -5196,16 +5088,16 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", "solana-commitment-config", "solana-fee-calculator", "solana-inflation", "solana-inline-spl", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", + "solana-signer", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "thiserror 2.0.12", @@ -5213,61 +5105,41 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "294874298fb4e52729bb0229e0cdda326d4393b7122b92823aa46e99960cb920" dependencies = [ - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", "solana-commitment-config", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-message", "solana-nonce", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-rpc-client", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", "thiserror 2.0.12", ] [[package]] name = "solana-sanitize" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[package]] -name = "solana-sanitize" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" - -[[package]] -name = "solana-sdk-ids" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f1bc1357b8188d9c4a3af3fc55276e56987265eb7ad073ae6f8180ee54cecf" [[package]] name = "solana-sdk-ids" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-sdk-macro" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5d8b9cc68d5c88b062a33e23a6466722467dde0035152d8fb1afbcdf350a5f" dependencies = [ - "bs58", - "proc-macro2", - "quote", - "syn 2.0.100", + "solana-pubkey", ] [[package]] name = "solana-sdk-macro" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86280da8b99d03560f6ab5aca9de2e38805681df34e0bb8f238e69b29433b9df" dependencies = [ "bs58", "proc-macro2", @@ -5277,28 +5149,20 @@ dependencies = [ [[package]] name = "solana-secp256k1-recover" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" dependencies = [ "libsecp256k1", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-define-syscall", "thiserror 2.0.12", ] [[package]] name = "solana-seed-phrase" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "hmac", - "pbkdf2", - "sha2 0.10.8", -] - -[[package]] -name = "solana-seed-phrase" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36187af2324f079f65a675ec22b31c24919cb4ac22c79472e85d819db9bbbc15" dependencies = [ "hmac", "pbkdf2", @@ -5307,149 +5171,140 @@ dependencies = [ [[package]] name = "solana-serde" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931484a408af466e14171556a47adaa215953c7f48b24e5f6b0282763818b04" dependencies = [ "serde", ] [[package]] name = "solana-serde-varint" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc07d00200d82e6def2f7f7a45738e3406b17fe54a18adcf0defa16a97ccadb" dependencies = [ "serde", ] [[package]] name = "solana-serialize-utils" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-sha256-hasher" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "817a284b63197d2b27afdba829c5ab34231da4a9b4e763466a003c40ca4f535e" dependencies = [ - "sha2 0.10.8", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-instruction", + "solana-pubkey", + "solana-sanitize", ] [[package]] name = "solana-sha256-hasher" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0037386961c0d633421f53560ad7c80675c0447cba4d1bb66d60974dd486c7ea" dependencies = [ "sha2 0.10.8", - "solana-define-syscall 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-hash 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-short-vec" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "serde", + "solana-define-syscall", + "solana-hash", ] [[package]] name = "solana-short-vec" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "serde", -] - -[[package]] -name = "solana-signature" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c54c66f19b9766a56fa0057d060de8378676cb64987533fa088861858fc5a69" dependencies = [ - "bs58", - "ed25519-dalek 1.0.1", "serde", - "serde-big-array", - "serde_derive", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", ] [[package]] name = "solana-signature" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d251c8f3dc015f320b4161daac7f108156c837428e5a8cc61136d25beb11d6" dependencies = [ "bs58", "ed25519-dalek 1.0.1", "serde", "serde-big-array", "serde_derive", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", -] - -[[package]] -name = "solana-signer" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sanitize", ] [[package]] name = "solana-signer" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c41991508a4b02f021c1342ba00bcfa098630b213726ceadc7cb032e051975b" dependencies = [ - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-signature 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-transaction-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-pubkey", + "solana-signature", + "solana-transaction-error", ] [[package]] name = "solana-slot-hashes" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8691982114513763e88d04094c9caa0376b867a29577939011331134c301ce" dependencies = [ "serde", "serde_derive", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-sdk-ids", "solana-sysvar-id", ] [[package]] name = "solana-slot-history" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ccc1b2067ca22754d5283afb2b0126d61eae734fc616d23871b0943b0d935e" dependencies = [ "bv", "serde", "serde_derive", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", "solana-sysvar-id", ] [[package]] name = "solana-stable-layout" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f14f7d02af8f2bc1b5efeeae71bc1c2b7f0f65cd75bcc7d8180f2c762a57f54" +dependencies = [ + "solana-instruction", + "solana-pubkey", +] + +[[package]] +name = "solana-stake-interface" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5269e89fde216b4d7e1d1739cf5303f8398a1ff372a81232abbee80e554a838c" dependencies = [ - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "borsh 0.10.4", + "borsh 1.5.7", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-system-interface", + "solana-sysvar-id", ] [[package]] name = "solana-streamer" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eaf5b216717d1d551716f3190878d028c689dabac40c8889767cead7e447481" dependencies = [ "async-channel", "bytes", @@ -5472,19 +5327,19 @@ dependencies = [ "rustls 0.23.25", "smallvec", "socket2", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", "solana-measure", "solana-metrics", "solana-net-utils", "solana-packet", "solana-perf", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-quic-definitions", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-signer", "solana-time-utils", "solana-tls-utils", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", "solana-transaction-metrics-tracker", "thiserror 2.0.12", "tokio", @@ -5502,16 +5357,17 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-decode-error 2.2.1", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-decode-error", + "solana-instruction", + "solana-pubkey", "wasm-bindgen", ] [[package]] name = "solana-sysvar" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf6b44740d7f0c9f375d045c165bc0aab4a90658f92d6835aeb0649afaeaff9a" dependencies = [ "base64 0.22.1", "bincode", @@ -5520,87 +5376,93 @@ dependencies = [ "lazy_static", "serde", "serde_derive", - "solana-account-info 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-define-syscall 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-info", + "solana-clock", + "solana-define-syscall", "solana-epoch-rewards", "solana-epoch-schedule", "solana-fee-calculator", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", "solana-instructions-sysvar", "solana-last-restart-slot", "solana-program-entrypoint", - "solana-program-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-program-memory 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", "solana-rent", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-macro 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", "solana-slot-hashes", "solana-slot-history", + "solana-stake-interface", "solana-sysvar-id", ] [[package]] name = "solana-sysvar-id" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5762b273d3325b047cfda250787f8d796d781746860d5d0a746ee29f3e8812c1" dependencies = [ - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", + "solana-sdk-ids", ] [[package]] name = "solana-thin-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "255bda447fbff4526b6b19b16b3652281ec2b7c4952d019b369a5f4a9dba4e5c" dependencies = [ "bincode", "log", "rayon", - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", "solana-client-traits", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", "solana-commitment-config", "solana-connection-cache", "solana-epoch-info", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", "solana-rpc-client", "solana-rpc-client-api", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-signer", "solana-system-interface", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction", + "solana-transaction-error", ] [[package]] name = "solana-time-utils" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af261afb0e8c39252a04d026e3ea9c405342b08c871a2ad8aa5448e068c784c" [[package]] name = "solana-tls-utils" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f227b3813b6c26c8ed38910b90a0b641baedb2ad075ea51ccfbff1992ee394" dependencies = [ "rustls 0.23.25", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", + "solana-pubkey", + "solana-signer", "x509-parser", ] [[package]] name = "solana-tpu-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc74ecb664add683a18bb9f484a30ca8c9d71f3addcd3a771eaaaaec12125fd" dependencies = [ "async-trait", "bincode", @@ -5610,107 +5472,80 @@ dependencies = [ "log", "rayon", "solana-client-traits", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", "solana-commitment-config", "solana-connection-cache", "solana-epoch-info", "solana-measure", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-message", "solana-net-utils", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-pubkey", "solana-pubsub-client", "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-signer", + "solana-transaction", + "solana-transaction-error", "thiserror 2.0.12", "tokio", ] [[package]] name = "solana-transaction" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" -dependencies = [ - "bincode", - "serde", - "serde_derive", - "solana-bincode 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signer 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-system-interface", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-transaction" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abec848d081beb15a324c633cd0e0ab33033318063230389895cae503ec9b544" dependencies = [ "bincode", "serde", "serde_derive", - "solana-bincode 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-hash 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-keypair 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-message 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-pubkey 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sdk-ids 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-short-vec 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-signature 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-signer 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-bincode", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", + "solana-signature", + "solana-signer", "solana-system-interface", - "solana-transaction-error 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-transaction-error", + "wasm-bindgen", ] [[package]] name = "solana-transaction-context" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5022de04cbba05377f68bf848c8c1322ead733f88a657bf792bb40f3257b8218" dependencies = [ - "solana-account 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account", + "solana-instruction", + "solana-pubkey", "solana-rent", ] [[package]] name = "solana-transaction-error" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a9dc8fdb61c6088baab34fc3a8b8473a03a7a5fd404ed8dd502fa79b67cb1" dependencies = [ "serde", "serde_derive", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", -] - -[[package]] -name = "solana-transaction-error" -version = "2.2.0" -source = "git+https://github.com/lpahlavi/agave.git#fa0bacd5508c1e443db79a67d470c537fa558de0" -dependencies = [ - "solana-instruction 2.2.0 (git+https://github.com/lpahlavi/agave.git)", - "solana-sanitize 2.2.0 (git+https://github.com/lpahlavi/agave.git)", + "solana-instruction", + "solana-sanitize", ] [[package]] name = "solana-transaction-metrics-tracker" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4c03abfcb923aaf71c228e81b54a804aa224a48577477d8e1096c3a1429d21b" dependencies = [ "base64 0.22.1", "bincode", @@ -5719,14 +5554,15 @@ dependencies = [ "rand 0.8.5", "solana-packet", "solana-perf", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-short-vec", + "solana-signature", ] [[package]] name = "solana-transaction-status-client-types" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aaef59e8a54fc3a2dabfd85c32e35493c5e228f9d1efbcdcdc3c0819dddf7fd" dependencies = [ "base64 0.22.1", "bincode", @@ -5734,65 +5570,68 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder-client-types 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-account-decoder-client-types", "solana-commitment-config", - "solana-message 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-message", "solana-reward-info", - "solana-signature 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-transaction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-signature", + "solana-transaction", "solana-transaction-context", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", "thiserror 2.0.12", ] [[package]] name = "solana-udp-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3e085a6adf81d51f678624934ffe266bd45a1c105849992b1af933c80bbf19" dependencies = [ "async-trait", "solana-connection-cache", - "solana-keypair 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-keypair", "solana-net-utils", "solana-streamer", - "solana-transaction-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-transaction-error", "thiserror 2.0.12", "tokio", ] [[package]] name = "solana-version" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a58e01912dc3d5ff4391fe49476461b3b9ebc4215f3713d2fe3ffcfeda7f8e2" dependencies = [ + "agave-feature-set", "semver", "serde", "serde_derive", - "solana-feature-set", - "solana-sanitize 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sanitize", "solana-serde-varint", ] [[package]] name = "solana-vote-interface" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b630547b7f12ee742e1c5069951fedba0fe5cbd4786f6342a779384e2b11f71" dependencies = [ "bincode", "num-derive", "num-traits", "serde", "serde_derive", - "solana-clock 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-decode-error 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-hash 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-instruction 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", - "solana-pubkey 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-clock", + "solana-decode-error", + "solana-hash", + "solana-instruction", + "solana-pubkey", "solana-rent", - "solana-sdk-ids 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-sdk-ids", "solana-serde-varint", "solana-serialize-utils", - "solana-short-vec 2.2.0 (git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag)", + "solana-short-vec", "solana-system-interface", ] @@ -7272,3 +7111,68 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "solana-account" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-account-decoder-client-types" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-client" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-clock" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-hash" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-instruction" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-keypair" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-message" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-nonce" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-program" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-pubkey" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-signature" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" + +[[patch.unused]] +name = "solana-transaction" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" diff --git a/Cargo.toml b/Cargo.toml index b6221e94..3652e9c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,8 +83,8 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] } # are using forked version of the relevant repositories. # see [solana-sdk#117](https://github.com/anza-xyz/solana-sdk/issues/117) [patch.crates-io] -solana-account = { git = "https://github.com/lpahlavi/agave.git" } -solana-account-decoder-client-types = { git = "https://github.com/lpahlavi/agave.git" } +solana-account = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } +solana-account-decoder-client-types = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-client = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-clock = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-hash = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } @@ -95,5 +95,4 @@ solana-nonce = { git = "https://github.com/dfinity/agave", tag = "323039e-js-fea solana-program = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-pubkey = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-signature = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } -solana-transaction = { git = "https://github.com/lpahlavi/agave.git" } -solana-rpc-client-api = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } +solana-transaction = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } From 56ea371f4db80e46bb2eedfc79b61daef5c1c3b9 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 8 Apr 2025 13:20:02 +0200 Subject: [PATCH 31/31] XC-288: Fix patch --- Cargo.lock | 590 ++++++++++++++++++----------------------------------- Cargo.toml | 1 + 2 files changed, 200 insertions(+), 391 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b0523db..129b0e30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,20 +17,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "agave-feature-set" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973a83d0d66d1f04647d1146a07736864f0742300b56bf2a5aadf5ce7b22fe47" -dependencies = [ - "ahash", - "solana-epoch-schedule", - "solana-feature-set-interface", - "solana-hash", - "solana-pubkey", - "solana-sha256-hasher", -] - [[package]] name = "ahash" version = "0.8.11" @@ -4112,9 +4098,8 @@ dependencies = [ [[package]] name = "solana-account" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f949fe4edaeaea78c844023bfc1c898e0b1f5a100f8a8d2d0f85d0a7b090258" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "serde", @@ -4130,9 +4115,8 @@ dependencies = [ [[package]] name = "solana-account-decoder-client-types" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c5d7d0f1581d98a869f2569122ded67e0735f3780d787b3e7653bdcd1708a2" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "base64 0.22.1", "bs58", @@ -4146,9 +4130,8 @@ dependencies = [ [[package]] name = "solana-account-info" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c17d606a298a205fae325489fbed88ee6dc4463c111672172327e741c8905d" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "serde", @@ -4159,9 +4142,8 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-interface" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1673f67efe870b64a65cb39e6194be5b26527691ce5922909939961a6e6b395" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "bytemuck", @@ -4176,18 +4158,16 @@ dependencies = [ [[package]] name = "solana-atomic-u64" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52e52720efe60465b052b9e7445a01c17550666beec855cce66f44766697bc2" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "parking_lot", ] [[package]] name = "solana-big-mod-exp" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "num-bigint 0.4.6", "num-traits", @@ -4196,9 +4176,8 @@ dependencies = [ [[package]] name = "solana-bincode" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a3787b8cf9c9fe3dd360800e8b70982b9e5a8af9e11c354b6665dd4a003adc" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "serde", @@ -4207,9 +4186,8 @@ dependencies = [ [[package]] name = "solana-blake3-hasher" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0801e25a1b31a14494fc80882a036be0ffd290efc4c2d640bfcca120a4672" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "blake3", "solana-define-syscall", @@ -4219,9 +4197,8 @@ dependencies = [ [[package]] name = "solana-borsh" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718333bcd0a1a7aed6655aa66bef8d7fb047944922b2d3a18f49cbc13e73d004" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "borsh 0.10.4", "borsh 1.5.7", @@ -4229,9 +4206,8 @@ dependencies = [ [[package]] name = "solana-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a6ae5a74f13425eb0f8503b9a2c0bf59581e98deeee2d0555dfe6f05502c9" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-trait", "bincode", @@ -4275,9 +4251,8 @@ dependencies = [ [[package]] name = "solana-client-traits" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f0071874e629f29e0eb3dab8a863e98502ac7aba55b7e0df1803fc5cac72a7" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-account", "solana-commitment-config", @@ -4296,9 +4271,8 @@ dependencies = [ [[package]] name = "solana-clock" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c2177a1b9fe8326004f1151a5acd124420b737811080b1035df31349e4d892" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4309,18 +4283,16 @@ dependencies = [ [[package]] name = "solana-cluster-type" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ace9fea2daa28354d107ea879cff107181d85cd4e0f78a2bedb10e1a428c97e" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-hash", ] [[package]] name = "solana-commitment-config" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac49c4dde3edfa832de1697e9bcdb7c3b3f7cb7a1981b7c62526c8bb6700fb73" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4328,9 +4300,8 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240bc217ca05f3e1d1d88f1cfda14b785a02288a630419e4a0ecd6b4fa5094b7" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-trait", "bincode", @@ -4352,9 +4323,8 @@ dependencies = [ [[package]] name = "solana-cpi" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc71126edddc2ba014622fc32d0f5e2e78ec6c5a1e0eb511b85618c09e9ea11" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-account-info", "solana-define-syscall", @@ -4364,6 +4334,14 @@ dependencies = [ "solana-stable-layout", ] +[[package]] +name = "solana-decode-error" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" +dependencies = [ + "num-traits", +] + [[package]] name = "solana-decode-error" version = "2.2.1" @@ -4375,15 +4353,13 @@ dependencies = [ [[package]] name = "solana-define-syscall" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf784bb2cb3e02cac9801813c30187344228d2ae952534902108f6150573a33d" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-epoch-info" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ef6f0b449290b0b9f32973eefd95af35b01c5c0c34c569f936c34c5b20d77b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4391,9 +4367,8 @@ dependencies = [ [[package]] name = "solana-epoch-rewards" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b575d3dd323b9ea10bb6fe89bf6bf93e249b215ba8ed7f68f1a3633f384db7" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4405,9 +4380,8 @@ dependencies = [ [[package]] name = "solana-epoch-schedule" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce071fbddecc55d727b1d7ed16a629afe4f6e4c217bc8d00af3b785f6f67ed" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4418,9 +4392,8 @@ dependencies = [ [[package]] name = "solana-example-mocks" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84461d56cbb8bb8d539347151e0525b53910102e4bced875d49d5139708e39d3" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4439,9 +4412,8 @@ dependencies = [ [[package]] name = "solana-feature-gate-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9c7fbf3e58b64a667c5f35e90af580538a95daea7001ff7806c0662d301bdf" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "serde", @@ -4457,20 +4429,22 @@ dependencies = [ ] [[package]] -name = "solana-feature-set-interface" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02007757246e40f10aa936dae4fa27efbf8dbd6a59575a12ccc802c1aea6e708" +name = "solana-feature-set" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "ahash", + "lazy_static", + "solana-epoch-schedule", + "solana-hash", "solana-pubkey", + "solana-sha256-hasher", ] [[package]] name = "solana-fee-calculator" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89bc408da0fb3812bc3008189d148b4d3e08252c79ad810b245482a3f70cd8d" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "log", "serde", @@ -4479,33 +4453,28 @@ dependencies = [ [[package]] name = "solana-hash" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7bcb14392900fe02e4e34e90234fbf0c673d4e327888410ba99fa2ba0f4e99" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "borsh 1.5.7", "bs58", "bytemuck", "bytemuck_derive", - "js-sys", "serde", "serde_derive", "solana-atomic-u64", "solana-sanitize", - "wasm-bindgen", ] [[package]] name = "solana-inflation" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23eef6a09eb8e568ce6839573e4966850e85e9ce71e6ae1a6c930c1c43947de3" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-inline-spl" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaac98c150932bba4bfbef5b52fae9ef445f767d66ded2f1398382149bc94f69" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bytemuck", "solana-pubkey", @@ -4513,27 +4482,22 @@ dependencies = [ [[package]] name = "solana-instruction" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce496a475e5062ba5de97215ab39d9c358f9c9df4bb7f3a45a1f1a8bd9065ed" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "borsh 1.5.7", - "getrandom 0.2.15", - "js-sys", "num-traits", "serde", "serde_derive", "solana-define-syscall", "solana-pubkey", - "wasm-bindgen", ] [[package]] name = "solana-instructions-sysvar" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427f2d0d6dc0bb49f16cef5e7f975180d2e80aab9bdd3b2af68e2d029ec63f43" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bitflags 2.9.0", "solana-account-info", @@ -4548,9 +4512,8 @@ dependencies = [ [[package]] name = "solana-keccak-hasher" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7aeb957fbd42a451b99235df4942d96db7ef678e8d5061ef34c9b34cae12f79" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "sha3", "solana-define-syscall", @@ -4560,9 +4523,8 @@ dependencies = [ [[package]] name = "solana-keypair" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dbb7042c2e0c561afa07242b2099d55c57bd1b1da3b6476932197d84e15e3e4" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bs58", "ed25519-dalek 1.0.1", @@ -4571,14 +4533,12 @@ dependencies = [ "solana-seed-phrase", "solana-signature", "solana-signer", - "wasm-bindgen", ] [[package]] name = "solana-last-restart-slot" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6360ac2fdc72e7463565cd256eedcf10d7ef0c28a1249d261ec168c1b55cdd" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4589,9 +4549,8 @@ dependencies = [ [[package]] name = "solana-loader-v2-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ab08006dad78ae7cd30df8eea0539e207d08d91eaefb3e1d49a446e1c49654" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_bytes", @@ -4603,9 +4562,8 @@ dependencies = [ [[package]] name = "solana-loader-v3-interface" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4be76cfa9afd84ca2f35ebc09f0da0f0092935ccdac0595d98447f259538c2" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_bytes", @@ -4618,9 +4576,8 @@ dependencies = [ [[package]] name = "solana-loader-v4-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706a777242f1f39a83e2a96a2a6cb034cb41169c6ecbee2cf09cb873d9659e7e" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_bytes", @@ -4633,15 +4590,13 @@ dependencies = [ [[package]] name = "solana-measure" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9566e754d9b9bcdee7b4aae38e425d47abf8e4f00057208868cb3ab9bee7feae" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-message" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "268486ba8a294ed22a4d7c1ec05f540c3dbe71cfa7c6c54b6d4d13668d895678" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "blake3", @@ -4657,14 +4612,12 @@ dependencies = [ "solana-short-vec", "solana-system-interface", "solana-transaction-error", - "wasm-bindgen", ] [[package]] name = "solana-metrics" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02311660a407de41df2d5ef4e4118dac7b51cfe81a52362314ea51b091ee4150" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "crossbeam-channel", "gethostname", @@ -4680,24 +4633,21 @@ dependencies = [ [[package]] name = "solana-msg" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36a1a14399afaabc2781a1db09cb14ee4cc4ee5c7a5a3cfcc601811379a8092" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-define-syscall", ] [[package]] name = "solana-native-token" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e9de00960197412e4be3902a6cd35e60817c511137aca6c34c66cd5d4017ec" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-net-utils" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27f0e0bbb972456ed255f81135378ecff3a380252ced7274fa965461ab99977" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "anyhow", "bincode", @@ -4717,9 +4667,8 @@ dependencies = [ [[package]] name = "solana-nonce" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703e22eb185537e06204a5bd9d509b948f0066f2d1d814a6f475dafb3ddf1325" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -4731,9 +4680,8 @@ dependencies = [ [[package]] name = "solana-packet" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004f2d2daf407b3ec1a1ca5ec34b3ccdfd6866dd2d3c7d0715004a96e4b6d127" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "bitflags 2.9.0", @@ -4745,9 +4693,8 @@ dependencies = [ [[package]] name = "solana-perf" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97222a3fda48570754ce114e43ca56af34741098c357cb8d3cb6695751e60330" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "ahash", "bincode", @@ -4777,9 +4724,8 @@ dependencies = [ [[package]] name = "solana-program" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "586469467e93ceb79048f8d8e3a619bf61d05396ee7de95cb40280301a589d05" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "blake3", @@ -4809,7 +4755,7 @@ dependencies = [ "solana-borsh", "solana-clock", "solana-cpi", - "solana-decode-error", + "solana-decode-error 2.2.0", "solana-define-syscall", "solana-epoch-rewards", "solana-epoch-schedule", @@ -4846,20 +4792,17 @@ dependencies = [ "solana-slot-hashes", "solana-slot-history", "solana-stable-layout", - "solana-stake-interface", "solana-system-interface", "solana-sysvar", "solana-sysvar-id", "solana-vote-interface", "thiserror 2.0.12", - "wasm-bindgen", ] [[package]] name = "solana-program-entrypoint" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473ffe73c68d93e9f2aa726ad2985fe52760052709aaab188100a42c618060ec" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-account-info", "solana-msg", @@ -4869,15 +4812,14 @@ dependencies = [ [[package]] name = "solana-program-error" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ae2c1a8d0d4ae865882d5770a7ebca92bab9c685e43f0461682c6c05a35bfa" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "borsh 1.5.7", "num-traits", "serde", "serde_derive", - "solana-decode-error", + "solana-decode-error 2.2.0", "solana-instruction", "solana-msg", "solana-pubkey", @@ -4885,9 +4827,8 @@ dependencies = [ [[package]] name = "solana-program-memory" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0268f6c89825fb634a34bd0c3b8fdaeaecfc3728be1d622a8ee6dd577b60d4" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "num-traits", "solana-define-syscall", @@ -4895,24 +4836,21 @@ dependencies = [ [[package]] name = "solana-program-option" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc677a2e9bc616eda6dbdab834d463372b92848b2bfe4a1ed4e4b4adba3397d0" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-program-pack" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "319f0ef15e6e12dc37c597faccb7d62525a509fec5f6975ecb9419efddeb277b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-program-error", ] [[package]] name = "solana-pubkey" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40db1ff5a0f8aea2c158d78ab5f2cf897848964251d1df42fef78efd3c85b863" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "borsh 0.10.4", "borsh 1.5.7", @@ -4921,24 +4859,20 @@ dependencies = [ "bytemuck_derive", "curve25519-dalek 4.1.3", "five8_const", - "getrandom 0.2.15", - "js-sys", "num-traits", "serde", "serde_derive", "solana-atomic-u64", - "solana-decode-error", + "solana-decode-error 2.2.0", "solana-define-syscall", "solana-sanitize", "solana-sha256-hasher", - "wasm-bindgen", ] [[package]] name = "solana-pubsub-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9633402b60b93f903d37c940a8ce0c1afc790b5a8678aaa8304f9099adf108b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "crossbeam-channel", "futures-util", @@ -4963,9 +4897,8 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826ec34b8d4181f0c46efaa84c6b7992a459ca129f21506656d79a1e62633d4b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-lock", "async-trait", @@ -4994,18 +4927,16 @@ dependencies = [ [[package]] name = "solana-quic-definitions" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e606feac5110eb5d8afaa43ccaeea3ec49ccec36773387930b5ba545e745aea2" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-keypair", ] [[package]] name = "solana-rayon-threadlimit" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "423c912a1a68455fe4ed5175cf94eb8965e061cd257973c9a5659e2bf4ea8371" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "lazy_static", "num_cpus", @@ -5013,9 +4944,8 @@ dependencies = [ [[package]] name = "solana-rent" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1aea8fdea9de98ca6e8c2da5827707fb3842833521b528a713810ca685d2480" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -5026,9 +4956,8 @@ dependencies = [ [[package]] name = "solana-reward-info" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18205b69139b1ae0ab8f6e11cdcb627328c0814422ad2482000fa2ca54ae4a2f" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -5036,9 +4965,8 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3313bc969e1a8681f19a74181d301e5f91e5cc5a60975fb42e793caa9768f22e" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-trait", "base64 0.22.1", @@ -5074,9 +5002,8 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc3276b526100d0f55a7d1db2366781acdc75ce9fe4a9d1bc9c85a885a503f8" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "anyhow", "base64 0.22.1", @@ -5105,9 +5032,8 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "294874298fb4e52729bb0229e0cdda326d4393b7122b92823aa46e99960cb920" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-account", "solana-commitment-config", @@ -5122,24 +5048,21 @@ dependencies = [ [[package]] name = "solana-sanitize" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f1bc1357b8188d9c4a3af3fc55276e56987265eb7ad073ae6f8180ee54cecf" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-sdk-ids" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5d8b9cc68d5c88b062a33e23a6466722467dde0035152d8fb1afbcdf350a5f" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-pubkey", ] [[package]] name = "solana-sdk-macro" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86280da8b99d03560f6ab5aca9de2e38805681df34e0bb8f238e69b29433b9df" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bs58", "proc-macro2", @@ -5149,9 +5072,8 @@ dependencies = [ [[package]] name = "solana-secp256k1-recover" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "libsecp256k1", "solana-define-syscall", @@ -5160,9 +5082,8 @@ dependencies = [ [[package]] name = "solana-seed-phrase" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36187af2324f079f65a675ec22b31c24919cb4ac22c79472e85d819db9bbbc15" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "hmac", "pbkdf2", @@ -5171,27 +5092,24 @@ dependencies = [ [[package]] name = "solana-serde" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931484a408af466e14171556a47adaa215953c7f48b24e5f6b0282763818b04" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", ] [[package]] name = "solana-serde-varint" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc07d00200d82e6def2f7f7a45738e3406b17fe54a18adcf0defa16a97ccadb" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", ] [[package]] name = "solana-serialize-utils" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817a284b63197d2b27afdba829c5ab34231da4a9b4e763466a003c40ca4f535e" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-instruction", "solana-pubkey", @@ -5200,9 +5118,8 @@ dependencies = [ [[package]] name = "solana-sha256-hasher" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0037386961c0d633421f53560ad7c80675c0447cba4d1bb66d60974dd486c7ea" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "sha2 0.10.8", "solana-define-syscall", @@ -5211,18 +5128,16 @@ dependencies = [ [[package]] name = "solana-short-vec" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c54c66f19b9766a56fa0057d060de8378676cb64987533fa088861858fc5a69" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", ] [[package]] name = "solana-signature" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d251c8f3dc015f320b4161daac7f108156c837428e5a8cc61136d25beb11d6" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bs58", "ed25519-dalek 1.0.1", @@ -5234,9 +5149,8 @@ dependencies = [ [[package]] name = "solana-signer" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c41991508a4b02f021c1342ba00bcfa098630b213726ceadc7cb032e051975b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-pubkey", "solana-signature", @@ -5245,9 +5159,8 @@ dependencies = [ [[package]] name = "solana-slot-hashes" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8691982114513763e88d04094c9caa0376b867a29577939011331134c301ce" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -5258,9 +5171,8 @@ dependencies = [ [[package]] name = "solana-slot-history" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ccc1b2067ca22754d5283afb2b0126d61eae734fc616d23871b0943b0d935e" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bv", "serde", @@ -5271,40 +5183,17 @@ dependencies = [ [[package]] name = "solana-stable-layout" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f14f7d02af8f2bc1b5efeeae71bc1c2b7f0f65cd75bcc7d8180f2c762a57f54" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-instruction", "solana-pubkey", ] -[[package]] -name = "solana-stake-interface" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5269e89fde216b4d7e1d1739cf5303f8398a1ff372a81232abbee80e554a838c" -dependencies = [ - "borsh 0.10.4", - "borsh 1.5.7", - "num-traits", - "serde", - "serde_derive", - "solana-clock", - "solana-cpi", - "solana-decode-error", - "solana-instruction", - "solana-program-error", - "solana-pubkey", - "solana-system-interface", - "solana-sysvar-id", -] - [[package]] name = "solana-streamer" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eaf5b216717d1d551716f3190878d028c689dabac40c8889767cead7e447481" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-channel", "bytes", @@ -5357,7 +5246,7 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-decode-error", + "solana-decode-error 2.2.1", "solana-instruction", "solana-pubkey", "wasm-bindgen", @@ -5365,9 +5254,8 @@ dependencies = [ [[package]] name = "solana-sysvar" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf6b44740d7f0c9f375d045c165bc0aab4a90658f92d6835aeb0649afaeaff9a" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "base64 0.22.1", "bincode", @@ -5396,15 +5284,13 @@ dependencies = [ "solana-sdk-macro", "solana-slot-hashes", "solana-slot-history", - "solana-stake-interface", "solana-sysvar-id", ] [[package]] name = "solana-sysvar-id" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5762b273d3325b047cfda250787f8d796d781746860d5d0a746ee29f3e8812c1" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-pubkey", "solana-sdk-ids", @@ -5412,9 +5298,8 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255bda447fbff4526b6b19b16b3652281ec2b7c4952d019b369a5f4a9dba4e5c" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "log", @@ -5441,15 +5326,13 @@ dependencies = [ [[package]] name = "solana-time-utils" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af261afb0e8c39252a04d026e3ea9c405342b08c871a2ad8aa5448e068c784c" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" [[package]] name = "solana-tls-utils" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f227b3813b6c26c8ed38910b90a0b641baedb2ad075ea51ccfbff1992ee394" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "rustls 0.23.25", "solana-keypair", @@ -5460,9 +5343,8 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc74ecb664add683a18bb9f484a30ca8c9d71f3addcd3a771eaaaaec12125fd" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-trait", "bincode", @@ -5494,9 +5376,8 @@ dependencies = [ [[package]] name = "solana-transaction" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abec848d081beb15a324c633cd0e0ab33033318063230389895cae503ec9b544" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "serde", @@ -5514,14 +5395,12 @@ dependencies = [ "solana-signer", "solana-system-interface", "solana-transaction-error", - "wasm-bindgen", ] [[package]] name = "solana-transaction-context" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5022de04cbba05377f68bf848c8c1322ead733f88a657bf792bb40f3257b8218" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "solana-account", "solana-instruction", @@ -5531,9 +5410,8 @@ dependencies = [ [[package]] name = "solana-transaction-error" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a9dc8fdb61c6088baab34fc3a8b8473a03a7a5fd404ed8dd502fa79b67cb1" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "serde", "serde_derive", @@ -5543,9 +5421,8 @@ dependencies = [ [[package]] name = "solana-transaction-metrics-tracker" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4c03abfcb923aaf71c228e81b54a804aa224a48577477d8e1096c3a1429d21b" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "base64 0.22.1", "bincode", @@ -5560,9 +5437,8 @@ dependencies = [ [[package]] name = "solana-transaction-status-client-types" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aaef59e8a54fc3a2dabfd85c32e35493c5e228f9d1efbcdcdc3c0819dddf7fd" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "base64 0.22.1", "bincode", @@ -5583,9 +5459,8 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3e085a6adf81d51f678624934ffe266bd45a1c105849992b1af933c80bbf19" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "async-trait", "solana-connection-cache", @@ -5599,23 +5474,21 @@ dependencies = [ [[package]] name = "solana-version" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a58e01912dc3d5ff4391fe49476461b3b9ebc4215f3713d2fe3ffcfeda7f8e2" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ - "agave-feature-set", "semver", "serde", "serde_derive", + "solana-feature-set", "solana-sanitize", "solana-serde-varint", ] [[package]] name = "solana-vote-interface" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b630547b7f12ee742e1c5069951fedba0fe5cbd4786f6342a779384e2b11f71" +version = "2.2.0" +source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" dependencies = [ "bincode", "num-derive", @@ -5623,7 +5496,7 @@ dependencies = [ "serde", "serde_derive", "solana-clock", - "solana-decode-error", + "solana-decode-error 2.2.0", "solana-hash", "solana-instruction", "solana-pubkey", @@ -7111,68 +6984,3 @@ dependencies = [ "cc", "pkg-config", ] - -[[patch.unused]] -name = "solana-account" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-account-decoder-client-types" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-client" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-clock" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-hash" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-instruction" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-keypair" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-message" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-nonce" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-program" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-pubkey" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-signature" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" - -[[patch.unused]] -name = "solana-transaction" -version = "2.2.0" -source = "git+https://github.com/dfinity/agave?tag=323039e-js-feature-flag#552a076307b8e68cde986d4b2d7740a88f15fb8b" diff --git a/Cargo.toml b/Cargo.toml index 3652e9c5..14d213fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,5 +94,6 @@ solana-message = { git = "https://github.com/dfinity/agave", tag = "323039e-js-f solana-nonce = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-program = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-pubkey = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } +solana-rpc-client-api = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-signature = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" } solana-transaction = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }