diff --git a/Cargo.lock b/Cargo.lock index 4aa147a..af142cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,9 +65,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.10", "once_cell", @@ -76,14 +76,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" dependencies = [ "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -112,111 +113,114 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", - "regex", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", "bs58 0.5.0", - "proc-macro2 1.0.69", - "quote 1.0.33", - "rustversion", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2 1.0.69", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-program" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.69", - "quote 1.0.33", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-derive-space" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-lang" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -225,6 +229,7 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", "arrayref", "base64 0.13.1", @@ -238,15 +243,15 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", "bs58 0.5.0", "heck", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "serde", "serde_json", "sha2 0.10.8", @@ -338,7 +343,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.33", + "quote", "syn 1.0.109", ] @@ -350,8 +355,8 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint 0.4.4", "num-traits", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -386,8 +391,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -401,12 +406,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "array-bytes" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" - [[package]] name = "arrayref" version = "0.3.7" @@ -447,8 +446,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure", ] @@ -459,8 +458,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -510,8 +509,8 @@ version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -591,6 +590,9 @@ name = "bitflags" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "bitmaps" @@ -642,7 +644,7 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" -version = "1.0.1" +version = "2.0.0" dependencies = [ "anchor-lang", "async-trait", @@ -696,7 +698,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.69", + "proc-macro2", "syn 1.0.109", ] @@ -709,7 +711,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.69", + "proc-macro2", "syn 1.0.109", ] @@ -719,8 +721,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -730,8 +732,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -741,8 +743,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -752,8 +754,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -824,8 +826,8 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -1142,8 +1144,8 @@ checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "strsim 0.10.0", "syn 2.0.38", ] @@ -1155,10 +1157,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", - "quote 1.0.33", + "quote", "syn 2.0.38", ] +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -1209,8 +1221,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1252,32 +1264,32 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] [[package]] -name = "dlopen" -version = "0.1.8" +name = "dlopen2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" dependencies = [ - "dlopen_derive", - "lazy_static", + "dlopen2_derive", "libc", + "once_cell", "winapi", ] [[package]] -name = "dlopen_derive" -version = "0.1.4" +name = "dlopen2_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ - "libc", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.38", ] [[package]] @@ -1357,8 +1369,8 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -1498,8 +1510,8 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -1631,7 +1643,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -1646,7 +1658,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.9", ] [[package]] @@ -1794,9 +1806,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.7", + "rustls", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -2030,6 +2042,18 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint 0.4.4", + "thiserror", +] + [[package]] name = "linux-raw-sys" version = "0.4.10" @@ -2233,8 +2257,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2244,8 +2268,8 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -2312,11 +2336,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70bf6736f74634d299d00086f02986875b3c2d924781a6a2cb6c201e73da0ceb" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.0", + "num_enum_derive 0.7.2", ] [[package]] @@ -2326,20 +2350,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] [[package]] name = "num_enum_derive" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -2499,9 +2523,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "plerkle_serialization" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f021e409a6a1ec8b7a325db27254e7fa3942e845cfe96f5f8f494977f2646a8" +checksum = "f832646491065468aa8e222b47d41dd5250e4be7866725bef5f0d31c64538f5f" dependencies = [ "bs58 0.4.0", "chrono", @@ -2555,15 +2579,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.69" @@ -2582,63 +2597,63 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "qualifier_attr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "quinn" -version = "0.9.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.20.9", + "rustls", "thiserror", "tokio", "tracing", - "webpki", ] [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.16.20", + "ring", "rustc-hash", - "rustls 0.20.9", + "rustls", "rustls-native-certs", "slab", "thiserror", "tinyvec", "tracing", - "webpki", ] [[package]] name = "quinn-udp" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ + "bytes", "libc", - "quinn-proto", - "socket2 0.4.9", + "socket2 0.5.4", "tracing", - "windows-sys 0.42.0", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "windows-sys 0.48.0", ] [[package]] @@ -2647,7 +2662,7 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2", ] [[package]] @@ -2757,7 +2772,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring 0.16.20", + "ring", "time", "yasna", ] @@ -2824,14 +2839,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.7", + "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -2851,26 +2866,12 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", + "spin", + "untrusted", "web-sys", "winapi", ] -[[package]] -name = "ring" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" -dependencies = [ - "cc", - "getrandom 0.2.10", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.48.0", -] - [[package]] name = "rpassword" version = "7.2.0" @@ -2935,18 +2936,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.21.7" @@ -2954,7 +2943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring 0.16.20", + "ring", "rustls-webpki", "sct", ] @@ -2986,8 +2975,8 @@ version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", ] [[package]] @@ -3032,8 +3021,8 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3043,8 +3032,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", ] [[package]] @@ -3100,8 +3089,8 @@ version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3162,8 +3151,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -3174,16 +3163,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" dependencies = [ "darling", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -3304,9 +3293,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52aec62a85932e26d1085864b0f7b99b31934aec8dd132429bfef6d7fb1d3a6" +checksum = "21ed570fba6f909f69c888b48b39c7e61b454e3594e448d0dad9d973f27f5668" dependencies = [ "Inflector", "base64 0.21.4", @@ -3317,47 +3306,25 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", "spl-token-2022", + "spl-token-group-interface", "spl-token-metadata-interface", "thiserror", "zstd", ] -[[package]] -name = "solana-address-lookup-table-program" -version = "1.16.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee0bd25f4ba0a15fc16c57b41b1e1b14f5271b83214fda158fdedb58758d394e" -dependencies = [ - "bincode", - "bytemuck", - "log", - "num-derive 0.3.3", - "num-traits", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-program", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - [[package]] name = "solana-clap-utils" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e963043668c640183d48472b281ebb9f713e0c36df0271961d23e6a394e09070" +checksum = "b4729fec3c2ac37b7daaf24c1ef879bbedbff3495b1ac728d9b627282d878753" dependencies = [ "chrono", "clap 2.34.0", "rpassword", - "solana-perf", "solana-remote-wallet", "solana-sdk", "thiserror", @@ -3368,19 +3335,19 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ccf7bb34fb81c74582a9011babaa2e0220da56c71186e77f45a6f352017fdb" +checksum = "2da13019a833940af2edebda969db4337ab11c6fb220eb0d4c02d79c83ae8034" dependencies = [ "async-trait", "bincode", + "dashmap", "futures", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "indicatif", "log", "quinn", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -3401,9 +3368,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd0fc1efb91a1661aeb1ff6a691156c3b1bffdaed0aa096589499dd83f9e50b" +checksum = "04b91ca968a63946e7513a1de20188e6e917f09136339ee3bec247aa0e985d36" dependencies = [ "bincode", "chrono", @@ -3415,16 +3382,17 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8759e9cb9b1e92a94c31812169ecb5e65b5e215fb70fb68691e03655de5b7b6c" +checksum = "49a850c0122f094efb83df00ab080ab6ace0dcd8dbf91240f91832157ee6d460" dependencies = [ "async-trait", "bincode", + "crossbeam-channel", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rcgen", "solana-measure", @@ -3436,11 +3404,11 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02eb4f0ed3eade20f4abdcc0031167344237cd6e16808bd0f33945f9db7861fe" +checksum = "8e2c5e5dde22cac045d29675b3fefa84817e1f63b0b911d094c599e80c0c07d9" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.9", "blake3", "block-buffer 0.10.4", "bs58 0.4.0", @@ -3449,13 +3417,10 @@ dependencies = [ "cc", "either", "generic-array", - "getrandom 0.1.16", "im", "lazy_static", "log", "memmap2", - "once_cell", - "rand_core 0.6.4", "rustc_version", "serde", "serde_bytes", @@ -3469,21 +3434,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28514761a285944cbad5b3d7930546369b80a713ba37d84bcf6ed2753611765" +checksum = "296e4cf0e2479e4c21afe4d17e32526f71f1bcd93b1c7c660900bc3e4233447a" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustc_version", "syn 2.0.38", ] [[package]] name = "solana-geyser-plugin-interface" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512372f741974113777872cecd560beee189cf79c3fb2eb84e1c28be69f011d1" +checksum = "8d910a096a3eac2546c4d654158c2fad8b88d5b733c1225d876de144a09fa262" dependencies = [ "log", "solana-sdk", @@ -3493,9 +3458,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c310c6749435ce1ea25a9ae3edfb2fd2c2aed2aa4d4f7e0487a8077a0b1ee30" +checksum = "d37a1b1a383a01039afbc6447a1712fb2a1a73a5ba8916762e693e8e492fabf3" dependencies = [ "env_logger", "lazy_static", @@ -3504,9 +3469,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d171357580e62aa4ca19c780e25f4e74de064e2780cb8b9f6b6901d986fcd23" +checksum = "19831a93d760205f5c3e20d05a37b0e533caa1889e48041648ad0859e68ec336" dependencies = [ "log", "solana-sdk", @@ -3514,9 +3479,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "013cbb3c82588278d2be18d3317ece5286cb54a3a06d5d38fc31e2a76a6d5e2d" +checksum = "f63c23a8db755b2903262ad473e32cbf0093e2d3a0a7b8183d797a182c08326a" dependencies = [ "crossbeam-channel", "gethostname", @@ -3524,23 +3489,24 @@ dependencies = [ "log", "reqwest", "solana-sdk", + "thiserror", ] [[package]] name = "solana-net-utils" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50d7cac0694b1fe07499de25404a0c7d6836457e359aba3b08c3983c3dc5eb6" +checksum = "29ac1afc7feb590b45fd72bee0ca4c4f24b2386184d7e00d9f0d17913655bb4a" dependencies = [ "bincode", "clap 3.2.25", "crossbeam-channel", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_derive", - "socket2 0.4.9", + "socket2 0.5.4", "solana-logger", "solana-sdk", "solana-version", @@ -3550,25 +3516,27 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395d559e5be2c439551298e9fa95561807f24921fd9a1e08bb82a3dc05c02dea" +checksum = "bfdf5a429e018e8ba693f4c43f833192db421fe97b88dfaf97041aa258e4b191" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.9", "bincode", "bv", "caps", "curve25519-dalek", - "dlopen", - "dlopen_derive", + "dlopen2", "fnv", "lazy_static", "libc", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "rayon", + "rustc_version", "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", "solana-metrics", "solana-rayon-threadlimit", "solana-sdk", @@ -3577,18 +3545,17 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff2aa5434a77413e9d43e971ceb47bdb003f2e8bbc0365a25b684aca2605c25" +checksum = "8e3a3b9623f09e2c480b4e129c92d7a036f8614fd0fc7519791bd44e64061ce8" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "array-bytes", "base64 0.21.4", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.0", "blake3", "borsh 0.10.3", "borsh 0.9.3", @@ -3605,14 +3572,14 @@ dependencies = [ "lazy_static", "libc", "libsecp256k1", + "light-poseidon", "log", "memoffset 0.9.0", "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", "parking_lot", - "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -3632,9 +3599,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1832fefc2187142dac169812518ec20da68b09abad86e4a78f8ae1787e4f56" +checksum = "9d5dbb56d36cc15b4cf5a71c0ce6262a263212f7a312b0dbc41b226654329c37" dependencies = [ "base64 0.21.4", "bincode", @@ -3646,7 +3613,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rustc_version", "serde", "solana-frozen-abi", @@ -3660,9 +3627,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89388addbc3192407d948634f82c95c4dbe1efbe578582abfd136720e059556e" +checksum = "2c22290c0d296a6a250a8d5b680797f12138a81af9c403a6ce62bd3ddad307e6" dependencies = [ "crossbeam-channel", "futures-util", @@ -3685,9 +3652,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7897b876a6df2d97b3a5ddfd764155c0591e3497e863fd7fdf32b54de4e2644" +checksum = "f924d8722f9e910d790678a79c2a0bfed786dffe1aefa5d769f8548679794263" dependencies = [ "async-mutex", "async-trait", @@ -3697,9 +3664,8 @@ dependencies = [ "log", "quinn", "quinn-proto", - "quinn-udp", "rcgen", - "rustls 0.20.9", + "rustls", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -3713,9 +3679,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba17a930f9974a17a9a6c6e82e7f89b40127e9cc0f9c17cfc29fc5b149d2c38" +checksum = "bc0a2e484e5b272690ac1431a6821f2b5180149d67c56934d9e007224ced15d0" dependencies = [ "lazy_static", "num_cpus", @@ -3723,9 +3689,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80fb35e3fa78ef1d08a6a1d852e2c357e6ae388cb307d24fad359f57c34429f0" +checksum = "fb9a96d1c001d07a0abb08e05b92ff6528b2d9239d03c57f99f738527839eb12" dependencies = [ "console", "dialoguer", @@ -3742,9 +3708,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c512944689d747a87f76936c89bb59f5be6c9a3189631857f49746cfa47d5bd1" +checksum = "91503edfdb2ba9c5e0127048e7795f22e050cf2bcee1259361af113d533b4b26" dependencies = [ "async-trait", "base64 0.21.4", @@ -3768,9 +3734,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918b75f8ac4c358a6b512bf8b7dafc8166ddcb52ded5164c6235e0693ccb09" +checksum = "131662e5eea4fa5fc88b01f07d9e430315c0976be848ba3994244249c5fb033a" dependencies = [ "base64 0.21.4", "bs58 0.4.0", @@ -3790,9 +3756,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e360ea2f3a756bdf6256c1f6ef13f8b01b5d2a7855b4f16cafb4a4017f0557" +checksum = "f67cdff955b9994ae240f6f287420c6727a581120c02ccc4f2fa535886732a1d" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -3803,14 +3769,14 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1002048941cedbd7dd6a96fdaa3dc5238b998aaa70b81946b1e3ec108cc2be" +checksum = "cb34583922c5e79004ad8d8d69f333d274d21b614f0e1a575f325fc29a104ec2" dependencies = [ "assert_matches", "base64 0.21.4", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.0", "borsh 0.10.3", "bs58 0.4.0", "bytemuck", @@ -3833,8 +3799,9 @@ dependencies = [ "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", + "qualifier_attr", "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -3856,29 +3823,35 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b41b63b2da4a37ce323aba108db21f4c7bfa638dd1bf58fdc870f83bdce48ba" +checksum = "60f58786e949f43b8c9b826fdfa5ad8586634b077ab04f989fb8e30535786712" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustversion", "syn 2.0.38", ] +[[package]] +name = "solana-security-txt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" + [[package]] name = "solana-streamer" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00e575f2bd5ae2776870fbd1d7379d4ad392c015e2a4e2a328953b821a9d36d" +checksum = "efe4c33e0f68ea7a3701650badf6753b85fef2100cac6bc187c8e443e61c53da" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 1.9.3", + "indexmap 2.0.2", "itertools", "libc", "log", @@ -3888,10 +3861,9 @@ dependencies = [ "pkcs8", "quinn", "quinn-proto", - "quinn-udp", - "rand 0.7.3", + "rand 0.8.5", "rcgen", - "rustls 0.20.9", + "rustls", "solana-metrics", "solana-perf", "solana-sdk", @@ -3902,9 +3874,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df328e2624cce68c9949a53eac317a264eceb997131cb9bd22175698a5f5dc74" +checksum = "54e782aabf9443a36d65e74d70ce732cc844707a5fec5a498bcbd81d3de7598c" dependencies = [ "bincode", "log", @@ -3917,17 +3889,16 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8ce6fe221c0e1fd8aa3078b8fcb0cc3f4c27942f1256b57a60608d81ae5348" +checksum = "980bee30cbfe3c51f973da7fdcccb9df2c2d9b9175c06066b293499e02108fd4" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 1.9.3", + "indexmap 2.0.2", "indicatif", "log", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -3942,9 +3913,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0b811793e78a908119cc02edca3ff8b54d5660104ebd06cc0e2e7e2f66900b" +checksum = "4c180013e406418d593ce7b51da7007a638ace18261de14901b090e53a1d7025" dependencies = [ "Inflector", "base64 0.21.4", @@ -3957,7 +3928,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", @@ -3968,9 +3938,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897ff303a15ba956e80573dee4cf96d94d41a69adc5362898b98851e347505ad" +checksum = "ab995970a424c89b7966a01aec90cdf1685c49aacf38a5f463200fc273a7d86b" dependencies = [ "async-trait", "solana-connection-cache", @@ -3983,9 +3953,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9513754d3b2203a0e1045a211c5d68e72e4ed135e477344c21d096897fd2bf70" +checksum = "b32cc394aa7132ab7f270801b98bf47fa585ab93f1038e5be27e480d7b5b2dca" dependencies = [ "log", "rustc_version", @@ -3999,9 +3969,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6bfc5302ce0383eb129aa3a916705a20d22c4ad448144ef684b7b028d4053f" +checksum = "589cad4dccb4392e23f5ae4ccdd1f0aaa10f2823b264b27c4feb6382f40f4fd4" dependencies = [ "bincode", "log", @@ -4021,9 +3991,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.16" +version = "1.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1fe77918563768a65fd5d6cd2fa06cf0aeb11e529a1ef8c230b0fe018600e3" +checksum = "03d932d7b13a223a6c1068d7061df7e9d2de14bfc0a874350eef19d59086b04a" dependencies = [ "aes-gcm-siv", "base64 0.21.4", @@ -4050,9 +4020,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" dependencies = [ "byteorder", "combine", @@ -4073,12 +4043,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.5.4" @@ -4091,9 +4055,9 @@ dependencies = [ [[package]] name = "spl-account-compression" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df052fd79e45c75c84ef20f5f2dcf037aeed230d0f2400bf68fa388cc0ece240" +checksum = "85c43bd4455d9fb29b9e4f83c087ccffa2f6f41fecfc0549932ae391d00f3378" dependencies = [ "anchor-lang", "bytemuck", @@ -4103,9 +4067,9 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" +checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" dependencies = [ "assert_matches", "borsh 0.10.3", @@ -4145,7 +4109,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" dependencies = [ - "quote 1.0.33", + "quote", "spl-discriminator-syn", "syn 2.0.38", ] @@ -4156,8 +4120,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.38", "thiserror", @@ -4213,17 +4177,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.38", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +checksum = "615d381f48ddd2bb3c57c7f7fb207591a2a05054639b18a62e785117dd7a8683" dependencies = [ "bytemuck", "solana-program", @@ -4250,26 +4214,41 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.9.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" dependencies = [ "arrayref", "bytemuck", "num-derive 0.4.1", "num-traits", - "num_enum 0.7.0", + "num_enum 0.7.2", "solana-program", + "solana-security-txt", "solana-zk-token-sdk", "spl-memo", "spl-pod", "spl-token", + "spl-token-group-interface", "spl-token-metadata-interface", "spl-transfer-hook-interface", "spl-type-length-value", "thiserror", ] +[[package]] +name = "spl-token-group-interface" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + [[package]] name = "spl-token-metadata-interface" version = "0.2.0" @@ -4286,9 +4265,9 @@ dependencies = [ [[package]] name = "spl-transfer-hook-interface" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" dependencies = [ "arrayref", "bytemuck", @@ -4331,25 +4310,14 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] @@ -4359,8 +4327,8 @@ version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] @@ -4370,10 +4338,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", - "unicode-xid 0.2.4", + "unicode-xid", ] [[package]] @@ -4449,8 +4417,8 @@ version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -4541,29 +4509,18 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls", "tokio", ] @@ -4580,18 +4537,17 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.17.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.20.9", + "rustls", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tungstenite", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.25.2", ] [[package]] @@ -4647,6 +4603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4658,8 +4615,8 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] @@ -4680,24 +4637,23 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.17.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", "rand 0.8.5", - "rustls 0.20.9", - "sha-1", + "rustls", + "sha1", "thiserror", "url", "utf-8", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.24.0", ] [[package]] @@ -4739,12 +4695,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.4" @@ -4776,12 +4726,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "uriparse" version = "0.6.4" @@ -4867,8 +4811,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", "wasm-bindgen-shared", ] @@ -4891,7 +4835,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.33", + "quote", "wasm-bindgen-macro-support", ] @@ -4901,8 +4845,8 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4924,23 +4868,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.3", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "webpki", + "rustls-webpki", ] [[package]] @@ -4989,21 +4923,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -5182,6 +5101,26 @@ dependencies = [ "time", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "zeroize" version = "1.3.0" @@ -5197,8 +5136,8 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.38", ] diff --git a/Cargo.toml b/Cargo.toml index 44f2799..67b5152 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,9 @@ members = [ "blockbuster", ] +resolver = "2" + +[workspace.lints.clippy] +clone_on_ref_ptr = "deny" +missing_const_for_fn = "deny" +trivially_copy_pass_by_ref = "deny" diff --git a/blockbuster/Cargo.toml b/blockbuster/Cargo.toml index 8ca9eaa..4139902 100644 --- a/blockbuster/Cargo.toml +++ b/blockbuster/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blockbuster" description = "Metaplex canonical program parsers, for indexing, analytics etc...." -version = "1.0.1" +version = "2.0.0" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/blockbuster" license = "AGPL-3.0" @@ -9,26 +9,26 @@ edition = "2021" readme = "../README.md" [dependencies] -spl-account-compression = { version = "0.2.0", features = ["no-entrypoint"] } -spl-noop = { version = "0.2.0", features = ["no-entrypoint"] } -mpl-bubblegum = "1.2.0" -mpl-token-metadata = { version = "4.1.1", features = ["serde"] } -plerkle_serialization = { version = "1.6.0" } -spl-token = { version = "4.0.0", features = ["no-entrypoint"] } +anchor-lang = { version = "0.29.0" } async-trait = "0.1.57" +borsh = "~0.10.3" bs58 = "0.4.0" lazy_static = "1.4.0" -flatbuffers = "23.1.21" -borsh = "~0.10.3" -thiserror = "1.0.32" -solana-sdk = "~1.16.11" -anchor-lang = { version = "0.28.0"} log = "0.4.17" +mpl-bubblegum = "1.2.0" +mpl-token-metadata = { version = "4.1.1", features = ["serde"] } +solana-sdk = "~1.17" +solana-transaction-status = "~1.17" +spl-account-compression = { version = "0.3.0", features = ["no-entrypoint"] } +spl-noop = { version = "0.2.0", features = ["no-entrypoint"] } +spl-token = { version = "4.0.0", features = ["no-entrypoint"] } +thiserror = "1.0.32" [dev-dependencies] +flatbuffers = "23.1.21" +plerkle_serialization = "1.8.0" rand = "0.8.5" +serde_json = "1.0.89" +solana-client = "~1.17" +solana-geyser-plugin-interface = "~1.17" spl-concurrent-merkle-tree = "0.2.0" -solana-client = "~1.16.11" -solana-transaction-status = "~1.16.11" -solana-geyser-plugin-interface = "~1.16.11" -serde_json="1.0.89" diff --git a/blockbuster/src/error.rs b/blockbuster/src/error.rs index d66168a..199eb3b 100644 --- a/blockbuster/src/error.rs +++ b/blockbuster/src/error.rs @@ -1,6 +1,5 @@ use std::io::Error; use thiserror::Error; -use plerkle_serialization::error::PlerkleSerializationError; #[derive(Error, Debug)] pub enum BlockbusterError { @@ -33,9 +32,3 @@ impl From for BlockbusterError { BlockbusterError::IOError(err.to_string()) } } - -impl From for BlockbusterError { - fn from(err: PlerkleSerializationError) -> Self { - BlockbusterError::IOError(err.to_string()) - } -} diff --git a/blockbuster/src/instruction.rs b/blockbuster/src/instruction.rs index 9154923..f4544c1 100644 --- a/blockbuster/src/instruction.rs +++ b/blockbuster/src/instruction.rs @@ -1,17 +1,15 @@ -use plerkle_serialization::{CompiledInstruction, Pubkey, TransactionInfo}; +use solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey}; +use solana_transaction_status::InnerInstructions; +use std::collections::{HashSet, VecDeque}; -use std::{ - cell::RefCell, - collections::{HashSet, VecDeque}, -}; - -pub type IxPair<'a> = (Pubkey, CompiledInstruction<'a>); +pub type IxPair<'a> = (Pubkey, &'a CompiledInstruction); +#[derive(Debug, Clone, Copy)] pub struct InstructionBundle<'a> { pub txn_id: &'a str, pub program: Pubkey, - pub instruction: Option>, - pub inner_ix: Option>>, + pub instruction: Option<&'a CompiledInstruction>, + pub inner_ix: Option<&'a [IxPair<'a>]>, pub keys: &'a [Pubkey], pub slot: u64, } @@ -20,7 +18,7 @@ impl<'a> Default for InstructionBundle<'a> { fn default() -> Self { InstructionBundle { txn_id: "", - program: Pubkey::new(&[0; 32]), + program: Pubkey::new_from_array([0; 32]), instruction: None, inner_ix: None, keys: &[], @@ -30,123 +28,61 @@ impl<'a> Default for InstructionBundle<'a> { } pub fn order_instructions<'a>( - programs: HashSet<&[u8]>, - transaction_info: &'a TransactionInfo<'a>, + programs: &HashSet, + account_keys: &[Pubkey], + message_instructions: &'a [CompiledInstruction], + meta_inner_instructions: &'a [InnerInstructions], ) -> VecDeque<(IxPair<'a>, Option>>)> { let mut ordered_ixs: VecDeque<(IxPair, Option>)> = VecDeque::new(); - // Get outer instructions. - let outer_instructions = match transaction_info.outer_instructions() { - None => { - println!("outer instructions deserialization error"); - return ordered_ixs; - } - Some(instructions) => instructions, - }; - if transaction_info.account_keys().is_none() { - return ordered_ixs; - } - // Get account keys. - let keys = RefCell::new( - transaction_info - .account_keys() + // Get inner instructions. + for (outer_instruction_index, message_instruction) in message_instructions.iter().enumerate() { + let non_hoisted_inner_instruction = meta_inner_instructions .iter() + .filter_map(|ix| (ix.index == outer_instruction_index as u8).then(|| &ix.instructions)) .flatten() - .collect::>(), - ); + .map(|inner_ix| { + let cix = &inner_ix.instruction; + (account_keys[cix.program_id_index as usize], cix) + }) + .collect::>(); - // Get inner instructions. - let legacy_inner_ix_list = transaction_info.inner_instructions(); - let compiled_inner_instructions = transaction_info.compiled_inner_instructions(); - for (outer_instruction_index, outer_instruction) in outer_instructions.iter().enumerate() { - let non_hoisted_inner_instruction = - if let Some(inner_instructions) = compiled_inner_instructions { - inner_instructions - .iter() - .filter(|x| x.index() == outer_instruction_index as u8) - .flat_map(|x| { - if let Some(ixes) = x.instructions() { - ixes.iter() - .filter_map(|ix| ix.compiled_instruction()) - .map(|ix| { - let kb = keys.borrow(); - (*kb[ix.program_id_index() as usize], ix) - }) - .collect::>() - } else { - Vec::new() - } - }) - .collect::>() - } else { - // legacy no stack height list must exist if no compiled or no processing will be done - let inner_instructions = legacy_inner_ix_list.unwrap(); - inner_instructions - .iter() - .filter(|x| x.index() == outer_instruction_index as u8) - .flat_map(|x| { - if let Some(ixes) = x.instructions() { - ixes.iter() - .map(|ix| { - let kb = keys.borrow(); - (*kb[ix.program_id_index() as usize], ix) - }) - .collect::>() - } else { - Vec::new() - } - }) - .collect::>() - }; - - let hoister = non_hoisted_inner_instruction.clone(); - let hoisted = hoist_known_programs(&programs, hoister); - - for h in hoisted { - ordered_ixs.push_back(h); - } + let hoisted = hoist_known_programs(programs, &non_hoisted_inner_instruction); + ordered_ixs.extend(hoisted); + if let Some(outer_program_id) = + account_keys.get(message_instruction.program_id_index as usize) { - let kb = keys.borrow(); - let outer_ix_program_id_index = outer_instruction.program_id_index() as usize; - let outer_program_id = kb.get(outer_ix_program_id_index); - if outer_program_id.is_none() { - eprintln!("outer program id deserialization error"); - continue; - } - let outer_program_id = **outer_program_id.unwrap(); - if programs.get(outer_program_id.0.as_ref()).is_some() { + if programs.contains(outer_program_id) { ordered_ixs.push_back(( - (outer_program_id, outer_instruction), + (*outer_program_id, message_instruction), Some(non_hoisted_inner_instruction), )); } + } else { + eprintln!("outer program id deserialization error"); } } ordered_ixs } -fn hoist_known_programs<'a, 'b>( - programs: &'b HashSet<&'b [u8]>, - instructions: Vec<(Pubkey, CompiledInstruction<'a>)>, +fn hoist_known_programs<'a>( + programs: &HashSet, + ix_pairs: &[IxPair<'a>], ) -> Vec<(IxPair<'a>, Option>>)> { - let mut hoist = Vec::new(); - // there must be a safe and less copy way to do this, I should only need to move CI, and copy the found nodes matching predicate on 172 - for (index, (pid, ci)) in instructions.iter().enumerate() { - let clone_for_inner = instructions.clone(); - - if programs.get(pid.0.as_ref()).is_some() { - let mut inner_copy = vec![]; - for new_inner_elem in clone_for_inner.into_iter().skip(index + 1) { - if pid.0 != new_inner_elem.0 .0 { - inner_copy.push(new_inner_elem); - } else { - break; - } - } - - hoist.push(((*pid, *ci), Some(inner_copy))); - } - } - hoist + ix_pairs + .iter() + .enumerate() + .filter_map(|(index, &(pid, ci))| { + programs.contains(&pid).then(|| { + let inner_copy = ix_pairs + .iter() + .skip(index + 1) + .take_while(|&&(inner_pid, _)| inner_pid != pid) + .cloned() + .collect::>>(); + ((pid, ci), Some(inner_copy)) + }) + }) + .collect() } diff --git a/blockbuster/src/program_handler.rs b/blockbuster/src/program_handler.rs index 0016e4c..ac7bb3a 100644 --- a/blockbuster/src/program_handler.rs +++ b/blockbuster/src/program_handler.rs @@ -1,7 +1,6 @@ use crate::{ error::BlockbusterError, instruction::InstructionBundle, programs::ProgramParseResult, }; -use plerkle_serialization::AccountInfo; use solana_sdk::pubkey::Pubkey; pub trait ParseResult: Sync + Send { @@ -42,7 +41,7 @@ pub trait ProgramParser: Sync + Send { fn handles_account_updates(&self) -> bool; fn handle_account( &self, - account_info: &AccountInfo, + _account_data: &[u8], ) -> Result, BlockbusterError>; fn handle_instruction( &self, diff --git a/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/src/programs/bubblegum/mod.rs index fa22d8a..faa1b8a 100644 --- a/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/src/programs/bubblegum/mod.rs @@ -1,13 +1,11 @@ -use log::warn; - use crate::{ error::BlockbusterError, instruction::InstructionBundle, - program_handler::{ParseResult, ProgramParser}, + program_handler::{NotUsed, ParseResult, ProgramParser}, + programs::ProgramParseResult, }; - -use crate::{program_handler::NotUsed, programs::ProgramParseResult}; use borsh::de::BorshDeserialize; +use log::warn; use mpl_bubblegum::{ get_instruction_type, instructions::{ @@ -19,7 +17,6 @@ pub use mpl_bubblegum::{ types::{LeafSchema, UseMethod}, InstructionName, LeafSchemaEvent, ID, }; -use plerkle_serialization::AccountInfo; use solana_sdk::pubkey::Pubkey; pub use spl_account_compression::events::{ AccountCompressionEvent::{self, ApplicationData, ChangeLog}, @@ -33,14 +30,14 @@ pub enum Payload { Unknown, MintV1 { args: MetadataArgs, - authority: [u8; 32], - tree_id: [u8; 32], + authority: Pubkey, + tree_id: Pubkey, }, Decompress { args: MetadataArgs, }, CancelRedeem { - root: [u8; 32], + root: Pubkey, }, CreatorVerification { metadata: MetadataArgs, @@ -54,7 +51,7 @@ pub enum Payload { UpdateMetadata { current_metadata: MetadataArgs, update_args: UpdateArgs, - tree_id: [u8; 32], + tree_id: Pubkey, }, } //TODO add more of the parsing here to minimize program transformer code @@ -107,7 +104,7 @@ impl ProgramParser for BubblegumParser { } fn handle_account( &self, - _account_info: &AccountInfo, + _account_data: &[u8], ) -> Result, BlockbusterError> { Ok(Box::new(NotUsed::new())) } @@ -124,63 +121,47 @@ impl ProgramParser for BubblegumParser { .. } = bundle; let outer_ix_data = match instruction { - Some(compiled_ix) if compiled_ix.data().is_some() => { - let data = compiled_ix.data().unwrap(); - data.iter().collect::>() - } - _ => { - return Err(BlockbusterError::DeserializationError); - } + Some(cix) => cix.data.as_ref(), + _ => return Err(BlockbusterError::DeserializationError), }; - let ix_type = get_instruction_type(&outer_ix_data); + let ix_type = get_instruction_type(outer_ix_data); let mut b_inst = BubblegumInstruction::new(ix_type); if let Some(ixs) = inner_ix { - for ix in ixs { - if ix.0 .0 == spl_noop::id().to_bytes() { - let cix = ix.1; - if let Some(inner_ix_data) = cix.data() { - let inner_ix_data = inner_ix_data.iter().collect::>(); - if !inner_ix_data.is_empty() { - match AccountCompressionEvent::try_from_slice(&inner_ix_data) { - Ok(result) => match result { - ChangeLog(changelog_event) => { - let ChangeLogEvent::V1(changelog_event) = changelog_event; - b_inst.tree_update = Some(changelog_event); - } - ApplicationData(app_data) => { - let ApplicationDataEvent::V1(app_data) = app_data; - let app_data = app_data.application_data; + for (pid, cix) in ixs.iter() { + if pid == &spl_noop::id() && !cix.data.is_empty() { + match AccountCompressionEvent::try_from_slice(&cix.data) { + Ok(result) => match result { + ChangeLog(changelog_event) => { + let ChangeLogEvent::V1(changelog_event) = changelog_event; + b_inst.tree_update = Some(changelog_event); + } + ApplicationData(app_data) => { + let ApplicationDataEvent::V1(app_data) = app_data; + let app_data = app_data.application_data; - let event_type_byte = if !app_data.is_empty() { - &app_data[0..1] - } else { - return Err(BlockbusterError::DeserializationError); - }; + let event_type_byte = if !app_data.is_empty() { + &app_data[0..1] + } else { + return Err(BlockbusterError::DeserializationError); + }; - match BubblegumEventType::try_from_slice(event_type_byte)? { - BubblegumEventType::Uninitialized => { - return Err( - BlockbusterError::MissingBubblegumEventData, - ); - } - BubblegumEventType::LeafSchemaEvent => { - b_inst.leaf_update = Some( - LeafSchemaEvent::try_from_slice(&app_data)?, - ); - } - } + match BubblegumEventType::try_from_slice(event_type_byte)? { + BubblegumEventType::Uninitialized => { + return Err(BlockbusterError::MissingBubblegumEventData); + } + BubblegumEventType::LeafSchemaEvent => { + b_inst.leaf_update = + Some(LeafSchemaEvent::try_from_slice(&app_data)?); } - }, - Err(e) => { - warn!( - "Error while deserializing txn {:?} with noop data: {:?}", - txn_id, e - ); } } + }, + Err(e) => { + warn!( + "Error while deserializing txn {:?} with noop data: {:?}", + txn_id, e + ); } - } else { - return Err(BlockbusterError::InstructionParsingError); } } } @@ -205,7 +186,8 @@ impl ProgramParser for BubblegumParser { let slice: [u8; 32] = ix_data .try_into() .map_err(|_e| BlockbusterError::InstructionParsingError)?; - b_inst.payload = Some(Payload::CancelRedeem { root: slice }); + let root = Pubkey::new_from_array(slice); + b_inst.payload = Some(Payload::CancelRedeem { root }); } InstructionName::VerifyCreator => { b_inst.payload = @@ -236,7 +218,7 @@ impl ProgramParser for BubblegumParser { // See Bubblegum documentation for offsets and positions: // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md#-verify_creator-and-unverify_creator fn build_creator_verification_payload( - keys: &[plerkle_serialization::Pubkey], + keys: &[Pubkey], ix_data: &[u8], verify: bool, ) -> Result { @@ -246,14 +228,13 @@ fn build_creator_verification_payload( UnverifyCreatorInstructionArgs::try_from_slice(ix_data)?.metadata }; - let creator = keys + let creator = *keys .get(5) - .ok_or(BlockbusterError::InstructionParsingError)? - .0; + .ok_or(BlockbusterError::InstructionParsingError)?; Ok(Payload::CreatorVerification { metadata, - creator: Pubkey::new_from_array(creator), + creator, verify, }) } @@ -262,21 +243,19 @@ fn build_creator_verification_payload( // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md#-verify_collection-unverify_collection-and-set_and_verify_collection // This uses the account. The collection is only provided as an argument for `set_and_verify_collection`. fn build_collection_verification_payload( - keys: &[plerkle_serialization::Pubkey], + keys: &[Pubkey], verify: bool, ) -> Result { - let collection_raw = keys + let collection = *keys .get(8) - .ok_or(BlockbusterError::InstructionParsingError)? - .0; - let collection: Pubkey = Pubkey::try_from_slice(&collection_raw)?; + .ok_or(BlockbusterError::InstructionParsingError)?; Ok(Payload::CollectionVerification { collection, verify }) } // See Bubblegum for offsets and positions: // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md fn build_mint_v1_payload( - keys: &[plerkle_serialization::Pubkey], + keys: &[Pubkey], ix_data: &[u8], set_verify: bool, ) -> Result { @@ -287,15 +266,13 @@ fn build_mint_v1_payload( } } - let authority = keys - .get(0) - .ok_or(BlockbusterError::InstructionParsingError)? - .0; + let authority = *keys + .first() + .ok_or(BlockbusterError::InstructionParsingError)?; - let tree_id = keys + let tree_id = *keys .get(3) - .ok_or(BlockbusterError::InstructionParsingError)? - .0; + .ok_or(BlockbusterError::InstructionParsingError)?; Ok(Payload::MintV1 { args, @@ -307,15 +284,14 @@ fn build_mint_v1_payload( // See Bubblegum for offsets and positions: // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md fn build_update_metadata_payload( - keys: &[plerkle_serialization::Pubkey], + keys: &[Pubkey], ix_data: &[u8], ) -> Result { let args = UpdateMetadataInstructionArgs::try_from_slice(ix_data)?; - let tree_id = keys + let tree_id = *keys .get(8) - .ok_or(BlockbusterError::InstructionParsingError)? - .0; + .ok_or(BlockbusterError::InstructionParsingError)?; Ok(Payload::UpdateMetadata { current_metadata: args.current_metadata, diff --git a/blockbuster/src/programs/token_account/mod.rs b/blockbuster/src/programs/token_account/mod.rs index f9bd7a5..298fa33 100644 --- a/blockbuster/src/programs/token_account/mod.rs +++ b/blockbuster/src/programs/token_account/mod.rs @@ -3,7 +3,6 @@ use crate::{ program_handler::{ParseResult, ProgramParser}, programs::ProgramParseResult, }; -use plerkle_serialization::AccountInfo; use solana_sdk::{program_pack::Pack, pubkey::Pubkey, pubkeys}; use spl_token::state::{Account as TokenAccount, Mint}; @@ -17,7 +16,6 @@ pub struct TokenAccountParser; pub enum TokenProgramAccount { Mint(Mint), TokenAccount(TokenAccount), - EmptyAccount } impl ParseResult for TokenProgramAccount { @@ -48,24 +46,24 @@ impl ProgramParser for TokenAccountParser { } fn handle_account( &self, - account_info: &AccountInfo, + account_data: &[u8], ) -> Result, BlockbusterError> { - let account_data = if let Some(account_info) = account_info.data() { - account_info.iter().collect::>() - } else { - return Ok(Box::new(TokenProgramAccount::EmptyAccount)); - }; - let account_type = match account_data.len() { 165 => { - let token_account = TokenAccount::unpack(&account_data) - .map_err(|_| BlockbusterError::CustomDeserializationError("Token Account Unpack Failed".to_string()))?; + let token_account = TokenAccount::unpack(account_data).map_err(|_| { + BlockbusterError::CustomDeserializationError( + "Token Account Unpack Failed".to_string(), + ) + })?; TokenProgramAccount::TokenAccount(token_account) } 82 => { - let mint = Mint::unpack(&account_data) - .map_err(|_| BlockbusterError::CustomDeserializationError("Token MINT Unpack Failed".to_string()))?; + let mint = Mint::unpack(account_data).map_err(|_| { + BlockbusterError::CustomDeserializationError( + "Token MINT Unpack Failed".to_string(), + ) + })?; TokenProgramAccount::Mint(mint) } @@ -76,5 +74,4 @@ impl ProgramParser for TokenAccountParser { Ok(Box::new(account_type)) } - } diff --git a/blockbuster/src/programs/token_metadata/mod.rs b/blockbuster/src/programs/token_metadata/mod.rs index d69908b..e19ee21 100644 --- a/blockbuster/src/programs/token_metadata/mod.rs +++ b/blockbuster/src/programs/token_metadata/mod.rs @@ -6,8 +6,6 @@ use crate::{ use borsh::BorshDeserialize; use solana_sdk::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey, pubkeys}; -use plerkle_serialization::AccountInfo; - use mpl_token_metadata::{ accounts::{ CollectionAuthorityRecord, DeprecatedMasterEditionV1, Edition, EditionMarker, @@ -70,16 +68,8 @@ impl ProgramParser for TokenMetadataParser { fn handle_account( &self, - account_info: &AccountInfo, + account_data: &[u8], ) -> Result, BlockbusterError> { - let account_data = if let Some(account_info) = account_info.data() { - account_info.iter().collect::>() - } else { - return Ok(Box::new(TokenMetadataAccountState { - key: Key::Uninitialized, - data: TokenMetadataAccountData::EmptyAccount, - })); - }; if account_data.is_empty() { return Ok(Box::new(TokenMetadataAccountState { key: Key::Uninitialized, @@ -89,7 +79,7 @@ impl ProgramParser for TokenMetadataParser { let key = Key::try_from_slice(&account_data[0..1])?; let token_metadata_account_state = match key { Key::EditionV1 => { - let account: Edition = try_from_slice_unchecked(&account_data)?; + let account: Edition = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -97,7 +87,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::MasterEditionV1 => { - let account: DeprecatedMasterEditionV1 = try_from_slice_unchecked(&account_data)?; + let account: DeprecatedMasterEditionV1 = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -105,7 +95,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::MasterEditionV2 => { - let account: MasterEdition = try_from_slice_unchecked(&account_data)?; + let account: MasterEdition = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -113,7 +103,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::UseAuthorityRecord => { - let account: UseAuthorityRecord = try_from_slice_unchecked(&account_data)?; + let account: UseAuthorityRecord = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -121,7 +111,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::EditionMarker => { - let account: EditionMarker = try_from_slice_unchecked(&account_data)?; + let account: EditionMarker = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -129,7 +119,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::CollectionAuthorityRecord => { - let account: CollectionAuthorityRecord = try_from_slice_unchecked(&account_data)?; + let account: CollectionAuthorityRecord = try_from_slice_unchecked(account_data)?; TokenMetadataAccountState { key: account.key, @@ -137,7 +127,7 @@ impl ProgramParser for TokenMetadataParser { } } Key::MetadataV1 => { - let account = Metadata::safe_deserialize(&account_data)?; + let account = Metadata::safe_deserialize(account_data)?; TokenMetadataAccountState { key: account.key, diff --git a/blockbuster/tests/bubblegum_parser_test.rs b/blockbuster/tests/bubblegum_parser_test.rs index 3ac7333..5c2afdf 100644 --- a/blockbuster/tests/bubblegum_parser_test.rs +++ b/blockbuster/tests/bubblegum_parser_test.rs @@ -1,6 +1,5 @@ #[cfg(test)] use blockbuster::{ - instruction::InstructionBundle, program_handler::ProgramParser, programs::{bubblegum::BubblegumParser, ProgramParseResult}, }; @@ -11,7 +10,6 @@ use mpl_bubblegum::{ types::{BubblegumEventType, Creator, LeafSchema, MetadataArgs, TokenProgramVersion, Version}, LeafSchemaEvent, }; -use plerkle_serialization::Pubkey; use spl_account_compression::{ events::{AccountCompressionEvent, ChangeLogEvent}, state::PathNode, @@ -31,10 +29,7 @@ fn test_mint() { let subject = BubblegumParser {}; let accounts = random_list_of(9, |_i| random_pubkey()); - let fb_accounts: Vec = accounts - .iter() - .map(|account| Pubkey(account.to_bytes())) - .collect(); + let fb_accounts = accounts.clone(); let fb_account_indexes: Vec = fb_accounts .iter() .enumerate() @@ -101,13 +96,12 @@ fn test_mint() { ); let cs_event = AccountCompressionEvent::ChangeLog(cs); - let mut ix_b = InstructionBundle::default(); let mut fbb1 = FlatBufferBuilder::new(); let mut fbb2 = FlatBufferBuilder::new(); let mut fbb3 = FlatBufferBuilder::new(); let mut fbb4 = FlatBufferBuilder::new(); - build_bubblegum_bundle( + let ix_b = build_bubblegum_bundle( &mut fbb1, &mut fbb2, &mut fbb3, @@ -117,7 +111,6 @@ fn test_mint() { &ix_data, lse, cs_event, - &mut ix_b, ); let result = subject.handle_instruction(&ix_b); @@ -141,10 +134,7 @@ fn test_basic_success_parsing() { let subject = BubblegumParser {}; let accounts = random_list_of(8, |_i| random_pubkey()); - let fb_accounts: Vec = accounts - .iter() - .map(|account| Pubkey(account.to_bytes())) - .collect(); + let fb_accounts = accounts.clone(); let fb_account_indexes: Vec = fb_accounts .iter() .enumerate() @@ -199,13 +189,12 @@ fn test_basic_success_parsing() { ); let cs_event = AccountCompressionEvent::ChangeLog(cs); - let mut ix_b = InstructionBundle::default(); let mut fbb1 = FlatBufferBuilder::new(); let mut fbb2 = FlatBufferBuilder::new(); let mut fbb3 = FlatBufferBuilder::new(); let mut fbb4 = FlatBufferBuilder::new(); - build_bubblegum_bundle( + let ix_b = build_bubblegum_bundle( &mut fbb1, &mut fbb2, &mut fbb3, @@ -215,7 +204,6 @@ fn test_basic_success_parsing() { &ix_data, lse, cs_event, - &mut ix_b, ); let result = subject.handle_instruction(&ix_b); diff --git a/blockbuster/tests/helpers.rs b/blockbuster/tests/helpers.rs index c1e1a3b..953dad3 100644 --- a/blockbuster/tests/helpers.rs +++ b/blockbuster/tests/helpers.rs @@ -10,18 +10,19 @@ use mpl_bubblegum::LeafSchemaEvent; use plerkle_serialization::{ root_as_account_info, root_as_compiled_instruction, serializer::seralize_encoded_transaction_with_status, AccountInfo, AccountInfoArgs, - CompiledInstruction, CompiledInstructionBuilder, InnerInstructionsBuilder, Pubkey as FBPubkey, - TransactionInfo, TransactionInfoBuilder, + CompiledInstruction as FBCompiledInstruction, CompiledInstructionBuilder, + InnerInstructionsBuilder, Pubkey as FBPubkey, TransactionInfo, TransactionInfoBuilder, }; use rand::Rng; use solana_geyser_plugin_interface::geyser_plugin_interface::ReplicaAccountInfo; -use solana_sdk::pubkey::Pubkey; -use solana_transaction_status::EncodedConfirmedTransactionWithStatusMeta; +use solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey}; +use solana_transaction_status::{ + EncodedConfirmedTransactionWithStatusMeta, InnerInstruction, InnerInstructions, +}; use spl_account_compression::events::{ AccountCompressionEvent, ApplicationDataEvent, ApplicationDataEventV1, }; -use std::fs::File; -use std::io::BufReader; +use std::{fs::File, io::BufReader}; pub fn random_program() -> Pubkey { Pubkey::new_unique() @@ -78,7 +79,7 @@ pub fn build_random_instruction<'a>( fbb: &mut FlatBufferBuilder<'a>, accounts_number_in_transaction: usize, number_of_accounts: usize, -) -> WIPOffset> { +) -> WIPOffset> { let accounts = random_list(5, random_u8_bound(1, number_of_accounts as u8)); let accounts = fbb.create_vector(&accounts); let data = random_data(10); @@ -134,7 +135,6 @@ pub fn get_programs(txn_info: TransactionInfo) -> Vec { .unwrap() .iter() .map(|ix| { - println!("{:?}", txn_info); Pubkey::new_from_array( txn_info .account_keys() @@ -176,7 +176,7 @@ pub fn build_instruction<'a>( fbb: &'a mut FlatBufferBuilder<'a>, data: &[u8], account_indexes: &[u8], -) -> Result, flatbuffers::InvalidFlatbuffer> { +) -> Result { let accounts_vec = fbb.create_vector(account_indexes); let ix_data = fbb.create_vector(data); let mut builder = CompiledInstructionBuilder::new(fbb); @@ -187,7 +187,20 @@ pub fn build_instruction<'a>( fbb.finish_minimal(offset); let data = fbb.finished_data(); - root_as_compiled_instruction(data) + let cix = root_as_compiled_instruction(data)?; + Ok(CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix + .accounts() + .expect("failed to deserialize accounts") + .bytes() + .to_vec(), + data: cix + .data() + .expect("failed to deserialize data") + .bytes() + .to_vec(), + }) } pub fn build_account_update<'a>( @@ -262,7 +275,8 @@ pub fn build_txn_from_fixture( .unwrap(); let reader = BufReader::new(file); let ectxn: EncodedConfirmedTransactionWithStatusMeta = serde_json::from_reader(reader).unwrap(); - seralize_encoded_transaction_with_status(fbb, ectxn).map_err(Into::into) + Ok(seralize_encoded_transaction_with_status(fbb, ectxn) + .expect("failed serialize encoded tx with status")) } #[allow(clippy::too_many_arguments)] @@ -271,35 +285,112 @@ pub fn build_bubblegum_bundle<'a>( fbb2: &'a mut FlatBufferBuilder<'a>, fbb3: &'a mut FlatBufferBuilder<'a>, fbb4: &'a mut FlatBufferBuilder<'a>, - accounts: &'a Vec, + accounts: &'a [Pubkey], account_indexes: &'a [u8], ix_data: &'a [u8], lse: LeafSchemaEvent, cs_event: AccountCompressionEvent, - ixb: &mut InstructionBundle<'a>, -) { +) -> InstructionBundle<'a> { let lse_versioned = ApplicationDataEventV1 { application_data: lse.try_to_vec().unwrap(), }; let lse_event = AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1(lse_versioned)); let outer_ix = build_instruction(fbb1, ix_data, account_indexes).unwrap(); + let lse = lse_event.try_to_vec().unwrap(); let noop_bgum = spl_noop::instruction(lse).data; let ix = build_instruction(fbb2, &noop_bgum, account_indexes).unwrap(); - let noop_bgum_ix: IxPair = (FBPubkey(spl_noop::id().to_bytes()), ix); + let noop_bgum_ix: IxPair = (spl_noop::id(), Box::leak(Box::new(ix))); + // The Compression Instruction here doesnt matter only the noop but we add it here to ensure we are validating that one Account compression event is happening after Bubblegum let ix = build_instruction(fbb3, &[0; 0], account_indexes).unwrap(); - let gummy_roll_ix: IxPair = (FBPubkey(spl_account_compression::id().to_bytes()), ix); + let gummy_roll_ix: IxPair = (spl_account_compression::id(), Box::leak(Box::new(ix))); + let cs = cs_event.try_to_vec().unwrap(); let noop_compression = spl_noop::instruction(cs).data; let ix = build_instruction(fbb4, &noop_compression, account_indexes).unwrap(); - let noop_compression_ix = (FBPubkey(spl_noop::id().to_bytes()), ix); + let noop_compression_ix: IxPair = (spl_noop::id(), Box::leak(Box::new(ix))); let inner_ix = vec![noop_bgum_ix, gummy_roll_ix, noop_compression_ix]; - ixb.program = FBPubkey(mpl_bubblegum::ID.to_bytes()); - ixb.inner_ix = Some(inner_ix); - ixb.keys = accounts.as_slice(); - ixb.instruction = Some(outer_ix); + // `Box::leak` is ok for tests + InstructionBundle { + program: mpl_bubblegum::ID, + inner_ix: Some(Box::leak(Box::new(inner_ix))), + keys: accounts, + instruction: Some(Box::leak(Box::new(outer_ix))), + ..Default::default() + } +} + +pub fn parse_fb( + tx_info: &TransactionInfo, +) -> ( + Vec, + Vec, + Vec, +) { + let mut account_keys = vec![]; + for key in tx_info.account_keys().iter().flatten() { + account_keys.push(Pubkey::try_from(key.0.as_slice()).expect("valid key from FlatBuffer")); + } + + let mut message_instructions = vec![]; + for cix in tx_info + .outer_instructions() + .expect("valid outer_instructions") + { + message_instructions.push(CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix.accounts().expect("valid accounts").bytes().to_vec(), + data: cix.data().expect("valid data").bytes().to_vec(), + }); + } + + let mut meta_inner_instructions = vec![]; + if let Some(ixs) = tx_info.compiled_inner_instructions() { + for ix in ixs { + let mut instructions = vec![]; + for ix in ix.instructions().expect("valid instructions") { + let cix = ix.compiled_instruction().expect("valid instruction"); + instructions.push(InnerInstruction { + instruction: CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix.accounts().expect("valid accounts").bytes().to_vec(), + data: cix.data().expect("valid data").bytes().to_vec(), + }, + stack_height: Some(ix.stack_height() as u32), + }) + } + + meta_inner_instructions.push(InnerInstructions { + index: ix.index(), + instructions, + }) + } + } else if let Some(ixs) = tx_info.inner_instructions() { + for ix in ixs { + let mut instructions = vec![]; + for cix in ix.instructions().expect("valid instructions") { + instructions.push(InnerInstruction { + instruction: CompiledInstruction { + program_id_index: cix.program_id_index(), + accounts: cix.accounts().expect("valid accounts").bytes().to_vec(), + data: cix.data().expect("valid data").bytes().to_vec(), + }, + stack_height: Some(0), + }) + } + + meta_inner_instructions.push(InnerInstructions { + index: ix.index(), + instructions, + }) + } + } else { + panic!("expect valid compiled_inner_instructions/inner_instructions") + } + + (account_keys, message_instructions, meta_inner_instructions) } diff --git a/blockbuster/tests/instructions_test.rs b/blockbuster/tests/instructions_test.rs index 0739c2f..b13a9d7 100644 --- a/blockbuster/tests/instructions_test.rs +++ b/blockbuster/tests/instructions_test.rs @@ -11,15 +11,14 @@ use blockbuster::{ }; use flatbuffers::FlatBufferBuilder; use helpers::*; -use plerkle_serialization::{root_as_transaction_info, Pubkey as FBPubkey}; +use plerkle_serialization::root_as_transaction_info; use rand::prelude::IteratorRandom; -use solana_sdk::pubkey::Pubkey; use spl_account_compression::events::{ AccountCompressionEvent::{self}, ApplicationDataEvent, ApplicationDataEventV1, ChangeLogEvent, ChangeLogEventV1, }; -use std::collections::HashSet; -use std::env; +use std::{collections::HashSet, env}; + #[test] fn test_filter() { let mut rng = rand::thread_rng(); @@ -28,21 +27,31 @@ fn test_filter() { let data = fbb.finished_data(); let txn = root_as_transaction_info(data).expect("TODO: panic message"); let programs = get_programs(txn); - let chosen_progs = programs.iter().choose_multiple(&mut rng, 3); - let mut hs = HashSet::new(); - chosen_progs.iter().fold(&mut hs, |hs, p| { - hs.insert(p.as_ref()); - hs - }); - let _len = hs.len(); - let hsb = hs.clone(); - let res = order_instructions(hs, &txn); + let hs = programs + .iter() + .choose_multiple(&mut rng, 3) + .into_iter() + .copied() + .collect::>(); + let (account_keys, message_instructions, meta_inner_instructions) = parse_fb(&txn); + let res = order_instructions( + &hs, + &account_keys, + &message_instructions, + &meta_inner_instructions, + ); + for (ib, _inner) in res.iter() { - let public_key_matches = hsb.contains(&ib.0 .0.as_ref()); + let public_key_matches = hs.contains(&ib.0); assert!(public_key_matches); } - let res = order_instructions(HashSet::new(), &txn); + let res = order_instructions( + &HashSet::new(), + &account_keys, + &message_instructions, + &meta_inner_instructions, + ); assert_eq!(res.len(), 0); } @@ -61,31 +70,31 @@ fn helium_nested() { let mut prog = HashSet::new(); let id = mpl_bubblegum::ID; let slot = txn.slot(); - prog.insert(id.as_ref()); - let res = order_instructions(prog, &txn); - let accounts = txn.account_keys().unwrap(); - let mut keys: Vec = Vec::with_capacity(accounts.len()); - for k in accounts.into_iter() { - keys.push(*k); - } + prog.insert(id); + let (account_keys, message_instructions, meta_inner_instructions) = parse_fb(&txn); + let res = order_instructions( + &prog, + &account_keys, + &message_instructions, + &meta_inner_instructions, + ); let _ix = 0; - let contains = res - .iter() - .any(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); + let contains = res.iter().any(|(ib, _inner)| ib.0 == mpl_bubblegum::ID); assert!(contains, "Must containe bgum at hoisted root"); let subject = BubblegumParser {}; for (outer_ix, inner_ix) in res.into_iter() { let (program, instruction) = outer_ix; - let ix_accounts = instruction.accounts().unwrap().iter().collect::>(); - let ix_account_len = ix_accounts.len(); - let _max = ix_accounts.iter().max().copied().unwrap_or(0) as usize; + // let ix_accounts = instruction.accounts.iter().collect::>(); + let ix_account_len = instruction.accounts.len(); + // let _max = ix_accounts.iter().max().copied().unwrap_or(0) as usize; let ix_accounts = - ix_accounts + instruction + .accounts .iter() .fold(Vec::with_capacity(ix_account_len), |mut acc, a| { - if let Some(key) = keys.get(*a as usize) { + if let Some(key) = account_keys.get(*a as usize) { acc.push(*key); } //else case here is handled on 272 @@ -95,7 +104,7 @@ fn helium_nested() { txn_id: "", program, instruction: Some(instruction), - inner_ix, + inner_ix: inner_ix.as_deref(), keys: ix_accounts.as_slice(), slot, }; @@ -132,27 +141,26 @@ fn test_double_mint() { let txn = root_as_transaction_info(txn.finished_data()).expect("Fail deser"); let mut programs = HashSet::new(); let subject = BubblegumParser {}.key(); - programs.insert(subject.as_ref()); - let ix = order_instructions(programs, &txn); + programs.insert(subject); + let (account_keys, message_instructions, meta_inner_instructions) = parse_fb(&txn); + let ix = order_instructions( + &programs, + &account_keys, + &message_instructions, + &meta_inner_instructions, + ); assert_eq!(ix.len(), 2); - let contains = ix - .iter() - .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); + let contains = ix.iter().filter(|(ib, _inner)| ib.0 == mpl_bubblegum::ID); let mut count = 0; - contains.for_each(|bix| { + contains.for_each(|(_pk, cix)| { count += 1; - if let Some(inner) = &bix.1 { + if let Some(inner) = &cix { println!("{}", inner.len()); for ii in inner { - println!( - "pp{} {:?}", - count, - Pubkey::try_from(ii.0 .0.as_ref()).unwrap() - ); + println!("pp{} {:?}", count, ii.0); } println!("------"); - let cl = AccountCompressionEvent::try_from_slice(inner[1].1.data().unwrap().bytes()) - .unwrap(); + let cl = AccountCompressionEvent::try_from_slice(&inner[1].1.data).unwrap(); if let AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1( ApplicationDataEventV1 { application_data }, )) = cl @@ -160,8 +168,7 @@ fn test_double_mint() { let lse = LeafSchemaEvent::try_from_slice(&application_data).unwrap(); println!("1 pp{} NONCE {:?}\n end", count, lse.schema.nonce()); } - let cl = AccountCompressionEvent::try_from_slice(inner[3].1.data().unwrap().bytes()) - .unwrap(); + let cl = AccountCompressionEvent::try_from_slice(&inner[3].1.data).unwrap(); if let AccountCompressionEvent::ChangeLog(ChangeLogEvent::V1(ChangeLogEventV1 { id, .. @@ -181,24 +188,23 @@ fn test_double_tree() { let txn = root_as_transaction_info(txn.finished_data()).expect("Fail deser"); let mut programs = HashSet::new(); let subject = BubblegumParser {}.key(); - programs.insert(subject.as_ref()); - let ix = order_instructions(programs, &txn); - let contains = ix - .iter() - .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); + programs.insert(subject); + let (account_keys, message_instructions, meta_inner_instructions) = parse_fb(&txn); + let ix = order_instructions( + &programs, + &account_keys, + &message_instructions, + &meta_inner_instructions, + ); + let contains = ix.iter().filter(|(ib, _inner)| ib.0 == mpl_bubblegum::ID); let mut count = 0; - contains.for_each(|bix| { - if let Some(inner) = &bix.1 { + contains.for_each(|(_pk, cix)| { + if let Some(inner) = &cix { for ii in inner { - println!( - "pp{} {:?}", - count, - Pubkey::try_from(ii.0 .0.as_ref()).unwrap() - ); + println!("pp{} {:?}", count, ii.0); } println!("------"); - let cl = AccountCompressionEvent::try_from_slice(inner[1].1.data().unwrap().bytes()) - .unwrap(); + let cl = AccountCompressionEvent::try_from_slice(&inner[1].1.data).unwrap(); if let AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1( ApplicationDataEventV1 { application_data }, )) = cl @@ -206,8 +212,7 @@ fn test_double_tree() { let lse = LeafSchemaEvent::try_from_slice(&application_data).unwrap(); println!("1 pp{} NONCE {:?}\n end", count, lse.schema.nonce()); } - let cl = AccountCompressionEvent::try_from_slice(inner[3].1.data().unwrap().bytes()) - .unwrap(); + let cl = AccountCompressionEvent::try_from_slice(&inner[3].1.data).unwrap(); if let AccountCompressionEvent::ChangeLog(ChangeLogEvent::V1(ChangeLogEventV1 { id, .. diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..f4ec842 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.73.0" \ No newline at end of file