From 67d42457911d86973fcb1912b9b707b78e9d8d14 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 11 Jun 2024 14:55:57 +0300 Subject: [PATCH 01/34] wip --- Cargo.lock | 1603 ++++- Cargo.toml | 31 +- blockbuster/.github/pull_request_template.md | 8 + blockbuster/.github/release.yml | 17 + blockbuster/.github/workflows/test.yml | 16 + blockbuster/.gitmodules | 4 + blockbuster/.vscode/extensions.json | 13 + blockbuster/.vscode/launch.json | 18 + blockbuster/Cargo.lock | 6356 +++++++++++++++++ blockbuster/Cargo.toml | 42 - blockbuster/LICENSE | 661 ++ blockbuster/blockbuster.iml | 15 + blockbuster/blockbuster/.gitignore | 11 + blockbuster/blockbuster/Cargo.toml | 43 + blockbuster/blockbuster/rustfmt.toml | 3 + blockbuster/{ => blockbuster}/src/error.rs | 0 .../{ => blockbuster}/src/instruction.rs | 23 +- blockbuster/{ => blockbuster}/src/lib.rs | 0 .../{ => blockbuster}/src/parsed_programs.rs | 0 .../{ => blockbuster}/src/program_handler.rs | 0 .../src/programs/bubblegum/mod.rs | 25 +- .../{ => blockbuster}/src/programs/mod.rs | 0 .../src/programs/mpl_core_program/mod.rs | 0 .../src/programs/token_account/mod.rs | 0 .../programs/token_extensions/extension.rs | 23 +- .../src/programs/token_extensions/mod.rs | 79 +- .../src/programs/token_metadata/mod.rs | 0 .../tests/bubblegum_parser_test.rs | 0 .../tests/fixtures/double_bubblegum_mint.json | 0 .../fixtures/helium_mint_double_tree.json | 0 .../tests/fixtures/helium_nested.json | 0 .../{ => blockbuster}/tests/helpers.rs | 0 .../tests/instructions_test.rs | 0 blockbuster/mpl-bubblegum | 1 + blockbuster/rust-toolchain.toml | 2 + .../src/programs/account_closure/mod.rs | 73 - .../src/dao/generated/asset.rs | 24 +- digital_asset_types/src/dao/generated/mod.rs | 1 + .../src/dao/generated/prelude.rs | 3 +- .../src/dao/generated/rollup_to_verify.rs | 75 + .../src/dao/generated/sea_orm_active_enums.rs | 186 +- docker-compose.yaml | 12 +- migration/src/lib.rs | 2 + ...alize_tree_with_root_instruction_handle.rs | 140 + nft_ingester/Cargo.toml | 1 + program_transformers/Cargo.toml | 6 + program_transformers/src/bubblegum/db.rs | 2 +- .../src/bubblegum/finalize_tree_with_root.rs | 79 + .../src/bubblegum/merkle_tree_wrapper.rs | 230 + program_transformers/src/bubblegum/mod.rs | 4 + .../src/bubblegum/rollup_persister.rs | 498 ++ program_transformers/src/error.rs | 38 + 52 files changed, 9746 insertions(+), 622 deletions(-) create mode 100644 blockbuster/.github/pull_request_template.md create mode 100644 blockbuster/.github/release.yml create mode 100644 blockbuster/.github/workflows/test.yml create mode 100644 blockbuster/.gitmodules create mode 100644 blockbuster/.vscode/extensions.json create mode 100644 blockbuster/.vscode/launch.json create mode 100644 blockbuster/Cargo.lock delete mode 100644 blockbuster/Cargo.toml create mode 100644 blockbuster/LICENSE create mode 100644 blockbuster/blockbuster.iml create mode 100644 blockbuster/blockbuster/.gitignore create mode 100644 blockbuster/blockbuster/Cargo.toml create mode 100644 blockbuster/blockbuster/rustfmt.toml rename blockbuster/{ => blockbuster}/src/error.rs (100%) rename blockbuster/{ => blockbuster}/src/instruction.rs (82%) rename blockbuster/{ => blockbuster}/src/lib.rs (100%) rename blockbuster/{ => blockbuster}/src/parsed_programs.rs (100%) rename blockbuster/{ => blockbuster}/src/program_handler.rs (100%) rename blockbuster/{ => blockbuster}/src/programs/bubblegum/mod.rs (91%) rename blockbuster/{ => blockbuster}/src/programs/mod.rs (100%) rename blockbuster/{ => blockbuster}/src/programs/mpl_core_program/mod.rs (100%) rename blockbuster/{ => blockbuster}/src/programs/token_account/mod.rs (100%) rename blockbuster/{ => blockbuster}/src/programs/token_extensions/extension.rs (97%) rename blockbuster/{ => blockbuster}/src/programs/token_extensions/mod.rs (79%) rename blockbuster/{ => blockbuster}/src/programs/token_metadata/mod.rs (100%) rename blockbuster/{ => blockbuster}/tests/bubblegum_parser_test.rs (100%) rename blockbuster/{ => blockbuster}/tests/fixtures/double_bubblegum_mint.json (100%) rename blockbuster/{ => blockbuster}/tests/fixtures/helium_mint_double_tree.json (100%) rename blockbuster/{ => blockbuster}/tests/fixtures/helium_nested.json (100%) rename blockbuster/{ => blockbuster}/tests/helpers.rs (100%) rename blockbuster/{ => blockbuster}/tests/instructions_test.rs (100%) create mode 160000 blockbuster/mpl-bubblegum create mode 100644 blockbuster/rust-toolchain.toml delete mode 100644 blockbuster/src/programs/account_closure/mod.rs create mode 100644 digital_asset_types/src/dao/generated/rollup_to_verify.rs create mode 100644 migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs create mode 100644 program_transformers/src/bubblegum/finalize_tree_with_root.rs create mode 100644 program_transformers/src/bubblegum/merkle_tree_wrapper.rs create mode 100644 program_transformers/src/bubblegum/rollup_persister.rs diff --git a/Cargo.lock b/Cargo.lock index 5563779d4..7e50a18ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,9 +104,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.5" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom 0.2.10", @@ -396,6 +396,20 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "aquamarine" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "arc-swap" version = "1.6.0" @@ -693,7 +707,7 @@ dependencies = [ "futures-lite 2.0.1", "parking", "polling 3.4.0", - "rustix 0.38.18", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -785,9 +799,9 @@ checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", @@ -889,9 +903,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -951,9 +965,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -1043,7 +1057,7 @@ dependencies = [ "solana-transaction-status", "solana-zk-token-sdk", "spl-account-compression", - "spl-concurrent-merkle-tree", + "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "spl-noop", "spl-pod", "spl-token", @@ -1051,6 +1065,7 @@ dependencies = [ "spl-token-group-interface", "spl-token-metadata-interface", "thiserror", + "triomphe", ] [[package]] @@ -1089,6 +1104,16 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "borsh-derive 1.5.1", + "cfg_aliases", +] + [[package]] name = "borsh-derive" version = "0.9.3" @@ -1115,6 +1140,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.66", + "syn_derive", +] + [[package]] name = "borsh-derive-internal" version = "0.9.3" @@ -1245,9 +1284,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" dependencies = [ "bytemuck_derive", ] @@ -1275,6 +1314,27 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "cadence" version = "0.29.1" @@ -1319,6 +1379,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.31" @@ -1334,6 +1400,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + [[package]] name = "cipher" version = "0.3.0" @@ -1467,7 +1542,7 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.9", ] [[package]] @@ -1481,15 +1556,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1575,11 +1650,10 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] @@ -1619,12 +1693,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1798,16 +1869,6 @@ dependencies = [ "tracing", ] -[[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 = "dashmap" version = "5.5.3" @@ -1819,6 +1880,7 @@ dependencies = [ "lock_api", "once_cell", "parking_lot_core 0.9.8", + "rayon", ] [[package]] @@ -1894,6 +1956,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "digest" version = "0.9.0" @@ -1937,12 +2005,21 @@ dependencies = [ "serde", "serde_json", "solana-sdk", - "spl-concurrent-merkle-tree", + "spl-concurrent-merkle-tree 0.2.0", "thiserror", "tokio", "url", ] +[[package]] +name = "dir-diff" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" +dependencies = [ + "walkdir", +] + [[package]] name = "dirs" version = "4.0.0" @@ -2003,6 +2080,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "dyn-clone" version = "1.0.14" @@ -2050,6 +2133,18 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "either" version = "1.9.0" @@ -2076,19 +2171,32 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "1.2.1" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" dependencies = [ + "num-bigint 0.4.4", + "num-traits", "proc-macro2", "quote", "syn 2.0.66", @@ -2128,12 +2236,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2238,6 +2346,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + [[package]] name = "finl_unicode" version = "1.2.0" @@ -2256,14 +2376,23 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2287,13 +2416,19 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -2323,9 +2458,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -2338,9 +2473,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -2348,15 +2483,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2376,9 +2511,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -2411,9 +2546,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -2422,21 +2557,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -2560,7 +2695,7 @@ dependencies = [ "indexmap 1.9.3", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.9", "tracing", ] @@ -2597,7 +2732,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.5", + "ahash 0.8.11", ] [[package]] @@ -2606,7 +2741,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ - "ahash 0.8.5", + "ahash 0.8.11", "allocator-api2", ] @@ -2788,7 +2923,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.7", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] @@ -2837,9 +2972,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2861,6 +2996,31 @@ dependencies = [ "version_check", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "index_list" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" + [[package]] name = "indexmap" version = "1.9.3" @@ -2874,9 +3034,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.1", @@ -2983,7 +3143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.18", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -3022,9 +3182,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -3124,7 +3284,7 @@ dependencies = [ "soketto", "tokio", "tokio-stream", - "tokio-util", + "tokio-util 0.7.9", "tower", "tracing", ] @@ -3150,6 +3310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a26f49495f94a283312e7ef45a243540ef20c9356bb01c8d84a61ac8ba5339b" dependencies = [ "borsh 0.10.3", + "serde", ] [[package]] @@ -3178,9 +3339,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsecp256k1" @@ -3256,9 +3423,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "load_generation" @@ -3294,6 +3461,35 @@ dependencies = [ "value-bag", ] +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -3435,15 +3631,42 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "modular-bitfield" version = "0.11.2" @@ -3467,23 +3690,32 @@ dependencies = [ [[package]] name = "mpl-bubblegum" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3cbca5deb859e66a1a21ada94f2eaab3eb5caa4584c0c8ade0efac29a5414b8" +version = "1.4.0" dependencies = [ + "assert_matches", "borsh 0.10.3", + "bytemuck", "kaigan", "num-derive 0.3.3", "num-traits", + "serde", + "serde_with 3.6.1", "solana-program", + "solana-program-test", + "solana-sdk", + "spl-account-compression", + "spl-associated-token-account", + "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-merkle-tree-reference 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-noop", + "spl-token", "thiserror", ] [[package]] name = "mpl-core" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b314fcf76dc22cc42a02a208231c667d0c533ce140d6ba9985df5a2a50b0aa" +source = "git+https://github.com/RequescoS/mpl-core.git#00496a76af1745aa2349199367be245cba2fec59" dependencies = [ "base64 0.22.0", "borsh 0.10.3", @@ -3568,6 +3800,7 @@ dependencies = [ "thiserror", "tokio", "tracing-subscriber", + "triomphe", "url", ] @@ -3594,6 +3827,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3712,6 +3951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3832,7 +4072,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -3870,6 +4110,25 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -4017,9 +4276,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "percentage" @@ -4118,8 +4377,7 @@ dependencies = [ [[package]] name = "plerkle_serialization" version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f832646491065468aa8e222b47d41dd5250e4be7866725bef5f0d31c64538f5f" +source = "git+https://github.com/n00m4d/digital-asset-validator-plugin.git#6920f6d3f30d6bc9c9c7eefeb5c7c1bcc87fa0c8" dependencies = [ "bs58 0.4.0", "chrono", @@ -4155,7 +4413,7 @@ dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.18", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] @@ -4202,6 +4460,36 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools 0.10.5", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -4222,7 +4510,16 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.0", +] + +[[package]] +name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" @@ -4271,6 +4568,8 @@ dependencies = [ name = "program_transformers" version = "0.7.2" dependencies = [ + "anchor-lang", + "async-trait", "blockbuster", "bs58 0.4.0", "cadence", @@ -4280,16 +4579,20 @@ dependencies = [ "heck 0.5.0", "mpl-bubblegum", "num-traits", + "paste", "sea-orm", + "serde_derive", "serde_json", "solana-sdk", "solana-transaction-status", "spl-account-compression", + "spl-concurrent-merkle-tree 0.2.0", "spl-token", "sqlx", "thiserror", "tokio", "tracing", + "triomphe", ] [[package]] @@ -4374,7 +4677,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.7", + "rustls 0.21.12", "thiserror", "tokio", "tracing", @@ -4390,7 +4693,7 @@ dependencies = [ "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.21.7", + "rustls 0.21.12", "rustls-native-certs", "slab", "thiserror", @@ -4406,7 +4709,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.4", + "socket2 0.5.7", "tracing", "windows-sys 0.48.0", ] @@ -4526,6 +4829,16 @@ dependencies = [ "getrandom 0.2.10", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -4546,9 +4859,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -4556,9 +4869,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -4605,7 +4918,7 @@ dependencies = [ "sha1_smol", "tokio", "tokio-native-tls", - "tokio-util", + "tokio-util 0.7.9", "url", ] @@ -4627,6 +4940,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -4640,14 +4962,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.9", - "regex-syntax 0.7.5", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -4661,13 +4983,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.4", ] [[package]] @@ -4678,9 +5000,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rend" @@ -4693,12 +5015,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "async-compression", - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -4717,16 +5039,17 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.7", + "rustls 0.21.12", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", - "tokio-util", + "tokio-util 0.7.9", "tower-service", "url", "wasm-bindgen", @@ -4917,15 +5240,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.18" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.10", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", ] [[package]] @@ -4942,12 +5265,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", + "ring 0.17.2", "rustls-webpki", "sct", ] @@ -4970,17 +5293,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", ] [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.2", + "untrusted 0.9.0", ] [[package]] @@ -4995,6 +5318,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.22" @@ -5277,9 +5609,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "seqlock" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "b5c67b6f14ecc5b86c66fa63d76b5092352678545a8a3cdae80aef5128371910" +dependencies = [ + "parking_lot 0.12.1", +] [[package]] name = "serde" @@ -5292,9 +5633,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] @@ -5323,11 +5664,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -5370,11 +5711,11 @@ version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.0.2", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -5412,7 +5753,7 @@ version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -5425,7 +5766,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" dependencies = [ - "dashmap 5.5.3", + "dashmap", "futures", "lazy_static", "log", @@ -5562,6 +5903,12 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "sized-chunks" version = "0.6.5" @@ -5583,9 +5930,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -5599,12 +5946,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5625,12 +5972,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d76c43ef61f527d719b5c6bfa5a62ebba60839739125da9e8a00fb82349afd2" +checksum = "b94ceb26c7d19530cb1bb49bf0f817647cb5fee691dae6779e19d33ac1d4fda1" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bs58 0.4.0", "bv", @@ -5648,11 +5995,178 @@ dependencies = [ "zstd", ] +[[package]] +name = "solana-accounts-db" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ccab24e16797d4324444337b09555f3762b85c6a862ee5fba6a211bc6c6736" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "flate2", + "fnv", + "im", + "index_list", + "itertools 0.10.5", + "lazy_static", + "log", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.4.1", + "num-traits", + "num_cpus", + "num_enum 0.7.2", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "seqlock", + "serde", + "serde_derive", + "smallvec", + "solana-bucket-map", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-nohash-hasher", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "static_assertions", + "strum", + "strum_macros", + "tar", + "tempfile", + "thiserror", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "195a93b87bd6794326a3c628cfcc8abaf70e476c4284bfb73545c873ba47c746" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive 0.4.1", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-banks-client" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "493962c963bd1e64e2086d4b962ac87e0744bde7998eb90132e9dfdad251b8d2" +dependencies = [ + "borsh 1.5.1", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d586b50a48b245369f359f043902f684abb3ad7599eff49a7387ea4641f19b" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee5ede19378812cf20c198a4be0c6ebf4b102d65cb0aa260f96c976030529a4" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-accounts-db", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "242706b2e7129926b929c6c5e7b9bf6659968a56bb666e7e07236167375eec99" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log", + "scopeguard", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d6de433be2c195c9139e7cba3b13c48e8db4b135cdb571e3225c34790d2adc" +dependencies = [ + "bv", + "bytemuck", + "log", + "memmap2", + "modular-bitfield", + "num_enum 0.7.2", + "rand 0.8.5", + "solana-measure", + "solana-sdk", + "tempfile", +] + [[package]] name = "solana-clap-utils" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb19b9bbd92eee2d8f637026559a9fb48bd98aba534caedf070498a50c91fce8" +checksum = "32063b76137e13fba2f93fdf67f999d84ac587af962b48cb4115f272037b2fae" dependencies = [ "chrono", "clap 2.34.0", @@ -5667,16 +6181,16 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9538e3db584a8b1e70060f1f24222b8e0429f18b607f531fb45eb826f4917265" +checksum = "31f6eaf198c544d4f448e6a86a51f9af8b328f041a490a007164a75194edf341" dependencies = [ "async-trait", "bincode", - "dashmap 4.0.2", + "dashmap", "futures", "futures-util", - "indexmap 2.0.2", + "indexmap 2.2.6", "indicatif", "log", "quinn", @@ -5698,11 +6212,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "solana-compute-budget-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a2af1d2aa3ea705147b99a34265b209393bae70930150d0583666305f91b958" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + [[package]] name = "solana-config-program" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3afd4e309d304e296765cab716fb1fd66c66ec300465c8b26f8cce763275132" +checksum = "378259800dc9dad34828d8be4ce0de71146bac1cbbd310f8901f6f19d92c5ea3" dependencies = [ "bincode", "chrono", @@ -5714,15 +6238,15 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92716758e8c0e1c0bc2a5ac2eb3df443a0337fd3991cd38a3b02b12c3fbd18ce" +checksum = "58b04571089f55754f5a09493ae0bcf8d8d5c8d9cd05be3e77c502f6b68c1a3b" dependencies = [ "async-trait", "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.0.2", + "indexmap 2.2.6", "log", "rand 0.8.5", "rayon", @@ -5734,19 +6258,39 @@ dependencies = [ "tokio", ] +[[package]] +name = "solana-cost-model" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c90655f4843a771d8cb94c6601c8dfac0ef0d5465bd12b0369047c0d12fd67" +dependencies = [ + "lazy_static", + "log", + "rustc_version", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", +] + [[package]] name = "solana-frozen-abi" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1b8230474ae9f7c841060c299999124582e8d2a0448d7847720792e98cc64e" +checksum = "780402262644f9efe9ac7d885812d245007fe65fd56a3dfed83ed30d61b44c74" dependencies = [ - "ahash 0.8.5", - "blake3", "block-buffer 0.10.4", "bs58 0.4.0", "bv", - "byteorder", - "cc", "either", "generic-array", "im", @@ -5757,7 +6301,6 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "serde_json", "sha2 0.10.8", "solana-frozen-abi-macro", "subtle", @@ -5766,9 +6309,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793910ab733b113b80c357f8f492dda2fabd5671c4ea03db3aa4e46b938fdbe3" +checksum = "df836de37aba77234c7afa1d857dc450fb9983572e4c6f595c84cdda65a63792" dependencies = [ "proc-macro2", "quote", @@ -5778,9 +6321,9 @@ dependencies = [ [[package]] name = "solana-geyser-plugin-interface" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f633425dc9409c6d3f019658b90bb1ad53747ed55acd45e0a18f58b95a0b89e5" +checksum = "7372ddfbe94019a1263f2c8ee16e7778778787eab6d9c8e78a52c9cb86241ea2" dependencies = [ "log", "solana-sdk", @@ -5788,11 +6331,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-loader-v4-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c15f85c202dda9a5aaa5a3c4948a55cb9b37731dd5811198bb58ced1bbfbac40" +dependencies = [ + "log", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana_rbpf", +] + [[package]] name = "solana-logger" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3f819af39632dc538a566c937253bf46256e4c0e60f621c6db448bc7c76294" +checksum = "9906be6edd0e1b579510736c153dbc51e5968808098d1b1f8c89dbea960aba58" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -5801,9 +6357,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb045f0235b16f7d926f6e0338db822747d61559a1368c3cb017ba6e02c516d0" +checksum = "7dc77e7f99fa5e845437ac9a593cd4bd67b5f9e4ba4a9578355eef25d3e839e9" dependencies = [ "log", "solana-sdk", @@ -5811,9 +6367,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af84362ad5804dc64ca88b1ca5c35bd41321e12d42c798ac06a6fbb60dd0e70" +checksum = "b0a9f68887ac31f84ef69365bdc2d7ca6bf19d50a9c6ee10806adb033e24e318" dependencies = [ "crossbeam-channel", "gethostname", @@ -5826,9 +6382,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e640a95d317cad1322015c5a2b6a71697fd8dabebcb8dd33ed7f5a22869d12" +checksum = "1ba07cceff31b644df6cd4acc909df077721fa047b624b9fa906d56bcc67435a" dependencies = [ "bincode", "clap 3.2.25", @@ -5838,7 +6394,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_derive", - "socket2 0.5.4", + "socket2 0.5.7", "solana-logger", "solana-sdk", "solana-version", @@ -5846,13 +6402,19 @@ dependencies = [ "url", ] +[[package]] +name = "solana-nohash-hasher" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" + [[package]] name = "solana-perf" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4266c4bd46620a925b8d508c26578d5559e97fcff6735fd22e39f369c3996ee1" +checksum = "0b7fa87b3344f96afe1395b5bb822db2ad03cdc2dbe8338636d57c58102a520b" dependencies = [ - "ahash 0.8.5", + "ahash 0.8.11", "bincode", "bv", "caps", @@ -5877,20 +6439,21 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f38a870bffbe623d900c68579984671f8dfa35bbfb3309d7134de22ce8652" +checksum = "48ecc7af7594674687260a4d7bcfb0588cefdbe9d0f6c4e9f3140999107566c4" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "base64 0.21.4", + "base64 0.21.7", "bincode", - "bitflags 2.4.0", + "bitflags 2.5.0", "blake3", "borsh 0.10.3", "borsh 0.9.3", + "borsh 1.5.1", "bs58 0.4.0", "bv", "bytemuck", @@ -5908,7 +6471,7 @@ dependencies = [ "log", "memoffset 0.9.0", "num-bigint 0.4.4", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "parking_lot 0.12.1", "rand 0.8.5", @@ -5931,18 +6494,18 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490b6f65aced077e0c5e57c20f151a134458fc350905c20d7dcf3f2162eaa6f6" +checksum = "0ef9218f50470228ebca12bb147650ca7052678aad915a4e19687ee215f8d947" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bincode", "eager", "enum-iterator", "itertools 0.10.5", "libc", "log", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "percentage", "rand 0.8.5", @@ -5957,11 +6520,41 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-program-test" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8725c449e05bec85f7ced22dc2eb88f6d45f0c4862eaebabc5fa1061fabbb1d" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.7", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-accounts-db", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "solana_rbpf", + "test-case", + "thiserror", + "tokio", +] + [[package]] name = "solana-pubsub-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0dc2b26a7a9860f180ce11f69b0ff2a8bea0d4b9e97daee741b1e76565b3c82" +checksum = "60325aaab2bcd99ca51e1ff5a4673027a03591353a944151690b38d5dadc2c0f" dependencies = [ "crossbeam-channel", "futures-util", @@ -5984,9 +6577,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727474945d51be37ffe03e7b1d6c9630da41228c7b298a8f45098c203a78ac89" +checksum = "d979690c6c392ffdb40a91e241a08ec3942eb217bddb0403b6174de0173ab61e" dependencies = [ "async-mutex", "async-trait", @@ -5997,7 +6590,7 @@ dependencies = [ "quinn", "quinn-proto", "rcgen", - "rustls 0.21.7", + "rustls 0.21.12", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -6011,9 +6604,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853794cccf3bd1984419a594040dfed19666e5a9ad33b0906d4174bc394b22af" +checksum = "6902079fb9d0bd4c455b97f5e48e2412d98e0e1facf635ec6fc6b783c0f3e2af" dependencies = [ "lazy_static", "num_cpus", @@ -6021,14 +6614,14 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b368f270526a5f92ec47c45a6b74ac304b62b08c169b45cf91e0d2f1703889bd" +checksum = "af88bad970c0dd63e98e7cc4c3c16a58acf32d4255aee79f611ea375592028ec" dependencies = [ "console", "dialoguer", "log", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "parking_lot 0.12.1", "qstring", @@ -6040,12 +6633,12 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b766876b0c56950ab530d8495ef7eeaeb79e162f03dadaffc0d6852de9e844" +checksum = "d1adab0dcdc851fc7bc6ca8c6926d9f56ed3982f1e4fabd67d362647b57143d3" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bs58 0.4.0", "indicatif", @@ -6066,11 +6659,11 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876b2e410cc2403ea3216893f05034b02a180431100eb831d0b67b14fca4d29f" +checksum = "6d6764712822bbc0259bbb5413377798a11462221863d000082f39968ce5ad03" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bs58 0.4.0", "jsonrpc-core", "reqwest", @@ -6088,9 +6681,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebdb3f02fb3cce3c967f718bc77b79433c24aa801b63dc70f374e8759b2424e4" +checksum = "49489fe59d308c10a2b3e3ecd3bee1107b9b67a325c99ffd278ba0870a5619cd" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -6100,18 +6693,95 @@ dependencies = [ ] [[package]] -name = "solana-sdk" -version = "1.17.28" +name = "solana-runtime" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d70ab837cc79ed67df6fdb145f1ffd544f1eaa60b0757b750f4864b90498bad" +checksum = "1359ea01de4d1575c7c6004a57b257da66e7b8e636e72d728c91bc6768fd593f" dependencies = [ - "assert_matches", - "base64 0.21.4", + "aquamarine", + "arrayref", + "base64 0.21.7", "bincode", - "bitflags 2.4.0", - "borsh 0.10.3", - "bs58 0.4.0", - "bytemuck", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "dir-diff", + "flate2", + "fnv", + "im", + "index_list", + "itertools 0.10.5", + "lazy_static", + "log", + "lru", + "lz4", + "memmap2", + "mockall", + "modular-bitfield", + "num-derive 0.4.1", + "num-traits", + "num_cpus", + "num_enum 0.7.2", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "serde_json", + "solana-accounts-db", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-cost-model", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-measure", + "solana-metrics", + "solana-perf", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-version", + "solana-vote", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk", + "static_assertions", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73bb113fa17e0607343afdc795c2c5230981c5b51c99b2c54fba91755879d65b" +dependencies = [ + "assert_matches", + "base64 0.21.7", + "bincode", + "bitflags 2.5.0", + "borsh 1.5.1", + "bs58 0.4.0", + "bytemuck", "byteorder", "chrono", "derivation-path", @@ -6126,9 +6796,9 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", - "num_enum 0.6.1", + "num_enum 0.7.2", "pbkdf2 0.11.0", "qstring", "qualifier_attr", @@ -6143,6 +6813,7 @@ dependencies = [ "serde_with 2.3.3", "sha2 0.10.8", "sha3 0.10.8", + "siphasher", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", @@ -6155,9 +6826,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9d0433c4084a3260a32ec67f6b4272c4232d15e732be542cd5dfdf0ae1e784" +checksum = "8fcdb3a94e2f04d856d2fba6feb4f6887a1da21a3ee0b64b69c08d15dc22d46c" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -6172,18 +6843,49 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" +[[package]] +name = "solana-send-transaction-service" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7550c870a6648614b0a34dd3ebf69d98a8b80ab808050aac207e17fe77e8b2d8" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + +[[package]] +name = "solana-stake-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bfb5f94949dbd8839cfe5cefd38b077a395a64407fa2e339c38657295e0fede" +dependencies = [ + "bincode", + "log", + "rustc_version", + "solana-config-program", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", +] + [[package]] name = "solana-streamer" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70eda40efb5bc57ad50b1ac8452485065c1adae0e701a0348b397db054e2ab5" +checksum = "c0e6132c9eefb372202e69e654e8c2a30b4c06635343dd6474467b9cca4b9dd9" dependencies = [ "async-channel 1.9.0", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 2.0.2", + "indexmap 2.2.6", "itertools 0.10.5", "libc", "log", @@ -6195,7 +6897,8 @@ dependencies = [ "quinn-proto", "rand 0.8.5", "rcgen", - "rustls 0.21.7", + "rustls 0.21.12", + "smallvec", "solana-metrics", "solana-perf", "solana-sdk", @@ -6204,11 +6907,25 @@ dependencies = [ "x509-parser", ] +[[package]] +name = "solana-system-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1338d45734fb10d4d378ccc84b8ff779111a7371719e92d045bcdf60db6c6ec4" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + [[package]] name = "solana-thin-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3c510144695c3d1ee1f84dd9975af7f7d35c168447c484bbd35c21e903c515" +checksum = "ca1c3ed492f61914aaa8074cf7a07f93bfd8d9adbf9846939e589b7b7c70fe39" dependencies = [ "bincode", "log", @@ -6221,14 +6938,14 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f27c8fec609179a7dfc287060df2a926c8cd89329235c4b8d78bd019a72462" +checksum = "c3fbfce5d27608f4853dcb0c0d964f59420710a7a4486409e7583717c610c3cf" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.0.2", + "indexmap 2.2.6", "indicatif", "log", "rayon", @@ -6245,12 +6962,12 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f58f2f864d900eddf2e21a99ebe445b6be525d597e44952f075d8237035b8e" +checksum = "6adbd8f3fccddeae87278a105dcf8a8792f8816c0f4fb5f7ae8f307af279ac49" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bs58 0.4.0", @@ -6270,9 +6987,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ead118c5d549e4345dc59cbc5d9b282164f3e5334707f186e3aa10d40e3b30" +checksum = "b90f8ebd26cac3cd563bf839ff8511f27698f2d220e58f7538b5d6d80d8970ed" dependencies = [ "async-trait", "solana-connection-cache", @@ -6285,9 +7002,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532f5d631562587facc5fe88abd2e31c0d1f29012b6766c664db9f05a39fb05b" +checksum = "ac8714cf9f6caefc403e19770ad73ed2e4c866b7201e31dd17a9e06b6a693a57" dependencies = [ "log", "rustc_version", @@ -6299,15 +7016,34 @@ dependencies = [ "solana-sdk", ] +[[package]] +name = "solana-vote" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db24fb82cba851f6db063400db08405a2108f68b27c3d5f2d3ed1da9849734f" +dependencies = [ + "crossbeam-channel", + "itertools 0.10.5", + "log", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", + "solana-vote-program", + "thiserror", +] + [[package]] name = "solana-vote-program" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c684430058b0a2e733936a8851c8843a3a6316ccd5c969d39411a479d6489642" +checksum = "b5de2428939c6e279901d4357bf02c809739e5b97164e8620e09a9e0b55c2327" dependencies = [ "bincode", "log", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "rustc_version", "serde", @@ -6321,14 +7057,28 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-zk-token-proof-program" +version = "1.18.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d381b5205bd4ff1edfbb910895f48d00a235a0257493462ff0d102004bc337" +dependencies = [ + "bytemuck", + "num-derive 0.4.1", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", +] + [[package]] name = "solana-zk-token-sdk" -version = "1.17.28" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aef1b48d9fdb2619349d2d15942d83c99aabe995ff945d9b418176373aa823c" +checksum = "8dad1753ec3b189879c8756ac35471467116dfc93d7aeb68cfd28f22a02c850d" dependencies = [ "aes-gcm-siv", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bytemuck", "byteorder", @@ -6337,7 +7087,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "merlin", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "rand 0.7.3", "serde", @@ -6394,12 +7144,11 @@ dependencies = [ [[package]] name = "spl-account-compression" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c43bd4455d9fb29b9e4f83c087ccffa2f6f41fecfc0549932ae391d00f3378" dependencies = [ "anchor-lang", "bytemuck", - "spl-concurrent-merkle-tree", + "solana-program", + "spl-concurrent-merkle-tree 0.2.0", "spl-noop", ] @@ -6419,6 +7168,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-concurrent-merkle-tree" +version = "0.2.0" +dependencies = [ + "bytemuck", + "rand 0.8.5", + "rand_distr", + "solana-program", + "spl-merkle-tree-reference 0.1.0", + "thiserror", + "tokio", +] + [[package]] name = "spl-concurrent-merkle-tree" version = "0.2.0" @@ -6474,11 +7236,27 @@ dependencies = [ "solana-program", ] +[[package]] +name = "spl-merkle-tree-reference" +version = "0.1.0" +dependencies = [ + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-merkle-tree-reference" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28437c617c7f0db6b7229a489239f3ea6160499542d9367fbca2fc5ec7744abb" +dependencies = [ + "solana-program", + "thiserror", +] + [[package]] name = "spl-noop" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd67ea3d0070a12ff141f5da46f9695f49384a03bce1203a5608f5739437950" dependencies = [ "solana-program", ] @@ -6489,7 +7267,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "borsh 0.10.3", "bytemuck", "serde", @@ -6800,12 +7578,40 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "subtle" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + [[package]] name = "syn" version = "1.0.109" @@ -6828,6 +7634,24 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "synstructure" version = "0.12.6" @@ -6867,17 +7691,62 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.3.5", - "rustix 0.38.18", - "windows-sys 0.48.0", + "rustix 0.38.34", + "windows-sys 0.52.0", ] [[package]] @@ -6889,6 +7758,45 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "test-case-core", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -6906,18 +7814,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", @@ -7009,9 +7917,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -7021,7 +7929,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.7", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -7029,9 +7937,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -7065,10 +7973,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls 0.21.12", "tokio", ] +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -7088,13 +8012,28 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.7", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", "tungstenite", "webpki-roots 0.25.2", ] +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.9" @@ -7146,7 +8085,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "toml_datetime", "winnow", ] @@ -7157,7 +8096,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -7250,6 +8189,19 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -7339,7 +8291,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.7", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -7490,9 +8442,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -7563,6 +8515,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -7598,9 +8560,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -7608,9 +8570,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -7635,9 +8597,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7645,9 +8607,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -7658,9 +8620,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" @@ -7769,15 +8731,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[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" @@ -7796,21 +8749,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[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" @@ -7842,12 +8780,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] -[[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" @@ -7860,12 +8792,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[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" @@ -7878,12 +8804,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[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" @@ -7902,12 +8822,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[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" @@ -7920,12 +8834,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[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" @@ -7938,12 +8846,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[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" @@ -7956,12 +8858,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[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" @@ -8020,6 +8916,17 @@ dependencies = [ "time 0.3.29", ] +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys 0.4.14", + "rustix 0.38.34", +] + [[package]] name = "xxhash-rust" version = "0.8.7" diff --git a/Cargo.toml b/Cargo.toml index 98d55ecff..85b2647e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "blockbuster", + "blockbuster/blockbuster", "core", "das_api", "digital_asset_types", @@ -32,7 +32,7 @@ anyhow = "1.0.75" async-std = "1.0.0" async-trait = "0.1.60" backon = "0.4.1" -blockbuster = {path = "blockbuster"} +blockbuster = {path = "blockbuster/blockbuster"} borsh = "~0.10.3" borsh-derive = "~0.10.3" bs58 = "0.4.0" @@ -67,8 +67,8 @@ log = "0.4.17" metrics = "0.20.1" migration = {path = "migration"} mime_guess = "2.0.4" -mpl-bubblegum = "1.2.0" -mpl-core = {version = "0.7.0", features = ["serde"]} +mpl-bubblegum = { path = "blockbuster/mpl-bubblegum/clients/rust" } +mpl-core = { git = "https://github.com/RequescoS/mpl-core.git", features = ["serde"] } mpl-token-metadata = "4.1.1" nft_ingester = {path = "nft_ingester"} num-derive = "0.3.3" @@ -77,7 +77,7 @@ once_cell = "1.19.0" open-rpc-derive = "0.0.4" open-rpc-schema = "0.0.4" plerkle_messenger = "1.6.0" -plerkle_serialization = "1.8.0" +plerkle_serialization = { git = "https://github.com/n00m4d/digital-asset-validator-plugin.git" } program_transformers = {path = "program_transformers"} prometheus = "0.13.3" proxy-wasm = "0.2.0" @@ -93,17 +93,17 @@ sea-query = "0.28.1" serde = "1.0.137" serde_json = "1.0.81" serial_test = "2.0.0" -solana-account-decoder = "~1.17" -solana-client = "~1.17" -solana-geyser-plugin-interface = "~1.17" -solana-program = "~1.17" -solana-sdk = "~1.17" -solana-transaction-status = "~1.17" +solana-account-decoder = "1.18.11" +solana-client = "1.18.11" +solana-geyser-plugin-interface = "1.18.11" +solana-program = "1.18.11" +solana-sdk = "1.18.11" +solana-transaction-status = "1.18.11" solana-zk-token-sdk = "1.17.16" -spl-account-compression = "0.3.0" +spl-account-compression = { path = "blockbuster/mpl-bubblegum/solana-program-library/account-compression/programs/account-compression", features = ["no-entrypoint"] } spl-associated-token-account = ">= 1.1.3, < 3.0" -spl-concurrent-merkle-tree = "0.2.0" -spl-noop = "0.2.0" +spl-concurrent-merkle-tree = { path = "blockbuster/mpl-bubblegum/solana-program-library/libraries/concurrent-merkle-tree"} +spl-noop = { path = "blockbuster/mpl-bubblegum/solana-program-library/account-compression/programs/noop", features = ["no-entrypoint"] } spl-pod = {version = "0.1.0", features = ["serde-traits"]} spl-token = ">= 3.5.0, < 5.0" spl-token-2022 = {version = "1.0", features = ["no-entrypoint"]} @@ -122,6 +122,9 @@ txn_forwarder = {path = "tools/txn_forwarder"} url = "2.3.1" wasi = "0.7.0" wasm-bindgen = "0.2.83" +triomphe = "=0.1.9" +paste = "1" +serde_derive = "1.0.195" [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/blockbuster/.github/pull_request_template.md b/blockbuster/.github/pull_request_template.md new file mode 100644 index 000000000..72383e401 --- /dev/null +++ b/blockbuster/.github/pull_request_template.md @@ -0,0 +1,8 @@ + +Thank you for taking the time to make an enhancement or bug fix to the digital asset validator plugin repo. +To ensure a quality PR experience this call may be recorded. Just Kidding, but we do expect a few things. + +1. The Name of the PR will show up in the changelog so make it a good one, we will rename PRs or reject based on the name. +2. Please make the PR as small as possible to achieve the bugfix or feature. Big prs often are scary and hard to review. +3. Be kind to your reviewers 🤓 +4. Add a good description, so we can see what the PR is all about without investing the time in the code review. We will often review code at a certain time in the day and having a list if important prs to review helps us move that along. diff --git a/blockbuster/.github/release.yml b/blockbuster/.github/release.yml new file mode 100644 index 000000000..c9057c6fd --- /dev/null +++ b/blockbuster/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + labels: + - ignore-for-release + categories: + - title: Breaking Changes 🛠 + labels: + - major + - title: Bug Fix 🐛 + labels: + - bug + - title: Exciting New Features 🎉 + labels: + - minor + - title: Other Changes 📋 + labels: + - "*" diff --git a/blockbuster/.github/workflows/test.yml b/blockbuster/.github/workflows/test.yml new file mode 100644 index 000000000..8d3534071 --- /dev/null +++ b/blockbuster/.github/workflows/test.yml @@ -0,0 +1,16 @@ +name: Testing +on: + push: + branches: + - main + pull_request: +env: + RUST_TOOLCHAIN: stable +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Test + run: | + cargo test diff --git a/blockbuster/.gitmodules b/blockbuster/.gitmodules new file mode 100644 index 000000000..8a0ec5533 --- /dev/null +++ b/blockbuster/.gitmodules @@ -0,0 +1,4 @@ +[submodule "mpl-bubblegum"] + path = mpl-bubblegum + url = git@github.com:n00m4d/mpl-bubblegum.git + branch = feat/rollup diff --git a/blockbuster/.vscode/extensions.json b/blockbuster/.vscode/extensions.json new file mode 100644 index 000000000..d1987c7ba --- /dev/null +++ b/blockbuster/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + + ] +} \ No newline at end of file diff --git a/blockbuster/.vscode/launch.json b/blockbuster/.vscode/launch.json new file mode 100644 index 000000000..91ee81322 --- /dev/null +++ b/blockbuster/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Cargo test", + "cwd": "${workspaceFolder}/blockbuster", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib" + ] + }, + "args": [] + } + ] +} \ No newline at end of file diff --git a/blockbuster/Cargo.lock b/blockbuster/Cargo.lock new file mode 100644 index 000000000..2a92a8f66 --- /dev/null +++ b/blockbuster/Cargo.lock @@ -0,0 +1,6356 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom 0.2.12", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "anchor-attribute-access-control" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +dependencies = [ + "anchor-syn", + "bs58 0.5.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +dependencies = [ + "anchor-syn", + "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.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "arrayref", + "base64 0.13.1", + "bincode", + "borsh 0.10.3", + "bytemuck", + "getrandom 0.2.12", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-syn" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +dependencies = [ + "anyhow", + "bs58 0.5.1", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "aquamarine" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.4", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-compression" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "blockbuster" +version = "2.3.0" +dependencies = [ + "anchor-lang", + "async-trait", + "borsh 0.10.3", + "bs58 0.4.0", + "bytemuck", + "flatbuffers", + "lazy_static", + "log", + "mpl-bubblegum", + "mpl-core", + "mpl-token-metadata", + "plerkle_serialization", + "rand 0.8.5", + "serde", + "serde_json", + "solana-client", + "solana-geyser-plugin-interface", + "solana-sdk", + "solana-transaction-status", + "solana-zk-token-sdk", + "spl-account-compression", + "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-noop", + "spl-pod", + "spl-token", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", + "thiserror", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +dependencies = [ + "borsh-derive 1.5.0", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.55", + "syn_derive", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "brotli" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "caps" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +dependencies = [ + "libc", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.4", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.1", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.55", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", + "rayon", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.4", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dir-diff" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" +dependencies = [ + "walkdir", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "dlopen2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + +[[package]] +name = "eager" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.8", +] + +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + +[[package]] +name = "flatbuffers" +version = "23.5.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" +dependencies = [ + "bitflags 1.3.2", + "rustc_version", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "h2" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util 0.7.10", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "index_list" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "kaigan" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e623cca1f0e2a0919032c1bdabbf81dd9aa34658d5066aca7bb90d608317ab91" +dependencies = [ + "borsh 0.10.3", + "serde", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +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.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mpl-bubblegum" +version = "1.4.0" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "bytemuck", + "kaigan", + "num-derive 0.3.3", + "num-traits", + "serde", + "serde_with 3.7.0", + "solana-program", + "solana-program-test", + "solana-sdk", + "spl-account-compression", + "spl-associated-token-account", + "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-merkle-tree-reference 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-noop", + "spl-token", + "thiserror", +] + +[[package]] +name = "mpl-core" +version = "0.6.1" +source = "git+https://github.com/n00m4d/mpl-core.git#b49c19ca3b8e63a173bee20cebecd6e64e4b8c96" +dependencies = [ + "base64 0.22.0", + "borsh 0.10.3", + "num-derive 0.3.3", + "num-traits", + "serde", + "serde_with 3.7.0", + "solana-program", + "thiserror", +] + +[[package]] +name = "mpl-token-metadata" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf0f61b553e424a6234af1268456972ee66c2222e1da89079242251fa7479e5" +dependencies = [ + "borsh 0.10.3", + "num-derive 0.3.3", + "num-traits", + "serde", + "serde_with 3.7.0", + "solana-program", + "thiserror", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "ouroboros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +dependencies = [ + "aliasable", + "ouroboros_macro", +] + +[[package]] +name = "ouroboros_macro" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "plerkle_serialization" +version = "1.8.0" +source = "git+https://github.com/n00m4d/digital-asset-validator-plugin.git#6920f6d3f30d6bc9c9c7eefeb5c7c1bcc87fa0c8" +dependencies = [ + "bs58 0.4.0", + "chrono", + "flatbuffers", + "serde", + "solana-sdk", + "solana-transaction-status", + "thiserror", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +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.55", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls", + "rustls-native-certs", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "async-compression", + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tokio-util 0.7.10", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.38.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "seqlock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c67b6f14ecc5b86c66fa63d76b5092352678545a8a3cdae80aef5128371910" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "serde", + "serde_with_macros 2.3.3", +] + +[[package]] +name = "serde_with" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +dependencies = [ + "base64 0.21.7", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.7.0", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "serde_with_macros" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "solana-account-decoder" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f31c3dc9c7ebfaff452f063b406bbf64d326d71120996f4d3fdeee7ae7f1b6e" +dependencies = [ + "Inflector", + "base64 0.21.7", + "bincode", + "bs58 0.4.0", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-config-program", + "solana-sdk", + "spl-token", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-accounts-db" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "085985c66a70f31d55abe3ea8955d424351e1c10f53d1b508627b571e3badb58" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", + "log", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.4.2", + "num-traits", + "num_cpus", + "num_enum 0.7.2", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "seqlock", + "serde", + "serde_derive", + "smallvec", + "solana-bucket-map", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-nohash-hasher", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "static_assertions", + "strum", + "strum_macros", + "tar", + "tempfile", + "thiserror", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f839249b791c98ed1d0d6e0d21932a962d6567963d34d3a6cbad52b55624131" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive 0.4.2", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-banks-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b520d4a39dc146d64a8326be372aeb482819c7b4f657408d3f956cca3d3ee2" +dependencies = [ + "borsh 1.5.0", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31a79263dbd1122ff4addbc956d01ad6e5c23585b951900871e0cb23615b8b22" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5c39a8d83676027a6b23502636c5f198072d39ce27642d326e9d2239f1436b8" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-accounts-db", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc06ca3f5b6a2979fcc679f98765c51e103a9f24c68f8d07af9ad58cb988a3a" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log", + "scopeguard", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c1f27fbbf17492f46335907b525ac7b1b9d3e2bcb21e029f12a90930842c414" +dependencies = [ + "bv", + "bytemuck", + "log", + "memmap2", + "modular-bitfield", + "num_enum 0.7.2", + "rand 0.8.5", + "solana-measure", + "solana-sdk", + "tempfile", +] + +[[package]] +name = "solana-clap-utils" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ffc5c1aa04a6ce12f4cccd2a26b78dfa1db2d559554b4b2cfffc1059e95764" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad2cc8cf76432aa7df46ffc50cd9c97a087b899de57a67d08a4a909bcf85496" +dependencies = [ + "async-trait", + "bincode", + "dashmap", + "futures", + "futures-util", + "indexmap 2.2.6", + "indicatif", + "log", + "quinn", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", + "solana-sdk", + "solana-streamer", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-compute-budget-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84226e74aeba7384a03c2dddd01e0dcd660bc2c1ea361f97e1de27e2b46bed44" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-config-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d12f4c7ca44f55afb012dfadd21a352cb818a225f4e6d7fe3db5c3fcb1e28ca1" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-connection-cache" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4fea76dc27635837568c533c7fadebe4fbf86fbdbf561937347357d41434b85" +dependencies = [ + "async-trait", + "bincode", + "crossbeam-channel", + "futures-util", + "indexmap 2.2.6", + "log", + "rand 0.8.5", + "rayon", + "rcgen", + "solana-measure", + "solana-metrics", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-cost-model" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b08fd2e03894f21f8f6df4c454a56185dc112dec8f6953c00bb25446dd4d9c8a" +dependencies = [ + "lazy_static", + "log", + "rustc_version", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9843fe4a4e4d541bd056465257704d8d53b50ed59328dcb5f37821ae0f843676" +dependencies = [ + "block-buffer 0.10.4", + "bs58 0.4.0", + "bv", + "either", + "generic-array", + "im", + "lazy_static", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.8", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f24edb8172842544ace0ccb9547353cc55fe4a6d3b2786e209939d3a8bf271d" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.55", +] + +[[package]] +name = "solana-geyser-plugin-interface" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac9c1d761318b992ea6514d2e32853e285af07e6158879dc299500f7fee9033" +dependencies = [ + "log", + "solana-sdk", + "solana-transaction-status", + "thiserror", +] + +[[package]] +name = "solana-loader-v4-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63ef21a0a7215853f4de4bd90ab1ca544114ab10065376d959945c4a2621074" +dependencies = [ + "log", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana_rbpf", +] + +[[package]] +name = "solana-logger" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a9c97300d5fd98fd490819186debfda9d47b1a5c82b5ffdb76e2ea6bad055c4" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-measure" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bf69dbc3d69406b67d3d263c8a5aa0d8501051d75aa842f47502652060596d" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a2112662341adaf1b8fbd4a8d819bc24ae5d1d59655e0561161c5c816894b9" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-net-utils" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc90c80c6f0a9b428464f0147f6407cae4a16aa5483d6b7ea37fd2976c76edc" +dependencies = [ + "bincode", + "clap 3.2.25", + "crossbeam-channel", + "log", + "nix", + "rand 0.8.5", + "serde", + "serde_derive", + "socket2", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-nohash-hasher" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" + +[[package]] +name = "solana-perf" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2485083355b1c22256d57270e5b915db23cc0e2f0165027ffc52c7f815015137" +dependencies = [ + "ahash 0.8.11", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen2", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.8.5", + "rayon", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de9a1634b9d30ca0e5c2d53806c030a5d9c07dfcc4505ebeb218206514d17b8" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.21.7", + "bincode", + "bitflags 2.5.0", + "blake3", + "borsh 0.10.3", + "borsh 0.9.3", + "borsh 1.5.0", + "bs58 0.4.0", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.12", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "light-poseidon", + "log", + "memoffset 0.9.0", + "num-bigint 0.4.4", + "num-derive 0.4.2", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.8", + "sha3 0.10.8", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-program-runtime" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078fbc30339aff91d84ef5fc49ad75818419fedc543da22617d2f36a93d56bff" +dependencies = [ + "base64 0.21.7", + "bincode", + "eager", + "enum-iterator", + "itertools", + "libc", + "log", + "num-derive 0.4.2", + "num-traits", + "percentage", + "rand 0.8.5", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-program-test" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71661f6294e651d6aee508c3194d26f8bcf95ced2bbafd1666c487bb292580eb" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.7", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-accounts-db", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "solana_rbpf", + "test-case", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e9e2ccf38a591001488200ee22675e15214d1fbeb1d23013a7a8798c78aca4" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6043950cfe26f79e0c35dc7f894a0cc0a3d2786255ef6fe745aa92b20ad6c2f9" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "rcgen", + "rustls", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba82ca1adb9f096d38415ef7ecc3279b8ca2599f3ae5de986c98bb331dec81b1" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868d095412afbdde6c8f02dcb26c61c7f7ac5332425eb1be682ca9c7d02abd3d" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive 0.4.2", + "num-traits", + "parking_lot", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-rpc-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed5aca9e30731a03608f595ff34198793b2de957ad7b5ae224388ea447522b3" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bincode", + "bs58 0.4.0", + "indicatif", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae63c92a83d40721aad647d07e40d63dd0612b4f787f64bf270877a4464c0e" +dependencies = [ + "base64 0.21.7", + "bs58 0.4.0", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39b025b6fed986086e236bbb8cd4b559b1dd2d549338bb7e808ef44505f6f816" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-runtime" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf35a99ff547508a70ffd70de3b35ab4fa677f8b91f6745f90bf6ea9b2a8a67" +dependencies = [ + "aquamarine", + "arrayref", + "base64 0.21.7", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "dir-diff", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", + "log", + "lru", + "lz4", + "memmap2", + "mockall", + "modular-bitfield", + "num-derive 0.4.2", + "num-traits", + "num_cpus", + "num_enum 0.7.2", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "serde_json", + "solana-accounts-db", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-cost-model", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-measure", + "solana-metrics", + "solana-perf", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-version", + "solana-vote", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk", + "static_assertions", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "323d21f0cb307e28ccfbcb3a24a5ae230abc8176bfb82492df6773deb79b62de" +dependencies = [ + "assert_matches", + "base64 0.21.7", + "bincode", + "bitflags 2.5.0", + "borsh 1.5.0", + "bs58 0.4.0", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.7", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive 0.4.2", + "num-traits", + "num_enum 0.7.2", + "pbkdf2 0.11.0", + "qstring", + "qualifier_attr", + "rand 0.7.3", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with 2.3.3", + "sha2 0.10.8", + "sha3 0.10.8", + "siphasher", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-program", + "solana-sdk-macro", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6d088aff04f5ad17f6f4a1a84a7a6aef633d48e8ed6c12154fcbb5dfde07bd" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.55", +] + +[[package]] +name = "solana-security-txt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" + +[[package]] +name = "solana-send-transaction-service" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c14685b33d7d1a2972f5c6e356b82b5762cedc9a8307ad17b9ec839286e4ad0" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + +[[package]] +name = "solana-stake-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b1744e5fb5a71cc7a9ef2eaaaa6c2a9112cf1856d4877c4c20c5cd151cfb86" +dependencies = [ + "bincode", + "log", + "rustc_version", + "solana-config-program", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-streamer" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce37f6de2695d5def82e3cc965f6d97d38e32c87b3b9dee525468ae6d6d3050d" +dependencies = [ + "async-channel", + "bytes", + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap 2.2.6", + "itertools", + "libc", + "log", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "quinn-proto", + "rand 0.8.5", + "rcgen", + "rustls", + "smallvec", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", + "x509-parser", +] + +[[package]] +name = "solana-system-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b22323cae3acc40bc5ac6f733b713e38747b879cffe020dac1ef859d87f8da4" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-thin-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833f35f6d7b24436643b87a19f7adbdd105750d49d556f4c9b0cba5e367c2ff7" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1006c69665839d00182d5fe260fb61e939c7a7877fbf67cdd812f07957a1b773" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 2.2.6", + "indicatif", + "log", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-transaction-status" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08bc13fa4f5ddf945253ac957b8b924c6181f9a80283e47e9922c07e73a845c" +dependencies = [ + "Inflector", + "base64 0.21.7", + "bincode", + "borsh 0.10.3", + "bs58 0.4.0", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-udp-client" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8db0bcf3c61965df993c08118245cf79fc5e1994566bbf62585aaf6bfd578b26" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-version" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180809ce9ca2dfc5a0bf62738c4ce22fe3f459cfde6589546922387a004fde82" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63f32ca0c27ebe5f0c50df270f9041750c02fdd93800c55b6b5bcbd0506408d6" +dependencies = [ + "crossbeam-channel", + "itertools", + "log", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", + "solana-vote-program", + "thiserror", +] + +[[package]] +name = "solana-vote-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f40d6a334adbe76160c8b4e2579bb7c71452794d5f06b72b0458f7cc088fa19" +dependencies = [ + "bincode", + "log", + "num-derive 0.4.2", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4526932336b0a6535ec4f90016c630246db83bad4d7fd2d4c8b3d5e211580fcd" +dependencies = [ + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.18.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ea6cfb74066a35ea9ad53b1108bb26f35752569bcfb3d9203f58a7bf57fac5" +dependencies = [ + "aes-gcm-siv", + "base64 0.21.7", + "bincode", + "bytemuck", + "byteorder", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "lazy_static", + "merlin", + "num-derive 0.4.2", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solana_rbpf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + +[[package]] +name = "spin" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spl-account-compression" +version = "0.4.0" +dependencies = [ + "anchor-lang", + "bytemuck", + "solana-program", + "spl-concurrent-merkle-tree 0.2.0", + "spl-noop", +] + +[[package]] +name = "spl-associated-token-account" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "spl-concurrent-merkle-tree" +version = "0.2.0" +dependencies = [ + "bytemuck", + "rand 0.8.5", + "rand_distr", + "solana-program", + "spl-merkle-tree-reference 0.1.0", + "thiserror", + "tokio", +] + +[[package]] +name = "spl-concurrent-merkle-tree" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141eaea58588beae81b71d101373a53f096737739873de42d6b1368bc2b8fc30" +dependencies = [ + "bytemuck", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +dependencies = [ + "quote", + "spl-discriminator-syn", + "syn 2.0.55", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.55", + "thiserror", +] + +[[package]] +name = "spl-memo" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-merkle-tree-reference" +version = "0.1.0" +dependencies = [ + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-merkle-tree-reference" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28437c617c7f0db6b7229a489239f3ea6160499542d9367fbca2fc5ec7744abb" +dependencies = [ + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-noop" +version = "0.2.0" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +dependencies = [ + "base64 0.21.7", + "borsh 0.10.3", + "bytemuck", + "serde", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +dependencies = [ + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.55", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", + "test-case-core", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "thiserror" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots 0.25.4", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha1", + "thiserror", + "url", + "utf-8", + "webpki-roots 0.24.0", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "untrusted" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.55", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +dependencies = [ + "rustls-webpki", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +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.55", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.55", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/blockbuster/Cargo.toml b/blockbuster/Cargo.toml deleted file mode 100644 index e110009ea..000000000 --- a/blockbuster/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -authors = ["Metaplex Developers "] -description = "Metaplex canonical program parsers, for indexing, analytics etc...." -edition = "2021" -license = "AGPL-3.0" -name = "blockbuster" -readme = "../README.md" -repository = "https://github.com/metaplex-foundation/blockbuster" -version = "2.3.0" - -[dependencies] -anchor-lang = {workspace = true} -async-trait = {workspace = true} -borsh = {workspace = true} -bs58 = {workspace = true} -bytemuck = {workspace = true} -lazy_static = {workspace = true} -log = {workspace = true} -mpl-bubblegum = {workspace = true} -mpl-core = {workspace = true, features = ["serde"]} -mpl-token-metadata = {workspace = true, features = ["serde"]} -serde = {workspace = true} -solana-sdk = {workspace = true} -solana-transaction-status = {workspace = true} -solana-zk-token-sdk = {workspace = true} -spl-account-compression = {workspace = true, features = ["no-entrypoint"]} -spl-noop = {workspace = true, features = ["no-entrypoint"]} -spl-pod = {workspace = true, features = ["serde-traits"]} -spl-token = {workspace = true, features = ["no-entrypoint"]} -spl-token-2022 = {workspace = true, features = ["no-entrypoint"]} -spl-token-group-interface = {workspace = true} -spl-token-metadata-interface = {workspace = true} -thiserror = {workspace = true} - -[dev-dependencies] -flatbuffers = {workspace = true} -plerkle_serialization = {workspace = true} -rand = {workspace = true} -serde_json = {workspace = true} -solana-client = {workspace = true} -solana-geyser-plugin-interface = {workspace = true} -spl-concurrent-merkle-tree = {workspace = true} diff --git a/blockbuster/LICENSE b/blockbuster/LICENSE new file mode 100644 index 000000000..be3f7b28e --- /dev/null +++ b/blockbuster/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/blockbuster/blockbuster.iml b/blockbuster/blockbuster.iml new file mode 100644 index 000000000..b5d6787f6 --- /dev/null +++ b/blockbuster/blockbuster.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blockbuster/blockbuster/.gitignore b/blockbuster/blockbuster/.gitignore new file mode 100644 index 000000000..28aaccd5c --- /dev/null +++ b/blockbuster/blockbuster/.gitignore @@ -0,0 +1,11 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + + +# These are backup files generated by rustfmt +**/*.rs.bk + +*.iml +blockbuster/target +target/ diff --git a/blockbuster/blockbuster/Cargo.toml b/blockbuster/blockbuster/Cargo.toml new file mode 100644 index 000000000..b78531be0 --- /dev/null +++ b/blockbuster/blockbuster/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "blockbuster" +description = "Metaplex canonical program parsers, for indexing, analytics etc...." +version = "2.3.0" +authors = ["Metaplex Developers "] +repository = "https://github.com/metaplex-foundation/blockbuster" +license = "AGPL-3.0" +edition = "2021" +readme = "../README.md" + +[dependencies] +bytemuck = { version = "1.14.0", features = ["derive"] } +spl-token-2022 = { version = "1.0", features = ["no-entrypoint"] } +spl-account-compression = { path = "../mpl-bubblegum/solana-program-library/account-compression/programs/account-compression", features = ["no-entrypoint"] } +spl-noop = { path = "../mpl-bubblegum/solana-program-library/account-compression/programs/noop", features = ["no-entrypoint"] } +mpl-bubblegum = { path = "../mpl-bubblegum/clients/rust" } +mpl-core = { git = "https://github.com/RequescoS/mpl-core.git", features = ["serde"] } +mpl-token-metadata = { version = "4.1.1", features = ["serde"] } +spl-token = { version = "4.0.0", features = ["no-entrypoint"] } +async-trait = "0.1.57" +bs58 = "0.4.0" +lazy_static = "1.4.0" +borsh = "~0.10.3" +thiserror = "1.0.32" +log = "0.4.17" +solana-sdk = "~1.18.11" +solana-transaction-status = "~1.18.11" +spl-token-metadata-interface = "0.2.0" +spl-token-group-interface = "0.1.0" +spl-pod = { version = "0.1.0", features = ["serde-traits"] } +serde = "1.0.140" +solana-zk-token-sdk = "~1.18.11" +anchor-lang = { version = "0.29.0" } +triomphe = { workspace = true } + +[dev-dependencies] +flatbuffers = "23.1.21" +plerkle_serialization = { git = "https://github.com/n00m4d/digital-asset-validator-plugin.git" } +rand = "0.8.5" +serde_json = "1.0.89" +solana-client = "~1.18.11" +solana-geyser-plugin-interface = "~1.18.11" +spl-concurrent-merkle-tree = "0.2.0" diff --git a/blockbuster/blockbuster/rustfmt.toml b/blockbuster/blockbuster/rustfmt.toml new file mode 100644 index 000000000..25c9650ab --- /dev/null +++ b/blockbuster/blockbuster/rustfmt.toml @@ -0,0 +1,3 @@ +edition = "2021" +imports_granularity="Crate" +reorder_imports = true diff --git a/blockbuster/src/error.rs b/blockbuster/blockbuster/src/error.rs similarity index 100% rename from blockbuster/src/error.rs rename to blockbuster/blockbuster/src/error.rs diff --git a/blockbuster/src/instruction.rs b/blockbuster/blockbuster/src/instruction.rs similarity index 82% rename from blockbuster/src/instruction.rs rename to blockbuster/blockbuster/src/instruction.rs index 4345e29ed..f4544c165 100644 --- a/blockbuster/src/instruction.rs +++ b/blockbuster/blockbuster/src/instruction.rs @@ -39,9 +39,7 @@ pub fn order_instructions<'a>( 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_some(&ix.instructions) - }) + .filter_map(|ix| (ix.index == outer_instruction_index as u8).then(|| &ix.instructions)) .flatten() .map(|inner_ix| { let cix = &inner_ix.instruction; @@ -75,15 +73,16 @@ fn hoist_known_programs<'a>( ix_pairs .iter() .enumerate() - .filter(|&(_index, &(pid, _ci))| programs.contains(&pid)) - .map(|(index, &(pid, ci))| { - let inner_copy = ix_pairs - .iter() - .skip(index + 1) - .take_while(|&&(inner_pid, _)| inner_pid != pid) - .cloned() - .collect::>>(); - ((pid, ci), Some(inner_copy)) + .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/lib.rs b/blockbuster/blockbuster/src/lib.rs similarity index 100% rename from blockbuster/src/lib.rs rename to blockbuster/blockbuster/src/lib.rs diff --git a/blockbuster/src/parsed_programs.rs b/blockbuster/blockbuster/src/parsed_programs.rs similarity index 100% rename from blockbuster/src/parsed_programs.rs rename to blockbuster/blockbuster/src/parsed_programs.rs diff --git a/blockbuster/src/program_handler.rs b/blockbuster/blockbuster/src/program_handler.rs similarity index 100% rename from blockbuster/src/program_handler.rs rename to blockbuster/blockbuster/src/program_handler.rs diff --git a/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs similarity index 91% rename from blockbuster/src/programs/bubblegum/mod.rs rename to blockbuster/blockbuster/src/programs/bubblegum/mod.rs index faa1b8aa1..2b61948aa 100644 --- a/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs @@ -9,7 +9,8 @@ use log::warn; use mpl_bubblegum::{ get_instruction_type, instructions::{ - UnverifyCreatorInstructionArgs, UpdateMetadataInstructionArgs, VerifyCreatorInstructionArgs, + FinalizeTreeWithRootInstructionArgs, UnverifyCreatorInstructionArgs, + UpdateMetadataInstructionArgs, VerifyCreatorInstructionArgs, }, types::{BubblegumEventType, MetadataArgs, UpdateArgs}, }; @@ -53,6 +54,10 @@ pub enum Payload { update_args: UpdateArgs, tree_id: Pubkey, }, + CreateTreeWithRoot { + args: FinalizeTreeWithRootInstructionArgs, + tree_id: Pubkey, + }, } //TODO add more of the parsing here to minimize program transformer code pub struct BubblegumInstruction { @@ -206,6 +211,9 @@ impl ProgramParser for BubblegumParser { InstructionName::UpdateMetadata => { b_inst.payload = Some(build_update_metadata_payload(keys, ix_data)?); } + InstructionName::CreateTreeWithRoot => { + b_inst.payload = Some(build_create_tree_with_root_payload(keys, ix_data)?); + } _ => {} }; } @@ -299,3 +307,18 @@ fn build_update_metadata_payload( tree_id, }) } + +// See Bubblegum for offsets and positions: +// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md +fn build_create_tree_with_root_payload( + keys: &[Pubkey], + ix_data: &[u8], +) -> Result { + let args = FinalizeTreeWithRootInstructionArgs::try_from_slice(ix_data)?; + + let tree_id = *keys + .get(1) + .ok_or(BlockbusterError::InstructionParsingError)?; + + Ok(Payload::CreateTreeWithRoot { args, tree_id }) +} diff --git a/blockbuster/src/programs/mod.rs b/blockbuster/blockbuster/src/programs/mod.rs similarity index 100% rename from blockbuster/src/programs/mod.rs rename to blockbuster/blockbuster/src/programs/mod.rs diff --git a/blockbuster/src/programs/mpl_core_program/mod.rs b/blockbuster/blockbuster/src/programs/mpl_core_program/mod.rs similarity index 100% rename from blockbuster/src/programs/mpl_core_program/mod.rs rename to blockbuster/blockbuster/src/programs/mpl_core_program/mod.rs diff --git a/blockbuster/src/programs/token_account/mod.rs b/blockbuster/blockbuster/src/programs/token_account/mod.rs similarity index 100% rename from blockbuster/src/programs/token_account/mod.rs rename to blockbuster/blockbuster/src/programs/token_account/mod.rs diff --git a/blockbuster/src/programs/token_extensions/extension.rs b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs similarity index 97% rename from blockbuster/src/programs/token_extensions/extension.rs rename to blockbuster/blockbuster/src/programs/token_extensions/extension.rs index c9a0b9b4a..d186fe863 100644 --- a/blockbuster/src/programs/token_extensions/extension.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs @@ -287,8 +287,8 @@ impl<'de> Visitor<'de> for ShadowAeCiphertextVisitor { A: SeqAccess<'de>, { let mut arr = [0u8; AE_CIPHERTEXT_LEN]; - for (i, item) in arr.iter_mut().enumerate().take(AE_CIPHERTEXT_LEN) { - *item = seq + for i in 0..AE_CIPHERTEXT_LEN { + arr[i] = seq .next_element()? .ok_or(de::Error::invalid_length(i, &self))?; } @@ -498,19 +498,24 @@ impl From for ShadowConfidentialTransferMint { impl From for ShadowConfidentialTransferAccount { fn from(original: ConfidentialTransferAccount) -> Self { ShadowConfidentialTransferAccount { - approved: original.approved, + approved: original.approved.into(), elgamal_pubkey: original.elgamal_pubkey.into(), pending_balance_lo: original.pending_balance_lo.into(), pending_balance_hi: original.pending_balance_hi.into(), available_balance: original.available_balance.into(), decryptable_available_balance: original.decryptable_available_balance.into(), - allow_confidential_credits: original.allow_confidential_credits, - allow_non_confidential_credits: original.allow_non_confidential_credits, - pending_balance_credit_counter: original.pending_balance_credit_counter, - maximum_pending_balance_credit_counter: original.maximum_pending_balance_credit_counter, + allow_confidential_credits: original.allow_confidential_credits.into(), + allow_non_confidential_credits: original.allow_non_confidential_credits.into(), + pending_balance_credit_counter: original.pending_balance_credit_counter.into(), + maximum_pending_balance_credit_counter: original + .maximum_pending_balance_credit_counter + .into(), expected_pending_balance_credit_counter: original - .expected_pending_balance_credit_counter, - actual_pending_balance_credit_counter: original.actual_pending_balance_credit_counter, + .expected_pending_balance_credit_counter + .into(), + actual_pending_balance_credit_counter: original + .actual_pending_balance_credit_counter + .into(), } } } diff --git a/blockbuster/src/programs/token_extensions/mod.rs b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs similarity index 79% rename from blockbuster/src/programs/token_extensions/mod.rs rename to blockbuster/blockbuster/src/programs/token_extensions/mod.rs index ec1633c9c..1d5e2c8bb 100644 --- a/blockbuster/src/programs/token_extensions/mod.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs @@ -82,7 +82,6 @@ pubkeys!( pub struct Token2022AccountParser; -#[allow(clippy::large_enum_variant)] pub enum TokenExtensionsProgramAccount { TokenAccount(TokenAccount), MintAccount(MintAccount), @@ -130,14 +129,20 @@ impl ProgramParser for Token2022AccountParser { let confidential_transfer = account .get_extension::() .ok() - .copied(); - let cpi_guard = account.get_extension::().ok().copied(); - let memo_transfer = account.get_extension::().ok().copied(); - let transfer_fee_amount = account.get_extension::().ok().copied(); + .map(|x| x.clone()); + let cpi_guard = account.get_extension::().ok().map(|x| x.clone()); + let memo_transfer = account + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_fee_amount = account + .get_extension::() + .ok() + .map(|x| x.clone()); // Create a structured account with extensions let structured_account = TokenAccount { - account: account.base, + account: account.base.clone(), extensions: TokenAccountExtensions { confidential_transfer: confidential_transfer .map(ShadowConfidentialTransferAccount::from), @@ -148,35 +153,61 @@ impl ProgramParser for Token2022AccountParser { }; result = TokenExtensionsProgramAccount::TokenAccount(structured_account); - } else if let Ok(mint) = StateWithExtensions::::unpack(account_data) { + } else if let Ok(mint) = StateWithExtensions::::unpack(&account_data) { let confidential_transfer_mint = mint .get_extension::() .ok() - .copied(); + .map(|x| x.clone()); let confidential_transfer_account = mint .get_extension::() .ok() - .copied(); + .map(|x| x.clone()); let confidential_transfer_fee_config = mint .get_extension::() .ok() - .copied(); - let default_account_state = mint.get_extension::().ok().copied(); - let interest_bearing_config = - mint.get_extension::().ok().copied(); - let transfer_fee_config = mint.get_extension::().ok().copied(); - let mint_close_authority = mint.get_extension::().ok().copied(); - let permanent_delegate = mint.get_extension::().ok().copied(); - let metadata_pointer = mint.get_extension::().ok().copied(); - let metadata = mint.get_variable_len_extension::().ok(); - let group_pointer = mint.get_extension::().ok().copied(); - let token_group = mint.get_extension::().ok().copied(); - let group_member_pointer = mint.get_extension::().ok().copied(); - let token_group_member = mint.get_extension::().ok().copied(); - let transfer_hook = mint.get_extension::().ok().copied(); + .map(|x| x.clone()); + let default_account_state = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let interest_bearing_config = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_fee_config = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let mint_close_authority = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let permanent_delegate = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let metadata_pointer = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let metadata = mint + .get_variable_len_extension::() + .ok() + .map(|x| x.clone()); + let group_pointer = mint.get_extension::().ok().map(|x| x.clone()); + let token_group = mint.get_extension::().ok().map(|x| x.clone()); + let group_member_pointer = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let token_group_member = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_hook = mint.get_extension::().ok().map(|x| x.clone()); let structured_mint = MintAccount { - account: mint.base, + account: mint.base.clone(), extensions: MintAccountExtensions { confidential_transfer_mint: confidential_transfer_mint .map(ShadowConfidentialTransferMint::from), diff --git a/blockbuster/src/programs/token_metadata/mod.rs b/blockbuster/blockbuster/src/programs/token_metadata/mod.rs similarity index 100% rename from blockbuster/src/programs/token_metadata/mod.rs rename to blockbuster/blockbuster/src/programs/token_metadata/mod.rs diff --git a/blockbuster/tests/bubblegum_parser_test.rs b/blockbuster/blockbuster/tests/bubblegum_parser_test.rs similarity index 100% rename from blockbuster/tests/bubblegum_parser_test.rs rename to blockbuster/blockbuster/tests/bubblegum_parser_test.rs diff --git a/blockbuster/tests/fixtures/double_bubblegum_mint.json b/blockbuster/blockbuster/tests/fixtures/double_bubblegum_mint.json similarity index 100% rename from blockbuster/tests/fixtures/double_bubblegum_mint.json rename to blockbuster/blockbuster/tests/fixtures/double_bubblegum_mint.json diff --git a/blockbuster/tests/fixtures/helium_mint_double_tree.json b/blockbuster/blockbuster/tests/fixtures/helium_mint_double_tree.json similarity index 100% rename from blockbuster/tests/fixtures/helium_mint_double_tree.json rename to blockbuster/blockbuster/tests/fixtures/helium_mint_double_tree.json diff --git a/blockbuster/tests/fixtures/helium_nested.json b/blockbuster/blockbuster/tests/fixtures/helium_nested.json similarity index 100% rename from blockbuster/tests/fixtures/helium_nested.json rename to blockbuster/blockbuster/tests/fixtures/helium_nested.json diff --git a/blockbuster/tests/helpers.rs b/blockbuster/blockbuster/tests/helpers.rs similarity index 100% rename from blockbuster/tests/helpers.rs rename to blockbuster/blockbuster/tests/helpers.rs diff --git a/blockbuster/tests/instructions_test.rs b/blockbuster/blockbuster/tests/instructions_test.rs similarity index 100% rename from blockbuster/tests/instructions_test.rs rename to blockbuster/blockbuster/tests/instructions_test.rs diff --git a/blockbuster/mpl-bubblegum b/blockbuster/mpl-bubblegum new file mode 160000 index 000000000..5a12db31d --- /dev/null +++ b/blockbuster/mpl-bubblegum @@ -0,0 +1 @@ +Subproject commit 5a12db31da59bf90fe5b7164af64303a98beab13 diff --git a/blockbuster/rust-toolchain.toml b/blockbuster/rust-toolchain.toml new file mode 100644 index 000000000..4dd8e5c56 --- /dev/null +++ b/blockbuster/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.75.0" \ No newline at end of file diff --git a/blockbuster/src/programs/account_closure/mod.rs b/blockbuster/src/programs/account_closure/mod.rs deleted file mode 100644 index 7586b7d22..000000000 --- a/blockbuster/src/programs/account_closure/mod.rs +++ /dev/null @@ -1,73 +0,0 @@ -use crate::{ - error::BlockbusterError, - program_handler::{ParseResult, ProgramParser}, - programs::ProgramParseResult, -}; -use solana_sdk::{pubkey::Pubkey, pubkeys}; - -use plerkle_serialization::AccountInfo; - -pubkeys!(solana_program_id, "11111111111111111111111111111111"); - -pub struct ClosedAccountInfo { - pub pubkey: Vec, - pub owner: Vec, -} - -#[allow(clippy::large_enum_variant)] -pub enum AccountClosureData { - ClosedAccountInfo(ClosedAccountInfo), - EmptyAccount, -} - -impl ParseResult for AccountClosureData { - fn result(&self) -> &Self - where - Self: Sized, - { - self - } - fn result_type(&self) -> ProgramParseResult { - ProgramParseResult::AccountClosure(self) - } -} - -pub struct AccountClosureParser; - -impl ProgramParser for AccountClosureParser { - fn key(&self) -> Pubkey { - solana_program_id() - } - fn key_match(&self, key: &Pubkey) -> bool { - key == &solana_program_id() - } - - fn handles_account_updates(&self) -> bool { - true - } - - fn handles_instructions(&self) -> bool { - false - } - - fn handle_account( - &self, - account_info: &AccountInfo, - ) -> Result, BlockbusterError> { - let account_data: ClosedAccountInfo = match (account_info.pubkey(), account_info.owner()) { - (Some(pubkey), Some(owner)) => ClosedAccountInfo { - pubkey: pubkey.0.to_vec(), - owner: owner.0.to_vec(), - }, - _ => return Ok(Box::new(AccountClosureData::EmptyAccount)), - }; - - if account_info.lamports() == 0 { - Ok(Box::new(AccountClosureData::ClosedAccountInfo( - account_data, - ))) - } else { - Ok(Box::new(AccountClosureData::EmptyAccount)) - } - } -} diff --git a/digital_asset_types/src/dao/generated/asset.rs b/digital_asset_types/src/dao/generated/asset.rs index e4f4ab0ac..12ae5ec49 100644 --- a/digital_asset_types/src/dao/generated/asset.rs +++ b/digital_asset_types/src/dao/generated/asset.rs @@ -41,15 +41,15 @@ pub struct Model { pub created_at: Option, pub burnt: bool, pub slot_updated: Option, - pub slot_updated_metadata_account: Option, - pub slot_updated_mint_account: Option, - pub slot_updated_token_account: Option, - pub slot_updated_cnft_transaction: Option, pub data_hash: Option, pub creator_hash: Option, pub owner_delegate_seq: Option, pub leaf_seq: Option, pub base_info_seq: Option, + pub slot_updated_metadata_account: Option, + pub slot_updated_token_account: Option, + pub slot_updated_mint_account: Option, + pub slot_updated_cnft_transaction: Option, pub mpl_core_plugins: Option, pub mpl_core_unknown_plugins: Option, pub mpl_core_collection_num_minted: Option, @@ -84,15 +84,15 @@ pub enum Column { CreatedAt, Burnt, SlotUpdated, - SlotUpdatedMetadataAccount, - SlotUpdatedMintAccount, - SlotUpdatedTokenAccount, - SlotUpdatedCnftTransaction, DataHash, CreatorHash, OwnerDelegateSeq, LeafSeq, BaseInfoSeq, + SlotUpdatedMetadataAccount, + SlotUpdatedTokenAccount, + SlotUpdatedMintAccount, + SlotUpdatedCnftTransaction, MplCorePlugins, MplCoreUnknownPlugins, MplCoreCollectionNumMinted, @@ -144,15 +144,15 @@ impl ColumnTrait for Column { Self::CreatedAt => ColumnType::TimestampWithTimeZone.def().null(), Self::Burnt => ColumnType::Boolean.def(), Self::SlotUpdated => ColumnType::BigInteger.def().null(), - Self::SlotUpdatedMetadataAccount => ColumnType::BigInteger.def().null(), - Self::SlotUpdatedMintAccount => ColumnType::BigInteger.def().null(), - Self::SlotUpdatedTokenAccount => ColumnType::BigInteger.def().null(), - Self::SlotUpdatedCnftTransaction => ColumnType::BigInteger.def().null(), Self::DataHash => ColumnType::Char(Some(50u32)).def().null(), Self::CreatorHash => ColumnType::Char(Some(50u32)).def().null(), Self::OwnerDelegateSeq => ColumnType::BigInteger.def().null(), Self::LeafSeq => ColumnType::BigInteger.def().null(), Self::BaseInfoSeq => ColumnType::BigInteger.def().null(), + Self::SlotUpdatedMetadataAccount => ColumnType::BigInteger.def().null(), + Self::SlotUpdatedTokenAccount => ColumnType::BigInteger.def().null(), + Self::SlotUpdatedMintAccount => ColumnType::BigInteger.def().null(), + Self::SlotUpdatedCnftTransaction => ColumnType::BigInteger.def().null(), Self::MplCorePlugins => ColumnType::JsonBinary.def().null(), Self::MplCoreUnknownPlugins => ColumnType::JsonBinary.def().null(), Self::MplCoreCollectionNumMinted => ColumnType::Integer.def().null(), diff --git a/digital_asset_types/src/dao/generated/mod.rs b/digital_asset_types/src/dao/generated/mod.rs index cb7314768..394e37c32 100644 --- a/digital_asset_types/src/dao/generated/mod.rs +++ b/digital_asset_types/src/dao/generated/mod.rs @@ -12,6 +12,7 @@ pub mod backfill_items; pub mod cl_audits_v2; pub mod cl_items; pub mod raw_txn; +pub mod rollup_to_verify; pub mod sea_orm_active_enums; pub mod tasks; pub mod token_accounts; diff --git a/digital_asset_types/src/dao/generated/prelude.rs b/digital_asset_types/src/dao/generated/prelude.rs index 4eabcb4a7..9b97c118a 100644 --- a/digital_asset_types/src/dao/generated/prelude.rs +++ b/digital_asset_types/src/dao/generated/prelude.rs @@ -1,7 +1,5 @@ //! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 -#![allow(unused_imports)] - pub use super::asset::Entity as Asset; pub use super::asset_authority::Entity as AssetAuthority; pub use super::asset_creators::Entity as AssetCreators; @@ -12,6 +10,7 @@ pub use super::backfill_items::Entity as BackfillItems; pub use super::cl_audits_v2::Entity as ClAuditsV2; pub use super::cl_items::Entity as ClItems; pub use super::raw_txn::Entity as RawTxn; +pub use super::rollup_to_verify::Entity as RollupToVerify; pub use super::tasks::Entity as Tasks; pub use super::token_accounts::Entity as TokenAccounts; pub use super::tokens::Entity as Tokens; diff --git a/digital_asset_types/src/dao/generated/rollup_to_verify.rs b/digital_asset_types/src/dao/generated/rollup_to_verify.rs new file mode 100644 index 000000000..ec7fd14e3 --- /dev/null +++ b/digital_asset_types/src/dao/generated/rollup_to_verify.rs @@ -0,0 +1,75 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 + +use super::sea_orm_active_enums::RollupFailStatus; +use super::sea_orm_active_enums::RollupPersistingState; +use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; + +#[derive(Copy, Clone, Default, Debug, DeriveEntity)] +pub struct Entity; + +impl EntityName for Entity { + fn table_name(&self) -> &str { + "rollup_to_verify" + } +} + +#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)] +pub struct Model { + pub file_hash: String, + pub url: String, + pub created_at_slot: i64, + pub signature: Vec, + pub download_attempts: i32, + pub rollup_persisting_state: RollupPersistingState, + pub rollup_fail_status: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] +pub enum Column { + FileHash, + Url, + CreatedAtSlot, + Signature, + DownloadAttempts, + RollupPersistingState, + RollupFailStatus, +} + +#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] +pub enum PrimaryKey { + FileHash, +} + +impl PrimaryKeyTrait for PrimaryKey { + type ValueType = String; + fn auto_increment() -> bool { + false + } +} + +#[derive(Copy, Clone, Debug, EnumIter)] +pub enum Relation {} + +impl ColumnTrait for Column { + type EntityName = Entity; + fn def(&self) -> ColumnDef { + match self { + Self::FileHash => ColumnType::String(None).def(), + Self::Url => ColumnType::String(None).def(), + Self::CreatedAtSlot => ColumnType::BigInteger.def(), + Self::Signature => ColumnType::Binary.def(), + Self::DownloadAttempts => ColumnType::Integer.def(), + Self::RollupPersistingState => RollupPersistingState::db_type(), + Self::RollupFailStatus => RollupFailStatus::db_type().null(), + } + } +} + +impl RelationTrait for Relation { + fn def(&self) -> RelationDef { + panic!("No RelationDef") + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index e4d0e012d..0114d0e80 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -7,17 +7,91 @@ use serde::{Deserialize, Serialize}; #[sea_orm( rs_type = "String", db_type = "Enum", - enum_name = "specification_versions" + enum_name = "royalty_target_type" )] -pub enum SpecificationVersions { +pub enum RoyaltyTargetType { + #[sea_orm(string_value = "creators")] + Creators, + #[sea_orm(string_value = "fanout")] + Fanout, + #[sea_orm(string_value = "single")] + Single, #[sea_orm(string_value = "unknown")] Unknown, - #[sea_orm(string_value = "v0")] - V0, - #[sea_orm(string_value = "v1")] - V1, - #[sea_orm(string_value = "v2")] - V2, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] +pub enum OwnerType { + #[sea_orm(string_value = "single")] + Single, + #[sea_orm(string_value = "token")] + Token, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] +pub enum ChainMutability { + #[sea_orm(string_value = "immutable")] + Immutable, + #[sea_orm(string_value = "mutable")] + Mutable, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] +pub enum Instruction { + #[sea_orm(string_value = "burn")] + Burn, + #[sea_orm(string_value = "cancel_redeem")] + CancelRedeem, + #[sea_orm(string_value = "compress")] + Compress, + #[sea_orm(string_value = "decompress_v1")] + DecompressV1, + #[sea_orm(string_value = "delegate")] + Delegate, + #[sea_orm(string_value = "mint_to_collection_v1")] + MintToCollectionV1, + #[sea_orm(string_value = "mint_v1")] + MintV1, + #[sea_orm(string_value = "redeem")] + Redeem, + #[sea_orm(string_value = "set_and_verify_collection")] + SetAndVerifyCollection, + #[sea_orm(string_value = "transfer")] + Transfer, + #[sea_orm(string_value = "unknown")] + Unknown, + #[sea_orm(string_value = "unverify_collection")] + UnverifyCollection, + #[sea_orm(string_value = "unverify_creator")] + UnverifyCreator, + #[sea_orm(string_value = "update_metadata")] + UpdateMetadata, + #[sea_orm(string_value = "verify_collection")] + VerifyCollection, + #[sea_orm(string_value = "verify_creator")] + VerifyCreator, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "rollup_persisting_state" +)] +pub enum RollupPersistingState { + #[sea_orm(string_value = "failed_to_persist")] + FailedToPersist, + #[sea_orm(string_value = "received_transaction")] + ReceivedTransaction, + #[sea_orm(string_value = "stored_update")] + StoredUpdate, + #[sea_orm(string_value = "successfully_download")] + SuccessfullyDownload, + #[sea_orm(string_value = "successfully_validate")] + SuccessfullyValidate, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] @@ -32,8 +106,8 @@ pub enum TaskStatus { Success, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] -pub enum ChainMutability { +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] +pub enum Mutability { #[sea_orm(string_value = "immutable")] Immutable, #[sea_orm(string_value = "mutable")] @@ -42,14 +116,32 @@ pub enum ChainMutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] -pub enum Mutability { - #[sea_orm(string_value = "immutable")] - Immutable, - #[sea_orm(string_value = "mutable")] - Mutable, +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "specification_versions" +)] +pub enum SpecificationVersions { #[sea_orm(string_value = "unknown")] Unknown, + #[sea_orm(string_value = "v0")] + V0, + #[sea_orm(string_value = "v1")] + V1, + #[sea_orm(string_value = "v2")] + V2, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] +pub enum RollupFailStatus { + #[sea_orm(string_value = "checksum_verify_failed")] + ChecksumVerifyFailed, + #[sea_orm(string_value = "download_failed")] + DownloadFailed, + #[sea_orm(string_value = "file_serialization")] + FileSerialization, + #[sea_orm(string_value = "rollup_verify_failed")] + RollupVerifyFailed, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( @@ -70,32 +162,6 @@ pub enum V1AccountAttachments { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] -pub enum OwnerType { - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "token")] - Token, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "royalty_target_type" -)] -pub enum RoyaltyTargetType { - #[sea_orm(string_value = "creators")] - Creators, - #[sea_orm(string_value = "fanout")] - Fanout, - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", @@ -127,39 +193,3 @@ pub enum SpecificationAssetClass { #[sea_orm(string_value = "unknown")] Unknown, } -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] -pub enum Instruction { - #[sea_orm(string_value = "burn")] - Burn, - #[sea_orm(string_value = "cancel_redeem")] - CancelRedeem, - #[sea_orm(string_value = "compress")] - Compress, - #[sea_orm(string_value = "decompress_v1")] - DecompressV1, - #[sea_orm(string_value = "delegate")] - Delegate, - #[sea_orm(string_value = "mint_to_collection_v1")] - MintToCollectionV1, - #[sea_orm(string_value = "mint_v1")] - MintV1, - #[sea_orm(string_value = "redeem")] - Redeem, - #[sea_orm(string_value = "set_and_verify_collection")] - SetAndVerifyCollection, - #[sea_orm(string_value = "transfer")] - Transfer, - #[sea_orm(string_value = "unknown")] - Unknown, - #[sea_orm(string_value = "unverify_collection")] - UnverifyCollection, - #[sea_orm(string_value = "unverify_creator")] - UnverifyCreator, - #[sea_orm(string_value = "update_metadata")] - UpdateMetadata, - #[sea_orm(string_value = "verify_collection")] - VerifyCollection, - #[sea_orm(string_value = "verify_creator")] - VerifyCreator, -} diff --git a/docker-compose.yaml b/docker-compose.yaml index 364a00855..57c5791b4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,10 +17,10 @@ services: - "2004:2004" migrator: depends_on: - - db + - reference-db - builder environment: - DATABASE_URL: postgres://solana:solana@db/solana + DATABASE_URL: postgres://solana:solana@reference-db/solana build: context: . dockerfile: Migrator.Dockerfile @@ -29,7 +29,7 @@ services: - migrator - builder - redis - - db + - reference-db - graphite - solana restart: always @@ -37,7 +37,7 @@ services: RUST_LOG: debug INGESTER_METRICS_PORT: 8125 INGESTER_METRICS_HOST: graphite - INGESTER_DATABASE_CONFIG: '{max_postgres_connections=, listener_channel="backfill_item_added", url="postgres://solana:solana@db/solana"}' + INGESTER_DATABASE_CONFIG: '{max_postgres_connections=, listener_channel="backfill_item_added", url="postgres://solana:solana@reference-db/solana"}' INGESTER_MESSENGER_CONFIG: '{connection_config={batch_size=500,idle_timeout=5000,redis_connection_str="redis://redis"}, messenger_type="Redis"}' INGESTER_RPC_CONFIG: '{url="http://${COMPOSE_PROJECT_NAME}-solana-1:8899/", commitment="confirmed"}' RUST_BACKTRACE: 1 @@ -73,7 +73,7 @@ services: - builder restart: always environment: - APP_DATABASE_URL: postgres://solana:solana@db/solana + APP_DATABASE_URL: postgres://solana:solana@reference-db/solana APP_SERVER_PORT: 9090 APP_METRICS_PORT: 8125 APP_METRICS_HOST: graphite @@ -86,7 +86,7 @@ services: image: "redis:7.0.0" ports: - "6379:6379" - db: + reference-db: image: 'postgres:14' command: [ "postgres", "-c", "log_statement=all", "-c", "log_destination=stderr" ,"-c","max_connections=200" ] ports: diff --git a/migration/src/lib.rs b/migration/src/lib.rs index 9b4689126..5082e65da 100644 --- a/migration/src/lib.rs +++ b/migration/src/lib.rs @@ -42,6 +42,7 @@ mod m20240313_120101_add_mpl_core_plugins_columns; mod m20240319_120101_add_mpl_core_enum_vals; mod m20240320_120101_add_mpl_core_info_items; mod m20240520_120101_add_mpl_core_external_plugins_columns; +mod m20240720_120101_add_finalize_tree_with_root_instruction_handle; pub mod model; @@ -93,6 +94,7 @@ impl MigratorTrait for Migrator { Box::new(m20240319_120101_add_mpl_core_enum_vals::Migration), Box::new(m20240320_120101_add_mpl_core_info_items::Migration), Box::new(m20240520_120101_add_mpl_core_external_plugins_columns::Migration), + Box::new(m20240720_120101_add_finalize_tree_with_root_instruction_handle::Migration), ] } } diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs new file mode 100644 index 000000000..305aafa39 --- /dev/null +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -0,0 +1,140 @@ +use enum_iterator::all; +use enum_iterator_derive::Sequence; +use sea_orm::sea_query::extension::postgres::{Type, TypeCreateStatement}; +use sea_orm_migration::prelude::*; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + // Create enums + manager + .create_type( + Type::create() + .as_enum(RollupToVerify::RollupFailStatus) + .values([ + FailedRollupState::ChecksumVerifyFailed, + FailedRollupState::RollupVerifyFailed, + FailedRollupState::DownloadFailed, + FailedRollupState::FileSerialization, + ]) + .to_owned(), + ) + .await?; + + manager + .create_type( + Type::create() + .as_enum(RollupToVerify::RollupPersistingState) + .values([ + PersistingRollupState::ReceivedTransaction, + PersistingRollupState::FailedToPersist, + PersistingRollupState::SuccessfullyDownload, + PersistingRollupState::SuccessfullyValidate, + PersistingRollupState::StoredUpdate, + ]) + .to_owned(), + ) + .await?; + + // Create RollupToVerify table + manager + .create_table( + Table::create() + .table(RollupToVerify::Table) + .if_not_exists() + .col( + ColumnDef::new(RollupToVerify::FileHash) + .string() + .not_null() + .primary_key(), + ) + .col(ColumnDef::new(RollupToVerify::Url).string().not_null()) + .col( + ColumnDef::new(RollupToVerify::CreatedAtSlot) + .big_integer() + .not_null(), + ) + .col( + ColumnDef::new(RollupToVerify::Signature) + .binary() + .not_null(), + ) + .col( + ColumnDef::new(RollupToVerify::DownloadAttempts) + .unsigned() + .not_null(), + ) + .col( + ColumnDef::new(RollupToVerify::RollupPersistingState) + .enumeration( + RollupToVerify::RollupPersistingState, + all::().collect::>(), + ) + .not_null(), + ) + .col( + ColumnDef::new(RollupToVerify::RollupFailStatus) + .enumeration( + RollupToVerify::RollupFailStatus, + all::().collect::>(), + ) + .null(), + ) + .to_owned(), + ) + .await?; + + // Create indexes + manager + .create_index( + Index::create() + .name("idx_created_at_slot") + .table(RollupToVerify::Table) + .col(RollupToVerify::CreatedAtSlot) + .col(RollupToVerify::RollupPersistingState) + .to_owned(), + ) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .drop_table(Table::drop().table(RollupToVerify::Table).to_owned()) + .await?; + Ok(()) + } +} + +#[derive(Iden)] +enum RollupToVerify { + Table, + Url, + FileHash, + CreatedAtSlot, + Signature, + DownloadAttempts, + RollupPersistingState, + RollupFailStatus, +} + +#[derive(Iden, Debug, PartialEq, Sequence)] +enum PersistingRollupState { + ReceivedTransaction, + FailedToPersist, + SuccessfullyDownload, + SuccessfullyValidate, + StoredUpdate, +} + +#[derive(Iden, Debug, PartialEq, Sequence)] +enum FailedRollupState { + DownloadFailed, + ChecksumVerifyFailed, + RollupVerifyFailed, + FileSerialization, +} diff --git a/nft_ingester/Cargo.toml b/nft_ingester/Cargo.toml index fd17a2bed..f727e0cb1 100644 --- a/nft_ingester/Cargo.toml +++ b/nft_ingester/Cargo.toml @@ -60,6 +60,7 @@ tracing-subscriber = { workspace = true, features = [ "ansi", ] } url = { workspace = true } +triomphe = { workspace = true } [lints] workspace = true diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 35bab7a19..1b575169c 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -25,6 +25,12 @@ sqlx = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["time"] } tracing = { workspace = true } +triomphe = { workspace = true } +spl-concurrent-merkle-tree = { workspace = true } +paste = { workspace = true } +async-trait = { workspace = true } +serde_derive = { workspace = true } +anchor-lang = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/bubblegum/db.rs b/program_transformers/src/bubblegum/db.rs index 08fb82f5f..02952abf2 100644 --- a/program_transformers/src/bubblegum/db.rs +++ b/program_transformers/src/bubblegum/db.rs @@ -1,5 +1,6 @@ use { crate::error::{ProgramTransformerError, ProgramTransformerResult}, + blockbuster::programs::bubblegum::ChangeLogEventV1, digital_asset_types::dao::{ asset, asset_authority, asset_creators, asset_data, asset_grouping, backfill_items, cl_audits_v2, cl_items, @@ -15,7 +16,6 @@ use { sea_query::query::OnConflict, ConnectionTrait, DbBackend, TransactionTrait, }, - spl_account_compression::events::ChangeLogEventV1, tracing::{debug, error, info}, }; diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs new file mode 100644 index 000000000..acff02640 --- /dev/null +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -0,0 +1,79 @@ + +use { + crate::{ + bubblegum::{ + db::{save_changelog_event, upsert_asset_with_seq}, + u32_to_u8_array, + }, + error::{ProgramTransformerError, ProgramTransformerResult}, + }, + blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}, + digital_asset_types::dao::asset, + sea_orm::{ + entity::{ActiveValue, EntityTrait}, + query::QueryTrait, + sea_query::query::OnConflict, + ConnectionTrait, DbBackend, TransactionTrait, + }, + solana_sdk::pubkey::Pubkey, + tracing::debug, +}; + +pub async fn finalize_tree_with_root<'c, T>( + parsing_result: &BubblegumInstruction, + bundle: &InstructionBundle<'c>, + txn: &'c T, + instruction: &str, + cl_audits: bool, +) -> ProgramTransformerResult<()> + where + T: ConnectionTrait + TransactionTrait, +{ + if let Some(cl) = &parsing_result.tree_update { + let seq = save_changelog_event(cl, bundle.slot, bundle.txn_id, txn, instruction, cl_audits) + .await?; + let leaf_index = cl.index; + let (asset_id, _) = Pubkey::find_program_address( + &[ + "asset".as_bytes(), + cl.id.as_ref(), + u32_to_u8_array(leaf_index).as_ref(), + ], + &mpl_bubblegum::ID, + ); + debug!("Indexing burn for asset id: {:?}", asset_id); + let id_bytes = asset_id.to_bytes(); + + let asset_model = asset::ActiveModel { + id: ActiveValue::Set(id_bytes.to_vec()), + burnt: ActiveValue::Set(true), + ..Default::default() + }; + + // Begin a transaction. If the transaction goes out of scope (i.e. one of the executions has + // an error and this function returns it using the `?` operator), then the transaction is + // automatically rolled back. + let multi_txn = txn.begin().await?; + + // Upsert asset table `burnt` column. Note we don't check for decompression (asset.seq = 0) + // because we know if the item was burnt it could not have been decompressed later. + let query = asset::Entity::insert(asset_model) + .on_conflict( + OnConflict::columns([asset::Column::Id]) + .update_columns([asset::Column::Burnt]) + .to_owned(), + ) + .build(DbBackend::Postgres); + multi_txn.execute(query).await?; + + upsert_asset_with_seq(&multi_txn, id_bytes.to_vec(), seq as i64).await?; + + multi_txn.commit().await?; + + return Ok(()); + } + Err(ProgramTransformerError::ParsingError( + "Ix not parsed correctly".to_string(), + )) +} + diff --git a/program_transformers/src/bubblegum/merkle_tree_wrapper.rs b/program_transformers/src/bubblegum/merkle_tree_wrapper.rs new file mode 100644 index 000000000..2c931f92c --- /dev/null +++ b/program_transformers/src/bubblegum/merkle_tree_wrapper.rs @@ -0,0 +1,230 @@ +use crate::error::ProgramTransformerError; +use spl_account_compression::{ConcurrentMerkleTree, ConcurrentMerkleTreeError, Node}; +use spl_concurrent_merkle_tree::changelog::ChangeLog; +use std::slice::Iter; + +/// Interface that abstract [ConcurrentMerkleTree] +/// regardless const generic parameters. +pub trait ITree { + fn initialize(&mut self) -> Result; + fn append(&mut self, node: Node) -> Result; + fn active_index(&self) -> u64; + fn change_logs(&self, ind: usize) -> Box; + fn sequence_number(&self) -> u64; + fn get_root(&self) -> [u8; 32]; +} + +#[macro_export] +macro_rules! make_tree_impls { + ( $( ($x:literal, $y:literal) ),* ) => { + $( + impl ITree for ConcurrentMerkleTree<$x,$y> { + fn initialize(&mut self) -> Result { + self.initialize() + } + fn append(&mut self, node: Node) -> Result { + self.append(node) + } + fn active_index(&self) -> u64 { + self.active_index + } + fn change_logs(&self, ind: usize) -> Box { + Box::new(self.change_logs[ind]) + } + fn sequence_number(&self) -> u64 { + self.sequence_number + } + fn get_root(&self) -> [u8; 32] { + self.get_root() + } + } + )* + } +} + +// Building implementations of ITree +// for all possible instances of ConcurrentMerkleTreeError. +make_tree_impls!( + (3, 8), + (5, 8), + (6, 16), + (7, 16), + (8, 16), + (9, 16), + (10, 32), + (11, 32), + (12, 32), + (13, 32), + (14, 64), + (14, 256), + (14, 1024), + (14, 2048), + (15, 64), + (16, 64), + (17, 64), + (18, 64), + (19, 64), + (20, 64), + (20, 256), + (20, 1024), + (20, 2048), + (24, 64), + (24, 256), + (24, 512), + (24, 1024), + (24, 2048), + (26, 512), + (26, 1024), + (26, 2048), + (30, 512), + (30, 1024), + (30, 2048) +); + +/// An abstraction for [ChangeLog] +/// that abstracts over const generic parameter. +/// Similar to [ITree]. +pub trait IChangeLog { + fn index(&self) -> u32; + fn root(&self) -> [u8; 32]; + fn path_iter(&self) -> Iter; + fn path_slice(&self) -> &[Node]; + fn path_len(&self) -> u32; +} + +#[macro_export] +macro_rules! make_changelog_impls { + ( $( $x:literal ),* ) => { + $( + impl IChangeLog for ChangeLog<$x> { + fn index(&self) -> u32 { + self.index + } + + fn root(&self) -> [u8; 32] { + self.root + } + + fn path_iter(&self) -> Iter { + self.path.iter() + } + + fn path_slice(&self) -> &[Node] { + &self.path + } + + fn path_len(&self) -> u32 { + self.path.len() as u32 + } + } + )* + } +} + +#[macro_export] +macro_rules! make_tree_creator_funcs { + ( $( ($x:literal, $y:literal) ),* ) => { + $( + paste::item! { + #[inline(never)] + fn [< make_concurrent_merkle_tree_ $x _ $y >]() -> Box { + Box::new(ConcurrentMerkleTree::<$x,$y>::new()) + } + } + )* + } +} + +make_tree_creator_funcs!( + (3, 8), + (5, 8), + (6, 16), + (7, 16), + (8, 16), + (9, 16), + (10, 32), + (11, 32), + (12, 32), + (13, 32), + (14, 64), + (14, 256), + (14, 1024), + (14, 2048), + (15, 64), + (16, 64), + (17, 64), + (18, 64), + (19, 64), + (20, 64), + (20, 256), + (20, 1024), + (20, 2048), + (24, 64), + (24, 256), + (24, 512), + (24, 1024), + (24, 2048), + (26, 512), + (26, 1024), + (26, 2048), + (30, 512), + (30, 1024), + (30, 2048) +); + +pub fn make_concurrent_merkle_tree( + max_dapth: u32, + max_buf_size: u32, +) -> Result, ProgramTransformerError> { + // Note: We do not create ConcurrentMerkleTree object right inside of match statement + // because of how Rust compiler reserves space for functions: + // the total size of function in memory (i.e. frame size) is as big as total size of + // all possible ConcurrentMerkleTree objects created in all branches. + // Because they are allocated on stack. + // And since these objects are quite big (up to 2MB), + // the total size of function becomes so big, it cannot fit in the thread stack. + // This all applies only for debug build, for release the compiler is smart enough + // to optimize this. + // Though, we need the debug to not fail with the stack overflow, + // that's why we had to move creation of an exact ConcurrentMerkleTree objects + // into separate function that return trait objects. + match (max_dapth, max_buf_size) { + (3, 8) => Ok(make_concurrent_merkle_tree_3_8()), + (5, 8) => Ok(make_concurrent_merkle_tree_5_8()), + (6, 16) => Ok(make_concurrent_merkle_tree_6_16()), + (7, 16) => Ok(make_concurrent_merkle_tree_7_16()), + (8, 16) => Ok(make_concurrent_merkle_tree_8_16()), + (9, 16) => Ok(make_concurrent_merkle_tree_9_16()), + (10, 32) => Ok(make_concurrent_merkle_tree_10_32()), + (11, 32) => Ok(make_concurrent_merkle_tree_11_32()), + (12, 32) => Ok(make_concurrent_merkle_tree_12_32()), + (13, 32) => Ok(make_concurrent_merkle_tree_13_32()), + (14, 64) => Ok(make_concurrent_merkle_tree_14_64()), + (14, 256) => Ok(make_concurrent_merkle_tree_14_256()), + (14, 1024) => Ok(make_concurrent_merkle_tree_14_1024()), + (14, 2048) => Ok(make_concurrent_merkle_tree_14_2048()), + (15, 64) => Ok(make_concurrent_merkle_tree_15_64()), + (16, 64) => Ok(make_concurrent_merkle_tree_16_64()), + (17, 64) => Ok(make_concurrent_merkle_tree_17_64()), + (18, 64) => Ok(make_concurrent_merkle_tree_18_64()), + (19, 64) => Ok(make_concurrent_merkle_tree_19_64()), + (20, 64) => Ok(make_concurrent_merkle_tree_20_64()), + (20, 256) => Ok(make_concurrent_merkle_tree_20_256()), + (20, 1024) => Ok(make_concurrent_merkle_tree_20_1024()), + (20, 2048) => Ok(make_concurrent_merkle_tree_20_2048()), + (24, 64) => Ok(make_concurrent_merkle_tree_24_64()), + (24, 256) => Ok(make_concurrent_merkle_tree_24_256()), + (24, 512) => Ok(make_concurrent_merkle_tree_24_512()), + (24, 1024) => Ok(make_concurrent_merkle_tree_24_1024()), + (24, 2048) => Ok(make_concurrent_merkle_tree_24_2048()), + (26, 512) => Ok(make_concurrent_merkle_tree_26_512()), + (26, 1024) => Ok(make_concurrent_merkle_tree_26_1024()), + (26, 2048) => Ok(make_concurrent_merkle_tree_26_2048()), + (30, 512) => Ok(make_concurrent_merkle_tree_30_512()), + (30, 1024) => Ok(make_concurrent_merkle_tree_30_1024()), + (30, 2048) => Ok(make_concurrent_merkle_tree_30_2048()), + (d, s) => Err(ProgramTransformerError::UnexpectedTreeSize(d, s)), + } +} + +make_changelog_impls!(3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 26, 30); diff --git a/program_transformers/src/bubblegum/mod.rs b/program_transformers/src/bubblegum/mod.rs index 07659011f..f2f771c78 100644 --- a/program_transformers/src/bubblegum/mod.rs +++ b/program_transformers/src/bubblegum/mod.rs @@ -20,10 +20,13 @@ mod collection_verification; mod creator_verification; mod db; mod delegate; +mod finalize_tree_with_root; +mod merkle_tree_wrapper; mod mint_v1; mod redeem; mod transfer; mod update_metadata; +mod rollup_persister; pub async fn handle_bubblegum_instruction<'c, T>( parsing_result: &'c BubblegumInstruction, @@ -58,6 +61,7 @@ where InstructionName::SetAndVerifyCollection => "SetAndVerifyCollection", InstructionName::SetDecompressibleState => "SetDecompressibleState", InstructionName::UpdateMetadata => "UpdateMetadata", + InstructionName::CreateTreeWithRoot => "CreateTreeWithRoot", }; info!("BGUM instruction txn={:?}: {:?}", ix_str, bundle.txn_id); diff --git a/program_transformers/src/bubblegum/rollup_persister.rs b/program_transformers/src/bubblegum/rollup_persister.rs new file mode 100644 index 000000000..6eefe43b3 --- /dev/null +++ b/program_transformers/src/bubblegum/rollup_persister.rs @@ -0,0 +1,498 @@ +use std::ops::Deref; +use std::{sync::Arc, time::Duration}; +use std::collections::HashMap; +use anchor_lang::AnchorSerialize; + +use async_trait::async_trait; +use serde_derive::{Deserialize, Serialize}; +use serde_json::value::RawValue; +use solana_sdk::keccak; +use solana_sdk::keccak::Hash; +use solana_sdk::pubkey::Pubkey; +use tracing::{error, info}; +use tokio::{sync::broadcast::Receiver, task::JoinError, time::Instant}; +use blockbuster::programs::bubblegum::BubblegumInstruction; +use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; +use mpl_bubblegum::utils::get_asset_id; +use crate::error::RollupValidationError; + +pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; + + +#[derive(Serialize, Deserialize, Clone)] +pub struct Rollup { + #[serde(with = "serde_with::As::")] + pub tree_id: Pubkey, + pub rolled_mints: Vec, + pub raw_metadata_map: HashMap>, // map by uri + pub max_depth: u32, + pub max_buffer_size: u32, + + // derived data + pub merkle_root: [u8; 32], // validate + pub last_leaf_hash: [u8; 32], // validate +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct RolledMintInstruction { + pub tree_update: ChangeLogEventV1, // validate // derive from nonce + pub leaf_update: LeafSchema, // validate + pub mint_args: MetadataArgs, + // V0.1: enforce collection.verify == false + // V0.1: enforce creator.verify == false + // V0.2: add pub collection_signature: Option - sign asset_id with collection authority + // V0.2: add pub creator_signature: Option> - sign asset_id with creator authority to ensure verified creator + #[serde(with = "serde_with::As::")] + pub authority: Pubkey, +} + +#[derive(Default, Clone)] +pub struct BatchMintInstruction { + pub max_depth: u32, + pub max_buffer_size: u32, + pub num_minted: u64, + pub root: [u8; 32], + pub leaf: [u8; 32], + pub index: u32, + pub metadata_url: String, + pub file_checksum: String, +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct ChangeLogEventV1 { + #[serde(with = "serde_with::As::")] + pub id: Pubkey, + pub path: Vec, + pub seq: u64, + pub index: u32, +} + +#[derive(Serialize, Deserialize, PartialEq, Copy, Clone)] +pub struct PathNode { + pub node: [u8; 32], + pub index: u32, +} + +impl From<&PathNode> for spl_account_compression::state::PathNode { + fn from(value: &PathNode) -> Self { + Self { + node: value.node, + index: value.index, + } + } +} +impl From for PathNode { + fn from(value: spl_account_compression::state::PathNode) -> Self { + Self { + node: value.node, + index: value.index, + } + } +} +impl From<&ChangeLogEventV1> for blockbuster::programs::bubblegum::ChangeLogEventV1 { + fn from(value: &ChangeLogEventV1) -> Self { + Self { + id: value.id, + path: value.path.iter().map(Into::into).collect::>(), + seq: value.seq, + index: value.index, + } + } +} +impl From for ChangeLogEventV1 { + fn from(value: blockbuster::programs::bubblegum::ChangeLogEventV1) -> Self { + Self { + id: value.id, + path: value.path.into_iter().map(Into::into).collect::>(), + seq: value.seq, + index: value.index, + } + } +} + +impl From<&RolledMintInstruction> for BubblegumInstruction { + fn from(value: &RolledMintInstruction) -> Self { + let hash = value.leaf_update.hash(); + Self { + instruction: InstructionName::MintV1, + tree_update: Some((&value.tree_update).into()), + leaf_update: Some(LeafSchemaEvent::new( + Version::V1, + value.leaf_update.clone(), + hash, + )), + payload: Some(Payload::MintV1 { + args: value.mint_args.clone(), + authority: value.authority, + tree_id: value.tree_update.id, + }), + } + } +} + +pub struct RollupPersister { + rocks_client: Arc, + downloader: D, + metrics: Arc, +} + +pub struct RollupDownloaderForPersister {} + +#[async_trait] +impl RollupDownloader for RollupDownloaderForPersister { + async fn download_rollup(&self, url: &str) -> Result, UsecaseError> { + let response = reqwest::get(url).await?.bytes().await?; + Ok(Box::new(serde_json::from_slice(&response)?)) + } + + async fn download_rollup_and_check_checksum( + &self, + url: &str, + checksum: &str, + ) -> Result, UsecaseError> { + let response = reqwest::get(url).await?.bytes().await?; + let file_hash = xxhash_rust::xxh3::xxh3_128(&response); + let hash_hex = hex::encode(file_hash.to_be_bytes()); + if hash_hex != checksum { + return Err(UsecaseError::HashMismatch(checksum.to_string(), hash_hex)); + } + Ok(Box::new(serde_json::from_slice(&response)?)) + } +} + +impl RollupPersister { + pub fn new( + rocks_client: Arc, + downloader: D, + metrics: Arc, + ) -> Self { + Self { + rocks_client, + downloader, + metrics, + } + } + + pub async fn persist_rollups(&self, mut rx: Receiver<()>) -> Result<(), JoinError> { + loop { + tokio::select! { + _ = tokio::time::sleep(Duration::from_secs(5)) => { + let (rollup_to_verify, rollup) = match self.get_rollup_to_verify().await { + Ok(res) => res, + Err(_) => { + continue; + } + }; + let Some(rollup_to_verify) = rollup_to_verify else { + // no rollups to persist + return Ok(()); + }; + self.persist_rollup(&rx, rollup_to_verify, rollup).await + }, + _ = rx.recv() => { + info!("Received stop signal, stopping ..."); + return Ok(()); + }, + } + } + } + + pub async fn persist_rollup( + &self, + rx: &Receiver<()>, + mut rollup_to_verify: RollupToVerify, + mut rollup: Option>, + ) { + let start_time = Instant::now(); + info!("Persisting {} rollup", &rollup_to_verify.url); + while rx.is_empty() { + match (&rollup_to_verify.persisting_state, &rollup) { + (&PersistingRollupState::ReceivedTransaction, _) | (_, None) => { + if let Err(err) = self + .download_rollup(&mut rollup_to_verify, &mut rollup) + .await + { + error!("Error during rollup downloading: {}", err) + }; + } + (&PersistingRollupState::SuccessfullyDownload, Some(r)) => { + self.validate_rollup(&mut rollup_to_verify, r).await; + } + (&PersistingRollupState::SuccessfullyValidate, Some(r)) => { + self.store_rollup_update(&mut rollup_to_verify, r).await; + } + (&PersistingRollupState::FailedToPersist, _) + | (&PersistingRollupState::StoredUpdate, _) => { + self.drop_rollup_from_queue(rollup_to_verify.file_hash.clone()) + .await; + info!( + "Finish processing {} rollup file with {:?} state", + &rollup_to_verify.url, &rollup_to_verify.persisting_state + ); + self.metrics.set_persisting_latency( + "rollup_persisting", + start_time.elapsed().as_millis() as f64, + ); + return; + } + } + } + } + + async fn get_rollup_to_verify( + &self, + ) -> Result<(Option, Option>), IngesterError> { + match self.rocks_client.fetch_rollup_for_verifying().await { + Ok((Some(rollup_to_verify), rollup_data)) => { + Ok((Some(rollup_to_verify), rollup_data.map(Box::new))) + } + Ok((None, _)) => Ok((None, None)), + Err(e) => { + self.metrics + .inc_rollups_with_status("rollup_fetch", MetricStatus::FAILURE); + error!("Failed to fetch rollup for verifying: {}", e); + Err(e.into()) + } + } + } + + async fn download_rollup( + &self, + rollup_to_verify: &mut RollupToVerify, + rollup: &mut Option>, + ) -> Result<(), IngesterError> { + if rollup.is_some() { + return Ok(()); + } + match self + .downloader + .download_rollup_and_check_checksum( + rollup_to_verify.url.as_ref(), + &rollup_to_verify.file_hash, + ) + .await + { + Ok(r) => { + self.metrics + .inc_rollups_with_status("rollup_download", MetricStatus::SUCCESS); + if let Err(e) = self + .rocks_client + .rollups + .put(rollup_to_verify.file_hash.clone(), r.deref().clone()) + { + self.metrics + .inc_rollups_with_status("persist_rollup", MetricStatus::FAILURE); + return Err(e.into()); + } + *rollup = Some(r); + rollup_to_verify.persisting_state = PersistingRollupState::SuccessfullyDownload; + } + Err(e) => { + if let UsecaseError::HashMismatch(expected, actual) = e { + rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + self.metrics + .inc_rollups_with_status("rollup_checksum_verify", MetricStatus::FAILURE); + self.save_rollup_as_failed( + FailedRollupState::ChecksumVerifyFailed, + rollup_to_verify, + )?; + + return Err(IngesterError::RollupValidation( + RollupValidationError::FileChecksumMismatch(expected, actual), + )); + } + if let UsecaseError::Serialization(e) = e { + rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + self.metrics.inc_rollups_with_status( + "rollup_file_deserialization", + MetricStatus::FAILURE, + ); + self.save_rollup_as_failed( + FailedRollupState::FileSerialization, + rollup_to_verify, + )?; + + return Err(IngesterError::SerializatonError(e)); + } + + self.metrics + .inc_rollups_with_status("rollup_download", MetricStatus::FAILURE); + if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS { + rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + self.save_rollup_as_failed( + FailedRollupState::DownloadFailed, + rollup_to_verify, + )?; + } else { + rollup_to_verify.download_attempts = rollup_to_verify.download_attempts + 1; + if let Err(e) = self.rocks_client.rollup_to_verify.put( + rollup_to_verify.file_hash.clone(), + RollupToVerify { + file_hash: rollup_to_verify.file_hash.clone(), + url: rollup_to_verify.url.clone(), + created_at_slot: rollup_to_verify.created_at_slot, + signature: rollup_to_verify.signature, + download_attempts: rollup_to_verify.download_attempts + 1, + persisting_state: PersistingRollupState::FailedToPersist, + }, + ) { + self.metrics.inc_rollups_with_status( + "rollup_attempts_update", + MetricStatus::FAILURE, + ); + return Err(e.into()); + } + self.metrics + .inc_rollups_with_status("rollup_attempts_update", MetricStatus::SUCCESS); + } + return Err(IngesterError::Usecase(e.to_string())); + } + } + Ok(()) + } + + async fn validate_rollup(&self, rollup_to_verify: &mut RollupToVerify, rollup: &Rollup) { + if let Err(e) = crate::rollup::rollup_verifier::validate_rollup(rollup).await { + self.metrics + .inc_rollups_with_status("rollup_validating", MetricStatus::FAILURE); + error!("Error while validating rollup: {}", e.to_string()); + + rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + if let Err(err) = + self.save_rollup_as_failed(FailedRollupState::RollupVerifyFailed, rollup_to_verify) + { + error!("Save rollup as failed: {}", err); + }; + return; + } + self.metrics + .inc_rollups_with_status("rollup_validating", MetricStatus::SUCCESS); + rollup_to_verify.persisting_state = PersistingRollupState::SuccessfullyValidate; + } + + async fn store_rollup_update(&self, rollup_to_verify: &mut RollupToVerify, rollup: &Rollup) { + if BubblegumTxProcessor::store_rollup_update( + rollup_to_verify.created_at_slot, + rollup, + self.rocks_client.clone(), + rollup_to_verify.signature, + ) + .await + .is_err() + { + self.metrics + .inc_rollups_with_status("rollup_persist", MetricStatus::FAILURE); + rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + return; + } + self.metrics + .inc_rollups_with_status("rollup_persist", MetricStatus::SUCCESS); + rollup_to_verify.persisting_state = PersistingRollupState::StoredUpdate; + } + + fn save_rollup_as_failed( + &self, + status: FailedRollupState, + rollup: &RollupToVerify, + ) -> Result<(), IngesterError> { + let key = FailedRollupKey { + status: status.clone(), + hash: rollup.file_hash.clone(), + }; + let value = FailedRollup { + status, + file_hash: rollup.file_hash.clone(), + url: rollup.url.clone(), + created_at_slot: rollup.created_at_slot, + signature: rollup.signature, + download_attempts: rollup.download_attempts + 1, + }; + if let Err(e) = self.rocks_client.failed_rollups.put(key, value) { + self.metrics + .inc_rollups_with_status("rollup_mark_as_failure", MetricStatus::FAILURE); + return Err(e.into()); + } + Ok(()) + } + + async fn drop_rollup_from_queue(&self, file_hash: String) { + if let Err(e) = self.rocks_client.drop_rollup_from_queue(file_hash).await { + self.metrics + .inc_rollups_with_status("rollup_queue_clear", MetricStatus::FAILURE); + error!("Rollup queue clear: {}", e) + } + } +} + +async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { + let mut leaf_hashes = Vec::new(); + for asset in rollup.rolled_mints.iter() { + let leaf_hash = match get_leaf_hash(asset, &rollup.tree_id) { + Ok(leaf_hash) => leaf_hash, + Err(e) => { + return Err(e); + } + }; + leaf_hashes.push(leaf_hash); + } + + usecase::merkle_tree::validate_change_logs( + rollup.max_depth, + rollup.max_buffer_size, + &leaf_hashes, + rollup, + ) +} + +fn get_leaf_hash( + asset: &RolledMintInstruction, + tree_id: &Pubkey, +) -> Result<[u8; 32], RollupValidationError> { + let asset_id = get_asset_id(tree_id, asset.leaf_update.nonce()); + if asset_id != asset.leaf_update.id() { + return Err(RollupValidationError::PDACheckFail( + asset_id.to_string(), + asset.leaf_update.id().to_string(), + )); + } + + // @dev: seller_fee_basis points is encoded twice so that it can be passed to marketplace + // instructions, without passing the entire, un-hashed MetadataArgs struct + let metadata_args_hash = keccak::hashv(&[asset.mint_args.try_to_vec()?.as_slice()]); + let data_hash = keccak::hashv(&[ + &metadata_args_hash.to_bytes(), + &asset.mint_args.seller_fee_basis_points.to_le_bytes(), + ]); + if asset.leaf_update.data_hash() != data_hash.to_bytes() { + return Err(RollupValidationError::InvalidDataHash( + data_hash.to_string(), + Hash::new(asset.leaf_update.data_hash().as_slice()).to_string(), + )); + } + + // Use the metadata auth to check whether we can allow `verified` to be set to true in the + // creator Vec. + let creator_data = asset + .mint_args + .creators + .iter() + .map(|c| [c.address.as_ref(), &[c.verified as u8], &[c.share]].concat()) + .collect::>(); + + // Calculate creator hash. + let creator_hash = keccak::hashv( + creator_data + .iter() + .map(|c| c.as_slice()) + .collect::>() + .as_ref(), + ); + if asset.leaf_update.creator_hash() != creator_hash.to_bytes() { + return Err(RollupValidationError::InvalidCreatorsHash( + creator_hash.to_string(), + Hash::new(asset.leaf_update.creator_hash().as_slice()).to_string(), + )); + } + + Ok(asset.leaf_update.hash()) +} diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index d0c29f383..db6c37b10 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -22,6 +22,8 @@ pub enum ProgramTransformerError { AssetIndexError(String), #[error("Failed to notify about download metadata: {0}")] DownloadMetadataNotify(Box), + #[error("Unexpected tree depth={0} and max size={1}")] + UnexpectedTreeSize(u32, u32), } impl From for ProgramTransformerError { @@ -35,3 +37,39 @@ impl From for ProgramTransformerError { ProgramTransformerError::StorageWriteError(e.to_string()) } } + +#[derive(thiserror::Error, Debug, PartialEq, Eq)] +pub enum RollupValidationError { + #[error("PDACheckFail: expected: {0}, got: {1}")] + PDACheckFail(String, String), + #[error("InvalidDataHash: expected: {0}, got: {1}")] + InvalidDataHash(String, String), + #[error("InvalidCreatorsHash: expected: {0}, got: {1}")] + InvalidCreatorsHash(String, String), + #[error("InvalidRoot: expected: {0}, got: {1}")] + InvalidRoot(String, String), + #[error("CannotCreateMerkleTree: depth [{0}], size [{1}]")] + CannotCreateMerkleTree(u32, u32), + #[error("NoRelevantRolledMint: index {0}")] + NoRelevantRolledMint(u64), + #[error("WrongAssetPath: id {0}")] + WrongAssetPath(String), + #[error("StdIo {0}")] + StdIo(String), + #[error("WrongTreeIdForChangeLog: asset: {0}, expected: {1}, got: {2}")] + WrongTreeIdForChangeLog(String, String, String), + #[error("WrongChangeLogIndex: asset: {0}, expected: {0}, got: {1}")] + WrongChangeLogIndex(String, u32, u32), + #[error("SplCompression: {0}")] + SplCompression(#[from] spl_account_compression::ConcurrentMerkleTreeError), + #[error("Anchor {0}")] + Anchor(#[from] anchor_lang::error::Error), + #[error("FileChecksumMismatch: expected {0}, actual file hash {1}")] + FileChecksumMismatch(String, String), +} + +impl From for RollupValidationError { + fn from(err: std::io::Error) -> Self { + RollupValidationError::StdIo(err.to_string()) + } +} From 4799ee7c8b9a40f67e0d4122ff2107a6e0755cfe Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 11 Jun 2024 17:10:18 +0300 Subject: [PATCH 02/34] wip --- Cargo.lock | 10 +- Cargo.toml | 2 + blockbuster/mpl-bubblegum | 1 - docker-compose.yaml | 2 +- program_transformers/Cargo.toml | 4 + .../src/bubblegum/finalize_tree_with_root.rs | 118 ++++---- .../src/bubblegum/merkle_tree_wrapper.rs | 71 ++++- program_transformers/src/bubblegum/mod.rs | 8 +- .../src/bubblegum/rollup_persister.rs | 283 +++++++++--------- program_transformers/src/error.rs | 3 + 10 files changed, 298 insertions(+), 204 deletions(-) delete mode 160000 blockbuster/mpl-bubblegum diff --git a/Cargo.lock b/Cargo.lock index 7e50a18ff..e8e8542cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4000,7 +4000,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.66", @@ -4577,9 +4577,12 @@ dependencies = [ "digital_asset_types", "futures", "heck 0.5.0", + "hex", + "mockall", "mpl-bubblegum", "num-traits", "paste", + "reqwest", "sea-orm", "serde_derive", "serde_json", @@ -4593,6 +4596,7 @@ dependencies = [ "tokio", "tracing", "triomphe", + "xxhash-rust", ] [[package]] @@ -8929,9 +8933,9 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.7" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" [[package]] name = "yaml-rust" diff --git a/Cargo.toml b/Cargo.toml index 85b2647e9..44b791e60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,6 +125,8 @@ wasm-bindgen = "0.2.83" triomphe = "=0.1.9" paste = "1" serde_derive = "1.0.195" +mockall = "0.11.4" +xxhash-rust = { version = "0.8.10", features = ["xxh3"] } [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/blockbuster/mpl-bubblegum b/blockbuster/mpl-bubblegum deleted file mode 160000 index 5a12db31d..000000000 --- a/blockbuster/mpl-bubblegum +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5a12db31da59bf90fe5b7164af64303a98beab13 diff --git a/docker-compose.yaml b/docker-compose.yaml index 57c5791b4..a8b4567e9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -90,7 +90,7 @@ services: image: 'postgres:14' command: [ "postgres", "-c", "log_statement=all", "-c", "log_destination=stderr" ,"-c","max_connections=200" ] ports: - - 5432:5432 + - 5433:5432 environment: POSTGRES_USER: solana # The PostgreSQL user (useful to connect to the database) POSTGRES_PASSWORD: solana # The PostgreSQL password (useful to connect to the database) diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 1b575169c..1bd1f00e7 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -31,6 +31,10 @@ paste = { workspace = true } async-trait = { workspace = true } serde_derive = { workspace = true } anchor-lang = { workspace = true } +mockall = { workspace = true } +reqwest = { workspace = true } +hex = { workspace = true } +xxhash-rust = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index acff02640..94151d384 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -1,79 +1,73 @@ - +use crate::bubblegum; +use crate::bubblegum::rollup_persister::Rollup; +use blockbuster::programs::bubblegum::Payload; +use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; +use sea_orm::{ActiveModelTrait, Set}; +use solana_sdk::signature::Signature; +use std::str::FromStr; use { - crate::{ - bubblegum::{ - db::{save_changelog_event, upsert_asset_with_seq}, - u32_to_u8_array, - }, - error::{ProgramTransformerError, ProgramTransformerResult}, - }, + crate::error::{ProgramTransformerError, ProgramTransformerResult}, blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}, - digital_asset_types::dao::asset, - sea_orm::{ - entity::{ActiveValue, EntityTrait}, - query::QueryTrait, - sea_query::query::OnConflict, - ConnectionTrait, DbBackend, TransactionTrait, - }, - solana_sdk::pubkey::Pubkey, - tracing::debug, + sea_orm::{query::QueryTrait, ConnectionTrait, TransactionTrait}, }; pub async fn finalize_tree_with_root<'c, T>( parsing_result: &BubblegumInstruction, bundle: &InstructionBundle<'c>, txn: &'c T, - instruction: &str, - cl_audits: bool, ) -> ProgramTransformerResult<()> - where - T: ConnectionTrait + TransactionTrait, +where + T: ConnectionTrait + TransactionTrait, { - if let Some(cl) = &parsing_result.tree_update { - let seq = save_changelog_event(cl, bundle.slot, bundle.txn_id, txn, instruction, cl_audits) - .await?; - let leaf_index = cl.index; - let (asset_id, _) = Pubkey::find_program_address( - &[ - "asset".as_bytes(), - cl.id.as_ref(), - u32_to_u8_array(leaf_index).as_ref(), - ], - &mpl_bubblegum::ID, - ); - debug!("Indexing burn for asset id: {:?}", asset_id); - let id_bytes = asset_id.to_bytes(); - - let asset_model = asset::ActiveModel { - id: ActiveValue::Set(id_bytes.to_vec()), - burnt: ActiveValue::Set(true), - ..Default::default() - }; - - // Begin a transaction. If the transaction goes out of scope (i.e. one of the executions has - // an error and this function returns it using the `?` operator), then the transaction is - // automatically rolled back. - let multi_txn = txn.begin().await?; - - // Upsert asset table `burnt` column. Note we don't check for decompression (asset.seq = 0) - // because we know if the item was burnt it could not have been decompressed later. - let query = asset::Entity::insert(asset_model) - .on_conflict( - OnConflict::columns([asset::Column::Id]) - .update_columns([asset::Column::Burnt]) - .to_owned(), - ) - .build(DbBackend::Postgres); - multi_txn.execute(query).await?; - - upsert_asset_with_seq(&multi_txn, id_bytes.to_vec(), seq as i64).await?; - - multi_txn.commit().await?; - + if let Some(Payload::CreateTreeWithRoot { args, .. }) = &parsing_result.payload { + digital_asset_types::dao::rollup_to_verify::ActiveModel { + file_hash: Set(args.metadata_hash.clone()), + url: Set(args.metadata_url.clone()), + created_at_slot: Set(bundle.slot as i64), + signature: Set(Signature::from_str(bundle.txn_id) + .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))? + .into()), + download_attempts: Set(0), + rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), + rollup_fail_status: Set(None), + } + .insert(txn) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; return Ok(()); } + Err(ProgramTransformerError::ParsingError( "Ix not parsed correctly".to_string(), )) } +pub async fn store_rollup_update<'c, T>( + slot: u64, + signature: Signature, + rollup: &Rollup, + txn: &'c T, + cl_audits: bool, +) -> ProgramTransformerResult<()> +where + T: ConnectionTrait + TransactionTrait, +{ + for rolled_mint in rollup.rolled_mints.iter() { + bubblegum::mint_v1::mint_v1( + &rolled_mint.into(), + &InstructionBundle { + txn_id: &signature.to_string(), + program: Default::default(), + instruction: None, + inner_ix: None, + keys: &[], + slot, + }, + txn, + "CreateTreeWithRoot", + cl_audits, + )?; + } + + Ok(()) +} diff --git a/program_transformers/src/bubblegum/merkle_tree_wrapper.rs b/program_transformers/src/bubblegum/merkle_tree_wrapper.rs index 2c931f92c..91574d0a5 100644 --- a/program_transformers/src/bubblegum/merkle_tree_wrapper.rs +++ b/program_transformers/src/bubblegum/merkle_tree_wrapper.rs @@ -1,4 +1,7 @@ -use crate::error::ProgramTransformerError; +use crate::bubblegum; +use crate::bubblegum::rollup_persister::Rollup; +use crate::error::{ProgramTransformerError, RollupValidationError}; +use anchor_lang::solana_program::keccak::Hash; use spl_account_compression::{ConcurrentMerkleTree, ConcurrentMerkleTreeError, Node}; use spl_concurrent_merkle_tree::changelog::ChangeLog; use std::slice::Iter; @@ -228,3 +231,69 @@ pub fn make_concurrent_merkle_tree( } make_changelog_impls!(3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 26, 30); + +pub fn validate_change_logs( + max_depth: u32, + max_buffer_size: u32, + leafs: &[[u8; 32]], + rollup: &Rollup, +) -> Result<(), RollupValidationError> { + let mut tree = make_concurrent_merkle_tree(max_depth, max_buffer_size)?; + tree.initialize()?; + for (i, leaf_hash) in leafs.iter().enumerate() { + tree.append(*leaf_hash)?; + let changelog = tree.change_logs(tree.active_index() as usize); + let path_len = changelog.path_len() as u32; + let mut path: Vec = changelog + .path_iter() + .enumerate() + .map(|(lvl, n)| { + spl_account_compression::state::PathNode::new( + *n, + (1 << (path_len - lvl as u32)) + (changelog.index() >> lvl), + ) + }) + .collect(); + path.push(spl_account_compression::state::PathNode::new( + changelog.root(), + 1, + )); + + match rollup.rolled_mints.get(i) { + Some(mint) => { + if mint.tree_update.path + != path + .into_iter() + .map(Into::::into) + .collect::>() + { + return Err(RollupValidationError::WrongAssetPath( + mint.leaf_update.id().to_string(), + )); + } + if mint.tree_update.id != rollup.tree_id { + return Err(RollupValidationError::WrongTreeIdForChangeLog( + mint.leaf_update.id().to_string(), + rollup.tree_id.to_string(), + mint.tree_update.id.to_string(), + )); + } + if mint.tree_update.index != changelog.index() { + return Err(RollupValidationError::WrongChangeLogIndex( + mint.leaf_update.id().to_string(), + changelog.index(), + mint.tree_update.index, + )); + } + } + None => return Err(RollupValidationError::NoRelevantRolledMint(i as u64)), + } + } + if tree.get_root() != rollup.merkle_root { + return Err(RollupValidationError::InvalidRoot( + Hash::new(tree.get_root().as_slice()).to_string(), + Hash::new(rollup.merkle_root.as_slice()).to_string(), + )); + } + Ok(()) +} diff --git a/program_transformers/src/bubblegum/mod.rs b/program_transformers/src/bubblegum/mod.rs index f2f771c78..c6d6026fa 100644 --- a/program_transformers/src/bubblegum/mod.rs +++ b/program_transformers/src/bubblegum/mod.rs @@ -24,9 +24,9 @@ mod finalize_tree_with_root; mod merkle_tree_wrapper; mod mint_v1; mod redeem; +mod rollup_persister; mod transfer; mod update_metadata; -mod rollup_persister; pub async fn handle_bubblegum_instruction<'c, T>( parsing_result: &'c BubblegumInstruction, @@ -113,6 +113,12 @@ where .map_err(ProgramTransformerError::DownloadMetadataNotify)?; } } + InstructionName::CreateTreeWithRoot => { + finalize_tree_with_root::finalize_tree_with_root(parsing_result, bundle, txn) + .await? + .map(From::from) + .map(Ok)? + } _ => debug!("Bubblegum: Not Implemented Instruction"), } Ok(()) diff --git a/program_transformers/src/bubblegum/rollup_persister.rs b/program_transformers/src/bubblegum/rollup_persister.rs index 6eefe43b3..e621915df 100644 --- a/program_transformers/src/bubblegum/rollup_persister.rs +++ b/program_transformers/src/bubblegum/rollup_persister.rs @@ -1,24 +1,32 @@ +use anchor_lang::AnchorSerialize; +use std::collections::HashMap; use std::ops::Deref; use std::{sync::Arc, time::Duration}; -use std::collections::HashMap; -use anchor_lang::AnchorSerialize; +use crate::bubblegum; +use crate::error::{ProgramTransformerError, RollupValidationError}; use async_trait::async_trait; +use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; +use digital_asset_types::dao::prelude::RollupToVerify; +use digital_asset_types::dao::rollup_to_verify; +use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; +use mockall::automock; +use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; +use mpl_bubblegum::utils::get_asset_id; +use mpl_bubblegum::{InstructionName, LeafSchemaEvent}; +use sea_orm::ActiveValue::Set; +use sea_orm::{ActiveModelTrait, Condition, ConnectionTrait, EntityTrait}; use serde_derive::{Deserialize, Serialize}; use serde_json::value::RawValue; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; -use tracing::{error, info}; +use solana_sdk::signature::Signature; use tokio::{sync::broadcast::Receiver, task::JoinError, time::Instant}; -use blockbuster::programs::bubblegum::BubblegumInstruction; -use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; -use mpl_bubblegum::utils::get_asset_id; -use crate::error::RollupValidationError; +use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; - #[derive(Serialize, Deserialize, Clone)] pub struct Rollup { #[serde(with = "serde_with::As::")] @@ -130,17 +138,28 @@ impl From<&RolledMintInstruction> for BubblegumInstruction { } } -pub struct RollupPersister { - rocks_client: Arc, +#[automock] +#[async_trait] +pub trait RollupDownloader { + async fn download_rollup(&self, url: &str) -> Result, ProgramTransformerError>; + async fn download_rollup_and_check_checksum( + &self, + url: &str, + checksum: &str, + ) -> Result, ProgramTransformerError>; +} + +pub struct RollupPersister { + txn: Arc, downloader: D, - metrics: Arc, + cl_audits: bool, } pub struct RollupDownloaderForPersister {} #[async_trait] impl RollupDownloader for RollupDownloaderForPersister { - async fn download_rollup(&self, url: &str) -> Result, UsecaseError> { + async fn download_rollup(&self, url: &str) -> Result, RollupValidationError> { let response = reqwest::get(url).await?.bytes().await?; Ok(Box::new(serde_json::from_slice(&response)?)) } @@ -149,27 +168,26 @@ impl RollupDownloader for RollupDownloaderForPersister { &self, url: &str, checksum: &str, - ) -> Result, UsecaseError> { + ) -> Result, RollupValidationError> { let response = reqwest::get(url).await?.bytes().await?; let file_hash = xxhash_rust::xxh3::xxh3_128(&response); let hash_hex = hex::encode(file_hash.to_be_bytes()); if hash_hex != checksum { - return Err(UsecaseError::HashMismatch(checksum.to_string(), hash_hex)); + return Err(RollupValidationError::InvalidDataHash( + checksum.to_string(), + hash_hex, + )); } Ok(Box::new(serde_json::from_slice(&response)?)) } } -impl RollupPersister { - pub fn new( - rocks_client: Arc, - downloader: D, - metrics: Arc, - ) -> Self { +impl RollupPersister { + pub fn new(txn: Arc, downloader: D, cl_audits: bool) -> Self { Self { - rocks_client, + txn, downloader, - metrics, + cl_audits, } } @@ -200,14 +218,13 @@ impl RollupPersister { pub async fn persist_rollup( &self, rx: &Receiver<()>, - mut rollup_to_verify: RollupToVerify, + mut rollup_to_verify: rollup_to_verify::Model, mut rollup: Option>, ) { - let start_time = Instant::now(); info!("Persisting {} rollup", &rollup_to_verify.url); while rx.is_empty() { - match (&rollup_to_verify.persisting_state, &rollup) { - (&PersistingRollupState::ReceivedTransaction, _) | (_, None) => { + match &rollup_to_verify.rollup_persisting_state { + &RollupPersistingState::ReceivedTransaction => { if let Err(err) = self .download_rollup(&mut rollup_to_verify, &mut rollup) .await @@ -215,23 +232,32 @@ impl RollupPersister { error!("Error during rollup downloading: {}", err) }; } - (&PersistingRollupState::SuccessfullyDownload, Some(r)) => { - self.validate_rollup(&mut rollup_to_verify, r).await; + &RollupPersistingState::SuccessfullyDownload => { + if let Some(r) = &rollup { + self.validate_rollup(&mut rollup_to_verify, r).await; + } else { + error!( + "Trying to validate non downloaded rollup: {:#?}", + &rollup_to_verify + ) + } } - (&PersistingRollupState::SuccessfullyValidate, Some(r)) => { - self.store_rollup_update(&mut rollup_to_verify, r).await; + &RollupPersistingState::SuccessfullyValidate => { + if let Some(r) = &rollup { + self.store_rollup_update(&mut rollup_to_verify, r).await; + } else { + error!( + "Trying to store update for non downloaded rollup: {:#?}", + &rollup_to_verify + ) + } } - (&PersistingRollupState::FailedToPersist, _) - | (&PersistingRollupState::StoredUpdate, _) => { + &RollupPersistingState::FailedToPersist | &RollupPersistingState::StoredUpdate => { self.drop_rollup_from_queue(rollup_to_verify.file_hash.clone()) .await; info!( "Finish processing {} rollup file with {:?} state", - &rollup_to_verify.url, &rollup_to_verify.persisting_state - ); - self.metrics.set_persisting_latency( - "rollup_persisting", - start_time.elapsed().as_millis() as f64, + &rollup_to_verify.url, &rollup_to_verify.rollup_persisting_state ); return; } @@ -241,26 +267,30 @@ impl RollupPersister { async fn get_rollup_to_verify( &self, - ) -> Result<(Option, Option>), IngesterError> { - match self.rocks_client.fetch_rollup_for_verifying().await { - Ok((Some(rollup_to_verify), rollup_data)) => { - Ok((Some(rollup_to_verify), rollup_data.map(Box::new))) - } - Ok((None, _)) => Ok((None, None)), - Err(e) => { - self.metrics - .inc_rollups_with_status("rollup_fetch", MetricStatus::FAILURE); - error!("Failed to fetch rollup for verifying: {}", e); - Err(e.into()) - } - } + ) -> Result<(Option, Option>), ProgramTransformerError> + { + let condition = Condition::all() + .add( + rollup_to_verify::Column::RollupPersistingState + .ne(RollupPersistingState::FailedToPersist), + ) + .add( + rollup_to_verify::Column::RollupPersistingState + .ne(RollupPersistingState::StoredUpdate), + ); + + rollup_to_verify::Entity::find() + .filter(condition) + .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) + .one(self.txn.as_ref()) + .await } async fn download_rollup( &self, - rollup_to_verify: &mut RollupToVerify, + rollup_to_verify: &mut rollup_to_verify::Model, rollup: &mut Option>, - ) -> Result<(), IngesterError> { + ) -> Result<(), ProgramTransformerError> { if rollup.is_some() { return Ok(()); } @@ -273,56 +303,45 @@ impl RollupPersister { .await { Ok(r) => { - self.metrics - .inc_rollups_with_status("rollup_download", MetricStatus::SUCCESS); if let Err(e) = self .rocks_client .rollups .put(rollup_to_verify.file_hash.clone(), r.deref().clone()) { - self.metrics - .inc_rollups_with_status("persist_rollup", MetricStatus::FAILURE); return Err(e.into()); } *rollup = Some(r); - rollup_to_verify.persisting_state = PersistingRollupState::SuccessfullyDownload; + rollup_to_verify.rollup_persisting_state = + RollupPersistingState::SuccessfullyDownload; } Err(e) => { - if let UsecaseError::HashMismatch(expected, actual) = e { - rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; - self.metrics - .inc_rollups_with_status("rollup_checksum_verify", MetricStatus::FAILURE); + if let RollupValidationError::InvalidDataHash(expected, actual) = e { + rollup_to_verify.rollup_persisting_state = + RollupPersistingState::FailedToPersist; self.save_rollup_as_failed( - FailedRollupState::ChecksumVerifyFailed, + RollupFailStatus::ChecksumVerifyFailed, rollup_to_verify, - )?; + ) + .await?; - return Err(IngesterError::RollupValidation( + return Err(ProgramTransformerError::RollupValidation( RollupValidationError::FileChecksumMismatch(expected, actual), )); } - if let UsecaseError::Serialization(e) = e { - rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; - self.metrics.inc_rollups_with_status( - "rollup_file_deserialization", - MetricStatus::FAILURE, - ); + if let ProgramTransformerError::Serialization(e) = e { + rollup_to_verify.rollup_persisting_state = + RollupPersistingState::FailedToPersist; self.save_rollup_as_failed( - FailedRollupState::FileSerialization, + RollupFailStatus::FileSerialization, rollup_to_verify, )?; - return Err(IngesterError::SerializatonError(e)); + return Err(ProgramTransformerError::SerializatonError(e)); } - - self.metrics - .inc_rollups_with_status("rollup_download", MetricStatus::FAILURE); if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS { - rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; - self.save_rollup_as_failed( - FailedRollupState::DownloadFailed, - rollup_to_verify, - )?; + rollup_to_verify.rollup_persisting_state = + RollupPersistingState::FailedToPersist; + self.save_rollup_as_failed(RollupFailStatus::DownloadFailed, rollup_to_verify)?; } else { rollup_to_verify.download_attempts = rollup_to_verify.download_attempts + 1; if let Err(e) = self.rocks_client.rollup_to_verify.put( @@ -333,93 +352,87 @@ impl RollupPersister { created_at_slot: rollup_to_verify.created_at_slot, signature: rollup_to_verify.signature, download_attempts: rollup_to_verify.download_attempts + 1, - persisting_state: PersistingRollupState::FailedToPersist, + persisting_state: RollupPersistingState::FailedToPersist, }, ) { - self.metrics.inc_rollups_with_status( - "rollup_attempts_update", - MetricStatus::FAILURE, - ); return Err(e.into()); } - self.metrics - .inc_rollups_with_status("rollup_attempts_update", MetricStatus::SUCCESS); } - return Err(IngesterError::Usecase(e.to_string())); + return Err(ProgramTransformerError::Usecase(e.to_string())); } } Ok(()) } - async fn validate_rollup(&self, rollup_to_verify: &mut RollupToVerify, rollup: &Rollup) { - if let Err(e) = crate::rollup::rollup_verifier::validate_rollup(rollup).await { - self.metrics - .inc_rollups_with_status("rollup_validating", MetricStatus::FAILURE); + async fn validate_rollup( + &self, + rollup_to_verify: &mut rollup_to_verify::Model, + rollup: &Rollup, + ) { + if let Err(e) = validate_rollup(rollup).await { error!("Error while validating rollup: {}", e.to_string()); - rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; if let Err(err) = - self.save_rollup_as_failed(FailedRollupState::RollupVerifyFailed, rollup_to_verify) + self.save_rollup_as_failed(RollupFailStatus::RollupVerifyFailed, rollup_to_verify) { error!("Save rollup as failed: {}", err); }; return; } - self.metrics - .inc_rollups_with_status("rollup_validating", MetricStatus::SUCCESS); - rollup_to_verify.persisting_state = PersistingRollupState::SuccessfullyValidate; + rollup_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyValidate; } - async fn store_rollup_update(&self, rollup_to_verify: &mut RollupToVerify, rollup: &Rollup) { - if BubblegumTxProcessor::store_rollup_update( - rollup_to_verify.created_at_slot, + async fn store_rollup_update( + &self, + rollup_to_verify: &mut rollup_to_verify::Model, + rollup: &Rollup, + ) { + if bubblegum::finalize_tree_with_root::store_rollup_update( + rollup_to_verify.created_at_slot as u64, + Signature::try_from(rollup_to_verify.signature.clone()) + .map_err(|e| ProgramTransformerError::SerializatonError(format!("{:?}", e)))?, rollup, - self.rocks_client.clone(), - rollup_to_verify.signature, + self.txn.as_ref(), + self.cl_audits, ) - .await - .is_err() + .await + .is_err() { - self.metrics - .inc_rollups_with_status("rollup_persist", MetricStatus::FAILURE); - rollup_to_verify.persisting_state = PersistingRollupState::FailedToPersist; + rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; return; } - self.metrics - .inc_rollups_with_status("rollup_persist", MetricStatus::SUCCESS); - rollup_to_verify.persisting_state = PersistingRollupState::StoredUpdate; + rollup_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; } - fn save_rollup_as_failed( + async fn save_rollup_as_failed( &self, - status: FailedRollupState, - rollup: &RollupToVerify, - ) -> Result<(), IngesterError> { - let key = FailedRollupKey { - status: status.clone(), - hash: rollup.file_hash.clone(), - }; - let value = FailedRollup { - status, - file_hash: rollup.file_hash.clone(), - url: rollup.url.clone(), - created_at_slot: rollup.created_at_slot, - signature: rollup.signature, - download_attempts: rollup.download_attempts + 1, - }; - if let Err(e) = self.rocks_client.failed_rollups.put(key, value) { - self.metrics - .inc_rollups_with_status("rollup_mark_as_failure", MetricStatus::FAILURE); - return Err(e.into()); + status: RollupFailStatus, + rollup: &rollup_to_verify::Model, + ) -> Result<(), ProgramTransformerError> { + rollup_to_verify::ActiveModel { + file_hash: Set(rollup.file_hash.clone()), + url: Set(rollup.url.clone()), + created_at_slot: Set(rollup.created_at_slot), + signature: Set(rollup.signature.clone()), + download_attempts: Set(rollup.download_attempts), + rollup_persisting_state: Set(rollup.rollup_persisting_state.clone()), + rollup_fail_status: Set(Some(status)), } + .insert(self.txn.as_ref()) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; Ok(()) } async fn drop_rollup_from_queue(&self, file_hash: String) { - if let Err(e) = self.rocks_client.drop_rollup_from_queue(file_hash).await { - self.metrics - .inc_rollups_with_status("rollup_queue_clear", MetricStatus::FAILURE); - error!("Rollup queue clear: {}", e) + if let Some(existing_rollup) = rollup_to_verify::Entity::find_by_id(file_hash.clone()) + .one(self.txn.as_ref()) + .await? + { + let mut active_model: rollup_to_verify::ActiveModel = existing_rollup.into(); + active_model.rollup_persisting_state = Set(RollupPersistingState::StoredUpdate); + active_model.update(self.txn.as_ref()).await?; } } } @@ -436,7 +449,7 @@ async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { leaf_hashes.push(leaf_hash); } - usecase::merkle_tree::validate_change_logs( + bubblegum::merkle_tree_wrapper::validate_change_logs( rollup.max_depth, rollup.max_buffer_size, &leaf_hashes, diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index db6c37b10..c402a81a0 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -1,3 +1,4 @@ +use thiserror::Error; use {blockbuster::error::BlockbusterError, sea_orm::DbErr}; pub type ProgramTransformerResult = Result; @@ -24,6 +25,8 @@ pub enum ProgramTransformerError { DownloadMetadataNotify(Box), #[error("Unexpected tree depth={0} and max size={1}")] UnexpectedTreeSize(u32, u32), + #[error("RollupValidation: {0}")] + RollupValidation(#[from] RollupValidationError), } impl From for ProgramTransformerError { From adfbd45741795bc8136385f3297ac01217ad33a3 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 11 Jun 2024 18:29:42 +0300 Subject: [PATCH 03/34] wip --- Cargo.lock | 21 +- Cargo.toml | 6 +- digital_asset_types/src/dao/generated/mod.rs | 1 + .../src/dao/generated/prelude.rs | 1 + .../src/dao/generated/rollup.rs | 58 +++++ .../src/dao/generated/rollup_to_verify.rs | 4 +- .../src/dao/generated/sea_orm_active_enums.rs | 208 +++++++++--------- docker-compose.yaml | 2 +- ...alize_tree_with_root_instruction_handle.rs | 37 +++- nft_ingester/src/main.rs | 15 ++ program_transformers/Cargo.toml | 3 + .../src/bubblegum/finalize_tree_with_root.rs | 40 +--- program_transformers/src/bubblegum/mod.rs | 9 +- program_transformers/src/error.rs | 19 +- program_transformers/src/lib.rs | 1 + .../merkle_tree_wrapper.rs | 12 +- program_transformers/src/rollups/mod.rs | 2 + .../rollup_persister.rs | 188 ++++++++++------ 18 files changed, 378 insertions(+), 249 deletions(-) create mode 100644 digital_asset_types/src/dao/generated/rollup.rs rename program_transformers/src/{bubblegum => rollups}/merkle_tree_wrapper.rs (96%) create mode 100644 program_transformers/src/rollups/mod.rs rename program_transformers/src/{bubblegum => rollups}/rollup_persister.rs (75%) diff --git a/Cargo.lock b/Cargo.lock index e8e8542cd..25d44176f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3699,7 +3699,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "serde", - "serde_with 3.6.1", + "serde_with 3.8.1", "solana-program", "solana-program-test", "solana-sdk", @@ -3725,7 +3725,7 @@ dependencies = [ "rmp-serde", "serde", "serde_json", - "serde_with 3.6.1", + "serde_with 3.8.1", "solana-program", "thiserror", ] @@ -3740,7 +3740,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "serde", - "serde_with 3.6.1", + "serde_with 3.8.1", "solana-program", "thiserror", ] @@ -4570,6 +4570,7 @@ version = "0.7.2" dependencies = [ "anchor-lang", "async-trait", + "bincode", "blockbuster", "bs58 0.4.0", "cadence", @@ -4584,8 +4585,10 @@ dependencies = [ "paste", "reqwest", "sea-orm", + "serde", "serde_derive", "serde_json", + "serde_with 3.8.1", "solana-sdk", "solana-transaction-status", "spl-account-compression", @@ -5711,11 +5714,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", "chrono", "hex", "indexmap 1.9.3", @@ -5723,7 +5726,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros 3.6.1", + "serde_with_macros 3.8.1", "time 0.3.29", ] @@ -5741,9 +5744,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 44b791e60..de69ab3e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,7 @@ log = "0.4.17" metrics = "0.20.1" migration = {path = "migration"} mime_guess = "2.0.4" -mpl-bubblegum = { path = "blockbuster/mpl-bubblegum/clients/rust" } +mpl-bubblegum = { path = "blockbuster/mpl-bubblegum/clients/rust", features = ["serde"] } mpl-core = { git = "https://github.com/RequescoS/mpl-core.git", features = ["serde"] } mpl-token-metadata = "4.1.1" nft_ingester = {path = "nft_ingester"} @@ -124,9 +124,11 @@ wasi = "0.7.0" wasm-bindgen = "0.2.83" triomphe = "=0.1.9" paste = "1" -serde_derive = "1.0.195" +serde_derive = "1.0.190" mockall = "0.11.4" xxhash-rust = { version = "0.8.10", features = ["xxh3"] } +serde_with = "3.8.1" +bincode = "1.3.3" [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/digital_asset_types/src/dao/generated/mod.rs b/digital_asset_types/src/dao/generated/mod.rs index 394e37c32..bc6869ff4 100644 --- a/digital_asset_types/src/dao/generated/mod.rs +++ b/digital_asset_types/src/dao/generated/mod.rs @@ -12,6 +12,7 @@ pub mod backfill_items; pub mod cl_audits_v2; pub mod cl_items; pub mod raw_txn; +pub mod rollup; pub mod rollup_to_verify; pub mod sea_orm_active_enums; pub mod tasks; diff --git a/digital_asset_types/src/dao/generated/prelude.rs b/digital_asset_types/src/dao/generated/prelude.rs index 9b97c118a..506e26bae 100644 --- a/digital_asset_types/src/dao/generated/prelude.rs +++ b/digital_asset_types/src/dao/generated/prelude.rs @@ -10,6 +10,7 @@ pub use super::backfill_items::Entity as BackfillItems; pub use super::cl_audits_v2::Entity as ClAuditsV2; pub use super::cl_items::Entity as ClItems; pub use super::raw_txn::Entity as RawTxn; +pub use super::rollup::Entity as Rollup; pub use super::rollup_to_verify::Entity as RollupToVerify; pub use super::tasks::Entity as Tasks; pub use super::token_accounts::Entity as TokenAccounts; diff --git a/digital_asset_types/src/dao/generated/rollup.rs b/digital_asset_types/src/dao/generated/rollup.rs new file mode 100644 index 000000000..f9105bcc1 --- /dev/null +++ b/digital_asset_types/src/dao/generated/rollup.rs @@ -0,0 +1,58 @@ +//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 + +use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; + +#[derive(Copy, Clone, Default, Debug, DeriveEntity)] +pub struct Entity; + +impl EntityName for Entity { + fn table_name(&self) -> &str { + "rollup" + } +} + +#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)] +pub struct Model { + pub file_hash: String, + pub rollup_binary_bincode: Vec, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] +pub enum Column { + FileHash, + RollupBinaryBincode, +} + +#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] +pub enum PrimaryKey { + FileHash, +} + +impl PrimaryKeyTrait for PrimaryKey { + type ValueType = String; + fn auto_increment() -> bool { + false + } +} + +#[derive(Copy, Clone, Debug, EnumIter)] +pub enum Relation {} + +impl ColumnTrait for Column { + type EntityName = Entity; + fn def(&self) -> ColumnDef { + match self { + Self::FileHash => ColumnType::String(None).def(), + Self::RollupBinaryBincode => ColumnType::Binary.def(), + } + } +} + +impl RelationTrait for Relation { + fn def(&self) -> RelationDef { + panic!("No RelationDef") + } +} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/digital_asset_types/src/dao/generated/rollup_to_verify.rs b/digital_asset_types/src/dao/generated/rollup_to_verify.rs index ec7fd14e3..26b885e1f 100644 --- a/digital_asset_types/src/dao/generated/rollup_to_verify.rs +++ b/digital_asset_types/src/dao/generated/rollup_to_verify.rs @@ -19,7 +19,7 @@ pub struct Model { pub file_hash: String, pub url: String, pub created_at_slot: i64, - pub signature: Vec, + pub signature: String, pub download_attempts: i32, pub rollup_persisting_state: RollupPersistingState, pub rollup_fail_status: Option, @@ -58,7 +58,7 @@ impl ColumnTrait for Column { Self::FileHash => ColumnType::String(None).def(), Self::Url => ColumnType::String(None).def(), Self::CreatedAtSlot => ColumnType::BigInteger.def(), - Self::Signature => ColumnType::Binary.def(), + Self::Signature => ColumnType::String(None).def(), Self::DownloadAttempts => ColumnType::Integer.def(), Self::RollupPersistingState => RollupPersistingState::db_type(), Self::RollupFailStatus => RollupFailStatus::db_type().null(), diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index 0114d0e80..e2edf4230 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -3,39 +3,111 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] +pub enum RollupFailStatus { + #[sea_orm(string_value = "checksum_verify_failed")] + ChecksumVerifyFailed, + #[sea_orm(string_value = "download_failed")] + DownloadFailed, + #[sea_orm(string_value = "file_serialization")] + FileSerialization, + #[sea_orm(string_value = "rollup_verify_failed")] + RollupVerifyFailed, +} #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", - enum_name = "royalty_target_type" + enum_name = "v1_account_attachments" )] -pub enum RoyaltyTargetType { - #[sea_orm(string_value = "creators")] - Creators, - #[sea_orm(string_value = "fanout")] - Fanout, - #[sea_orm(string_value = "single")] - Single, +pub enum V1AccountAttachments { + #[sea_orm(string_value = "edition")] + Edition, + #[sea_orm(string_value = "edition_marker")] + EditionMarker, + #[sea_orm(string_value = "master_edition_v1")] + MasterEditionV1, + #[sea_orm(string_value = "master_edition_v2")] + MasterEditionV2, #[sea_orm(string_value = "unknown")] Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] -pub enum OwnerType { - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "token")] - Token, +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "rollup_persisting_state" +)] +pub enum RollupPersistingState { + #[sea_orm(string_value = "failed_to_persist")] + FailedToPersist, + #[sea_orm(string_value = "received_transaction")] + ReceivedTransaction, + #[sea_orm(string_value = "stored_update")] + StoredUpdate, + #[sea_orm(string_value = "successfully_download")] + SuccessfullyDownload, + #[sea_orm(string_value = "successfully_validate")] + SuccessfullyValidate, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "specification_asset_class" +)] +pub enum SpecificationAssetClass { + #[sea_orm(string_value = "FUNGIBLE_ASSET")] + FungibleAsset, + #[sea_orm(string_value = "FUNGIBLE_TOKEN")] + FungibleToken, + #[sea_orm(string_value = "IDENTITY_NFT")] + IdentityNft, + #[sea_orm(string_value = "MPL_CORE_ASSET")] + MplCoreAsset, + #[sea_orm(string_value = "MPL_CORE_COLLECTION")] + MplCoreCollection, + #[sea_orm(string_value = "NFT")] + Nft, + #[sea_orm(string_value = "NON_TRANSFERABLE_NFT")] + NonTransferableNft, + #[sea_orm(string_value = "PRINT")] + Print, + #[sea_orm(string_value = "PRINTABLE_NFT")] + PrintableNft, + #[sea_orm(string_value = "PROGRAMMABLE_NFT")] + ProgrammableNft, + #[sea_orm(string_value = "TRANSFER_RESTRICTED_NFT")] + TransferRestrictedNft, #[sea_orm(string_value = "unknown")] Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] -pub enum ChainMutability { - #[sea_orm(string_value = "immutable")] - Immutable, - #[sea_orm(string_value = "mutable")] - Mutable, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] +pub enum TaskStatus { + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "running")] + Running, + #[sea_orm(string_value = "success")] + Success, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "royalty_target_type" +)] +pub enum RoyaltyTargetType { + #[sea_orm(string_value = "creators")] + Creators, + #[sea_orm(string_value = "fanout")] + Fanout, + #[sea_orm(string_value = "single")] + Single, #[sea_orm(string_value = "unknown")] Unknown, } @@ -76,36 +148,6 @@ pub enum Instruction { VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "rollup_persisting_state" -)] -pub enum RollupPersistingState { - #[sea_orm(string_value = "failed_to_persist")] - FailedToPersist, - #[sea_orm(string_value = "received_transaction")] - ReceivedTransaction, - #[sea_orm(string_value = "stored_update")] - StoredUpdate, - #[sea_orm(string_value = "successfully_download")] - SuccessfullyDownload, - #[sea_orm(string_value = "successfully_validate")] - SuccessfullyValidate, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] -pub enum TaskStatus { - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "running")] - Running, - #[sea_orm(string_value = "success")] - Success, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] pub enum Mutability { #[sea_orm(string_value = "immutable")] @@ -132,64 +174,22 @@ pub enum SpecificationVersions { V2, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] -pub enum RollupFailStatus { - #[sea_orm(string_value = "checksum_verify_failed")] - ChecksumVerifyFailed, - #[sea_orm(string_value = "download_failed")] - DownloadFailed, - #[sea_orm(string_value = "file_serialization")] - FileSerialization, - #[sea_orm(string_value = "rollup_verify_failed")] - RollupVerifyFailed, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "v1_account_attachments" -)] -pub enum V1AccountAttachments { - #[sea_orm(string_value = "edition")] - Edition, - #[sea_orm(string_value = "edition_marker")] - EditionMarker, - #[sea_orm(string_value = "master_edition_v1")] - MasterEditionV1, - #[sea_orm(string_value = "master_edition_v2")] - MasterEditionV2, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] +pub enum OwnerType { + #[sea_orm(string_value = "single")] + Single, + #[sea_orm(string_value = "token")] + Token, #[sea_orm(string_value = "unknown")] Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "specification_asset_class" -)] -pub enum SpecificationAssetClass { - #[sea_orm(string_value = "FUNGIBLE_ASSET")] - FungibleAsset, - #[sea_orm(string_value = "FUNGIBLE_TOKEN")] - FungibleToken, - #[sea_orm(string_value = "IDENTITY_NFT")] - IdentityNft, - #[sea_orm(string_value = "MPL_CORE_ASSET")] - MplCoreAsset, - #[sea_orm(string_value = "MPL_CORE_COLLECTION")] - MplCoreCollection, - #[sea_orm(string_value = "NFT")] - Nft, - #[sea_orm(string_value = "NON_TRANSFERABLE_NFT")] - NonTransferableNft, - #[sea_orm(string_value = "PRINT")] - Print, - #[sea_orm(string_value = "PRINTABLE_NFT")] - PrintableNft, - #[sea_orm(string_value = "PROGRAMMABLE_NFT")] - ProgrammableNft, - #[sea_orm(string_value = "TRANSFER_RESTRICTED_NFT")] - TransferRestrictedNft, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] +pub enum ChainMutability { + #[sea_orm(string_value = "immutable")] + Immutable, + #[sea_orm(string_value = "mutable")] + Mutable, #[sea_orm(string_value = "unknown")] Unknown, } diff --git a/docker-compose.yaml b/docker-compose.yaml index a8b4567e9..45d82bf88 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -90,7 +90,7 @@ services: image: 'postgres:14' command: [ "postgres", "-c", "log_statement=all", "-c", "log_destination=stderr" ,"-c","max_connections=200" ] ports: - - 5433:5432 + - 5434:5432 environment: POSTGRES_USER: solana # The PostgreSQL user (useful to connect to the database) POSTGRES_PASSWORD: solana # The PostgreSQL password (useful to connect to the database) diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 305aafa39..28c93a6b2 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -1,6 +1,6 @@ use enum_iterator::all; use enum_iterator_derive::Sequence; -use sea_orm::sea_query::extension::postgres::{Type, TypeCreateStatement}; +use sea_orm::sea_query::extension::postgres::Type; use sea_orm_migration::prelude::*; #[derive(DeriveMigrationName)] @@ -9,7 +9,6 @@ pub struct Migration; #[async_trait::async_trait] impl MigrationTrait for Migration { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { - // Create enums manager .create_type( Type::create() @@ -39,7 +38,6 @@ impl MigrationTrait for Migration { ) .await?; - // Create RollupToVerify table manager .create_table( Table::create() @@ -59,7 +57,7 @@ impl MigrationTrait for Migration { ) .col( ColumnDef::new(RollupToVerify::Signature) - .binary() + .string() .not_null(), ) .col( @@ -87,7 +85,6 @@ impl MigrationTrait for Migration { ) .await?; - // Create indexes manager .create_index( Index::create() @@ -99,6 +96,26 @@ impl MigrationTrait for Migration { ) .await?; + manager + .create_table( + Table::create() + .table(Rollup::Table) + .if_not_exists() + .col( + ColumnDef::new(Rollup::FileHash) + .string() + .not_null() + .primary_key(), + ) + .col( + ColumnDef::new(Rollup::RollupBinaryBincode) + .binary() + .not_null(), + ) + .to_owned(), + ) + .await?; + Ok(()) } @@ -106,6 +123,9 @@ impl MigrationTrait for Migration { manager .drop_table(Table::drop().table(RollupToVerify::Table).to_owned()) .await?; + manager + .drop_table(Table::drop().table(Rollup::Table).to_owned()) + .await?; Ok(()) } } @@ -138,3 +158,10 @@ enum FailedRollupState { RollupVerifyFailed, FileSerialization, } + +#[derive(Iden)] +enum Rollup { + Table, + FileHash, + RollupBinaryBincode, +} diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index caf2c26f1..7809d89bb 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -27,6 +27,11 @@ use chrono::Duration; use clap::{arg, command, value_parser}; use log::{error, info}; use plerkle_messenger::{redis_messenger::RedisMessenger, ConsumptionType}; +use program_transformers::rollups::rollup_persister::{ + RollupDownloaderForPersister, RollupPersister, +}; +use sea_orm::SqlxPostgresConnector; +use std::sync::Arc; use std::{path::PathBuf, time}; use tokio::{signal, task::JoinSet}; @@ -148,6 +153,15 @@ pub async fn main() -> Result<(), IngesterError> { } } } + + let rollup_persister = RollupPersister::new( + Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( + database_pool.clone(), + )), + RollupDownloaderForPersister {}, + config.cl_audits.unwrap_or_default(), + ); + tasks.spawn(async move { rollup_persister.persist_rollups().await }); } // Stream Size Timers ---------------------------------------- // Setup Stream Size Timers, these are small processes that run every 60 seconds and farm metrics for the size of the streams. @@ -174,6 +188,7 @@ pub async fn main() -> Result<(), IngesterError> { } } + // Don`t we need to use some graceful stop mechanism such as cancellation token? tasks.shutdown().await; Ok(()) diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 1bd1f00e7..b2472a8c5 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -35,6 +35,9 @@ mockall = { workspace = true } reqwest = { workspace = true } hex = { workspace = true } xxhash-rust = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } +bincode = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 94151d384..d8d86decb 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -1,14 +1,10 @@ -use crate::bubblegum; -use crate::bubblegum::rollup_persister::Rollup; use blockbuster::programs::bubblegum::Payload; use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; use sea_orm::{ActiveModelTrait, Set}; -use solana_sdk::signature::Signature; -use std::str::FromStr; use { crate::error::{ProgramTransformerError, ProgramTransformerResult}, blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}, - sea_orm::{query::QueryTrait, ConnectionTrait, TransactionTrait}, + sea_orm::{ConnectionTrait, TransactionTrait}, }; pub async fn finalize_tree_with_root<'c, T>( @@ -24,9 +20,7 @@ where file_hash: Set(args.metadata_hash.clone()), url: Set(args.metadata_url.clone()), created_at_slot: Set(bundle.slot as i64), - signature: Set(Signature::from_str(bundle.txn_id) - .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))? - .into()), + signature: Set(bundle.txn_id.to_string()), download_attempts: Set(0), rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), rollup_fail_status: Set(None), @@ -41,33 +35,3 @@ where "Ix not parsed correctly".to_string(), )) } - -pub async fn store_rollup_update<'c, T>( - slot: u64, - signature: Signature, - rollup: &Rollup, - txn: &'c T, - cl_audits: bool, -) -> ProgramTransformerResult<()> -where - T: ConnectionTrait + TransactionTrait, -{ - for rolled_mint in rollup.rolled_mints.iter() { - bubblegum::mint_v1::mint_v1( - &rolled_mint.into(), - &InstructionBundle { - txn_id: &signature.to_string(), - program: Default::default(), - instruction: None, - inner_ix: None, - keys: &[], - slot, - }, - txn, - "CreateTreeWithRoot", - cl_audits, - )?; - } - - Ok(()) -} diff --git a/program_transformers/src/bubblegum/mod.rs b/program_transformers/src/bubblegum/mod.rs index c6d6026fa..fd18a305f 100644 --- a/program_transformers/src/bubblegum/mod.rs +++ b/program_transformers/src/bubblegum/mod.rs @@ -21,10 +21,8 @@ mod creator_verification; mod db; mod delegate; mod finalize_tree_with_root; -mod merkle_tree_wrapper; -mod mint_v1; +pub(crate) mod mint_v1; mod redeem; -mod rollup_persister; mod transfer; mod update_metadata; @@ -114,10 +112,7 @@ where } } InstructionName::CreateTreeWithRoot => { - finalize_tree_with_root::finalize_tree_with_root(parsing_result, bundle, txn) - .await? - .map(From::from) - .map(Ok)? + finalize_tree_with_root::finalize_tree_with_root(parsing_result, bundle, txn).await? } _ => debug!("Bubblegum: Not Implemented Instruction"), } diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index c402a81a0..48fa48757 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -1,4 +1,3 @@ -use thiserror::Error; use {blockbuster::error::BlockbusterError, sea_orm::DbErr}; pub type ProgramTransformerResult = Result; @@ -23,8 +22,6 @@ pub enum ProgramTransformerError { AssetIndexError(String), #[error("Failed to notify about download metadata: {0}")] DownloadMetadataNotify(Box), - #[error("Unexpected tree depth={0} and max size={1}")] - UnexpectedTreeSize(u32, u32), #[error("RollupValidation: {0}")] RollupValidation(#[from] RollupValidationError), } @@ -69,6 +66,12 @@ pub enum RollupValidationError { Anchor(#[from] anchor_lang::error::Error), #[error("FileChecksumMismatch: expected {0}, actual file hash {1}")] FileChecksumMismatch(String, String), + #[error("Unexpected tree depth={0} and max size={1}")] + UnexpectedTreeSize(u32, u32), + #[error("Serialization: {0}")] + Serialization(String), + #[error("Reqwest: {0}")] + Reqwest(String), } impl From for RollupValidationError { @@ -76,3 +79,13 @@ impl From for RollupValidationError { RollupValidationError::StdIo(err.to_string()) } } +impl From for RollupValidationError { + fn from(value: serde_json::Error) -> Self { + Self::Serialization(value.to_string()) + } +} +impl From for RollupValidationError { + fn from(value: reqwest::Error) -> Self { + Self::Reqwest(value.to_string()) + } +} diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index edde20ca3..1d15d3de0 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -32,6 +32,7 @@ mod asset_upserts; mod bubblegum; pub mod error; mod mpl_core_program; +pub mod rollups; mod token; mod token_metadata; diff --git a/program_transformers/src/bubblegum/merkle_tree_wrapper.rs b/program_transformers/src/rollups/merkle_tree_wrapper.rs similarity index 96% rename from program_transformers/src/bubblegum/merkle_tree_wrapper.rs rename to program_transformers/src/rollups/merkle_tree_wrapper.rs index 91574d0a5..6454f4ed1 100644 --- a/program_transformers/src/bubblegum/merkle_tree_wrapper.rs +++ b/program_transformers/src/rollups/merkle_tree_wrapper.rs @@ -1,6 +1,6 @@ -use crate::bubblegum; -use crate::bubblegum::rollup_persister::Rollup; -use crate::error::{ProgramTransformerError, RollupValidationError}; +use crate::error::RollupValidationError; +use crate::rollups::rollup_persister; +use crate::rollups::rollup_persister::Rollup; use anchor_lang::solana_program::keccak::Hash; use spl_account_compression::{ConcurrentMerkleTree, ConcurrentMerkleTreeError, Node}; use spl_concurrent_merkle_tree::changelog::ChangeLog; @@ -178,7 +178,7 @@ make_tree_creator_funcs!( pub fn make_concurrent_merkle_tree( max_dapth: u32, max_buf_size: u32, -) -> Result, ProgramTransformerError> { +) -> Result, RollupValidationError> { // Note: We do not create ConcurrentMerkleTree object right inside of match statement // because of how Rust compiler reserves space for functions: // the total size of function in memory (i.e. frame size) is as big as total size of @@ -226,7 +226,7 @@ pub fn make_concurrent_merkle_tree( (30, 512) => Ok(make_concurrent_merkle_tree_30_512()), (30, 1024) => Ok(make_concurrent_merkle_tree_30_1024()), (30, 2048) => Ok(make_concurrent_merkle_tree_30_2048()), - (d, s) => Err(ProgramTransformerError::UnexpectedTreeSize(d, s)), + (d, s) => Err(RollupValidationError::UnexpectedTreeSize(d, s)), } } @@ -264,7 +264,7 @@ pub fn validate_change_logs( if mint.tree_update.path != path .into_iter() - .map(Into::::into) + .map(Into::::into) .collect::>() { return Err(RollupValidationError::WrongAssetPath( diff --git a/program_transformers/src/rollups/mod.rs b/program_transformers/src/rollups/mod.rs new file mode 100644 index 000000000..2f9a50430 --- /dev/null +++ b/program_transformers/src/rollups/mod.rs @@ -0,0 +1,2 @@ +mod merkle_tree_wrapper; +pub mod rollup_persister; diff --git a/program_transformers/src/bubblegum/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs similarity index 75% rename from program_transformers/src/bubblegum/rollup_persister.rs rename to program_transformers/src/rollups/rollup_persister.rs index e621915df..b5d7ceb7b 100644 --- a/program_transformers/src/bubblegum/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -1,28 +1,30 @@ use anchor_lang::AnchorSerialize; use std::collections::HashMap; -use std::ops::Deref; use std::{sync::Arc, time::Duration}; use crate::bubblegum; -use crate::error::{ProgramTransformerError, RollupValidationError}; +use crate::error::{ProgramTransformerError, ProgramTransformerResult, RollupValidationError}; +use crate::rollups::merkle_tree_wrapper; use async_trait::async_trait; +use blockbuster::instruction::InstructionBundle; use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; -use digital_asset_types::dao::prelude::RollupToVerify; -use digital_asset_types::dao::rollup_to_verify; use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; +use digital_asset_types::dao::{rollup, rollup_to_verify}; use mockall::automock; use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; use mpl_bubblegum::utils::get_asset_id; use mpl_bubblegum::{InstructionName, LeafSchemaEvent}; use sea_orm::ActiveValue::Set; -use sea_orm::{ActiveModelTrait, Condition, ConnectionTrait, EntityTrait}; -use serde_derive::{Deserialize, Serialize}; +use sea_orm::{ + ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, EntityTrait, IntoActiveModel, + QueryFilter, QueryOrder, TransactionTrait, +}; +use serde::{Deserialize, Serialize}; use serde_json::value::RawValue; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::Signature; -use tokio::{sync::broadcast::Receiver, task::JoinError, time::Instant}; +use tokio::task::JoinError; use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; @@ -141,15 +143,15 @@ impl From<&RolledMintInstruction> for BubblegumInstruction { #[automock] #[async_trait] pub trait RollupDownloader { - async fn download_rollup(&self, url: &str) -> Result, ProgramTransformerError>; + async fn download_rollup(&self, url: &str) -> Result, RollupValidationError>; async fn download_rollup_and_check_checksum( &self, url: &str, checksum: &str, - ) -> Result, ProgramTransformerError>; + ) -> Result, RollupValidationError>; } -pub struct RollupPersister { +pub struct RollupPersister { txn: Arc, downloader: D, cl_audits: bool, @@ -182,7 +184,7 @@ impl RollupDownloader for RollupDownloaderForPersister { } } -impl RollupPersister { +impl RollupPersister { pub fn new(txn: Arc, downloader: D, cl_audits: bool) -> Self { Self { txn, @@ -191,38 +193,30 @@ impl RollupPersister { } } - pub async fn persist_rollups(&self, mut rx: Receiver<()>) -> Result<(), JoinError> { + pub async fn persist_rollups(&self) -> Result<(), JoinError> { loop { - tokio::select! { - _ = tokio::time::sleep(Duration::from_secs(5)) => { - let (rollup_to_verify, rollup) = match self.get_rollup_to_verify().await { - Ok(res) => res, - Err(_) => { - continue; - } - }; - let Some(rollup_to_verify) = rollup_to_verify else { - // no rollups to persist - return Ok(()); - }; - self.persist_rollup(&rx, rollup_to_verify, rollup).await - }, - _ = rx.recv() => { - info!("Received stop signal, stopping ..."); - return Ok(()); - }, - } + let rollup_to_verify = match self.get_rollup_to_verify().await { + Ok(res) => res, + Err(_) => { + continue; + } + }; + let Some(rollup_to_verify) = rollup_to_verify else { + // no rollups to persist + return Ok(()); + }; + self.persist_rollup(rollup_to_verify, None).await; + tokio::time::sleep(Duration::from_secs(5)).await } } pub async fn persist_rollup( &self, - rx: &Receiver<()>, mut rollup_to_verify: rollup_to_verify::Model, mut rollup: Option>, ) { info!("Persisting {} rollup", &rollup_to_verify.url); - while rx.is_empty() { + loop { match &rollup_to_verify.rollup_persisting_state { &RollupPersistingState::ReceivedTransaction => { if let Err(err) = self @@ -244,7 +238,10 @@ impl RollupPersister { } &RollupPersistingState::SuccessfullyValidate => { if let Some(r) = &rollup { - self.store_rollup_update(&mut rollup_to_verify, r).await; + // TODO: Add retry? + if let Err(e) = self.store_rollup_update(&mut rollup_to_verify, r).await { + error!("Store rollup update: {}", e) + }; } else { error!( "Trying to store update for non downloaded rollup: {:#?}", @@ -253,8 +250,7 @@ impl RollupPersister { } } &RollupPersistingState::FailedToPersist | &RollupPersistingState::StoredUpdate => { - self.drop_rollup_from_queue(rollup_to_verify.file_hash.clone()) - .await; + if let Err(_e) = self.drop_rollup_from_queue(&rollup_to_verify).await {}; info!( "Finish processing {} rollup file with {:?} state", &rollup_to_verify.url, &rollup_to_verify.rollup_persisting_state @@ -267,8 +263,7 @@ impl RollupPersister { async fn get_rollup_to_verify( &self, - ) -> Result<(Option, Option>), ProgramTransformerError> - { + ) -> Result, ProgramTransformerError> { let condition = Condition::all() .add( rollup_to_verify::Column::RollupPersistingState @@ -284,6 +279,7 @@ impl RollupPersister { .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) .one(self.txn.as_ref()) .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string())) } async fn download_rollup( @@ -303,10 +299,13 @@ impl RollupPersister { .await { Ok(r) => { - if let Err(e) = self - .rocks_client - .rollups - .put(rollup_to_verify.file_hash.clone(), r.deref().clone()) + if let Err(e) = (rollup::ActiveModel { + file_hash: Default::default(), + rollup_binary_bincode: Set(bincode::serialize(rollup) + .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), + }) + .insert(self.txn.as_ref()) + .await { return Err(e.into()); } @@ -328,37 +327,42 @@ impl RollupPersister { RollupValidationError::FileChecksumMismatch(expected, actual), )); } - if let ProgramTransformerError::Serialization(e) = e { + if let RollupValidationError::Serialization(e) = e { rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; self.save_rollup_as_failed( RollupFailStatus::FileSerialization, rollup_to_verify, - )?; + ) + .await?; return Err(ProgramTransformerError::SerializatonError(e)); } - if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS { + if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS as i32 { rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - self.save_rollup_as_failed(RollupFailStatus::DownloadFailed, rollup_to_verify)?; + self.save_rollup_as_failed(RollupFailStatus::DownloadFailed, rollup_to_verify) + .await?; } else { rollup_to_verify.download_attempts = rollup_to_verify.download_attempts + 1; - if let Err(e) = self.rocks_client.rollup_to_verify.put( - rollup_to_verify.file_hash.clone(), - RollupToVerify { - file_hash: rollup_to_verify.file_hash.clone(), - url: rollup_to_verify.url.clone(), - created_at_slot: rollup_to_verify.created_at_slot, - signature: rollup_to_verify.signature, - download_attempts: rollup_to_verify.download_attempts + 1, - persisting_state: RollupPersistingState::FailedToPersist, - }, - ) { + if let Err(e) = (rollup_to_verify::ActiveModel { + file_hash: Set(rollup_to_verify.file_hash.clone()), + url: Set(rollup_to_verify.url.clone()), + created_at_slot: Set(rollup_to_verify.created_at_slot), + signature: Set(rollup_to_verify.signature.clone()), + download_attempts: Set(rollup_to_verify.download_attempts + 1), + rollup_persisting_state: Set(rollup_to_verify + .rollup_persisting_state + .clone()), + rollup_fail_status: Set(rollup_to_verify.rollup_fail_status.clone()), + } + .insert(self.txn.as_ref())) + .await + { return Err(e.into()); } } - return Err(ProgramTransformerError::Usecase(e.to_string())); + return Err(ProgramTransformerError::RollupValidation(e)); } } Ok(()) @@ -373,8 +377,9 @@ impl RollupPersister { error!("Error while validating rollup: {}", e.to_string()); rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - if let Err(err) = - self.save_rollup_as_failed(RollupFailStatus::RollupVerifyFailed, rollup_to_verify) + if let Err(err) = self + .save_rollup_as_failed(RollupFailStatus::RollupVerifyFailed, rollup_to_verify) + .await { error!("Save rollup as failed: {}", err); }; @@ -387,11 +392,10 @@ impl RollupPersister { &self, rollup_to_verify: &mut rollup_to_verify::Model, rollup: &Rollup, - ) { - if bubblegum::finalize_tree_with_root::store_rollup_update( + ) -> Result<(), ProgramTransformerError> { + if store_rollup_update( rollup_to_verify.created_at_slot as u64, - Signature::try_from(rollup_to_verify.signature.clone()) - .map_err(|e| ProgramTransformerError::SerializatonError(format!("{:?}", e)))?, + rollup_to_verify.signature.clone(), rollup, self.txn.as_ref(), self.cl_audits, @@ -400,9 +404,10 @@ impl RollupPersister { .is_err() { rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - return; + return Ok(()); } rollup_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; + Ok(()) } async fn save_rollup_as_failed( @@ -425,15 +430,23 @@ impl RollupPersister { Ok(()) } - async fn drop_rollup_from_queue(&self, file_hash: String) { - if let Some(existing_rollup) = rollup_to_verify::Entity::find_by_id(file_hash.clone()) + async fn drop_rollup_from_queue( + &self, + rollup_to_verify: &rollup_to_verify::Model, + ) -> Result<(), ProgramTransformerError> { + if rollup_to_verify::Entity::find_by_id(rollup_to_verify.file_hash.clone()) .one(self.txn.as_ref()) .await? + .is_some() { - let mut active_model: rollup_to_verify::ActiveModel = existing_rollup.into(); - active_model.rollup_persisting_state = Set(RollupPersistingState::StoredUpdate); - active_model.update(self.txn.as_ref()).await?; + rollup_to_verify + .clone() + .into_active_model() + .update(self.txn.as_ref()) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; } + Ok(()) } } @@ -449,7 +462,7 @@ async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { leaf_hashes.push(leaf_hash); } - bubblegum::merkle_tree_wrapper::validate_change_logs( + merkle_tree_wrapper::validate_change_logs( rollup.max_depth, rollup.max_buffer_size, &leaf_hashes, @@ -509,3 +522,34 @@ fn get_leaf_hash( Ok(asset.leaf_update.hash()) } + +pub async fn store_rollup_update( + slot: u64, + signature: String, + rollup: &Rollup, + txn: &T, + cl_audits: bool, +) -> ProgramTransformerResult<()> +where + T: ConnectionTrait + TransactionTrait, +{ + for rolled_mint in rollup.rolled_mints.iter() { + bubblegum::mint_v1::mint_v1( + &rolled_mint.into(), + &InstructionBundle { + txn_id: &signature, + program: Default::default(), + instruction: None, + inner_ix: None, + keys: &[], + slot, + }, + txn, + "CreateTreeWithRoot", + cl_audits, + ) + .await?; + } + + Ok(()) +} From d63cd803d742222f861eb0643baa02378eecda3f Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 11 Jun 2024 18:40:29 +0300 Subject: [PATCH 04/34] feat: rollup indexer --- nft_ingester/src/main.rs | 5 ++- .../src/rollups/rollup_persister.rs | 40 +++++++++++++------ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index 7809d89bb..ea0b3f12c 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -161,7 +161,10 @@ pub async fn main() -> Result<(), IngesterError> { RollupDownloaderForPersister {}, config.cl_audits.unwrap_or_default(), ); - tasks.spawn(async move { rollup_persister.persist_rollups().await }); + tasks.spawn(async move { + rollup_persister.persist_rollups().await; + Ok(()) + }); } // Stream Size Timers ---------------------------------------- // Setup Stream Size Timers, these are small processes that run every 60 seconds and farm metrics for the size of the streams. diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index b5d7ceb7b..1c9ec8465 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -193,20 +193,25 @@ impl RollupPersister } } - pub async fn persist_rollups(&self) -> Result<(), JoinError> { + pub async fn persist_rollups(&self) { loop { - let rollup_to_verify = match self.get_rollup_to_verify().await { - Ok(res) => res, - Err(_) => { - continue; - } + tokio::time::sleep(Duration::from_secs(5)).await; + let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { + continue; }; let Some(rollup_to_verify) = rollup_to_verify else { // no rollups to persist - return Ok(()); + continue; + }; + let Ok(rollup) = rollup + .map(|r| bincode::deserialize::(r.rollup_binary_bincode.as_slice())) + .transpose() + .map_err(|e| ProgramTransformerError::DeserializationError(e.to_string())) + else { + continue; }; - self.persist_rollup(rollup_to_verify, None).await; - tokio::time::sleep(Duration::from_secs(5)).await + self.persist_rollup(rollup_to_verify, rollup.map(Box::new)) + .await; } } @@ -263,7 +268,8 @@ impl RollupPersister async fn get_rollup_to_verify( &self, - ) -> Result, ProgramTransformerError> { + ) -> Result<(Option, Option), ProgramTransformerError> + { let condition = Condition::all() .add( rollup_to_verify::Column::RollupPersistingState @@ -274,12 +280,22 @@ impl RollupPersister .ne(RollupPersistingState::StoredUpdate), ); - rollup_to_verify::Entity::find() + let rollup_to_verify = rollup_to_verify::Entity::find() .filter(condition) .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) .one(self.txn.as_ref()) .await - .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string())) + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; + let mut rollup = None; + if let Some(ref r) = rollup_to_verify { + rollup = rollup::Entity::find() + .filter(rollup::Column::FileHash.eq(r.file_hash.clone())) + .one(self.txn.as_ref()) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; + } + + Ok((rollup_to_verify, rollup)) } async fn download_rollup( From 5b3cb461cdf5a4d618b76551ae0385220555c800 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 11 Jun 2024 19:05:44 +0300 Subject: [PATCH 05/34] rm redundant changes --- docker-compose.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 45d82bf88..2294fc4a4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,10 +17,10 @@ services: - "2004:2004" migrator: depends_on: - - reference-db + - db - builder environment: - DATABASE_URL: postgres://solana:solana@reference-db/solana + DATABASE_URL: postgres://solana:solana@db/solana build: context: . dockerfile: Migrator.Dockerfile @@ -29,7 +29,7 @@ services: - migrator - builder - redis - - reference-db + - db - graphite - solana restart: always @@ -37,7 +37,7 @@ services: RUST_LOG: debug INGESTER_METRICS_PORT: 8125 INGESTER_METRICS_HOST: graphite - INGESTER_DATABASE_CONFIG: '{max_postgres_connections=, listener_channel="backfill_item_added", url="postgres://solana:solana@reference-db/solana"}' + INGESTER_DATABASE_CONFIG: '{max_postgres_connections=, listener_channel="backfill_item_added", url="postgres://solana:solana@db/solana"}' INGESTER_MESSENGER_CONFIG: '{connection_config={batch_size=500,idle_timeout=5000,redis_connection_str="redis://redis"}, messenger_type="Redis"}' INGESTER_RPC_CONFIG: '{url="http://${COMPOSE_PROJECT_NAME}-solana-1:8899/", commitment="confirmed"}' RUST_BACKTRACE: 1 @@ -73,7 +73,7 @@ services: - builder restart: always environment: - APP_DATABASE_URL: postgres://solana:solana@reference-db/solana + APP_DATABASE_URL: postgres://solana:solana@db/solana APP_SERVER_PORT: 9090 APP_METRICS_PORT: 8125 APP_METRICS_HOST: graphite @@ -86,11 +86,11 @@ services: image: "redis:7.0.0" ports: - "6379:6379" - reference-db: + db: image: 'postgres:14' command: [ "postgres", "-c", "log_statement=all", "-c", "log_destination=stderr" ,"-c","max_connections=200" ] ports: - - 5434:5432 + - 5432:5432 environment: POSTGRES_USER: solana # The PostgreSQL user (useful to connect to the database) POSTGRES_PASSWORD: solana # The PostgreSQL password (useful to connect to the database) @@ -114,4 +114,4 @@ services: - "9900:9900" volumes: grafana_data: { } - graphite_data: { } + graphite_data: { } \ No newline at end of file From 54fcf10e6e0970aa565070d8a5234bfa250b125f Mon Sep 17 00:00:00 2001 From: requesco Date: Wed, 12 Jun 2024 09:35:10 +0300 Subject: [PATCH 06/34] gitmodules --- .gitmodules | 4 ++++ .../src/rollups/rollup_persister.rs | 13 ++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..0e67ee71a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "blockbuster"] + path = blockbuster + url = git@github.com:n00m4d/blockbuster.git + branch = feat/create-tree-with-root diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 1c9ec8465..cf7e120c2 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -24,7 +24,6 @@ use serde_json::value::RawValue; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; -use tokio::task::JoinError; use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; @@ -39,19 +38,15 @@ pub struct Rollup { pub max_buffer_size: u32, // derived data - pub merkle_root: [u8; 32], // validate - pub last_leaf_hash: [u8; 32], // validate + pub merkle_root: [u8; 32], + pub last_leaf_hash: [u8; 32], } #[derive(Serialize, Deserialize, Clone)] pub struct RolledMintInstruction { - pub tree_update: ChangeLogEventV1, // validate // derive from nonce - pub leaf_update: LeafSchema, // validate + pub tree_update: ChangeLogEventV1, + pub leaf_update: LeafSchema, pub mint_args: MetadataArgs, - // V0.1: enforce collection.verify == false - // V0.1: enforce creator.verify == false - // V0.2: add pub collection_signature: Option - sign asset_id with collection authority - // V0.2: add pub creator_signature: Option> - sign asset_id with creator authority to ensure verified creator #[serde(with = "serde_with::As::")] pub authority: Pubkey, } From e3e2116ee1206d60406dc765230eb0c151c0a7c4 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:36:31 +0300 Subject: [PATCH 07/34] Delete blockbuster/Cargo.lock --- blockbuster/Cargo.lock | 6356 ---------------------------------------- 1 file changed, 6356 deletions(-) delete mode 100644 blockbuster/Cargo.lock diff --git a/blockbuster/Cargo.lock b/blockbuster/Cargo.lock deleted file mode 100644 index 2a92a8f66..000000000 --- a/blockbuster/Cargo.lock +++ /dev/null @@ -1,6356 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", - "opaque-debug", -] - -[[package]] -name = "aes-gcm-siv" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "polyval", - "subtle", - "zeroize", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.12", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom 0.2.12", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "anchor-attribute-access-control" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" -dependencies = [ - "anchor-syn", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-attribute-account" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" -dependencies = [ - "anchor-syn", - "bs58 0.5.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-attribute-constant" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" -dependencies = [ - "anchor-syn", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-attribute-error" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" -dependencies = [ - "anchor-syn", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-attribute-event" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" -dependencies = [ - "anchor-syn", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-attribute-program" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" -dependencies = [ - "anchor-syn", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-derive-accounts" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" -dependencies = [ - "anchor-syn", - "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.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "anchor-lang" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" -dependencies = [ - "anchor-attribute-access-control", - "anchor-attribute-account", - "anchor-attribute-constant", - "anchor-attribute-error", - "anchor-attribute-event", - "anchor-attribute-program", - "anchor-derive-accounts", - "anchor-derive-serde", - "anchor-derive-space", - "arrayref", - "base64 0.13.1", - "bincode", - "borsh 0.10.3", - "bytemuck", - "getrandom 0.2.12", - "solana-program", - "thiserror", -] - -[[package]] -name = "anchor-syn" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" -dependencies = [ - "anyhow", - "bs58 0.5.1", - "heck 0.3.3", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2 0.10.8", - "syn 1.0.109", - "thiserror", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" - -[[package]] -name = "aquamarine" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" -dependencies = [ - "include_dir", - "itertools", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-bn254" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-ec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" -dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", - "itertools", - "num-traits", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "digest 0.10.7", - "itertools", - "num-bigint 0.4.4", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint 0.4.4", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-poly" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-serialize-derive", - "ark-std", - "digest 0.10.7", - "num-bigint 0.4.4", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - -[[package]] -name = "asn1-rs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "assert_matches" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-compression" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" -dependencies = [ - "brotli", - "flate2", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-trait" -version = "0.1.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" -dependencies = [ - "serde", -] - -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - -[[package]] -name = "blake3" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", - "digest 0.10.7", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding", - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "blockbuster" -version = "2.3.0" -dependencies = [ - "anchor-lang", - "async-trait", - "borsh 0.10.3", - "bs58 0.4.0", - "bytemuck", - "flatbuffers", - "lazy_static", - "log", - "mpl-bubblegum", - "mpl-core", - "mpl-token-metadata", - "plerkle_serialization", - "rand 0.8.5", - "serde", - "serde_json", - "solana-client", - "solana-geyser-plugin-interface", - "solana-sdk", - "solana-transaction-status", - "solana-zk-token-sdk", - "spl-account-compression", - "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-noop", - "spl-pod", - "spl-token", - "spl-token-2022", - "spl-token-group-interface", - "spl-token-metadata-interface", - "thiserror", -] - -[[package]] -name = "borsh" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" -dependencies = [ - "borsh-derive 0.9.3", - "hashbrown 0.11.2", -] - -[[package]] -name = "borsh" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" -dependencies = [ - "borsh-derive 0.10.3", - "hashbrown 0.13.2", -] - -[[package]] -name = "borsh" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" -dependencies = [ - "borsh-derive 1.5.0", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" -dependencies = [ - "borsh-derive-internal 0.9.3", - "borsh-schema-derive-internal 0.9.3", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal 0.10.3", - "borsh-schema-derive-internal 0.10.3", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" -dependencies = [ - "once_cell", - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.55", - "syn_derive", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "brotli" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "bumpalo" -version = "3.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" - -[[package]] -name = "bv" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" -dependencies = [ - "feature-probe", - "serde", -] - -[[package]] -name = "bytemuck" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "caps" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" -dependencies = [ - "libc", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - -[[package]] -name = "chrono" -version = "0.4.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.52.4", -] - -[[package]] -name = "chrono-humanize" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" -dependencies = [ - "chrono", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_lex", - "indexmap 1.9.3", - "once_cell", - "strsim 0.10.0", - "termcolor", - "textwrap 0.16.1", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "combine" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" -dependencies = [ - "ascii", - "byteorder", - "either", - "memchr", - "unreachable", -] - -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.52.0", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - -[[package]] -name = "console_log" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" -dependencies = [ - "log", - "web-sys", -] - -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "serde", - "subtle", - "zeroize", -] - -[[package]] -name = "darling" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 2.0.55", -] - -[[package]] -name = "darling_macro" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.3", - "lock_api", - "once_cell", - "parking_lot_core", - "rayon", -] - -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid", -] - -[[package]] -name = "der-parser" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint 0.4.4", - "num-traits", - "rusticata-macros", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "derivation-path" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "dialoguer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" -dependencies = [ - "console", - "shell-words", - "tempfile", - "zeroize", -] - -[[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common", - "subtle", -] - -[[package]] -name = "dir-diff" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" -dependencies = [ - "walkdir", -] - -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "dlopen2" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "downcast" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" - -[[package]] -name = "eager" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "ed25519-dalek-bip32" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" -dependencies = [ - "derivation-path", - "ed25519-dalek", - "hmac 0.12.1", - "sha2 0.10.8", -] - -[[package]] -name = "educe" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "enum-iterator" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "enum-ordinalize" -version = "3.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" -dependencies = [ - "num-bigint 0.4.4", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "env_logger" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - -[[package]] -name = "feature-probe" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.52.0", -] - -[[package]] -name = "flatbuffers" -version = "23.5.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" -dependencies = [ - "bitflags 1.3.2", - "rustc_version", -] - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "float-cmp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fragile" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "serde", - "typenum", - "version_check", -] - -[[package]] -name = "gethostname" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "goblin" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" -dependencies = [ - "log", - "plain", - "scroll", -] - -[[package]] -name = "h2" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util 0.7.10", - "tracing", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.11", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "histogram" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array", - "hmac 0.8.1", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "im" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" -dependencies = [ - "bitmaps", - "rand_core 0.6.4", - "rand_xoshiro", - "rayon", - "serde", - "sized-chunks", - "typenum", - "version_check", -] - -[[package]] -name = "include_dir" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "index_list" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.3", - "serde", -] - -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "jsonrpc-core" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" -dependencies = [ - "futures", - "futures-executor", - "futures-util", - "log", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "kaigan" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e623cca1f0e2a0919032c1bdabbf81dd9aa34658d5066aca7bb90d608317ab91" -dependencies = [ - "borsh 0.10.3", - "serde", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libsecp256k1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" -dependencies = [ - "arrayref", - "base64 0.12.3", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" -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.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - -[[package]] -name = "lz4" -version = "1.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" -dependencies = [ - "libc", - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - -[[package]] -name = "mockall" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "lazy_static", - "mockall_derive", - "predicates", - "predicates-tree", -] - -[[package]] -name = "mockall_derive" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "modular-bitfield" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" -dependencies = [ - "modular-bitfield-impl", - "static_assertions", -] - -[[package]] -name = "modular-bitfield-impl" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mpl-bubblegum" -version = "1.4.0" -dependencies = [ - "assert_matches", - "borsh 0.10.3", - "bytemuck", - "kaigan", - "num-derive 0.3.3", - "num-traits", - "serde", - "serde_with 3.7.0", - "solana-program", - "solana-program-test", - "solana-sdk", - "spl-account-compression", - "spl-associated-token-account", - "spl-concurrent-merkle-tree 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-merkle-tree-reference 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-noop", - "spl-token", - "thiserror", -] - -[[package]] -name = "mpl-core" -version = "0.6.1" -source = "git+https://github.com/n00m4d/mpl-core.git#b49c19ca3b8e63a173bee20cebecd6e64e4b8c96" -dependencies = [ - "base64 0.22.0", - "borsh 0.10.3", - "num-derive 0.3.3", - "num-traits", - "serde", - "serde_with 3.7.0", - "solana-program", - "thiserror", -] - -[[package]] -name = "mpl-token-metadata" -version = "4.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf0f61b553e424a6234af1268456972ee66c2222e1da89079242251fa7479e5" -dependencies = [ - "borsh 0.10.3", - "num-derive 0.3.3", - "num-traits", - "serde", - "serde_with 3.7.0", - "solana-program", - "thiserror", -] - -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - -[[package]] -name = "num" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" -dependencies = [ - "num-bigint 0.2.6", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint 0.2.6", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", -] - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive 0.7.2", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "thiserror", -] - -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - -[[package]] -name = "ouroboros" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" -dependencies = [ - "aliasable", - "ouroboros_macro", -] - -[[package]] -name = "ouroboros_macro" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" -dependencies = [ - "Inflector", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "percentage" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" -dependencies = [ - "num", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der", - "spki", - "zeroize", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "plerkle_serialization" -version = "1.8.0" -source = "git+https://github.com/n00m4d/digital-asset-validator-plugin.git#6920f6d3f30d6bc9c9c7eefeb5c7c1bcc87fa0c8" -dependencies = [ - "bs58 0.4.0", - "chrono", - "flatbuffers", - "serde", - "solana-sdk", - "solana-transaction-status", - "thiserror", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "predicates" -version = "2.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" -dependencies = [ - "difflib", - "float-cmp", - "itertools", - "normalize-line-endings", - "predicates-core", - "regex", -] - -[[package]] -name = "predicates-core" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" - -[[package]] -name = "predicates-tree" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" -dependencies = [ - "predicates-core", - "termtree", -] - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "qstring" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" -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.55", -] - -[[package]] -name = "quinn" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls", - "rustls-native-certs", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" -dependencies = [ - "bytes", - "libc", - "socket2", - "tracing", - "windows-sys 0.48.0", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.12", -] - -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rcgen" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" -dependencies = [ - "pem", - "ring 0.16.20", - "time", - "yasna", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "async-compression", - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-rustls", - "tokio-util 0.7.10", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots 0.25.4", - "winreg", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.12", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.52.0", -] - -[[package]] -name = "rpassword" -version = "7.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" -dependencies = [ - "libc", - "rtoolbox", - "windows-sys 0.48.0", -] - -[[package]] -name = "rtoolbox" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scroll" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "seqlock" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c67b6f14ecc5b86c66fa63d76b5092352678545a8a3cdae80aef5128371910" -dependencies = [ - "parking_lot", -] - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" -dependencies = [ - "serde", - "serde_with_macros 2.3.3", -] - -[[package]] -name = "serde_with" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" -dependencies = [ - "base64 0.21.7", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.6", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros 3.7.0", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "serde_with_macros" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "solana-account-decoder" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f31c3dc9c7ebfaff452f063b406bbf64d326d71120996f4d3fdeee7ae7f1b6e" -dependencies = [ - "Inflector", - "base64 0.21.7", - "bincode", - "bs58 0.4.0", - "bv", - "lazy_static", - "serde", - "serde_derive", - "serde_json", - "solana-config-program", - "solana-sdk", - "spl-token", - "spl-token-2022", - "spl-token-group-interface", - "spl-token-metadata-interface", - "thiserror", - "zstd", -] - -[[package]] -name = "solana-accounts-db" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085985c66a70f31d55abe3ea8955d424351e1c10f53d1b508627b571e3badb58" -dependencies = [ - "arrayref", - "bincode", - "blake3", - "bv", - "bytemuck", - "byteorder", - "bzip2", - "crossbeam-channel", - "dashmap", - "flate2", - "fnv", - "im", - "index_list", - "itertools", - "lazy_static", - "log", - "lz4", - "memmap2", - "modular-bitfield", - "num-derive 0.4.2", - "num-traits", - "num_cpus", - "num_enum 0.7.2", - "ouroboros", - "percentage", - "qualifier_attr", - "rand 0.8.5", - "rayon", - "regex", - "rustc_version", - "seqlock", - "serde", - "serde_derive", - "smallvec", - "solana-bucket-map", - "solana-config-program", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-measure", - "solana-metrics", - "solana-nohash-hasher", - "solana-program-runtime", - "solana-rayon-threadlimit", - "solana-sdk", - "solana-stake-program", - "solana-system-program", - "solana-vote-program", - "static_assertions", - "strum", - "strum_macros", - "tar", - "tempfile", - "thiserror", -] - -[[package]] -name = "solana-address-lookup-table-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f839249b791c98ed1d0d6e0d21932a962d6567963d34d3a6cbad52b55624131" -dependencies = [ - "bincode", - "bytemuck", - "log", - "num-derive 0.4.2", - "num-traits", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-program", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - -[[package]] -name = "solana-banks-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b520d4a39dc146d64a8326be372aeb482819c7b4f657408d3f956cca3d3ee2" -dependencies = [ - "borsh 1.5.0", - "futures", - "solana-banks-interface", - "solana-program", - "solana-sdk", - "tarpc", - "thiserror", - "tokio", - "tokio-serde", -] - -[[package]] -name = "solana-banks-interface" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a79263dbd1122ff4addbc956d01ad6e5c23585b951900871e0cb23615b8b22" -dependencies = [ - "serde", - "solana-sdk", - "tarpc", -] - -[[package]] -name = "solana-banks-server" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c39a8d83676027a6b23502636c5f198072d39ce27642d326e9d2239f1436b8" -dependencies = [ - "bincode", - "crossbeam-channel", - "futures", - "solana-accounts-db", - "solana-banks-interface", - "solana-client", - "solana-runtime", - "solana-sdk", - "solana-send-transaction-service", - "tarpc", - "tokio", - "tokio-serde", -] - -[[package]] -name = "solana-bpf-loader-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc06ca3f5b6a2979fcc679f98765c51e103a9f24c68f8d07af9ad58cb988a3a" -dependencies = [ - "bincode", - "byteorder", - "libsecp256k1", - "log", - "scopeguard", - "solana-measure", - "solana-program-runtime", - "solana-sdk", - "solana-zk-token-sdk", - "solana_rbpf", - "thiserror", -] - -[[package]] -name = "solana-bucket-map" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1f27fbbf17492f46335907b525ac7b1b9d3e2bcb21e029f12a90930842c414" -dependencies = [ - "bv", - "bytemuck", - "log", - "memmap2", - "modular-bitfield", - "num_enum 0.7.2", - "rand 0.8.5", - "solana-measure", - "solana-sdk", - "tempfile", -] - -[[package]] -name = "solana-clap-utils" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ffc5c1aa04a6ce12f4cccd2a26b78dfa1db2d559554b4b2cfffc1059e95764" -dependencies = [ - "chrono", - "clap 2.34.0", - "rpassword", - "solana-remote-wallet", - "solana-sdk", - "thiserror", - "tiny-bip39", - "uriparse", - "url", -] - -[[package]] -name = "solana-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad2cc8cf76432aa7df46ffc50cd9c97a087b899de57a67d08a4a909bcf85496" -dependencies = [ - "async-trait", - "bincode", - "dashmap", - "futures", - "futures-util", - "indexmap 2.2.6", - "indicatif", - "log", - "quinn", - "rayon", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-pubsub-client", - "solana-quic-client", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-rpc-client-nonce-utils", - "solana-sdk", - "solana-streamer", - "solana-thin-client", - "solana-tpu-client", - "solana-udp-client", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-compute-budget-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84226e74aeba7384a03c2dddd01e0dcd660bc2c1ea361f97e1de27e2b46bed44" -dependencies = [ - "solana-program-runtime", - "solana-sdk", -] - -[[package]] -name = "solana-config-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d12f4c7ca44f55afb012dfadd21a352cb818a225f4e6d7fe3db5c3fcb1e28ca1" -dependencies = [ - "bincode", - "chrono", - "serde", - "serde_derive", - "solana-program-runtime", - "solana-sdk", -] - -[[package]] -name = "solana-connection-cache" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fea76dc27635837568c533c7fadebe4fbf86fbdbf561937347357d41434b85" -dependencies = [ - "async-trait", - "bincode", - "crossbeam-channel", - "futures-util", - "indexmap 2.2.6", - "log", - "rand 0.8.5", - "rayon", - "rcgen", - "solana-measure", - "solana-metrics", - "solana-sdk", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-cost-model" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08fd2e03894f21f8f6df4c454a56185dc112dec8f6953c00bb25446dd4d9c8a" -dependencies = [ - "lazy_static", - "log", - "rustc_version", - "solana-address-lookup-table-program", - "solana-bpf-loader-program", - "solana-compute-budget-program", - "solana-config-program", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-loader-v4-program", - "solana-metrics", - "solana-program-runtime", - "solana-sdk", - "solana-stake-program", - "solana-system-program", - "solana-vote-program", -] - -[[package]] -name = "solana-frozen-abi" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9843fe4a4e4d541bd056465257704d8d53b50ed59328dcb5f37821ae0f843676" -dependencies = [ - "block-buffer 0.10.4", - "bs58 0.4.0", - "bv", - "either", - "generic-array", - "im", - "lazy_static", - "log", - "memmap2", - "rustc_version", - "serde", - "serde_bytes", - "serde_derive", - "sha2 0.10.8", - "solana-frozen-abi-macro", - "subtle", - "thiserror", -] - -[[package]] -name = "solana-frozen-abi-macro" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f24edb8172842544ace0ccb9547353cc55fe4a6d3b2786e209939d3a8bf271d" -dependencies = [ - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.55", -] - -[[package]] -name = "solana-geyser-plugin-interface" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac9c1d761318b992ea6514d2e32853e285af07e6158879dc299500f7fee9033" -dependencies = [ - "log", - "solana-sdk", - "solana-transaction-status", - "thiserror", -] - -[[package]] -name = "solana-loader-v4-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63ef21a0a7215853f4de4bd90ab1ca544114ab10065376d959945c4a2621074" -dependencies = [ - "log", - "solana-measure", - "solana-program-runtime", - "solana-sdk", - "solana_rbpf", -] - -[[package]] -name = "solana-logger" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9c97300d5fd98fd490819186debfda9d47b1a5c82b5ffdb76e2ea6bad055c4" -dependencies = [ - "env_logger", - "lazy_static", - "log", -] - -[[package]] -name = "solana-measure" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bf69dbc3d69406b67d3d263c8a5aa0d8501051d75aa842f47502652060596d" -dependencies = [ - "log", - "solana-sdk", -] - -[[package]] -name = "solana-metrics" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35a2112662341adaf1b8fbd4a8d819bc24ae5d1d59655e0561161c5c816894b9" -dependencies = [ - "crossbeam-channel", - "gethostname", - "lazy_static", - "log", - "reqwest", - "solana-sdk", - "thiserror", -] - -[[package]] -name = "solana-net-utils" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc90c80c6f0a9b428464f0147f6407cae4a16aa5483d6b7ea37fd2976c76edc" -dependencies = [ - "bincode", - "clap 3.2.25", - "crossbeam-channel", - "log", - "nix", - "rand 0.8.5", - "serde", - "serde_derive", - "socket2", - "solana-logger", - "solana-sdk", - "solana-version", - "tokio", - "url", -] - -[[package]] -name = "solana-nohash-hasher" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" - -[[package]] -name = "solana-perf" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2485083355b1c22256d57270e5b915db23cc0e2f0165027ffc52c7f815015137" -dependencies = [ - "ahash 0.8.11", - "bincode", - "bv", - "caps", - "curve25519-dalek", - "dlopen2", - "fnv", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "rayon", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-metrics", - "solana-rayon-threadlimit", - "solana-sdk", - "solana-vote-program", -] - -[[package]] -name = "solana-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de9a1634b9d30ca0e5c2d53806c030a5d9c07dfcc4505ebeb218206514d17b8" -dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", - "base64 0.21.7", - "bincode", - "bitflags 2.5.0", - "blake3", - "borsh 0.10.3", - "borsh 0.9.3", - "borsh 1.5.0", - "bs58 0.4.0", - "bv", - "bytemuck", - "cc", - "console_error_panic_hook", - "console_log", - "curve25519-dalek", - "getrandom 0.2.12", - "itertools", - "js-sys", - "lazy_static", - "libc", - "libsecp256k1", - "light-poseidon", - "log", - "memoffset 0.9.0", - "num-bigint 0.4.4", - "num-derive 0.4.2", - "num-traits", - "parking_lot", - "rand 0.8.5", - "rustc_version", - "rustversion", - "serde", - "serde_bytes", - "serde_derive", - "serde_json", - "sha2 0.10.8", - "sha3 0.10.8", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-sdk-macro", - "thiserror", - "tiny-bip39", - "wasm-bindgen", - "zeroize", -] - -[[package]] -name = "solana-program-runtime" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078fbc30339aff91d84ef5fc49ad75818419fedc543da22617d2f36a93d56bff" -dependencies = [ - "base64 0.21.7", - "bincode", - "eager", - "enum-iterator", - "itertools", - "libc", - "log", - "num-derive 0.4.2", - "num-traits", - "percentage", - "rand 0.8.5", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-measure", - "solana-metrics", - "solana-sdk", - "solana_rbpf", - "thiserror", -] - -[[package]] -name = "solana-program-test" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71661f6294e651d6aee508c3194d26f8bcf95ced2bbafd1666c487bb292580eb" -dependencies = [ - "assert_matches", - "async-trait", - "base64 0.21.7", - "bincode", - "chrono-humanize", - "crossbeam-channel", - "log", - "serde", - "solana-accounts-db", - "solana-banks-client", - "solana-banks-interface", - "solana-banks-server", - "solana-bpf-loader-program", - "solana-logger", - "solana-program-runtime", - "solana-runtime", - "solana-sdk", - "solana-vote-program", - "solana_rbpf", - "test-case", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-pubsub-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e9e2ccf38a591001488200ee22675e15214d1fbeb1d23013a7a8798c78aca4" -dependencies = [ - "crossbeam-channel", - "futures-util", - "log", - "reqwest", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", - "solana-sdk", - "thiserror", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tungstenite", - "url", -] - -[[package]] -name = "solana-quic-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6043950cfe26f79e0c35dc7f894a0cc0a3d2786255ef6fe745aa92b20ad6c2f9" -dependencies = [ - "async-mutex", - "async-trait", - "futures", - "itertools", - "lazy_static", - "log", - "quinn", - "quinn-proto", - "rcgen", - "rustls", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-rpc-client-api", - "solana-sdk", - "solana-streamer", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-rayon-threadlimit" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba82ca1adb9f096d38415ef7ecc3279b8ca2599f3ae5de986c98bb331dec81b1" -dependencies = [ - "lazy_static", - "num_cpus", -] - -[[package]] -name = "solana-remote-wallet" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "868d095412afbdde6c8f02dcb26c61c7f7ac5332425eb1be682ca9c7d02abd3d" -dependencies = [ - "console", - "dialoguer", - "log", - "num-derive 0.4.2", - "num-traits", - "parking_lot", - "qstring", - "semver", - "solana-sdk", - "thiserror", - "uriparse", -] - -[[package]] -name = "solana-rpc-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed5aca9e30731a03608f595ff34198793b2de957ad7b5ae224388ea447522b3" -dependencies = [ - "async-trait", - "base64 0.21.7", - "bincode", - "bs58 0.4.0", - "indicatif", - "log", - "reqwest", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", - "solana-sdk", - "solana-transaction-status", - "solana-version", - "solana-vote-program", - "tokio", -] - -[[package]] -name = "solana-rpc-client-api" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae63c92a83d40721aad647d07e40d63dd0612b4f787f64bf270877a4464c0e" -dependencies = [ - "base64 0.21.7", - "bs58 0.4.0", - "jsonrpc-core", - "reqwest", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-sdk", - "solana-transaction-status", - "solana-version", - "spl-token-2022", - "thiserror", -] - -[[package]] -name = "solana-rpc-client-nonce-utils" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39b025b6fed986086e236bbb8cd4b559b1dd2d549338bb7e808ef44505f6f816" -dependencies = [ - "clap 2.34.0", - "solana-clap-utils", - "solana-rpc-client", - "solana-sdk", - "thiserror", -] - -[[package]] -name = "solana-runtime" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf35a99ff547508a70ffd70de3b35ab4fa677f8b91f6745f90bf6ea9b2a8a67" -dependencies = [ - "aquamarine", - "arrayref", - "base64 0.21.7", - "bincode", - "blake3", - "bv", - "bytemuck", - "byteorder", - "bzip2", - "crossbeam-channel", - "dashmap", - "dir-diff", - "flate2", - "fnv", - "im", - "index_list", - "itertools", - "lazy_static", - "log", - "lru", - "lz4", - "memmap2", - "mockall", - "modular-bitfield", - "num-derive 0.4.2", - "num-traits", - "num_cpus", - "num_enum 0.7.2", - "ouroboros", - "percentage", - "qualifier_attr", - "rand 0.8.5", - "rayon", - "regex", - "rustc_version", - "serde", - "serde_derive", - "serde_json", - "solana-accounts-db", - "solana-address-lookup-table-program", - "solana-bpf-loader-program", - "solana-bucket-map", - "solana-compute-budget-program", - "solana-config-program", - "solana-cost-model", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-loader-v4-program", - "solana-measure", - "solana-metrics", - "solana-perf", - "solana-program-runtime", - "solana-rayon-threadlimit", - "solana-sdk", - "solana-stake-program", - "solana-system-program", - "solana-version", - "solana-vote", - "solana-vote-program", - "solana-zk-token-proof-program", - "solana-zk-token-sdk", - "static_assertions", - "strum", - "strum_macros", - "symlink", - "tar", - "tempfile", - "thiserror", - "zstd", -] - -[[package]] -name = "solana-sdk" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323d21f0cb307e28ccfbcb3a24a5ae230abc8176bfb82492df6773deb79b62de" -dependencies = [ - "assert_matches", - "base64 0.21.7", - "bincode", - "bitflags 2.5.0", - "borsh 1.5.0", - "bs58 0.4.0", - "bytemuck", - "byteorder", - "chrono", - "derivation-path", - "digest 0.10.7", - "ed25519-dalek", - "ed25519-dalek-bip32", - "generic-array", - "hmac 0.12.1", - "itertools", - "js-sys", - "lazy_static", - "libsecp256k1", - "log", - "memmap2", - "num-derive 0.4.2", - "num-traits", - "num_enum 0.7.2", - "pbkdf2 0.11.0", - "qstring", - "qualifier_attr", - "rand 0.7.3", - "rand 0.8.5", - "rustc_version", - "rustversion", - "serde", - "serde_bytes", - "serde_derive", - "serde_json", - "serde_with 2.3.3", - "sha2 0.10.8", - "sha3 0.10.8", - "siphasher", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-logger", - "solana-program", - "solana-sdk-macro", - "thiserror", - "uriparse", - "wasm-bindgen", -] - -[[package]] -name = "solana-sdk-macro" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6d088aff04f5ad17f6f4a1a84a7a6aef633d48e8ed6c12154fcbb5dfde07bd" -dependencies = [ - "bs58 0.4.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.55", -] - -[[package]] -name = "solana-security-txt" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" - -[[package]] -name = "solana-send-transaction-service" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c14685b33d7d1a2972f5c6e356b82b5762cedc9a8307ad17b9ec839286e4ad0" -dependencies = [ - "crossbeam-channel", - "log", - "solana-client", - "solana-measure", - "solana-metrics", - "solana-runtime", - "solana-sdk", - "solana-tpu-client", -] - -[[package]] -name = "solana-stake-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58b1744e5fb5a71cc7a9ef2eaaaa6c2a9112cf1856d4877c4c20c5cd151cfb86" -dependencies = [ - "bincode", - "log", - "rustc_version", - "solana-config-program", - "solana-program-runtime", - "solana-sdk", - "solana-vote-program", -] - -[[package]] -name = "solana-streamer" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce37f6de2695d5def82e3cc965f6d97d38e32c87b3b9dee525468ae6d6d3050d" -dependencies = [ - "async-channel", - "bytes", - "crossbeam-channel", - "futures-util", - "histogram", - "indexmap 2.2.6", - "itertools", - "libc", - "log", - "nix", - "pem", - "percentage", - "pkcs8", - "quinn", - "quinn-proto", - "rand 0.8.5", - "rcgen", - "rustls", - "smallvec", - "solana-metrics", - "solana-perf", - "solana-sdk", - "thiserror", - "tokio", - "x509-parser", -] - -[[package]] -name = "solana-system-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b22323cae3acc40bc5ac6f733b713e38747b879cffe020dac1ef859d87f8da4" -dependencies = [ - "bincode", - "log", - "serde", - "serde_derive", - "solana-program-runtime", - "solana-sdk", -] - -[[package]] -name = "solana-thin-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833f35f6d7b24436643b87a19f7adbdd105750d49d556f4c9b0cba5e367c2ff7" -dependencies = [ - "bincode", - "log", - "rayon", - "solana-connection-cache", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-sdk", -] - -[[package]] -name = "solana-tpu-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1006c69665839d00182d5fe260fb61e939c7a7877fbf67cdd812f07957a1b773" -dependencies = [ - "async-trait", - "bincode", - "futures-util", - "indexmap 2.2.6", - "indicatif", - "log", - "rayon", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-pubsub-client", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-sdk", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-transaction-status" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08bc13fa4f5ddf945253ac957b8b924c6181f9a80283e47e9922c07e73a845c" -dependencies = [ - "Inflector", - "base64 0.21.7", - "bincode", - "borsh 0.10.3", - "bs58 0.4.0", - "lazy_static", - "log", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-sdk", - "spl-associated-token-account", - "spl-memo", - "spl-token", - "spl-token-2022", - "thiserror", -] - -[[package]] -name = "solana-udp-client" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db0bcf3c61965df993c08118245cf79fc5e1994566bbf62585aaf6bfd578b26" -dependencies = [ - "async-trait", - "solana-connection-cache", - "solana-net-utils", - "solana-sdk", - "solana-streamer", - "thiserror", - "tokio", -] - -[[package]] -name = "solana-version" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180809ce9ca2dfc5a0bf62738c4ce22fe3f459cfde6589546922387a004fde82" -dependencies = [ - "log", - "rustc_version", - "semver", - "serde", - "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-sdk", -] - -[[package]] -name = "solana-vote" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f32ca0c27ebe5f0c50df270f9041750c02fdd93800c55b6b5bcbd0506408d6" -dependencies = [ - "crossbeam-channel", - "itertools", - "log", - "rustc_version", - "serde", - "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-sdk", - "solana-vote-program", - "thiserror", -] - -[[package]] -name = "solana-vote-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f40d6a334adbe76160c8b4e2579bb7c71452794d5f06b72b0458f7cc088fa19" -dependencies = [ - "bincode", - "log", - "num-derive 0.4.2", - "num-traits", - "rustc_version", - "serde", - "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-metrics", - "solana-program", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - -[[package]] -name = "solana-zk-token-proof-program" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4526932336b0a6535ec4f90016c630246db83bad4d7fd2d4c8b3d5e211580fcd" -dependencies = [ - "bytemuck", - "num-derive 0.4.2", - "num-traits", - "solana-program-runtime", - "solana-sdk", - "solana-zk-token-sdk", -] - -[[package]] -name = "solana-zk-token-sdk" -version = "1.18.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ea6cfb74066a35ea9ad53b1108bb26f35752569bcfb3d9203f58a7bf57fac5" -dependencies = [ - "aes-gcm-siv", - "base64 0.21.7", - "bincode", - "bytemuck", - "byteorder", - "curve25519-dalek", - "getrandom 0.1.16", - "itertools", - "lazy_static", - "merlin", - "num-derive 0.4.2", - "num-traits", - "rand 0.7.3", - "serde", - "serde_json", - "sha3 0.9.1", - "solana-program", - "solana-sdk", - "subtle", - "thiserror", - "zeroize", -] - -[[package]] -name = "solana_rbpf" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" -dependencies = [ - "byteorder", - "combine", - "goblin", - "hash32", - "libc", - "log", - "rand 0.8.5", - "rustc-demangle", - "scroll", - "thiserror", - "winapi", -] - -[[package]] -name = "spin" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "spl-account-compression" -version = "0.4.0" -dependencies = [ - "anchor-lang", - "bytemuck", - "solana-program", - "spl-concurrent-merkle-tree 0.2.0", - "spl-noop", -] - -[[package]] -name = "spl-associated-token-account" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" -dependencies = [ - "assert_matches", - "borsh 0.10.3", - "num-derive 0.4.2", - "num-traits", - "solana-program", - "spl-token", - "spl-token-2022", - "thiserror", -] - -[[package]] -name = "spl-concurrent-merkle-tree" -version = "0.2.0" -dependencies = [ - "bytemuck", - "rand 0.8.5", - "rand_distr", - "solana-program", - "spl-merkle-tree-reference 0.1.0", - "thiserror", - "tokio", -] - -[[package]] -name = "spl-concurrent-merkle-tree" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141eaea58588beae81b71d101373a53f096737739873de42d6b1368bc2b8fc30" -dependencies = [ - "bytemuck", - "solana-program", - "thiserror", -] - -[[package]] -name = "spl-discriminator" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator-derive", -] - -[[package]] -name = "spl-discriminator-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" -dependencies = [ - "quote", - "spl-discriminator-syn", - "syn 2.0.55", -] - -[[package]] -name = "spl-discriminator-syn" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" -dependencies = [ - "proc-macro2", - "quote", - "sha2 0.10.8", - "syn 2.0.55", - "thiserror", -] - -[[package]] -name = "spl-memo" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" -dependencies = [ - "solana-program", -] - -[[package]] -name = "spl-merkle-tree-reference" -version = "0.1.0" -dependencies = [ - "solana-program", - "thiserror", -] - -[[package]] -name = "spl-merkle-tree-reference" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28437c617c7f0db6b7229a489239f3ea6160499542d9367fbca2fc5ec7744abb" -dependencies = [ - "solana-program", - "thiserror", -] - -[[package]] -name = "spl-noop" -version = "0.2.0" -dependencies = [ - "solana-program", -] - -[[package]] -name = "spl-pod" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" -dependencies = [ - "base64 0.21.7", - "borsh 0.10.3", - "bytemuck", - "serde", - "solana-program", - "solana-zk-token-sdk", - "spl-program-error", -] - -[[package]] -name = "spl-program-error" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" -dependencies = [ - "num-derive 0.4.2", - "num-traits", - "solana-program", - "spl-program-error-derive", - "thiserror", -] - -[[package]] -name = "spl-program-error-derive" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" -dependencies = [ - "proc-macro2", - "quote", - "sha2 0.10.8", - "syn 2.0.55", -] - -[[package]] -name = "spl-tlv-account-resolution" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-token" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.3.3", - "num-traits", - "num_enum 0.6.1", - "solana-program", - "thiserror", -] - -[[package]] -name = "spl-token-2022" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.4.2", - "num-traits", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" -dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-transfer-hook-interface" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" -dependencies = [ - "arrayref", - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-tlv-account-resolution", - "spl-type-length-value", -] - -[[package]] -name = "spl-type-length-value" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "symlink" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tar" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "tarpc" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" -dependencies = [ - "anyhow", - "fnv", - "futures", - "humantime", - "opentelemetry", - "pin-project", - "rand 0.8.5", - "serde", - "static_assertions", - "tarpc-plugins", - "thiserror", - "tokio", - "tokio-serde", - "tokio-util 0.6.10", - "tracing", - "tracing-opentelemetry", -] - -[[package]] -name = "tarpc-plugins" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "termtree" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" - -[[package]] -name = "test-case" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" -dependencies = [ - "test-case-macros", -] - -[[package]] -name = "test-case-core" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "test-case-macros" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", - "test-case-core", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" - -[[package]] -name = "thiserror" -version = "1.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tiny-bip39" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" -dependencies = [ - "anyhow", - "hmac 0.8.1", - "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.9", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", - "serde_json", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls", - "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots 0.25.4", -] - -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "slab", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls", - "sha1", - "thiserror", - "url", - "utf-8", - "webpki-roots 0.24.0", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - -[[package]] -name = "untrusted" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" -dependencies = [ - "fnv", - "lazy_static", -] - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.55", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" -dependencies = [ - "rustls-webpki", -] - -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" -dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "x509-parser" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" -dependencies = [ - "asn1-rs", - "base64 0.13.1", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "xattr" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" -dependencies = [ - "libc", - "linux-raw-sys", - "rustix", -] - -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -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.55", -] - -[[package]] -name = "zeroize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" -dependencies = [ - "cc", - "pkg-config", -] From dd03782b72f9d01094f7f6bf005b3ee529ffb6b6 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:36:55 +0300 Subject: [PATCH 08/34] Delete blockbuster/.github/pull_request_template.md --- blockbuster/.github/pull_request_template.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 blockbuster/.github/pull_request_template.md diff --git a/blockbuster/.github/pull_request_template.md b/blockbuster/.github/pull_request_template.md deleted file mode 100644 index 72383e401..000000000 --- a/blockbuster/.github/pull_request_template.md +++ /dev/null @@ -1,8 +0,0 @@ - -Thank you for taking the time to make an enhancement or bug fix to the digital asset validator plugin repo. -To ensure a quality PR experience this call may be recorded. Just Kidding, but we do expect a few things. - -1. The Name of the PR will show up in the changelog so make it a good one, we will rename PRs or reject based on the name. -2. Please make the PR as small as possible to achieve the bugfix or feature. Big prs often are scary and hard to review. -3. Be kind to your reviewers 🤓 -4. Add a good description, so we can see what the PR is all about without investing the time in the code review. We will often review code at a certain time in the day and having a list if important prs to review helps us move that along. From fedb2a178dc5336f4e78a618545ba3c185541ded Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:37:10 +0300 Subject: [PATCH 09/34] Delete blockbuster/.github/release.yml --- blockbuster/.github/release.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 blockbuster/.github/release.yml diff --git a/blockbuster/.github/release.yml b/blockbuster/.github/release.yml deleted file mode 100644 index c9057c6fd..000000000 --- a/blockbuster/.github/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -changelog: - exclude: - labels: - - ignore-for-release - categories: - - title: Breaking Changes 🛠 - labels: - - major - - title: Bug Fix 🐛 - labels: - - bug - - title: Exciting New Features 🎉 - labels: - - minor - - title: Other Changes 📋 - labels: - - "*" From 2cb841ae2354a4118bbb552875a3a85df3cf4173 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:37:23 +0300 Subject: [PATCH 10/34] Delete .gitmodules --- .gitmodules | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0e67ee71a..000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "blockbuster"] - path = blockbuster - url = git@github.com:n00m4d/blockbuster.git - branch = feat/create-tree-with-root From 997fda9f5408b54d1b12d454bb655a5eeddbab69 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:37:36 +0300 Subject: [PATCH 11/34] Delete blockbuster/.github/workflows/test.yml --- blockbuster/.github/workflows/test.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 blockbuster/.github/workflows/test.yml diff --git a/blockbuster/.github/workflows/test.yml b/blockbuster/.github/workflows/test.yml deleted file mode 100644 index 8d3534071..000000000 --- a/blockbuster/.github/workflows/test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Testing -on: - push: - branches: - - main - pull_request: -env: - RUST_TOOLCHAIN: stable -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Test - run: | - cargo test From bdb3799127af15d18d99acd6a0b11fe2ea23d22b Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:37:52 +0300 Subject: [PATCH 12/34] Delete blockbuster/.vscode/extensions.json --- blockbuster/.vscode/extensions.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 blockbuster/.vscode/extensions.json diff --git a/blockbuster/.vscode/extensions.json b/blockbuster/.vscode/extensions.json deleted file mode 100644 index d1987c7ba..000000000 --- a/blockbuster/.vscode/extensions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [ - - ] -} \ No newline at end of file From 390e5e6c558169c0e38f8b890004e8124c1c32a8 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:38:06 +0300 Subject: [PATCH 13/34] Delete blockbuster/.vscode/launch.json --- blockbuster/.vscode/launch.json | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 blockbuster/.vscode/launch.json diff --git a/blockbuster/.vscode/launch.json b/blockbuster/.vscode/launch.json deleted file mode 100644 index 91ee81322..000000000 --- a/blockbuster/.vscode/launch.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "type": "lldb", - "request": "launch", - "name": "Cargo test", - "cwd": "${workspaceFolder}/blockbuster", - "cargo": { - "args": [ - "test", - "--no-run", - "--lib" - ] - }, - "args": [] - } - ] -} \ No newline at end of file From 04de3da105780f7cc46e2c2e3a905a7ed61d9c87 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:38:53 +0300 Subject: [PATCH 14/34] Delete blockbuster/LICENSE --- blockbuster/LICENSE | 661 -------------------------------------------- 1 file changed, 661 deletions(-) delete mode 100644 blockbuster/LICENSE diff --git a/blockbuster/LICENSE b/blockbuster/LICENSE deleted file mode 100644 index be3f7b28e..000000000 --- a/blockbuster/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. From ed4b6c91dc286807abdb8814222e46687593a4d5 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:39:07 +0300 Subject: [PATCH 15/34] Delete blockbuster/blockbuster.iml --- blockbuster/blockbuster.iml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 blockbuster/blockbuster.iml diff --git a/blockbuster/blockbuster.iml b/blockbuster/blockbuster.iml deleted file mode 100644 index b5d6787f6..000000000 --- a/blockbuster/blockbuster.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file From 3f42f2522650c2612f8f16937436cf95c2232ea2 Mon Sep 17 00:00:00 2001 From: RequescoS <112031297+RequescoS@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:39:25 +0300 Subject: [PATCH 16/34] Delete blockbuster/blockbuster/.gitignore --- blockbuster/blockbuster/.gitignore | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 blockbuster/blockbuster/.gitignore diff --git a/blockbuster/blockbuster/.gitignore b/blockbuster/blockbuster/.gitignore deleted file mode 100644 index 28aaccd5c..000000000 --- a/blockbuster/blockbuster/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -/target/ - - -# These are backup files generated by rustfmt -**/*.rs.bk - -*.iml -blockbuster/target -target/ From 0a06487694e2990f6d70385eaffd52eee249b1ef Mon Sep 17 00:00:00 2001 From: requesco Date: Wed, 12 Jun 2024 10:16:22 +0300 Subject: [PATCH 17/34] rollup validation test --- Cargo.lock | 1 + program_transformers/Cargo.toml | 1 + program_transformers/src/error.rs | 2 - program_transformers/src/rollups/mod.rs | 1 + .../src/rollups/rollup_persister.rs | 2 +- program_transformers/src/rollups/tests.rs | 301 ++++++++++++++++++ 6 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 program_transformers/src/rollups/tests.rs diff --git a/Cargo.lock b/Cargo.lock index 25d44176f..e775d54e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4583,6 +4583,7 @@ dependencies = [ "mpl-bubblegum", "num-traits", "paste", + "rand 0.8.5", "reqwest", "sea-orm", "serde", diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index b2472a8c5..664e23f9d 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -38,6 +38,7 @@ xxhash-rust = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } bincode = { workspace = true } +rand = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index 48fa48757..4abf80042 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -48,8 +48,6 @@ pub enum RollupValidationError { InvalidCreatorsHash(String, String), #[error("InvalidRoot: expected: {0}, got: {1}")] InvalidRoot(String, String), - #[error("CannotCreateMerkleTree: depth [{0}], size [{1}]")] - CannotCreateMerkleTree(u32, u32), #[error("NoRelevantRolledMint: index {0}")] NoRelevantRolledMint(u64), #[error("WrongAssetPath: id {0}")] diff --git a/program_transformers/src/rollups/mod.rs b/program_transformers/src/rollups/mod.rs index 2f9a50430..54e92f651 100644 --- a/program_transformers/src/rollups/mod.rs +++ b/program_transformers/src/rollups/mod.rs @@ -1,2 +1,3 @@ mod merkle_tree_wrapper; pub mod rollup_persister; +mod tests; diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index cf7e120c2..4c70870e6 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -461,7 +461,7 @@ impl RollupPersister } } -async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { +pub async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { let mut leaf_hashes = Vec::new(); for asset in rollup.rolled_mints.iter() { let leaf_hash = match get_leaf_hash(asset, &rollup.tree_id) { diff --git a/program_transformers/src/rollups/tests.rs b/program_transformers/src/rollups/tests.rs new file mode 100644 index 000000000..2f0a9c0b5 --- /dev/null +++ b/program_transformers/src/rollups/tests.rs @@ -0,0 +1,301 @@ +use crate::error::RollupValidationError; +use crate::rollups::rollup_persister::{ + validate_rollup, ChangeLogEventV1, PathNode, RolledMintInstruction, Rollup, +}; +use anchor_lang::AnchorSerialize; +use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; +use rand::{thread_rng, Rng}; +use solana_sdk::keccak; +use solana_sdk::pubkey::Pubkey; +use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; +use std::collections::HashMap; +use std::str::FromStr; + +fn generate_rollup(size: usize) -> Rollup { + let authority = Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(); + let tree = Pubkey::from_str("HxhCw9g3kZvrdg9zZvctmh6qpSDg1FfsBXfFvRkbCHB7").unwrap(); + let mut mints = Vec::new(); + let mut merkle = ConcurrentMerkleTree::<10, 32>::new(); + merkle.initialize().unwrap(); + + let mut last_leaf_hash = [0u8; 32]; + for i in 0..size { + let mint_args = MetadataArgs { + name: thread_rng() + .sample_iter(rand::distributions::Alphanumeric) + .take(15) + .map(char::from) + .collect(), + symbol: thread_rng() + .sample_iter(rand::distributions::Alphanumeric) + .take(5) + .map(char::from) + .collect(), + uri: format!( + "https://arweave.net/{}", + thread_rng() + .sample_iter(rand::distributions::Alphanumeric) + .take(43) + .map(char::from) + .collect::() + ), + seller_fee_basis_points: thread_rng() + .sample(rand::distributions::Uniform::new(0, 10000)), + primary_sale_happened: thread_rng().gen_bool(0.5), + is_mutable: thread_rng().gen_bool(0.5), + edition_nonce: if thread_rng().gen_bool(0.5) { + None + } else { + Some(thread_rng().sample(rand::distributions::Uniform::new(0, 255))) + }, + token_standard: if thread_rng().gen_bool(0.5) { + None + } else { + Some(mpl_bubblegum::types::TokenStandard::NonFungible) + }, + collection: if thread_rng().gen_bool(0.5) { + None + } else { + Some(mpl_bubblegum::types::Collection { + verified: false, + key: Pubkey::new_unique(), + }) + }, + uses: None, // todo + token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, + creators: (0..thread_rng().sample(rand::distributions::Uniform::new(1, 5))) + .map(|_| mpl_bubblegum::types::Creator { + address: Pubkey::new_unique(), + verified: false, + share: thread_rng().sample(rand::distributions::Uniform::new(0, 100)), + }) + .collect(), + }; + let nonce = i as u64; + let id = mpl_bubblegum::utils::get_asset_id(&tree, nonce); + let owner = authority.clone(); + let delegate = authority.clone(); + + let metadata_args_hash = keccak::hashv(&[mint_args.try_to_vec().unwrap().as_slice()]); + let data_hash = keccak::hashv(&[ + &metadata_args_hash.to_bytes(), + &mint_args.seller_fee_basis_points.to_le_bytes(), + ]); + let creator_data = mint_args + .creators + .iter() + .map(|c| [c.address.as_ref(), &[c.verified as u8], &[c.share]].concat()) + .collect::>(); + let creator_hash = keccak::hashv( + creator_data + .iter() + .map(|c| c.as_slice()) + .collect::>() + .as_ref(), + ); + + let hashed_leaf = keccak::hashv(&[ + &[1], //self.version().to_bytes() + id.as_ref(), + owner.as_ref(), + delegate.as_ref(), + nonce.to_le_bytes().as_ref(), + data_hash.as_ref(), + creator_hash.as_ref(), + ]) + .to_bytes(); + merkle.append(hashed_leaf).unwrap(); + last_leaf_hash = hashed_leaf; + let changelog = merkle.change_logs[merkle.active_index as usize]; + let path_len = changelog.path.len() as u32; + let mut path: Vec = changelog + .path + .iter() + .enumerate() + .map(|(lvl, n)| { + spl_account_compression::state::PathNode::new( + *n, + (1 << (path_len - lvl as u32)) + (changelog.index >> lvl), + ) + }) + .collect(); + path.push(spl_account_compression::state::PathNode::new( + changelog.root, + 1, + )); + + let rolled_mint = RolledMintInstruction { + tree_update: ChangeLogEventV1 { + id: tree, + path: path.into_iter().map(Into::into).collect::>(), + seq: merkle.sequence_number, + index: changelog.index, + }, + leaf_update: LeafSchema::V1 { + id, + owner, + delegate, + nonce, + data_hash: data_hash.to_bytes(), + creator_hash: creator_hash.to_bytes(), + }, + mint_args, + authority, + }; + mints.push(rolled_mint); + } + let rollup = Rollup { + tree_id: tree, + raw_metadata_map: HashMap::new(), + max_depth: 10, + rolled_mints: mints, + merkle_root: merkle.get_root(), + last_leaf_hash, + max_buffer_size: 32, + }; + + rollup +} + +#[tokio::test] +async fn rollup_validation_test() { + let mut rollup = generate_rollup(1000); + + let validation_result = validate_rollup(&rollup).await; + assert_eq!(validation_result, Ok(())); + + let old_root = rollup.merkle_root; + let new_root = Pubkey::new_unique(); + rollup.merkle_root = new_root.to_bytes(); + + let validation_result = validate_rollup(&rollup).await; + assert_eq!( + validation_result, + Err(RollupValidationError::InvalidRoot( + Pubkey::from(old_root).to_string(), + new_root.to_string() + )) + ); + + rollup.merkle_root = old_root; + let leaf_idx = 111; + let old_leaf_data_hash = rollup.rolled_mints[leaf_idx].leaf_update.data_hash(); + let new_leaf_data_hash = Pubkey::new_unique(); + rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: rollup.rolled_mints[leaf_idx].leaf_update.id(), + owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), + delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), + nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + data_hash: new_leaf_data_hash.to_bytes(), + creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + }; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::InvalidDataHash( + Pubkey::from(old_leaf_data_hash).to_string(), + new_leaf_data_hash.to_string() + )) + ); + + rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: rollup.rolled_mints[leaf_idx].leaf_update.id(), + owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), + delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), + nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + data_hash: old_leaf_data_hash, + creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + }; + let old_tree_depth = rollup.max_depth; + let new_tree_depth = 100; + rollup.max_depth = new_tree_depth; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::UnexpectedTreeSize( + new_tree_depth, + rollup.max_buffer_size + )) + ); + + rollup.max_depth = old_tree_depth; + let new_asset_id = Pubkey::new_unique(); + let old_asset_id = rollup.rolled_mints[leaf_idx].leaf_update.id(); + rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: new_asset_id, + owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), + delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), + nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + data_hash: rollup.rolled_mints[leaf_idx].leaf_update.data_hash(), + creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + }; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::PDACheckFail( + old_asset_id.to_string(), + new_asset_id.to_string() + )) + ); + + rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: old_asset_id, + owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), + delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), + nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + data_hash: rollup.rolled_mints[leaf_idx].leaf_update.data_hash(), + creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + }; + let old_path = rollup.rolled_mints[leaf_idx] + .tree_update + .path + .iter() + .map(|path| PathNode { + node: path.node, + index: path.index, + }) + .collect::>(); + let new_path = Vec::new(); + rollup.rolled_mints[leaf_idx].tree_update.path = new_path; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::WrongAssetPath( + rollup.rolled_mints[leaf_idx].leaf_update.id().to_string() + )) + ); + + rollup.rolled_mints[leaf_idx].tree_update.path = old_path; + let old_tree_id = rollup.rolled_mints[leaf_idx].tree_update.id; + let new_tree_id = Pubkey::new_unique(); + rollup.rolled_mints[leaf_idx].tree_update.id = new_tree_id; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::WrongTreeIdForChangeLog( + rollup.rolled_mints[leaf_idx].leaf_update.id().to_string(), + old_tree_id.to_string(), + new_tree_id.to_string() + )) + ); + + rollup.rolled_mints[leaf_idx].tree_update.id = old_tree_id; + let old_index = rollup.rolled_mints[leaf_idx].tree_update.index; + let new_index = 1; + rollup.rolled_mints[leaf_idx].tree_update.index = new_index; + let validation_result = validate_rollup(&rollup).await; + + assert_eq!( + validation_result, + Err(RollupValidationError::WrongChangeLogIndex( + rollup.rolled_mints[leaf_idx].leaf_update.id().to_string(), + old_index, + new_index + )) + ); +} From 27d4e1c846ab7d64963ef6d552941fcf743de344 Mon Sep 17 00:00:00 2001 From: requesco Date: Wed, 12 Jun 2024 12:34:41 +0300 Subject: [PATCH 18/34] some tests + fixes --- Cargo.lock | 3 + Cargo.toml | 1 + integration_tests/Cargo.toml | 3 + .../tests/integration_tests/main.rs | 1 + .../tests/integration_tests/rollup_tests.rs | 276 ++++++++++++++++++ .../src/bubblegum/finalize_tree_with_root.rs | 46 ++- program_transformers/src/rollups/mod.rs | 2 +- .../src/rollups/rollup_persister.rs | 48 +-- program_transformers/src/rollups/tests.rs | 2 +- 9 files changed, 346 insertions(+), 36 deletions(-) create mode 100644 integration_tests/tests/integration_tests/rollup_tests.rs diff --git a/Cargo.lock b/Cargo.lock index e775d54e6..1a2ce4659 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3100,6 +3100,7 @@ dependencies = [ "itertools 0.10.5", "log", "migration", + "mpl-bubblegum", "mpl-token-metadata", "nft_ingester", "once_cell", @@ -3113,8 +3114,10 @@ dependencies = [ "solana-client", "solana-sdk", "solana-transaction-status", + "spl-concurrent-merkle-tree 0.2.0", "spl-token", "sqlx", + "tempfile", "tokio", "tokio-stream", ] diff --git a/Cargo.toml b/Cargo.toml index de69ab3e9..2cb3945cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,6 +129,7 @@ mockall = "0.11.4" xxhash-rust = { version = "0.8.10", features = ["xxh3"] } serde_with = "3.8.1" bincode = "1.3.3" +tempfile = "3.10.1" [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 10c817a3e..5d796c975 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -33,3 +33,6 @@ spl-token = { workspace = true, features = ["no-entrypoint"] } sqlx = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +mpl-bubblegum = { workspace = true } +spl-concurrent-merkle-tree = { workspace = true } +tempfile = { workspace = true } \ No newline at end of file diff --git a/integration_tests/tests/integration_tests/main.rs b/integration_tests/tests/integration_tests/main.rs index 7220ca96c..6b0fe1dba 100644 --- a/integration_tests/tests/integration_tests/main.rs +++ b/integration_tests/tests/integration_tests/main.rs @@ -4,3 +4,4 @@ mod common; mod general_scenario_tests; mod mpl_core_tests; mod regular_nft_tests; +mod rollup_tests; diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/rollup_tests.rs new file mode 100644 index 000000000..81a89d43f --- /dev/null +++ b/integration_tests/tests/integration_tests/rollup_tests.rs @@ -0,0 +1,276 @@ +use crate::common::TestSetup; +use borsh::BorshSerialize; +use das_api::api::ApiContract; +use das_api::api::GetAssetProof; +use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; +use digital_asset_types::dao::{rollup, rollup_to_verify}; +use flatbuffers::FlatBufferBuilder; +use mpl_bubblegum::types::LeafSchema; +use nft_ingester::plerkle::PlerkleTransactionInfo; +use plerkle_serialization::root_as_transaction_info; +use plerkle_serialization::serializer::serialize_transaction; +use program_transformers::rollups::rollup_persister::{ + MockRollupDownloader, Rollup, RollupPersister, +}; +use program_transformers::rollups::tests::generate_rollup; +use sea_orm::sea_query::OnConflict; +use sea_orm::{ColumnTrait, ConnectionTrait, DbBackend, IntoActiveModel, QueryTrait, Set}; +use sea_orm::{EntityTrait, QueryFilter}; +use solana_sdk::instruction::CompiledInstruction; +use solana_sdk::keccak; +use solana_sdk::message::{Message, MessageHeader}; +use solana_sdk::pubkey::Pubkey; +use solana_sdk::signature::Signature; +use solana_sdk::transaction::{SanitizedTransaction, Transaction}; +use solana_transaction_status::{InnerInstruction, InnerInstructions, TransactionStatusMeta}; +use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; +use std::fs::File; +use std::str::FromStr; + +#[tokio::test] +async fn save_rollup_to_queue_test() { + let setup = TestSetup::new("save_rollup_to_queue_test".to_string()).await; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + + // arbitrary data + let rollup_instruction_data = + mpl_bubblegum::instructions::FinalizeTreeWithRootInstructionArgs { + rightmost_root: [1; 32], + rightmost_leaf: [1; 32], + rightmost_index: 99, + metadata_url: metadata_url.clone(), + metadata_hash: metadata_hash.clone(), + }; + + // took it from Bubblegum client + // this value is generated by Anchor library, it's instruction identifier + let mut instruction_data = vec![101, 214, 253, 135, 176, 170, 11, 235]; + instruction_data.extend(rollup_instruction_data.try_to_vec().unwrap().iter()); + + let transaction = SanitizedTransaction::from_transaction_for_tests(Transaction { + signatures: vec![Signature::new_unique()], + message: Message { + header: MessageHeader { + num_required_signatures: 1, + num_readonly_signed_accounts: 0, + num_readonly_unsigned_accounts: 0, + }, + account_keys: vec![ + Pubkey::new_unique(), + Pubkey::from_str("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY").unwrap(), + Pubkey::new_unique(), + Pubkey::new_unique(), + ], + recent_blockhash: [1; 32].into(), + instructions: vec![CompiledInstruction { + program_id_index: 1, + accounts: vec![2, 3], + data: instruction_data, + }], + }, + }); + + // inner instruction is useless here but required by transaction parser + let transaction_status_meta = TransactionStatusMeta { + inner_instructions: Some(vec![InnerInstructions { + index: 0, + instructions: vec![InnerInstruction { + instruction: CompiledInstruction { + program_id_index: 2, + accounts: vec![], + data: vec![], + }, + stack_height: None, + }], + }]), + ..Default::default() + }; + + let transaction_info = + plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaTransactionInfoV2 { + signature: &Signature::new_unique(), + is_vote: false, + transaction: &transaction, + transaction_status_meta: &transaction_status_meta, + index: 0, + }; + let builder = FlatBufferBuilder::new(); + let builder = serialize_transaction(builder, &transaction_info, 10); + let transaction_info = PlerkleTransactionInfo( + root_as_transaction_info(builder.finished_data().to_vec().as_slice()).unwrap(), + ) + .try_into() + .unwrap(); + + setup + .transformer + .handle_transaction(&transaction_info) + .await + .unwrap(); + + let r = rollup_to_verify::Entity::find() + .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap(); + + assert_eq!(r.file_hash, metadata_hash); + assert_eq!(r.url, metadata_url); +} + +fn generate_merkle_tree_from_rollup(rollup: &Rollup) -> ConcurrentMerkleTree<10, 32> { + let mut merkle_tree = ConcurrentMerkleTree::<10, 32>::new(); + merkle_tree.initialize().unwrap(); + + for (nonce, asset) in rollup.rolled_mints.iter().enumerate() { + let metadata_args_hash = keccak::hashv(&[asset.mint_args.try_to_vec().unwrap().as_slice()]); + let data_hash = keccak::hashv(&[ + &metadata_args_hash.to_bytes(), + &asset.mint_args.seller_fee_basis_points.to_le_bytes(), + ]); + + let creator_data = asset + .mint_args + .creators + .iter() + .map(|c| [c.address.as_ref(), &[c.verified as u8], &[c.share]].concat()) + .collect::>(); + + let creator_hash = keccak::hashv( + creator_data + .iter() + .map(|c| c.as_slice()) + .collect::>() + .as_ref(), + ); + + let id = mpl_bubblegum::utils::get_asset_id(&rollup.tree_id, nonce as u64); + + let leaf = LeafSchema::V1 { + id, + owner: Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(), + delegate: Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(), + nonce: nonce as u64, + data_hash: data_hash.to_bytes(), + creator_hash: creator_hash.to_bytes(), + }; + merkle_tree.append(leaf.hash()).unwrap(); + } + merkle_tree +} + +#[tokio::test] +async fn rollup_persister_test() { + let setup = TestSetup::new("rollup_persister_test".to_string()).await; + let test_rollup = generate_rollup(10); + let tmp_dir = tempfile::TempDir::new().unwrap(); + + let tmp_file = File::create(tmp_dir.path().join("rollup-10.json")).unwrap(); + serde_json::to_writer(tmp_file, &test_rollup).unwrap(); + + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let rollup_to_verify = rollup_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + download_attempts: Set(0), + rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), + rollup_fail_status: Set(None), + } + .into_active_model(); + + let query = rollup_to_verify::Entity::insert(rollup_to_verify) + .on_conflict( + OnConflict::columns([rollup_to_verify::Column::FileHash]) + .update_columns([rollup_to_verify::Column::Url]) + .update_columns([rollup_to_verify::Column::Signature]) + .update_columns([rollup_to_verify::Column::DownloadAttempts]) + .update_columns([rollup_to_verify::Column::RollupFailStatus]) + .update_columns([rollup_to_verify::Column::RollupPersistingState]) + .update_columns([rollup_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockRollupDownloader::new(); + mocked_downloader + .expect_download_rollup_and_check_checksum() + .returning(move |_, _| { + let json_file = std::fs::read_to_string(tmp_dir.path().join("rollup-10.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader, true); + + let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); + + rollup_persister + .persist_rollup(rollup_to_verify.unwrap(), None) + .await; + let merkle_tree = generate_merkle_tree_from_rollup(&test_rollup); + + let leaf_index = 4u32; + + let payload = GetAssetProof { + id: test_rollup + .rolled_mints + .get(leaf_index as usize) + .unwrap() + .leaf_update + .id() + .to_string(), + }; + let asset_proof = setup.das_api.get_asset_proof(payload).await.unwrap(); + let mut proofs: [[u8; 32]; 10] = [[0; 32]; 10]; + + for (i, s) in asset_proof.proof.iter().enumerate() { + proofs[i] = Pubkey::from_str(s).unwrap().to_bytes(); + } + + assert_eq!( + merkle_tree.check_valid_proof( + Pubkey::from_str(asset_proof.leaf.as_str()) + .unwrap() + .to_bytes(), + &proofs, + leaf_index + ), + true + ); + assert_eq!( + merkle_tree.check_valid_proof( + Pubkey::from_str(asset_proof.leaf.as_str()) + .unwrap() + .to_bytes(), + &proofs, + leaf_index + 1 + ), + false + ); + + assert_eq!( + rollup_to_verify::Entity::find() + .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .rollup_persisting_state, + RollupPersistingState::StoredUpdate + ); + + assert_eq!( + rollup::Entity::find() + .filter(rollup::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .is_some(), + true + ); +} diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index d8d86decb..35590628b 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -1,6 +1,7 @@ use blockbuster::programs::bubblegum::Payload; use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; -use sea_orm::{ActiveModelTrait, Set}; +use sea_orm::sea_query::OnConflict; +use sea_orm::{DbBackend, EntityTrait, QueryTrait, Set}; use { crate::error::{ProgramTransformerError, ProgramTransformerResult}, blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}, @@ -16,18 +17,37 @@ where T: ConnectionTrait + TransactionTrait, { if let Some(Payload::CreateTreeWithRoot { args, .. }) = &parsing_result.payload { - digital_asset_types::dao::rollup_to_verify::ActiveModel { - file_hash: Set(args.metadata_hash.clone()), - url: Set(args.metadata_url.clone()), - created_at_slot: Set(bundle.slot as i64), - signature: Set(bundle.txn_id.to_string()), - download_attempts: Set(0), - rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), - rollup_fail_status: Set(None), - } - .insert(txn) - .await - .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; + let query = digital_asset_types::dao::rollup_to_verify::Entity::insert( + digital_asset_types::dao::rollup_to_verify::ActiveModel { + file_hash: Set(args.metadata_hash.clone()), + url: Set(args.metadata_url.clone()), + created_at_slot: Set(bundle.slot as i64), + signature: Set(bundle.txn_id.to_string()), + download_attempts: Set(0), + rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), + rollup_fail_status: Set(None), + }, + ) + .on_conflict( + OnConflict::columns([digital_asset_types::dao::rollup_to_verify::Column::FileHash]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Url]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Signature]) + .update_columns([ + digital_asset_types::dao::rollup_to_verify::Column::DownloadAttempts, + ]) + .update_columns([ + digital_asset_types::dao::rollup_to_verify::Column::RollupFailStatus, + ]) + .update_columns([ + digital_asset_types::dao::rollup_to_verify::Column::RollupPersistingState, + ]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + txn.execute(query) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; return Ok(()); } diff --git a/program_transformers/src/rollups/mod.rs b/program_transformers/src/rollups/mod.rs index 54e92f651..6b85d8dd2 100644 --- a/program_transformers/src/rollups/mod.rs +++ b/program_transformers/src/rollups/mod.rs @@ -1,3 +1,3 @@ mod merkle_tree_wrapper; pub mod rollup_persister; -mod tests; +pub mod tests; diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 4c70870e6..3d225e402 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -14,10 +14,11 @@ use mockall::automock; use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; use mpl_bubblegum::utils::get_asset_id; use mpl_bubblegum::{InstructionName, LeafSchemaEvent}; +use sea_orm::sea_query::OnConflict; use sea_orm::ActiveValue::Set; use sea_orm::{ - ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, EntityTrait, IntoActiveModel, - QueryFilter, QueryOrder, TransactionTrait, + ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, DbBackend, EntityTrait, + IntoActiveModel, QueryFilter, QueryOrder, QueryTrait, TransactionTrait, }; use serde::{Deserialize, Serialize}; use serde_json::value::RawValue; @@ -250,7 +251,9 @@ impl RollupPersister } } &RollupPersistingState::FailedToPersist | &RollupPersistingState::StoredUpdate => { - if let Err(_e) = self.drop_rollup_from_queue(&rollup_to_verify).await {}; + if let Err(e) = self.drop_rollup_from_queue(&rollup_to_verify).await { + error!("failed to drop rollup from queue: {}", e); + }; info!( "Finish processing {} rollup file with {:?} state", &rollup_to_verify.url, &rollup_to_verify.rollup_persisting_state @@ -261,7 +264,7 @@ impl RollupPersister } } - async fn get_rollup_to_verify( + pub async fn get_rollup_to_verify( &self, ) -> Result<(Option, Option), ProgramTransformerError> { @@ -310,14 +313,18 @@ impl RollupPersister .await { Ok(r) => { - if let Err(e) = (rollup::ActiveModel { - file_hash: Default::default(), + let query = rollup::Entity::insert(rollup::ActiveModel { + file_hash: Set(rollup_to_verify.file_hash.clone()), rollup_binary_bincode: Set(bincode::serialize(rollup) .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), }) - .insert(self.txn.as_ref()) - .await - { + .on_conflict( + OnConflict::columns([rollup::Column::FileHash]) + .update_columns([rollup::Column::RollupBinaryBincode]) + .to_owned(), + ) + .build(DbBackend::Postgres); + if let Err(e) = self.txn.execute(query).await { return Err(e.into()); } *rollup = Some(r); @@ -445,18 +452,17 @@ impl RollupPersister &self, rollup_to_verify: &rollup_to_verify::Model, ) -> Result<(), ProgramTransformerError> { - if rollup_to_verify::Entity::find_by_id(rollup_to_verify.file_hash.clone()) - .one(self.txn.as_ref()) - .await? - .is_some() - { - rollup_to_verify - .clone() - .into_active_model() - .update(self.txn.as_ref()) - .await - .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; - } + rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { + rollup_persisting_state: Set(rollup_to_verify.rollup_persisting_state.clone()), + rollup_fail_status: Set(rollup_to_verify.rollup_fail_status.clone()), + download_attempts: Set(rollup_to_verify.download_attempts), + ..rollup_to_verify.clone().into_active_model() + }) + .filter(rollup_to_verify::Column::FileHash.eq(rollup_to_verify.file_hash.clone())) + .exec(self.txn.as_ref()) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; + Ok(()) } } diff --git a/program_transformers/src/rollups/tests.rs b/program_transformers/src/rollups/tests.rs index 2f0a9c0b5..8e0626c45 100644 --- a/program_transformers/src/rollups/tests.rs +++ b/program_transformers/src/rollups/tests.rs @@ -11,7 +11,7 @@ use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; use std::collections::HashMap; use std::str::FromStr; -fn generate_rollup(size: usize) -> Rollup { +pub fn generate_rollup(size: usize) -> Rollup { let authority = Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(); let tree = Pubkey::from_str("HxhCw9g3kZvrdg9zZvctmh6qpSDg1FfsBXfFvRkbCHB7").unwrap(); let mut mints = Vec::new(); From 6d7cc81921bc8b5af8b5cc0772fa823e70cebc80 Mon Sep 17 00:00:00 2001 From: requesco Date: Wed, 12 Jun 2024 12:47:46 +0300 Subject: [PATCH 19/34] more tests + fix --- .../tests/integration_tests/rollup_tests.rs | 80 ++++++++++++++++++- .../src/rollups/rollup_persister.rs | 9 +-- 2 files changed, 80 insertions(+), 9 deletions(-) diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/rollup_tests.rs index 81a89d43f..8c1f3ad17 100644 --- a/integration_tests/tests/integration_tests/rollup_tests.rs +++ b/integration_tests/tests/integration_tests/rollup_tests.rs @@ -2,15 +2,16 @@ use crate::common::TestSetup; use borsh::BorshSerialize; use das_api::api::ApiContract; use das_api::api::GetAssetProof; -use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; +use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; use digital_asset_types::dao::{rollup, rollup_to_verify}; use flatbuffers::FlatBufferBuilder; use mpl_bubblegum::types::LeafSchema; use nft_ingester::plerkle::PlerkleTransactionInfo; use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_transaction; +use program_transformers::error::RollupValidationError; use program_transformers::rollups::rollup_persister::{ - MockRollupDownloader, Rollup, RollupPersister, + MockRollupDownloader, Rollup, RollupPersister, MAX_ROLLUP_DOWNLOAD_ATTEMPTS, }; use program_transformers::rollups::tests::generate_rollup; use sea_orm::sea_query::OnConflict; @@ -206,9 +207,7 @@ async fn rollup_persister_test() { }); let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader, true); - let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); - rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) .await; @@ -274,3 +273,76 @@ async fn rollup_persister_test() { true ); } + +#[tokio::test] +async fn rollup_persister_download_fail_test() { + let setup = TestSetup::new("rollup_persister_download_fail_test".to_string()).await; + let test_rollup = generate_rollup(10); + let tmp_dir = tempfile::TempDir::new().unwrap(); + let tmp_file = File::create(tmp_dir.path().join("rollup-10.json")).unwrap(); + serde_json::to_writer(tmp_file, &test_rollup).unwrap(); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let rollup_to_verify = rollup_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + download_attempts: Set(download_attempts), + rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), + rollup_fail_status: Set(None), + } + .into_active_model(); + + let query = rollup_to_verify::Entity::insert(rollup_to_verify) + .on_conflict( + OnConflict::columns([rollup_to_verify::Column::FileHash]) + .update_columns([rollup_to_verify::Column::Url]) + .update_columns([rollup_to_verify::Column::Signature]) + .update_columns([rollup_to_verify::Column::DownloadAttempts]) + .update_columns([rollup_to_verify::Column::RollupFailStatus]) + .update_columns([rollup_to_verify::Column::RollupPersistingState]) + .update_columns([rollup_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockRollupDownloader::new(); + mocked_downloader + .expect_download_rollup_and_check_checksum() + .returning(move |_, _| { + Err(RollupValidationError::Reqwest( + "Could not download file".to_string(), + )) + }); + + let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader, true); + let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); + rollup_persister + .persist_rollup(rollup_to_verify.unwrap(), None) + .await; + + assert_eq!( + rollup_to_verify::Entity::find() + .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .rollup_persisting_state, + RollupPersistingState::FailedToPersist + ); + assert_eq!( + rollup_to_verify::Entity::find() + .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .rollup_fail_status, + Some(RollupFailStatus::DownloadFailed) + ); +} diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 3d225e402..005d4e5e0 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -433,7 +433,7 @@ impl RollupPersister status: RollupFailStatus, rollup: &rollup_to_verify::Model, ) -> Result<(), ProgramTransformerError> { - rollup_to_verify::ActiveModel { + rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { file_hash: Set(rollup.file_hash.clone()), url: Set(rollup.url.clone()), created_at_slot: Set(rollup.created_at_slot), @@ -441,8 +441,9 @@ impl RollupPersister download_attempts: Set(rollup.download_attempts), rollup_persisting_state: Set(rollup.rollup_persisting_state.clone()), rollup_fail_status: Set(Some(status)), - } - .insert(self.txn.as_ref()) + }) + .filter(rollup_to_verify::Column::FileHash.eq(rollup.file_hash.clone())) + .exec(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; Ok(()) @@ -454,8 +455,6 @@ impl RollupPersister ) -> Result<(), ProgramTransformerError> { rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { rollup_persisting_state: Set(rollup_to_verify.rollup_persisting_state.clone()), - rollup_fail_status: Set(rollup_to_verify.rollup_fail_status.clone()), - download_attempts: Set(rollup_to_verify.download_attempts), ..rollup_to_verify.clone().into_active_model() }) .filter(rollup_to_verify::Column::FileHash.eq(rollup_to_verify.file_hash.clone())) From 19674febc9a331b1b6480518305e13b30e713e85 Mon Sep 17 00:00:00 2001 From: requesco Date: Thu, 27 Jun 2024 13:50:39 +0300 Subject: [PATCH 20/34] some comments --- .gitmodules | 4 +++ blockbuster/.gitignore | 11 ------ blockbuster/.gitmodules | 4 --- blockbuster/README.md | 22 ------------ .../blockbuster/src/programs/bubblegum/mod.rs | 34 +++++++++++++++++-- .../programs/token_extensions/extension.rs | 4 +-- .../src/programs/token_extensions/mod.rs | 1 + .../src/dao/generated/prelude.rs | 2 ++ 8 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 .gitmodules delete mode 100644 blockbuster/.gitignore delete mode 100644 blockbuster/.gitmodules delete mode 100644 blockbuster/README.md diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..0df22b35f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "mpl-bubblegum"] + path = mpl-bubblegum + url = git@github.com:adm-metaex/mpl-bubblegum.git + branch = feat/staker-role-reference diff --git a/blockbuster/.gitignore b/blockbuster/.gitignore deleted file mode 100644 index 28aaccd5c..000000000 --- a/blockbuster/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -/target/ - - -# These are backup files generated by rustfmt -**/*.rs.bk - -*.iml -blockbuster/target -target/ diff --git a/blockbuster/.gitmodules b/blockbuster/.gitmodules deleted file mode 100644 index 8a0ec5533..000000000 --- a/blockbuster/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "mpl-bubblegum"] - path = mpl-bubblegum - url = git@github.com:n00m4d/mpl-bubblegum.git - branch = feat/rollup diff --git a/blockbuster/README.md b/blockbuster/README.md deleted file mode 100644 index 896d8bbc5..000000000 --- a/blockbuster/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# BlockBuster - -BlockBuster -> "Busting Solana blocks into little pieces to index and operate on the programs therein" - Noone - 1995 - -This repository is the home for Metaplex Program Parsers. Program parsers are canonical libraries that take a transaction or account update from a geyser plugin and parse them correctly according to Metaplex smart contracts. This sort of parsing is hard to automate as it must contain some knowledge of the API structure of the contract which is not fully describable yet via IDLs. Things like remaining accounts, optional accounts and complex instruction data are not always 100% clear what they mean without knowledge of the contract. - -## Mode of Operation -This library works best as a consumer of messages sent via a geyser plugin using the [Plerkle Serialization](https://github.com/metaplex-foundation/digital-asset-validator-plugin) library by metaplex. The types from that library are FlatBuffer based currently, and are the wire format of messages coming out of Plerkle into the rest of the infrastructure. -For more information about Plerkle and the [Digital Asset RPC infrastructure](https://github.com/metaplex-foundation/digital-asset-validator-plugin) It can however be used in any general programs provided you can create the data in the FlatBuffer types. - -## Scope - -This library contains parsers for the following programs and the parsers are specific to how these contracts relate to metaplex assets. - -* Gummyroll (Solana) -* Bubblegum (Metaplex) -* Spl Token (Solana) -* Token Metadata (Metaplex) -* Auction House (Metaplex) -* Candy Machine (Metaplex) -* Hydra (Metaplex) - diff --git a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs index 2b61948aa..4ceb6d1d2 100644 --- a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs @@ -4,7 +4,7 @@ use crate::{ program_handler::{NotUsed, ParseResult, ProgramParser}, programs::ProgramParseResult, }; -use borsh::de::BorshDeserialize; +use borsh::{BorshDeserialize, BorshSerialize}; use log::warn; use mpl_bubblegum::{ get_instruction_type, @@ -26,6 +26,32 @@ pub use spl_account_compression::events::{ use spl_noop; +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub struct FinalizeTreeWithRootInstructionArgsWithStaker { + pub rightmost_root: [u8; 32], + pub rightmost_leaf: [u8; 32], + pub rightmost_index: u32, + pub metadata_url: String, + pub metadata_hash: String, + pub staker: Pubkey, +} +impl FinalizeTreeWithRootInstructionArgsWithStaker { + fn build_finalize_tree_with_root_instruction_args_with_staker( + args: FinalizeTreeWithRootInstructionArgs, + staker: Pubkey, + ) -> Self { + Self { + rightmost_root: args.rightmost_root, + rightmost_leaf: args.rightmost_leaf, + rightmost_index: args.rightmost_index, + metadata_url: args.metadata_url, + metadata_hash: args.metadata_hash, + staker, + } + } +} + #[derive(Eq, PartialEq)] pub enum Payload { Unknown, @@ -55,7 +81,7 @@ pub enum Payload { tree_id: Pubkey, }, CreateTreeWithRoot { - args: FinalizeTreeWithRootInstructionArgs, + args: FinalizeTreeWithRootInstructionArgsWithStaker, tree_id: Pubkey, }, } @@ -319,6 +345,10 @@ fn build_create_tree_with_root_payload( let tree_id = *keys .get(1) .ok_or(BlockbusterError::InstructionParsingError)?; + let staker = *keys + .get(2) + .ok_or(BlockbusterError::InstructionParsingError)?; + let args = FinalizeTreeWithRootInstructionArgsWithStaker::build_finalize_tree_with_root_instruction_args_with_staker(args, staker); Ok(Payload::CreateTreeWithRoot { args, tree_id }) } diff --git a/blockbuster/blockbuster/src/programs/token_extensions/extension.rs b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs index d186fe863..b09a3f1b5 100644 --- a/blockbuster/blockbuster/src/programs/token_extensions/extension.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs @@ -287,8 +287,8 @@ impl<'de> Visitor<'de> for ShadowAeCiphertextVisitor { A: SeqAccess<'de>, { let mut arr = [0u8; AE_CIPHERTEXT_LEN]; - for i in 0..AE_CIPHERTEXT_LEN { - arr[i] = seq + for (i, item) in arr.iter_mut().enumerate().take(AE_CIPHERTEXT_LEN) { + *item = seq .next_element()? .ok_or(de::Error::invalid_length(i, &self))?; } diff --git a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs index 1d5e2c8bb..be99a60e7 100644 --- a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs @@ -82,6 +82,7 @@ pubkeys!( pub struct Token2022AccountParser; +#[allow(clippy::large_enum_variant)] pub enum TokenExtensionsProgramAccount { TokenAccount(TokenAccount), MintAccount(MintAccount), diff --git a/digital_asset_types/src/dao/generated/prelude.rs b/digital_asset_types/src/dao/generated/prelude.rs index 506e26bae..3d9e7a882 100644 --- a/digital_asset_types/src/dao/generated/prelude.rs +++ b/digital_asset_types/src/dao/generated/prelude.rs @@ -1,5 +1,7 @@ //! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 +#![allow(unused_imports)] + pub use super::asset::Entity as Asset; pub use super::asset_authority::Entity as AssetAuthority; pub use super::asset_creators::Entity as AssetCreators; From e8d97211e7539bacbb663f9c51ce0da350b2707b Mon Sep 17 00:00:00 2001 From: requesco Date: Mon, 1 Jul 2024 07:39:23 +0300 Subject: [PATCH 21/34] wip --- Builder.Dockerfile | 1 + .../tests/integration_tests/rollup_tests.rs | 4 ++-- ...alize_tree_with_root_instruction_handle.rs | 4 ++++ nft_ingester/src/main.rs | 1 - .../src/rollups/rollup_persister.rs | 20 +++++-------------- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Builder.Dockerfile b/Builder.Dockerfile index 4ea85b7c9..e93234724 100644 --- a/Builder.Dockerfile +++ b/Builder.Dockerfile @@ -5,6 +5,7 @@ RUN apt-get update -y && \ RUN mkdir /rust RUN mkdir /rust/bins COPY Cargo.toml /rust +COPY Cargo.lock /rust COPY core /rust/core COPY das_api /rust/das_api COPY digital_asset_types /rust/digital_asset_types diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/rollup_tests.rs index 8c1f3ad17..ba1731dd8 100644 --- a/integration_tests/tests/integration_tests/rollup_tests.rs +++ b/integration_tests/tests/integration_tests/rollup_tests.rs @@ -206,7 +206,7 @@ async fn rollup_persister_test() { Ok(Box::new(serde_json::from_str(&json_file).unwrap())) }); - let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader, true); + let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) @@ -319,7 +319,7 @@ async fn rollup_persister_download_fail_test() { )) }); - let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader, true); + let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 28c93a6b2..0d03e5b1e 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -29,6 +29,7 @@ impl MigrationTrait for Migration { .as_enum(RollupToVerify::RollupPersistingState) .values([ PersistingRollupState::ReceivedTransaction, + PersistingRollupState::StartProcessing, PersistingRollupState::FailedToPersist, PersistingRollupState::SuccessfullyDownload, PersistingRollupState::SuccessfullyValidate, @@ -60,6 +61,7 @@ impl MigrationTrait for Migration { .string() .not_null(), ) + .col(ColumnDef::new(RollupToVerify::Staker).binary().not_null()) .col( ColumnDef::new(RollupToVerify::DownloadAttempts) .unsigned() @@ -140,12 +142,14 @@ enum RollupToVerify { DownloadAttempts, RollupPersistingState, RollupFailStatus, + Staker, } #[derive(Iden, Debug, PartialEq, Sequence)] enum PersistingRollupState { ReceivedTransaction, FailedToPersist, + StartProcessing, SuccessfullyDownload, SuccessfullyValidate, StoredUpdate, diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index ea0b3f12c..e46fc6443 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -159,7 +159,6 @@ pub async fn main() -> Result<(), IngesterError> { database_pool.clone(), )), RollupDownloaderForPersister {}, - config.cl_audits.unwrap_or_default(), ); tasks.spawn(async move { rollup_persister.persist_rollups().await; diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 005d4e5e0..3c7b2a4d8 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -150,7 +150,6 @@ pub trait RollupDownloader { pub struct RollupPersister { txn: Arc, downloader: D, - cl_audits: bool, } pub struct RollupDownloaderForPersister {} @@ -181,12 +180,8 @@ impl RollupDownloader for RollupDownloaderForPersister { } impl RollupPersister { - pub fn new(txn: Arc, downloader: D, cl_audits: bool) -> Self { - Self { - txn, - downloader, - cl_audits, - } + pub fn new(txn: Arc, downloader: D) -> Self { + Self { txn, downloader } } pub async fn persist_rollups(&self) { @@ -199,13 +194,10 @@ impl RollupPersister // no rollups to persist continue; }; - let Ok(rollup) = rollup + let rollup = rollup .map(|r| bincode::deserialize::(r.rollup_binary_bincode.as_slice())) .transpose() - .map_err(|e| ProgramTransformerError::DeserializationError(e.to_string())) - else { - continue; - }; + .unwrap_or_default(); self.persist_rollup(rollup_to_verify, rollup.map(Box::new)) .await; } @@ -416,7 +408,6 @@ impl RollupPersister rollup_to_verify.signature.clone(), rollup, self.txn.as_ref(), - self.cl_audits, ) .await .is_err() @@ -544,7 +535,6 @@ pub async fn store_rollup_update( signature: String, rollup: &Rollup, txn: &T, - cl_audits: bool, ) -> ProgramTransformerResult<()> where T: ConnectionTrait + TransactionTrait, @@ -562,7 +552,7 @@ where }, txn, "CreateTreeWithRoot", - cl_audits, + false, ) .await?; } From 3181d991585147f9a687fad1d26808728681d564 Mon Sep 17 00:00:00 2001 From: requesco Date: Mon, 1 Jul 2024 09:20:41 +0300 Subject: [PATCH 22/34] add Staker role and StartProcessing RollupPersistingState --- .../src/dao/generated/rollup_to_verify.rs | 3 + .../src/dao/generated/sea_orm_active_enums.rs | 198 +++++++++--------- .../src/bubblegum/finalize_tree_with_root.rs | 1 + .../src/rollups/rollup_persister.rs | 27 ++- 4 files changed, 129 insertions(+), 100 deletions(-) diff --git a/digital_asset_types/src/dao/generated/rollup_to_verify.rs b/digital_asset_types/src/dao/generated/rollup_to_verify.rs index 26b885e1f..87bccc8ca 100644 --- a/digital_asset_types/src/dao/generated/rollup_to_verify.rs +++ b/digital_asset_types/src/dao/generated/rollup_to_verify.rs @@ -20,6 +20,7 @@ pub struct Model { pub url: String, pub created_at_slot: i64, pub signature: String, + pub staker: Vec, pub download_attempts: i32, pub rollup_persisting_state: RollupPersistingState, pub rollup_fail_status: Option, @@ -31,6 +32,7 @@ pub enum Column { Url, CreatedAtSlot, Signature, + Staker, DownloadAttempts, RollupPersistingState, RollupFailStatus, @@ -59,6 +61,7 @@ impl ColumnTrait for Column { Self::Url => ColumnType::String(None).def(), Self::CreatedAtSlot => ColumnType::BigInteger.def(), Self::Signature => ColumnType::String(None).def(), + Self::Staker => ColumnType::Binary.def(), Self::DownloadAttempts => ColumnType::Integer.def(), Self::RollupPersistingState => RollupPersistingState::db_type(), Self::RollupFailStatus => RollupFailStatus::db_type().null(), diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index e2edf4230..ae880a38c 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -4,52 +4,40 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] -pub enum RollupFailStatus { - #[sea_orm(string_value = "checksum_verify_failed")] - ChecksumVerifyFailed, - #[sea_orm(string_value = "download_failed")] - DownloadFailed, - #[sea_orm(string_value = "file_serialization")] - FileSerialization, - #[sea_orm(string_value = "rollup_verify_failed")] - RollupVerifyFailed, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "v1_account_attachments" -)] -pub enum V1AccountAttachments { - #[sea_orm(string_value = "edition")] - Edition, - #[sea_orm(string_value = "edition_marker")] - EditionMarker, - #[sea_orm(string_value = "master_edition_v1")] - MasterEditionV1, - #[sea_orm(string_value = "master_edition_v2")] - MasterEditionV2, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] +pub enum Instruction { + #[sea_orm(string_value = "burn")] + Burn, + #[sea_orm(string_value = "cancel_redeem")] + CancelRedeem, + #[sea_orm(string_value = "compress")] + Compress, + #[sea_orm(string_value = "decompress_v1")] + DecompressV1, + #[sea_orm(string_value = "delegate")] + Delegate, + #[sea_orm(string_value = "mint_to_collection_v1")] + MintToCollectionV1, + #[sea_orm(string_value = "mint_v1")] + MintV1, + #[sea_orm(string_value = "redeem")] + Redeem, + #[sea_orm(string_value = "set_and_verify_collection")] + SetAndVerifyCollection, + #[sea_orm(string_value = "transfer")] + Transfer, #[sea_orm(string_value = "unknown")] Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "rollup_persisting_state" -)] -pub enum RollupPersistingState { - #[sea_orm(string_value = "failed_to_persist")] - FailedToPersist, - #[sea_orm(string_value = "received_transaction")] - ReceivedTransaction, - #[sea_orm(string_value = "stored_update")] - StoredUpdate, - #[sea_orm(string_value = "successfully_download")] - SuccessfullyDownload, - #[sea_orm(string_value = "successfully_validate")] - SuccessfullyValidate, + #[sea_orm(string_value = "unverify_collection")] + UnverifyCollection, + #[sea_orm(string_value = "unverify_creator")] + UnverifyCreator, + #[sea_orm(string_value = "update_metadata")] + UpdateMetadata, + #[sea_orm(string_value = "verify_collection")] + VerifyCollection, + #[sea_orm(string_value = "verify_creator")] + VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( @@ -84,18 +72,6 @@ pub enum SpecificationAssetClass { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] -pub enum TaskStatus { - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "running")] - Running, - #[sea_orm(string_value = "success")] - Success, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", @@ -112,40 +88,56 @@ pub enum RoyaltyTargetType { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] -pub enum Instruction { - #[sea_orm(string_value = "burn")] - Burn, - #[sea_orm(string_value = "cancel_redeem")] - CancelRedeem, - #[sea_orm(string_value = "compress")] - Compress, - #[sea_orm(string_value = "decompress_v1")] - DecompressV1, - #[sea_orm(string_value = "delegate")] - Delegate, - #[sea_orm(string_value = "mint_to_collection_v1")] - MintToCollectionV1, - #[sea_orm(string_value = "mint_v1")] - MintV1, - #[sea_orm(string_value = "redeem")] - Redeem, - #[sea_orm(string_value = "set_and_verify_collection")] - SetAndVerifyCollection, - #[sea_orm(string_value = "transfer")] - Transfer, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] +pub enum RollupFailStatus { + #[sea_orm(string_value = "checksum_verify_failed")] + ChecksumVerifyFailed, + #[sea_orm(string_value = "download_failed")] + DownloadFailed, + #[sea_orm(string_value = "file_serialization")] + FileSerialization, + #[sea_orm(string_value = "rollup_verify_failed")] + RollupVerifyFailed, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] +pub enum TaskStatus { + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "running")] + Running, + #[sea_orm(string_value = "success")] + Success, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] +pub enum ChainMutability { + #[sea_orm(string_value = "immutable")] + Immutable, + #[sea_orm(string_value = "mutable")] + Mutable, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "v1_account_attachments" +)] +pub enum V1AccountAttachments { + #[sea_orm(string_value = "edition")] + Edition, + #[sea_orm(string_value = "edition_marker")] + EditionMarker, + #[sea_orm(string_value = "master_edition_v1")] + MasterEditionV1, + #[sea_orm(string_value = "master_edition_v2")] + MasterEditionV2, #[sea_orm(string_value = "unknown")] Unknown, - #[sea_orm(string_value = "unverify_collection")] - UnverifyCollection, - #[sea_orm(string_value = "unverify_creator")] - UnverifyCreator, - #[sea_orm(string_value = "update_metadata")] - UpdateMetadata, - #[sea_orm(string_value = "verify_collection")] - VerifyCollection, - #[sea_orm(string_value = "verify_creator")] - VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] @@ -174,6 +166,26 @@ pub enum SpecificationVersions { V2, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "rollup_persisting_state" +)] +pub enum RollupPersistingState { + #[sea_orm(string_value = "failed_to_persist")] + FailedToPersist, + #[sea_orm(string_value = "received_transaction")] + ReceivedTransaction, + #[sea_orm(string_value = "start_processing")] + StartProcessing, + #[sea_orm(string_value = "stored_update")] + StoredUpdate, + #[sea_orm(string_value = "successfully_download")] + SuccessfullyDownload, + #[sea_orm(string_value = "successfully_validate")] + SuccessfullyValidate, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] pub enum OwnerType { #[sea_orm(string_value = "single")] @@ -183,13 +195,3 @@ pub enum OwnerType { #[sea_orm(string_value = "unknown")] Unknown, } -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] -pub enum ChainMutability { - #[sea_orm(string_value = "immutable")] - Immutable, - #[sea_orm(string_value = "mutable")] - Mutable, - #[sea_orm(string_value = "unknown")] - Unknown, -} diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 35590628b..04115914a 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -23,6 +23,7 @@ where url: Set(args.metadata_url.clone()), created_at_slot: Set(bundle.slot as i64), signature: Set(bundle.txn_id.to_string()), + staker: Set(args.staker.to_bytes().to_vec()), download_attempts: Set(0), rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), rollup_fail_status: Set(None), diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 3c7b2a4d8..b77e13cd2 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -211,7 +211,8 @@ impl RollupPersister info!("Persisting {} rollup", &rollup_to_verify.url); loop { match &rollup_to_verify.rollup_persisting_state { - &RollupPersistingState::ReceivedTransaction => { + &RollupPersistingState::ReceivedTransaction + | &RollupPersistingState::StartProcessing => { if let Err(err) = self .download_rollup(&mut rollup_to_verify, &mut rollup) .await @@ -260,6 +261,7 @@ impl RollupPersister &self, ) -> Result<(Option, Option), ProgramTransformerError> { + let multi_txn = self.txn.begin().await?; let condition = Condition::all() .add( rollup_to_verify::Column::RollupPersistingState @@ -268,12 +270,16 @@ impl RollupPersister .add( rollup_to_verify::Column::RollupPersistingState .ne(RollupPersistingState::StoredUpdate), + ) + .add( + rollup_to_verify::Column::RollupPersistingState + .ne(RollupPersistingState::StartProcessing), ); let rollup_to_verify = rollup_to_verify::Entity::find() .filter(condition) .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) - .one(self.txn.as_ref()) + .one(&multi_txn) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; let mut rollup = None; @@ -283,7 +289,22 @@ impl RollupPersister .one(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; + rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { + file_hash: Set(r.file_hash.clone()), + url: Set(r.url.clone()), + created_at_slot: Set(r.created_at_slot), + signature: Set(r.signature.clone()), + staker: Set(r.staker.clone()), + download_attempts: Set(r.download_attempts), + rollup_persisting_state: Set(RollupPersistingState::StartProcessing), + rollup_fail_status: Set(r.rollup_fail_status.clone()), + }) + .filter(rollup_to_verify::Column::FileHash.eq(r.file_hash.clone())) + .exec(&multi_txn) + .await + .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; } + multi_txn.commit().await?; Ok((rollup_to_verify, rollup)) } @@ -360,6 +381,7 @@ impl RollupPersister url: Set(rollup_to_verify.url.clone()), created_at_slot: Set(rollup_to_verify.created_at_slot), signature: Set(rollup_to_verify.signature.clone()), + staker: Set(rollup_to_verify.staker.clone()), download_attempts: Set(rollup_to_verify.download_attempts + 1), rollup_persisting_state: Set(rollup_to_verify .rollup_persisting_state @@ -429,6 +451,7 @@ impl RollupPersister url: Set(rollup.url.clone()), created_at_slot: Set(rollup.created_at_slot), signature: Set(rollup.signature.clone()), + staker: Set(rollup.staker.clone()), download_attempts: Set(rollup.download_attempts), rollup_persisting_state: Set(rollup.rollup_persisting_state.clone()), rollup_fail_status: Set(Some(status)), From cb3de1dbf07e5997e2926f84317e1b5698eacda0 Mon Sep 17 00:00:00 2001 From: requesco Date: Thu, 4 Jul 2024 01:34:15 +0300 Subject: [PATCH 23/34] new_rollup listener --- .../tests/integration_tests/common.rs | 2 ++ .../tests/integration_tests/rollup_tests.rs | 16 ++++++++-- ...alize_tree_with_root_instruction_handle.rs | 27 +++++++++++++++++ nft_ingester/src/main.rs | 1 + .../src/rollups/rollup_persister.rs | 29 +++++++++++++++++-- 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index e190b39fa..3e328c734 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -66,6 +66,7 @@ pub struct TestSetup { pub db: Arc, pub transformer: ProgramTransformer, pub das_api: DasApi, + pub database_test_url: String, } impl TestSetup { @@ -104,6 +105,7 @@ impl TestSetup { name, client, db: Arc::new(db), + database_test_url, transformer, das_api, } diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/rollup_tests.rs index ba1731dd8..b0915c7a4 100644 --- a/integration_tests/tests/integration_tests/rollup_tests.rs +++ b/integration_tests/tests/integration_tests/rollup_tests.rs @@ -11,7 +11,7 @@ use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_transaction; use program_transformers::error::RollupValidationError; use program_transformers::rollups::rollup_persister::{ - MockRollupDownloader, Rollup, RollupPersister, MAX_ROLLUP_DOWNLOAD_ATTEMPTS, + MockRollupDownloader, Rollup, RollupPersister, }; use program_transformers::rollups::tests::generate_rollup; use sea_orm::sea_query::OnConflict; @@ -178,6 +178,7 @@ async fn rollup_persister_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(0), rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), rollup_fail_status: Set(None), @@ -206,7 +207,11 @@ async fn rollup_persister_test() { Ok(Box::new(serde_json::from_str(&json_file).unwrap())) }); - let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader); + let rollup_persister = RollupPersister::new( + setup.db.clone(), + setup.database_test_url.clone(), + mocked_downloader, + ); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) @@ -290,6 +295,7 @@ async fn rollup_persister_download_fail_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), rollup_fail_status: Set(None), @@ -319,7 +325,11 @@ async fn rollup_persister_download_fail_test() { )) }); - let rollup_persister = RollupPersister::new(setup.db.clone(), mocked_downloader); + let rollup_persister = RollupPersister::new( + setup.db.clone(), + setup.database_test_url.clone(), + mocked_downloader, + ); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 0d03e5b1e..596ed9bfd 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -1,7 +1,9 @@ +use crate::sea_orm::{DatabaseBackend, Statement}; use enum_iterator::all; use enum_iterator_derive::Sequence; use sea_orm::sea_query::extension::postgres::Type; use sea_orm_migration::prelude::*; +use sea_orm_migration::sea_orm::ConnectionTrait; #[derive(DeriveMigrationName)] pub struct Migration; @@ -117,11 +119,36 @@ impl MigrationTrait for Migration { .to_owned(), ) .await?; + manager + .get_connection() + .execute(Statement::from_string( + DatabaseBackend::Postgres, + "CREATE FUNCTION notify_new_rollup() RETURNS trigger LANGUAGE plpgsql AS $$ + BEGIN + PERFORM pg_notify('new_rollup', NEW::text); + RETURN NEW; + END; + $$; + CREATE TRIGGER rollup_to_verify_trigger + AFTER INSERT ON rollup_to_verify + FOR EACH ROW EXECUTE FUNCTION notify_new_rollup();" + .to_string(), + )) + .await?; Ok(()) } async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .get_connection() + .execute(Statement::from_string( + DatabaseBackend::Postgres, + "DROP TRIGGER IF EXISTS rollup_to_verify_trigger ON rollup_to_verify; + DROP FUNCTION IF EXISTS notify_new_rollup;" + .to_string(), + )) + .await?; manager .drop_table(Table::drop().table(RollupToVerify::Table).to_owned()) .await?; diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index e46fc6443..8d9eac874 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -158,6 +158,7 @@ pub async fn main() -> Result<(), IngesterError> { Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( database_pool.clone(), )), + config.get_database_url(), RollupDownloaderForPersister {}, ); tasks.spawn(async move { diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index b77e13cd2..492bd632f 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -25,9 +25,12 @@ use serde_json::value::RawValue; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; +use sqlx::postgres::PgListener; +use tokio::sync::Mutex; use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; +const ROLLUP_LISTEN_KEY: &str = "new_rollup"; #[derive(Serialize, Deserialize, Clone)] pub struct Rollup { @@ -149,6 +152,7 @@ pub trait RollupDownloader { pub struct RollupPersister { txn: Arc, + database_url: String, downloader: D, } @@ -180,13 +184,32 @@ impl RollupDownloader for RollupDownloaderForPersister { } impl RollupPersister { - pub fn new(txn: Arc, downloader: D) -> Self { - Self { txn, downloader } + pub fn new(txn: Arc, database_url: String, downloader: D) -> Self { + Self { + txn, + database_url, + downloader, + } } pub async fn persist_rollups(&self) { + let mut listener = match PgListener::connect(&self.database_url).await { + Ok(listener) => listener, + Err(e) => { + error!("New rollup listener: {}", e); + return; + } + }; + if let Err(e) = listener.listen(ROLLUP_LISTEN_KEY).await { + error!("New rollup listener: {}", e); + return; + }; loop { - tokio::time::sleep(Duration::from_secs(5)).await; + if let Err(e) = listener.recv().await { + error!("Recv rollup notification: {}", e); + tokio::time::sleep(Duration::from_secs(5)).await; + continue; + }; let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { continue; }; From 63105b8eb630cb3e1b2f72b8e0e68abf318f6380 Mon Sep 17 00:00:00 2001 From: requesco Date: Thu, 4 Jul 2024 19:27:38 +0300 Subject: [PATCH 24/34] add metrics --- .../src/rollups/rollup_persister.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 492bd632f..aecf6d4af 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -8,6 +8,7 @@ use crate::rollups::merkle_tree_wrapper; use async_trait::async_trait; use blockbuster::instruction::InstructionBundle; use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; +use cadence_macros::{statsd_count, statsd_histogram}; use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; use digital_asset_types::dao::{rollup, rollup_to_verify}; use mockall::automock; @@ -27,6 +28,7 @@ use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; use sqlx::postgres::PgListener; use tokio::sync::Mutex; +use tokio::time::Instant; use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; @@ -211,6 +213,7 @@ impl RollupPersister continue; }; let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { + statsd_count!("rollup.fail_get_rollup", 1); continue; }; let Some(rollup_to_verify) = rollup_to_verify else { @@ -231,6 +234,7 @@ impl RollupPersister mut rollup_to_verify: rollup_to_verify::Model, mut rollup: Option>, ) { + let start_time = Instant::now(); info!("Persisting {} rollup", &rollup_to_verify.url); loop { match &rollup_to_verify.rollup_persisting_state { @@ -274,6 +278,11 @@ impl RollupPersister "Finish processing {} rollup file with {:?} state", &rollup_to_verify.url, &rollup_to_verify.rollup_persisting_state ); + statsd_histogram!( + "rollup.persisting_latency", + start_time.elapsed().as_millis() as u64 + ); + statsd_count!("rollup.total_processed", 1); return; } } @@ -366,8 +375,10 @@ impl RollupPersister *rollup = Some(r); rollup_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyDownload; + statsd_count!("rollup.successfully_download", 1); } Err(e) => { + statsd_count!("rollup.download_fail", 1); if let RollupValidationError::InvalidDataHash(expected, actual) = e { rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; @@ -377,6 +388,7 @@ impl RollupPersister ) .await?; + statsd_count!("rollup.checksum_verify_fail", 1); return Err(ProgramTransformerError::RollupValidation( RollupValidationError::FileChecksumMismatch(expected, actual), )); @@ -390,6 +402,7 @@ impl RollupPersister ) .await?; + statsd_count!("rollup.file_deserialization_fail", 1); return Err(ProgramTransformerError::SerializatonError(e)); } if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS as i32 { @@ -431,6 +444,7 @@ impl RollupPersister if let Err(e) = validate_rollup(rollup).await { error!("Error while validating rollup: {}", e.to_string()); + statsd_count!("rollup.validating_fail", 1); rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; if let Err(err) = self .save_rollup_as_failed(RollupFailStatus::RollupVerifyFailed, rollup_to_verify) @@ -440,6 +454,7 @@ impl RollupPersister }; return; } + statsd_count!("rollup.validating_success", 1); rollup_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyValidate; } @@ -457,9 +472,11 @@ impl RollupPersister .await .is_err() { + statsd_count!("rollup.store_update_fail", 1); rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; return Ok(()); } + statsd_count!("rollup.store_update_success", 1); rollup_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; Ok(()) } From d40241e8f0405c9102a9c8f80245811bd24cb11e Mon Sep 17 00:00:00 2001 From: Vadim <31490938+n00m4d@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:21:45 +0200 Subject: [PATCH 25/34] Make rollup processing feature optional (#199) * feat: make rollup processing feature optional * feat: inverted parameter --- nft_ingester/src/config.rs | 1 + nft_ingester/src/main.rs | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/nft_ingester/src/config.rs b/nft_ingester/src/config.rs index ab1f3cd38..653dc6434 100644 --- a/nft_ingester/src/config.rs +++ b/nft_ingester/src/config.rs @@ -31,6 +31,7 @@ pub struct IngesterConfig { pub code_version: Option<&'static str>, pub background_task_runner_config: Option, pub cl_audits: Option, // save transaction logs for compressed nfts + pub skip_rollup_indexing: bool, } #[derive(Deserialize, PartialEq, Debug, Clone)] diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index 8d9eac874..ac9e80609 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -154,17 +154,19 @@ pub async fn main() -> Result<(), IngesterError> { } } - let rollup_persister = RollupPersister::new( - Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( - database_pool.clone(), - )), - config.get_database_url(), - RollupDownloaderForPersister {}, - ); - tasks.spawn(async move { - rollup_persister.persist_rollups().await; - Ok(()) - }); + if !config.skip_rollup_indexing { + let rollup_persister = RollupPersister::new( + Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( + database_pool.clone(), + )), + config.get_database_url(), + RollupDownloaderForPersister {}, + ); + tasks.spawn(async move { + rollup_persister.persist_rollups().await; + Ok(()) + }); + } } // Stream Size Timers ---------------------------------------- // Setup Stream Size Timers, these are small processes that run every 60 seconds and farm metrics for the size of the streams. From cd55b346b82bafcd36b203bb9c5c8c2e1b18647d Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 16 Jul 2024 09:04:05 +0300 Subject: [PATCH 26/34] wip --- Cargo.lock | 25 +++++++++++---- Cargo.toml | 1 + nft_ingester/Cargo.toml | 1 + nft_ingester/src/lib.rs | 1 + nft_ingester/src/main.rs | 2 ++ nft_ingester/src/rollup_updates.rs | 32 +++++++++++++++++++ program_transformers/Cargo.toml | 1 + .../src/rollups/rollup_persister.rs | 19 ++--------- 8 files changed, 58 insertions(+), 24 deletions(-) create mode 100644 nft_ingester/src/rollup_updates.rs diff --git a/Cargo.lock b/Cargo.lock index 1a2ce4659..990864eab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,13 +619,12 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 3.1.0", - "event-listener-strategy", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite", ] @@ -729,7 +728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "655b9c7fe787d3b25cc0f804a1a8401790f0c5bc395beb5a64dc77d8de079105" dependencies = [ "event-listener 3.1.0", - "event-listener-strategy", + "event-listener-strategy 0.3.0", "pin-project-lite", ] @@ -1074,7 +1073,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.0", + "async-channel 2.3.1", "async-lock 3.1.1", "async-task", "fastrand 2.0.1", @@ -2284,6 +2283,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite", +] + [[package]] name = "fake" version = "2.9.2" @@ -3770,6 +3779,7 @@ dependencies = [ name = "nft_ingester" version = "0.7.2" dependencies = [ + "async-channel 2.3.1", "async-trait", "blockbuster", "borsh 0.10.3", @@ -4572,6 +4582,7 @@ name = "program_transformers" version = "0.7.2" dependencies = [ "anchor-lang", + "async-channel 2.3.1", "async-trait", "bincode", "blockbuster", @@ -7551,7 +7562,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70a313e115c2cd9a88d99d60386bc88641c853d468b2c3bc454c294f385fc084" dependencies = [ - "async-channel 2.1.0", + "async-channel 2.3.1", "async-io 2.3.2", "atomic", "crossbeam-channel", diff --git a/Cargo.toml b/Cargo.toml index 2cb3945cb..e9de00676 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,6 +130,7 @@ xxhash-rust = { version = "0.8.10", features = ["xxh3"] } serde_with = "3.8.1" bincode = "1.3.3" tempfile = "3.10.1" +async-channel = "2.3.1" [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/nft_ingester/Cargo.toml b/nft_ingester/Cargo.toml index f727e0cb1..2b8709a77 100644 --- a/nft_ingester/Cargo.toml +++ b/nft_ingester/Cargo.toml @@ -61,6 +61,7 @@ tracing-subscriber = { workspace = true, features = [ ] } url = { workspace = true } triomphe = { workspace = true } +async-channel = { workspace = true } [lints] workspace = true diff --git a/nft_ingester/src/lib.rs b/nft_ingester/src/lib.rs index 9569da43a..c387b6ffc 100644 --- a/nft_ingester/src/lib.rs +++ b/nft_ingester/src/lib.rs @@ -8,3 +8,4 @@ pub mod plerkle; pub mod stream; pub mod tasks; pub mod transaction_notifications; +pub mod rollup_updates; diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index ac9e80609..8ba32a0a6 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -33,6 +33,7 @@ use program_transformers::rollups::rollup_persister::{ use sea_orm::SqlxPostgresConnector; use std::sync::Arc; use std::{path::PathBuf, time}; +use sqlx::postgres::PgListener; use tokio::{signal, task::JoinSet}; #[tokio::main(flavor = "multi_thread")] @@ -155,6 +156,7 @@ pub async fn main() -> Result<(), IngesterError> { } if !config.skip_rollup_indexing { + let rollup_persister = RollupPersister::new( Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( database_pool.clone(), diff --git a/nft_ingester/src/rollup_updates.rs b/nft_ingester/src/rollup_updates.rs new file mode 100644 index 000000000..52bc47888 --- /dev/null +++ b/nft_ingester/src/rollup_updates.rs @@ -0,0 +1,32 @@ +use std::time::Duration; +use log::error; +use sqlx::postgres::PgListener; +use tokio::task::{JoinError, JoinSet}; + +const ROLLUP_LISTEN_KEY: &str = "new_rollup"; + +pub(crate) async fn create_rollup_notification_channel(database_url: &str, tasks: &mut JoinSet>) { + let mut listener = match PgListener::connect(database_url).await { + Ok(listener) => listener, + Err(e) => { + error!("New rollup listener: {}", e); + return; + } + }; + if let Err(e) = listener.listen(ROLLUP_LISTEN_KEY).await { + error!("New rollup listener: {}", e); + return; + }; + + let (s, r) = async_channel::unbounded::<()>(); + + tasks.spawn(async move { + loop { + if let Err(e) = listener.recv().await { + error!("Recv rollup notification: {}", e); + tokio::time::sleep(Duration::from_secs(5)).await; + continue; + } + s.send(()).await + }); +} diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 664e23f9d..94929bbd3 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -39,6 +39,7 @@ serde = { workspace = true } serde_with = { workspace = true } bincode = { workspace = true } rand = { workspace = true } +async-channel = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index aecf6d4af..17a166599 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -32,7 +32,6 @@ use tokio::time::Instant; use tracing::{error, info}; pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; -const ROLLUP_LISTEN_KEY: &str = "new_rollup"; #[derive(Serialize, Deserialize, Clone)] pub struct Rollup { @@ -195,23 +194,9 @@ impl RollupPersister } pub async fn persist_rollups(&self) { - let mut listener = match PgListener::connect(&self.database_url).await { - Ok(listener) => listener, - Err(e) => { - error!("New rollup listener: {}", e); - return; - } - }; - if let Err(e) = listener.listen(ROLLUP_LISTEN_KEY).await { - error!("New rollup listener: {}", e); - return; - }; + loop { - if let Err(e) = listener.recv().await { - error!("Recv rollup notification: {}", e); - tokio::time::sleep(Duration::from_secs(5)).await; - continue; - }; + let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { statsd_count!("rollup.fail_get_rollup", 1); continue; From 086e28b4878783eeac0388e1d947f5a9e0daad08 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 16 Jul 2024 10:03:19 +0300 Subject: [PATCH 27/34] wip --- Cargo.lock | 1 - blockbuster/blockbuster/Cargo.toml | 1 - .../programs/token_extensions/extension.rs | 19 ++-- .../src/programs/token_extensions/mod.rs | 74 ++++--------- nft_ingester/src/config.rs | 6 ++ nft_ingester/src/error/mod.rs | 8 ++ nft_ingester/src/lib.rs | 2 +- nft_ingester/src/main.rs | 102 ++++++++++-------- nft_ingester/src/rollup_updates.rs | 32 +++--- .../src/rollups/rollup_persister.rs | 25 +++-- 10 files changed, 131 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 990864eab..0309d0f90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,7 +1064,6 @@ dependencies = [ "spl-token-group-interface", "spl-token-metadata-interface", "thiserror", - "triomphe", ] [[package]] diff --git a/blockbuster/blockbuster/Cargo.toml b/blockbuster/blockbuster/Cargo.toml index b78531be0..c9c949611 100644 --- a/blockbuster/blockbuster/Cargo.toml +++ b/blockbuster/blockbuster/Cargo.toml @@ -31,7 +31,6 @@ spl-pod = { version = "0.1.0", features = ["serde-traits"] } serde = "1.0.140" solana-zk-token-sdk = "~1.18.11" anchor-lang = { version = "0.29.0" } -triomphe = { workspace = true } [dev-dependencies] flatbuffers = "23.1.21" diff --git a/blockbuster/blockbuster/src/programs/token_extensions/extension.rs b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs index b09a3f1b5..c9a0b9b4a 100644 --- a/blockbuster/blockbuster/src/programs/token_extensions/extension.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/extension.rs @@ -498,24 +498,19 @@ impl From for ShadowConfidentialTransferMint { impl From for ShadowConfidentialTransferAccount { fn from(original: ConfidentialTransferAccount) -> Self { ShadowConfidentialTransferAccount { - approved: original.approved.into(), + approved: original.approved, elgamal_pubkey: original.elgamal_pubkey.into(), pending_balance_lo: original.pending_balance_lo.into(), pending_balance_hi: original.pending_balance_hi.into(), available_balance: original.available_balance.into(), decryptable_available_balance: original.decryptable_available_balance.into(), - allow_confidential_credits: original.allow_confidential_credits.into(), - allow_non_confidential_credits: original.allow_non_confidential_credits.into(), - pending_balance_credit_counter: original.pending_balance_credit_counter.into(), - maximum_pending_balance_credit_counter: original - .maximum_pending_balance_credit_counter - .into(), + allow_confidential_credits: original.allow_confidential_credits, + allow_non_confidential_credits: original.allow_non_confidential_credits, + pending_balance_credit_counter: original.pending_balance_credit_counter, + maximum_pending_balance_credit_counter: original.maximum_pending_balance_credit_counter, expected_pending_balance_credit_counter: original - .expected_pending_balance_credit_counter - .into(), - actual_pending_balance_credit_counter: original - .actual_pending_balance_credit_counter - .into(), + .expected_pending_balance_credit_counter, + actual_pending_balance_credit_counter: original.actual_pending_balance_credit_counter, } } } diff --git a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs index be99a60e7..7bd02fa8e 100644 --- a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs @@ -131,19 +131,13 @@ impl ProgramParser for Token2022AccountParser { .get_extension::() .ok() .map(|x| x.clone()); - let cpi_guard = account.get_extension::().ok().map(|x| x.clone()); - let memo_transfer = account - .get_extension::() - .ok() - .map(|x| x.clone()); - let transfer_fee_amount = account - .get_extension::() - .ok() - .map(|x| x.clone()); + let cpi_guard = account.get_extension::().ok().copied(); + let memo_transfer = account.get_extension::().ok().copied(); + let transfer_fee_amount = account.get_extension::().ok().copied(); // Create a structured account with extensions let structured_account = TokenAccount { - account: account.base.clone(), + account: account.base, extensions: TokenAccountExtensions { confidential_transfer: confidential_transfer .map(ShadowConfidentialTransferAccount::from), @@ -158,57 +152,31 @@ impl ProgramParser for Token2022AccountParser { let confidential_transfer_mint = mint .get_extension::() .ok() - .map(|x| x.clone()); + .copied(); let confidential_transfer_account = mint .get_extension::() .ok() - .map(|x| x.clone()); + .copied(); let confidential_transfer_fee_config = mint .get_extension::() .ok() - .map(|x| x.clone()); - let default_account_state = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let interest_bearing_config = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let transfer_fee_config = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let mint_close_authority = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let permanent_delegate = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let metadata_pointer = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let metadata = mint - .get_variable_len_extension::() - .ok() - .map(|x| x.clone()); - let group_pointer = mint.get_extension::().ok().map(|x| x.clone()); - let token_group = mint.get_extension::().ok().map(|x| x.clone()); - let group_member_pointer = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let token_group_member = mint - .get_extension::() - .ok() - .map(|x| x.clone()); - let transfer_hook = mint.get_extension::().ok().map(|x| x.clone()); + .copied(); + let default_account_state = mint.get_extension::().ok().copied(); + let interest_bearing_config = + mint.get_extension::().ok().copied(); + let transfer_fee_config = mint.get_extension::().ok().copied(); + let mint_close_authority = mint.get_extension::().ok().copied(); + let permanent_delegate = mint.get_extension::().ok().copied(); + let metadata_pointer = mint.get_extension::().ok().copied(); + let metadata = mint.get_variable_len_extension::().ok(); + let group_pointer = mint.get_extension::().ok().copied(); + let token_group = mint.get_extension::().ok().copied(); + let group_member_pointer = mint.get_extension::().ok().copied(); + let token_group_member = mint.get_extension::().ok().copied(); + let transfer_hook = mint.get_extension::().ok().copied(); let structured_mint = MintAccount { - account: mint.base.clone(), + account: mint.base, extensions: MintAccountExtensions { confidential_transfer_mint: confidential_transfer_mint .map(ShadowConfidentialTransferMint::from), diff --git a/nft_ingester/src/config.rs b/nft_ingester/src/config.rs index 653dc6434..5fd5cacd6 100644 --- a/nft_ingester/src/config.rs +++ b/nft_ingester/src/config.rs @@ -45,6 +45,7 @@ pub struct WorkerConfig { pub enum WorkerType { Account, Transaction, + Rollup, } impl IngesterConfig { @@ -92,6 +93,11 @@ impl IngesterConfig { worker_count: 2, worker_type: WorkerType::Transaction, }, + WorkerConfig { + stream_name: "RLP".to_string(), + worker_count: 1, + worker_type: WorkerType::Rollup, + }, ] } } diff --git a/nft_ingester/src/error/mod.rs b/nft_ingester/src/error/mod.rs index 37ed5f24b..9a7d60151 100644 --- a/nft_ingester/src/error/mod.rs +++ b/nft_ingester/src/error/mod.rs @@ -52,6 +52,8 @@ pub enum IngesterError { HttpError { status_code: String }, #[error("AssetIndex Error {0}")] AssetIndexError(String), + #[error("sqlx Error {0}")] + SqlxError(String), } impl From for IngesterError { @@ -113,3 +115,9 @@ impl From for IngesterError { IngesterError::SerializatonError(e.to_string()) } } + +impl From for IngesterError { + fn from(e: sqlx::Error) -> Self { + IngesterError::SqlxError(e.to_string()) + } +} diff --git a/nft_ingester/src/lib.rs b/nft_ingester/src/lib.rs index c387b6ffc..053c61648 100644 --- a/nft_ingester/src/lib.rs +++ b/nft_ingester/src/lib.rs @@ -5,7 +5,7 @@ pub mod database; pub mod error; pub mod metrics; pub mod plerkle; +pub mod rollup_updates; pub mod stream; pub mod tasks; pub mod transaction_notifications; -pub mod rollup_updates; diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index 8ba32a0a6..6fe664a73 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -26,14 +26,14 @@ use cadence_macros::{is_global_default_set, statsd_count}; use chrono::Duration; use clap::{arg, command, value_parser}; use log::{error, info}; +use nft_ingester::rollup_updates; use plerkle_messenger::{redis_messenger::RedisMessenger, ConsumptionType}; use program_transformers::rollups::rollup_persister::{ RollupDownloaderForPersister, RollupPersister, }; -use sea_orm::SqlxPostgresConnector; +use sea_orm::{DatabaseConnection, SqlxPostgresConnector}; use std::sync::Arc; use std::{path::PathBuf, time}; -use sqlx::postgres::PgListener; use tokio::{signal, task::JoinSet}; #[tokio::main(flavor = "multi_thread")] @@ -101,6 +101,24 @@ pub async fn main() -> Result<(), IngesterError> { if role != IngesterRole::BackgroundTaskRunner { tasks.spawn(bg_task_listener); } + let mut rollup_persister: Option< + Arc>, + > = None; + if !config.skip_rollup_indexing { + let r = rollup_updates::create_rollup_notification_channel( + &config.get_database_url(), + &mut tasks, + ) + .await + .unwrap(); + rollup_persister = Some(Arc::new(RollupPersister::new( + Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( + database_pool.clone(), + )), + r, + RollupDownloaderForPersister {}, + ))); + } // Stream Consumers Setup ------------------------------------- if role == IngesterRole::Ingester || role == IngesterRole::All { @@ -124,51 +142,47 @@ pub async fn main() -> Result<(), IngesterError> { } for i in 0..worker.worker_count { - if worker.worker_type == WorkerType::Account { - let _account = account_worker::( - database_pool.clone(), - config.get_messneger_client_config(), - bg_task_sender.clone(), - ack_sender.clone(), - if i == 0 { - ConsumptionType::Redeliver - } else { - ConsumptionType::New - }, - stream_name, - ); - } else if worker.worker_type == WorkerType::Transaction { - let _txn = transaction_worker::( - database_pool.clone(), - config.get_messneger_client_config(), - bg_task_sender.clone(), - ack_sender.clone(), - if i == 0 { - ConsumptionType::Redeliver - } else { - ConsumptionType::New - }, - config.cl_audits.unwrap_or(false), - stream_name, - ); + match worker.worker_type { + WorkerType::Account => { + let _account = account_worker::( + database_pool.clone(), + config.get_messneger_client_config(), + bg_task_sender.clone(), + ack_sender.clone(), + if i == 0 { + ConsumptionType::Redeliver + } else { + ConsumptionType::New + }, + stream_name, + ); + } + WorkerType::Transaction => { + let _txn = transaction_worker::( + database_pool.clone(), + config.get_messneger_client_config(), + bg_task_sender.clone(), + ack_sender.clone(), + if i == 0 { + ConsumptionType::Redeliver + } else { + ConsumptionType::New + }, + config.cl_audits.unwrap_or(false), + stream_name, + ); + } + WorkerType::Rollup => { + if let Some(rollup_persister) = rollup_persister.clone() { + tasks.spawn(async move { + rollup_persister.persist_rollups().await; + Ok(()) + }); + } + } } } } - - if !config.skip_rollup_indexing { - - let rollup_persister = RollupPersister::new( - Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( - database_pool.clone(), - )), - config.get_database_url(), - RollupDownloaderForPersister {}, - ); - tasks.spawn(async move { - rollup_persister.persist_rollups().await; - Ok(()) - }); - } } // Stream Size Timers ---------------------------------------- // Setup Stream Size Timers, these are small processes that run every 60 seconds and farm metrics for the size of the streams. diff --git a/nft_ingester/src/rollup_updates.rs b/nft_ingester/src/rollup_updates.rs index 52bc47888..dfbb5a732 100644 --- a/nft_ingester/src/rollup_updates.rs +++ b/nft_ingester/src/rollup_updates.rs @@ -1,32 +1,32 @@ -use std::time::Duration; +use crate::error::IngesterError; +use async_channel::Receiver; use log::error; use sqlx::postgres::PgListener; +use std::time::Duration; use tokio::task::{JoinError, JoinSet}; const ROLLUP_LISTEN_KEY: &str = "new_rollup"; -pub(crate) async fn create_rollup_notification_channel(database_url: &str, tasks: &mut JoinSet>) { - let mut listener = match PgListener::connect(database_url).await { - Ok(listener) => listener, - Err(e) => { - error!("New rollup listener: {}", e); - return; - } - }; - if let Err(e) = listener.listen(ROLLUP_LISTEN_KEY).await { - error!("New rollup listener: {}", e); - return; - }; - +pub async fn create_rollup_notification_channel( + database_url: &str, + tasks: &mut JoinSet>, +) -> Result, IngesterError> { + let mut listener = PgListener::connect(database_url).await?; + listener.listen(ROLLUP_LISTEN_KEY).await?; let (s, r) = async_channel::unbounded::<()>(); - tasks.spawn(async move { loop { if let Err(e) = listener.recv().await { error!("Recv rollup notification: {}", e); tokio::time::sleep(Duration::from_secs(5)).await; continue; + } + if let Err(e) = s.send(()).await { + error!("Send rollup notification: {}", e); + tokio::time::sleep(Duration::from_secs(5)).await; + } } - s.send(()).await }); + + Ok(r) } diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 17a166599..982d4e1de 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -1,4 +1,5 @@ use anchor_lang::AnchorSerialize; +use async_channel::Receiver; use std::collections::HashMap; use std::{sync::Arc, time::Duration}; @@ -15,19 +16,17 @@ use mockall::automock; use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; use mpl_bubblegum::utils::get_asset_id; use mpl_bubblegum::{InstructionName, LeafSchemaEvent}; -use sea_orm::sea_query::OnConflict; +use sea_orm::sea_query::{LockType, OnConflict}; use sea_orm::ActiveValue::Set; use sea_orm::{ ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, DbBackend, EntityTrait, - IntoActiveModel, QueryFilter, QueryOrder, QueryTrait, TransactionTrait, + IntoActiveModel, QueryFilter, QueryOrder, QuerySelect, QueryTrait, TransactionTrait, }; use serde::{Deserialize, Serialize}; use serde_json::value::RawValue; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; -use sqlx::postgres::PgListener; -use tokio::sync::Mutex; use tokio::time::Instant; use tracing::{error, info}; @@ -153,7 +152,7 @@ pub trait RollupDownloader { pub struct RollupPersister { txn: Arc, - database_url: String, + notification_receiver: Receiver<()>, downloader: D, } @@ -185,18 +184,21 @@ impl RollupDownloader for RollupDownloaderForPersister { } impl RollupPersister { - pub fn new(txn: Arc, database_url: String, downloader: D) -> Self { + pub fn new(txn: Arc, notification_receiver: Receiver<()>, downloader: D) -> Self { Self { txn, - database_url, + notification_receiver, downloader, } } pub async fn persist_rollups(&self) { - loop { - + if let Err(e) = self.notification_receiver.recv().await { + error!("Recv rollup notification: {}", e); + tokio::time::sleep(Duration::from_secs(5)).await; + continue; + }; let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { statsd_count!("rollup.fail_get_rollup", 1); continue; @@ -223,8 +225,8 @@ impl RollupPersister info!("Persisting {} rollup", &rollup_to_verify.url); loop { match &rollup_to_verify.rollup_persisting_state { - &RollupPersistingState::ReceivedTransaction - | &RollupPersistingState::StartProcessing => { + &RollupPersistingState::ReceivedTransaction => {} + &RollupPersistingState::StartProcessing => { if let Err(err) = self .download_rollup(&mut rollup_to_verify, &mut rollup) .await @@ -296,6 +298,7 @@ impl RollupPersister let rollup_to_verify = rollup_to_verify::Entity::find() .filter(condition) .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) + .lock(LockType::Update) .one(&multi_txn) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; From 16846ca14b8db1af6b644731fd58a46c4bab6e85 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 16 Jul 2024 10:06:49 +0300 Subject: [PATCH 28/34] wip --- blockbuster/blockbuster/src/programs/token_extensions/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs index 7bd02fa8e..ec1633c9c 100644 --- a/blockbuster/blockbuster/src/programs/token_extensions/mod.rs +++ b/blockbuster/blockbuster/src/programs/token_extensions/mod.rs @@ -130,7 +130,7 @@ impl ProgramParser for Token2022AccountParser { let confidential_transfer = account .get_extension::() .ok() - .map(|x| x.clone()); + .copied(); let cpi_guard = account.get_extension::().ok().copied(); let memo_transfer = account.get_extension::().ok().copied(); let transfer_fee_amount = account.get_extension::().ok().copied(); @@ -148,7 +148,7 @@ impl ProgramParser for Token2022AccountParser { }; result = TokenExtensionsProgramAccount::TokenAccount(structured_account); - } else if let Ok(mint) = StateWithExtensions::::unpack(&account_data) { + } else if let Ok(mint) = StateWithExtensions::::unpack(account_data) { let confidential_transfer_mint = mint .get_extension::() .ok() From ea62bae644c6939aaa5a55ec95d0ab812bcd6207 Mon Sep 17 00:00:00 2001 From: requesco Date: Tue, 16 Jul 2024 18:48:26 +0300 Subject: [PATCH 29/34] tests fix --- Cargo.lock | 1 + .../blockbuster/src/programs/bubblegum/mod.rs | 2 +- integration_tests/Cargo.toml | 3 ++- .../tests/integration_tests/rollup_tests.rs | 22 ++++++++++--------- .../src/rollups/rollup_persister.rs | 6 ++++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0309d0f90..c58b6fee4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3098,6 +3098,7 @@ name = "integration_tests" version = "0.1.0" dependencies = [ "anyhow", + "async-channel 2.3.1", "borsh 0.10.3", "das_api", "digital_asset_types", diff --git a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs index 4ceb6d1d2..e1f50a553 100644 --- a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs @@ -346,7 +346,7 @@ fn build_create_tree_with_root_payload( .get(1) .ok_or(BlockbusterError::InstructionParsingError)?; let staker = *keys - .get(2) + .get(4) .ok_or(BlockbusterError::InstructionParsingError)?; let args = FinalizeTreeWithRootInstructionArgsWithStaker::build_finalize_tree_with_root_instruction_args_with_staker(args, staker); diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 5d796c975..a100b83c9 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -35,4 +35,5 @@ tokio = { workspace = true } tokio-stream = { workspace = true } mpl-bubblegum = { workspace = true } spl-concurrent-merkle-tree = { workspace = true } -tempfile = { workspace = true } \ No newline at end of file +tempfile = { workspace = true } +async-channel = { workspace = true } diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/rollup_tests.rs index b0915c7a4..8b6dde554 100644 --- a/integration_tests/tests/integration_tests/rollup_tests.rs +++ b/integration_tests/tests/integration_tests/rollup_tests.rs @@ -7,6 +7,7 @@ use digital_asset_types::dao::{rollup, rollup_to_verify}; use flatbuffers::FlatBufferBuilder; use mpl_bubblegum::types::LeafSchema; use nft_ingester::plerkle::PlerkleTransactionInfo; +use nft_ingester::rollup_updates::create_rollup_notification_channel; use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_transaction; use program_transformers::error::RollupValidationError; @@ -27,6 +28,7 @@ use solana_transaction_status::{InnerInstruction, InnerInstructions, Transaction use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; use std::fs::File; use std::str::FromStr; +use tokio::task::JoinSet; #[tokio::test] async fn save_rollup_to_queue_test() { @@ -207,11 +209,11 @@ async fn rollup_persister_test() { Ok(Box::new(serde_json::from_str(&json_file).unwrap())) }); - let rollup_persister = RollupPersister::new( - setup.db.clone(), - setup.database_test_url.clone(), - mocked_downloader, - ); + let mut tasks = JoinSet::new(); + let r = create_rollup_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let rollup_persister = RollupPersister::new(setup.db.clone(), r, mocked_downloader); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) @@ -325,11 +327,11 @@ async fn rollup_persister_download_fail_test() { )) }); - let rollup_persister = RollupPersister::new( - setup.db.clone(), - setup.database_test_url.clone(), - mocked_downloader, - ); + let mut tasks = JoinSet::new(); + let r = create_rollup_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let rollup_persister = RollupPersister::new(setup.db.clone(), r, mocked_downloader); let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); rollup_persister .persist_rollup(rollup_to_verify.unwrap(), None) diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/rollups/rollup_persister.rs index 982d4e1de..4d9624227 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/rollups/rollup_persister.rs @@ -225,7 +225,11 @@ impl RollupPersister info!("Persisting {} rollup", &rollup_to_verify.url); loop { match &rollup_to_verify.rollup_persisting_state { - &RollupPersistingState::ReceivedTransaction => {} + &RollupPersistingState::ReceivedTransaction => { + // We get ReceivedTransaction state on the start of processing + rollup_to_verify.rollup_persisting_state = + RollupPersistingState::StartProcessing; + } &RollupPersistingState::StartProcessing => { if let Err(err) = self .download_rollup(&mut rollup_to_verify, &mut rollup) From ef8df2a0564d4fc83321f1f2e022d373cc285667 Mon Sep 17 00:00:00 2001 From: requesco Date: Thu, 25 Jul 2024 18:57:08 +0300 Subject: [PATCH 30/34] wip --- .../{rollup_tests.rs => batch_mint_tests.rs} | 97 +++--- .../tests/integration_tests/main.rs | 2 +- ...ollup_updates.rs => batch_mint_updates.rs} | 12 +- nft_ingester/src/lib.rs | 2 +- nft_ingester/src/main.rs | 16 +- .../batch_mint_persister.rs} | 321 +++++++++--------- .../merkle_tree_wrapper.rs | 44 +-- .../src/{rollups => batch_minting}/mod.rs | 2 +- .../src/{rollups => batch_minting}/tests.rs | 147 ++++---- .../src/bubblegum/finalize_tree_with_root.rs | 27 +- program_transformers/src/error.rs | 14 +- program_transformers/src/lib.rs | 2 +- 12 files changed, 358 insertions(+), 328 deletions(-) rename integration_tests/tests/integration_tests/{rollup_tests.rs => batch_mint_tests.rs} (77%) rename nft_ingester/src/{rollup_updates.rs => batch_mint_updates.rs} (61%) rename program_transformers/src/{rollups/rollup_persister.rs => batch_minting/batch_mint_persister.rs} (59%) rename program_transformers/src/{rollups => batch_minting}/merkle_tree_wrapper.rs (87%) rename program_transformers/src/{rollups => batch_minting}/mod.rs (57%) rename program_transformers/src/{rollups => batch_minting}/tests.rs (60%) diff --git a/integration_tests/tests/integration_tests/rollup_tests.rs b/integration_tests/tests/integration_tests/batch_mint_tests.rs similarity index 77% rename from integration_tests/tests/integration_tests/rollup_tests.rs rename to integration_tests/tests/integration_tests/batch_mint_tests.rs index 8b6dde554..1c57bf958 100644 --- a/integration_tests/tests/integration_tests/rollup_tests.rs +++ b/integration_tests/tests/integration_tests/batch_mint_tests.rs @@ -6,15 +6,15 @@ use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPer use digital_asset_types::dao::{rollup, rollup_to_verify}; use flatbuffers::FlatBufferBuilder; use mpl_bubblegum::types::LeafSchema; +use nft_ingester::batch_mint_updates::create_batch_mint_notification_channel; use nft_ingester::plerkle::PlerkleTransactionInfo; -use nft_ingester::rollup_updates::create_rollup_notification_channel; use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_transaction; -use program_transformers::error::RollupValidationError; -use program_transformers::rollups::rollup_persister::{ - MockRollupDownloader, Rollup, RollupPersister, +use program_transformers::batch_minting::batch_mint_persister::{ + BatchMint, BatchMintPersister, MockBatchMintDownloader, }; -use program_transformers::rollups::tests::generate_rollup; +use program_transformers::batch_minting::tests::generate_batch_mint; +use program_transformers::error::BatchMintValidationError; use sea_orm::sea_query::OnConflict; use sea_orm::{ColumnTrait, ConnectionTrait, DbBackend, IntoActiveModel, QueryTrait, Set}; use sea_orm::{EntityTrait, QueryFilter}; @@ -31,13 +31,13 @@ use std::str::FromStr; use tokio::task::JoinSet; #[tokio::test] -async fn save_rollup_to_queue_test() { - let setup = TestSetup::new("save_rollup_to_queue_test".to_string()).await; +async fn save_batch_mint_to_queue_test() { + let setup = TestSetup::new("save_batch_mint_to_queue_test".to_string()).await; let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); // arbitrary data - let rollup_instruction_data = + let batch_mint_instruction_data = mpl_bubblegum::instructions::FinalizeTreeWithRootInstructionArgs { rightmost_root: [1; 32], rightmost_leaf: [1; 32], @@ -49,7 +49,7 @@ async fn save_rollup_to_queue_test() { // took it from Bubblegum client // this value is generated by Anchor library, it's instruction identifier let mut instruction_data = vec![101, 214, 253, 135, 176, 170, 11, 235]; - instruction_data.extend(rollup_instruction_data.try_to_vec().unwrap().iter()); + instruction_data.extend(batch_mint_instruction_data.try_to_vec().unwrap().iter()); let transaction = SanitizedTransaction::from_transaction_for_tests(Transaction { signatures: vec![Signature::new_unique()], @@ -123,11 +123,11 @@ async fn save_rollup_to_queue_test() { assert_eq!(r.url, metadata_url); } -fn generate_merkle_tree_from_rollup(rollup: &Rollup) -> ConcurrentMerkleTree<10, 32> { +fn generate_merkle_tree_from_batch_mint(batch_mint: &BatchMint) -> ConcurrentMerkleTree<10, 32> { let mut merkle_tree = ConcurrentMerkleTree::<10, 32>::new(); merkle_tree.initialize().unwrap(); - for (nonce, asset) in rollup.rolled_mints.iter().enumerate() { + for (nonce, asset) in batch_mint.batch_mints.iter().enumerate() { let metadata_args_hash = keccak::hashv(&[asset.mint_args.try_to_vec().unwrap().as_slice()]); let data_hash = keccak::hashv(&[ &metadata_args_hash.to_bytes(), @@ -149,7 +149,7 @@ fn generate_merkle_tree_from_rollup(rollup: &Rollup) -> ConcurrentMerkleTree<10, .as_ref(), ); - let id = mpl_bubblegum::utils::get_asset_id(&rollup.tree_id, nonce as u64); + let id = mpl_bubblegum::utils::get_asset_id(&batch_mint.tree_id, nonce as u64); let leaf = LeafSchema::V1 { id, @@ -165,17 +165,17 @@ fn generate_merkle_tree_from_rollup(rollup: &Rollup) -> ConcurrentMerkleTree<10, } #[tokio::test] -async fn rollup_persister_test() { - let setup = TestSetup::new("rollup_persister_test".to_string()).await; - let test_rollup = generate_rollup(10); +async fn batch_mint_persister_test() { + let setup = TestSetup::new("batch_mint_persister_test".to_string()).await; + let test_batch_mint = generate_batch_mint(10); let tmp_dir = tempfile::TempDir::new().unwrap(); - let tmp_file = File::create(tmp_dir.path().join("rollup-10.json")).unwrap(); - serde_json::to_writer(tmp_file, &test_rollup).unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); + serde_json::to_writer(tmp_file, &test_batch_mint).unwrap(); let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); - let rollup_to_verify = rollup_to_verify::ActiveModel { + let batch_mint_to_verify = rollup_to_verify::ActiveModel { file_hash: Set(metadata_hash.clone()), url: Set(metadata_url.clone()), created_at_slot: Set(10), @@ -187,7 +187,7 @@ async fn rollup_persister_test() { } .into_active_model(); - let query = rollup_to_verify::Entity::insert(rollup_to_verify) + let query = rollup_to_verify::Entity::insert(batch_mint_to_verify) .on_conflict( OnConflict::columns([rollup_to_verify::Column::FileHash]) .update_columns([rollup_to_verify::Column::Url]) @@ -201,30 +201,34 @@ async fn rollup_persister_test() { .build(DbBackend::Postgres); setup.db.execute(query).await.unwrap(); - let mut mocked_downloader = MockRollupDownloader::new(); + let mut mocked_downloader = MockBatchMintDownloader::new(); mocked_downloader - .expect_download_rollup_and_check_checksum() + .expect_download_batch_mint_and_check_checksum() .returning(move |_, _| { - let json_file = std::fs::read_to_string(tmp_dir.path().join("rollup-10.json")).unwrap(); + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint-10.json")).unwrap(); Ok(Box::new(serde_json::from_str(&json_file).unwrap())) }); let mut tasks = JoinSet::new(); - let r = create_rollup_notification_channel(&setup.database_test_url, &mut tasks) + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) .await .unwrap(); - let rollup_persister = RollupPersister::new(setup.db.clone(), r, mocked_downloader); - let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); - rollup_persister - .persist_rollup(rollup_to_verify.unwrap(), None) + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) .await; - let merkle_tree = generate_merkle_tree_from_rollup(&test_rollup); + let merkle_tree = generate_merkle_tree_from_batch_mint(&test_batch_mint); let leaf_index = 4u32; let payload = GetAssetProof { - id: test_rollup - .rolled_mints + id: test_batch_mint + .batch_mints .get(leaf_index as usize) .unwrap() .leaf_update @@ -282,17 +286,17 @@ async fn rollup_persister_test() { } #[tokio::test] -async fn rollup_persister_download_fail_test() { - let setup = TestSetup::new("rollup_persister_download_fail_test".to_string()).await; - let test_rollup = generate_rollup(10); +async fn batch_mint_persister_download_fail_test() { + let setup = TestSetup::new("batch_mint_persister_download_fail_test".to_string()).await; + let test_batch_mint = generate_batch_mint(10); let tmp_dir = tempfile::TempDir::new().unwrap(); - let tmp_file = File::create(tmp_dir.path().join("rollup-10.json")).unwrap(); - serde_json::to_writer(tmp_file, &test_rollup).unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); + serde_json::to_writer(tmp_file, &test_batch_mint).unwrap(); let download_attempts = 0; let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); - let rollup_to_verify = rollup_to_verify::ActiveModel { + let batch_mint_to_verify = rollup_to_verify::ActiveModel { file_hash: Set(metadata_hash.clone()), url: Set(metadata_url.clone()), created_at_slot: Set(10), @@ -304,7 +308,7 @@ async fn rollup_persister_download_fail_test() { } .into_active_model(); - let query = rollup_to_verify::Entity::insert(rollup_to_verify) + let query = rollup_to_verify::Entity::insert(batch_mint_to_verify) .on_conflict( OnConflict::columns([rollup_to_verify::Column::FileHash]) .update_columns([rollup_to_verify::Column::Url]) @@ -318,23 +322,26 @@ async fn rollup_persister_download_fail_test() { .build(DbBackend::Postgres); setup.db.execute(query).await.unwrap(); - let mut mocked_downloader = MockRollupDownloader::new(); + let mut mocked_downloader = MockBatchMintDownloader::new(); mocked_downloader - .expect_download_rollup_and_check_checksum() + .expect_download_batch_mint_and_check_checksum() .returning(move |_, _| { - Err(RollupValidationError::Reqwest( + Err(BatchMintValidationError::Reqwest( "Could not download file".to_string(), )) }); let mut tasks = JoinSet::new(); - let r = create_rollup_notification_channel(&setup.database_test_url, &mut tasks) + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() .await .unwrap(); - let rollup_persister = RollupPersister::new(setup.db.clone(), r, mocked_downloader); - let (rollup_to_verify, _) = rollup_persister.get_rollup_to_verify().await.unwrap(); - rollup_persister - .persist_rollup(rollup_to_verify.unwrap(), None) + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) .await; assert_eq!( diff --git a/integration_tests/tests/integration_tests/main.rs b/integration_tests/tests/integration_tests/main.rs index 6b0fe1dba..7b73db395 100644 --- a/integration_tests/tests/integration_tests/main.rs +++ b/integration_tests/tests/integration_tests/main.rs @@ -1,7 +1,7 @@ mod account_update_tests; +mod batch_mint_tests; mod cnft_tests; mod common; mod general_scenario_tests; mod mpl_core_tests; mod regular_nft_tests; -mod rollup_tests; diff --git a/nft_ingester/src/rollup_updates.rs b/nft_ingester/src/batch_mint_updates.rs similarity index 61% rename from nft_ingester/src/rollup_updates.rs rename to nft_ingester/src/batch_mint_updates.rs index dfbb5a732..418efcee0 100644 --- a/nft_ingester/src/rollup_updates.rs +++ b/nft_ingester/src/batch_mint_updates.rs @@ -5,25 +5,23 @@ use sqlx::postgres::PgListener; use std::time::Duration; use tokio::task::{JoinError, JoinSet}; -const ROLLUP_LISTEN_KEY: &str = "new_rollup"; +const BATCH_MINT_LISTEN_KEY: &str = "new_rollup"; -pub async fn create_rollup_notification_channel( +pub async fn create_batch_mint_notification_channel( database_url: &str, tasks: &mut JoinSet>, ) -> Result, IngesterError> { let mut listener = PgListener::connect(database_url).await?; - listener.listen(ROLLUP_LISTEN_KEY).await?; + listener.listen(BATCH_MINT_LISTEN_KEY).await?; let (s, r) = async_channel::unbounded::<()>(); tasks.spawn(async move { loop { if let Err(e) = listener.recv().await { - error!("Recv rollup notification: {}", e); - tokio::time::sleep(Duration::from_secs(5)).await; + error!("Recv batch mint notification: {}", e); continue; } if let Err(e) = s.send(()).await { - error!("Send rollup notification: {}", e); - tokio::time::sleep(Duration::from_secs(5)).await; + error!("Send batch mint notification: {}", e); } } }); diff --git a/nft_ingester/src/lib.rs b/nft_ingester/src/lib.rs index 053c61648..8c2a44e13 100644 --- a/nft_ingester/src/lib.rs +++ b/nft_ingester/src/lib.rs @@ -1,11 +1,11 @@ pub mod ack; pub mod backfiller; +pub mod batch_mint_updates; pub mod config; pub mod database; pub mod error; pub mod metrics; pub mod plerkle; -pub mod rollup_updates; pub mod stream; pub mod tasks; pub mod transaction_notifications; diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index 6fe664a73..2b2e31823 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -26,10 +26,10 @@ use cadence_macros::{is_global_default_set, statsd_count}; use chrono::Duration; use clap::{arg, command, value_parser}; use log::{error, info}; -use nft_ingester::rollup_updates; +use nft_ingester::batch_mint_updates; use plerkle_messenger::{redis_messenger::RedisMessenger, ConsumptionType}; -use program_transformers::rollups::rollup_persister::{ - RollupDownloaderForPersister, RollupPersister, +use program_transformers::batch_minting::batch_mint_persister::{ + BatchMintDownloaderForPersister, BatchMintPersister, }; use sea_orm::{DatabaseConnection, SqlxPostgresConnector}; use std::sync::Arc; @@ -102,21 +102,21 @@ pub async fn main() -> Result<(), IngesterError> { tasks.spawn(bg_task_listener); } let mut rollup_persister: Option< - Arc>, + Arc>, > = None; if !config.skip_rollup_indexing { - let r = rollup_updates::create_rollup_notification_channel( + let r = batch_mint_updates::create_batch_mint_notification_channel( &config.get_database_url(), &mut tasks, ) .await .unwrap(); - rollup_persister = Some(Arc::new(RollupPersister::new( + rollup_persister = Some(Arc::new(BatchMintPersister::new( Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool( database_pool.clone(), )), r, - RollupDownloaderForPersister {}, + BatchMintDownloaderForPersister {}, ))); } @@ -175,7 +175,7 @@ pub async fn main() -> Result<(), IngesterError> { WorkerType::Rollup => { if let Some(rollup_persister) = rollup_persister.clone() { tasks.spawn(async move { - rollup_persister.persist_rollups().await; + rollup_persister.persist_batch_mints().await; Ok(()) }); } diff --git a/program_transformers/src/rollups/rollup_persister.rs b/program_transformers/src/batch_minting/batch_mint_persister.rs similarity index 59% rename from program_transformers/src/rollups/rollup_persister.rs rename to program_transformers/src/batch_minting/batch_mint_persister.rs index 4d9624227..ad41e3b08 100644 --- a/program_transformers/src/rollups/rollup_persister.rs +++ b/program_transformers/src/batch_minting/batch_mint_persister.rs @@ -1,11 +1,11 @@ use anchor_lang::AnchorSerialize; use async_channel::Receiver; use std::collections::HashMap; -use std::{sync::Arc, time::Duration}; +use std::sync::Arc; +use crate::batch_minting::merkle_tree_wrapper; use crate::bubblegum; -use crate::error::{ProgramTransformerError, ProgramTransformerResult, RollupValidationError}; -use crate::rollups::merkle_tree_wrapper; +use crate::error::{BatchMintValidationError, ProgramTransformerError, ProgramTransformerResult}; use async_trait::async_trait; use blockbuster::instruction::InstructionBundle; use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; @@ -30,13 +30,13 @@ use solana_sdk::pubkey::Pubkey; use tokio::time::Instant; use tracing::{error, info}; -pub const MAX_ROLLUP_DOWNLOAD_ATTEMPTS: u8 = 5; +pub const MAX_BATCH_MINT_DOWNLOAD_ATTEMPTS: u8 = 5; #[derive(Serialize, Deserialize, Clone)] -pub struct Rollup { +pub struct BatchMint { #[serde(with = "serde_with::As::")] pub tree_id: Pubkey, - pub rolled_mints: Vec, + pub batch_mints: Vec, pub raw_metadata_map: HashMap>, // map by uri pub max_depth: u32, pub max_buffer_size: u32, @@ -47,7 +47,7 @@ pub struct Rollup { } #[derive(Serialize, Deserialize, Clone)] -pub struct RolledMintInstruction { +pub struct BatchedMintInstruction { pub tree_update: ChangeLogEventV1, pub leaf_update: LeafSchema, pub mint_args: MetadataArgs, @@ -119,8 +119,8 @@ impl From for ChangeLogEvent } } -impl From<&RolledMintInstruction> for BubblegumInstruction { - fn from(value: &RolledMintInstruction) -> Self { +impl From<&BatchedMintInstruction> for BubblegumInstruction { + fn from(value: &BatchedMintInstruction) -> Self { let hash = value.leaf_update.hash(); Self { instruction: InstructionName::MintV1, @@ -141,40 +141,46 @@ impl From<&RolledMintInstruction> for BubblegumInstruction { #[automock] #[async_trait] -pub trait RollupDownloader { - async fn download_rollup(&self, url: &str) -> Result, RollupValidationError>; - async fn download_rollup_and_check_checksum( +pub trait BatchMintDownloader { + async fn download_batch_mint( + &self, + url: &str, + ) -> Result, BatchMintValidationError>; + async fn download_batch_mint_and_check_checksum( &self, url: &str, checksum: &str, - ) -> Result, RollupValidationError>; + ) -> Result, BatchMintValidationError>; } -pub struct RollupPersister { +pub struct BatchMintPersister { txn: Arc, notification_receiver: Receiver<()>, downloader: D, } -pub struct RollupDownloaderForPersister {} +pub struct BatchMintDownloaderForPersister {} #[async_trait] -impl RollupDownloader for RollupDownloaderForPersister { - async fn download_rollup(&self, url: &str) -> Result, RollupValidationError> { +impl BatchMintDownloader for BatchMintDownloaderForPersister { + async fn download_batch_mint( + &self, + url: &str, + ) -> Result, BatchMintValidationError> { let response = reqwest::get(url).await?.bytes().await?; Ok(Box::new(serde_json::from_slice(&response)?)) } - async fn download_rollup_and_check_checksum( + async fn download_batch_mint_and_check_checksum( &self, url: &str, checksum: &str, - ) -> Result, RollupValidationError> { + ) -> Result, BatchMintValidationError> { let response = reqwest::get(url).await?.bytes().await?; let file_hash = xxhash_rust::xxh3::xxh3_128(&response); let hash_hex = hex::encode(file_hash.to_be_bytes()); if hash_hex != checksum { - return Err(RollupValidationError::InvalidDataHash( + return Err(BatchMintValidationError::InvalidDataHash( checksum.to_string(), hash_hex, )); @@ -183,7 +189,7 @@ impl RollupDownloader for RollupDownloaderForPersister { } } -impl RollupPersister { +impl BatchMintPersister { pub fn new(txn: Arc, notification_receiver: Receiver<()>, downloader: D) -> Self { Self { txn, @@ -192,95 +198,97 @@ impl RollupPersister } } - pub async fn persist_rollups(&self) { + pub async fn persist_batch_mints(&self) { loop { if let Err(e) = self.notification_receiver.recv().await { - error!("Recv rollup notification: {}", e); - tokio::time::sleep(Duration::from_secs(5)).await; + error!("Recv batch mint notification: {}", e); continue; }; - let Ok((rollup_to_verify, rollup)) = self.get_rollup_to_verify().await else { - statsd_count!("rollup.fail_get_rollup", 1); + let Ok((batch_mint_to_verify, batch_mint)) = self.get_batch_mint_to_verify().await + else { + statsd_count!("batch_mint.fail_get_rollup", 1); continue; }; - let Some(rollup_to_verify) = rollup_to_verify else { - // no rollups to persist + let Some(batch_mint_to_verify) = batch_mint_to_verify else { + // no batch mints to persist continue; }; - let rollup = rollup - .map(|r| bincode::deserialize::(r.rollup_binary_bincode.as_slice())) + let batch_mint = batch_mint + .map(|r| bincode::deserialize::(r.rollup_binary_bincode.as_slice())) .transpose() .unwrap_or_default(); - self.persist_rollup(rollup_to_verify, rollup.map(Box::new)) + self.persist_batch_mint(batch_mint_to_verify, batch_mint.map(Box::new)) .await; } } - pub async fn persist_rollup( + pub async fn persist_batch_mint( &self, - mut rollup_to_verify: rollup_to_verify::Model, - mut rollup: Option>, + mut batch_mint_to_verify: rollup_to_verify::Model, + mut batch_mint: Option>, ) { let start_time = Instant::now(); - info!("Persisting {} rollup", &rollup_to_verify.url); + info!("Persisting {} batch mint", &batch_mint_to_verify.url); loop { - match &rollup_to_verify.rollup_persisting_state { + match &batch_mint_to_verify.rollup_persisting_state { &RollupPersistingState::ReceivedTransaction => { // We get ReceivedTransaction state on the start of processing - rollup_to_verify.rollup_persisting_state = + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::StartProcessing; } &RollupPersistingState::StartProcessing => { if let Err(err) = self - .download_rollup(&mut rollup_to_verify, &mut rollup) + .download_batch_mint(&mut batch_mint_to_verify, &mut batch_mint) .await { - error!("Error during rollup downloading: {}", err) + error!("Error during batch mint downloading: {}", err) }; } &RollupPersistingState::SuccessfullyDownload => { - if let Some(r) = &rollup { - self.validate_rollup(&mut rollup_to_verify, r).await; + if let Some(r) = &batch_mint { + self.validate_batch_mint(&mut batch_mint_to_verify, r).await; } else { error!( - "Trying to validate non downloaded rollup: {:#?}", - &rollup_to_verify + "Trying to validate non downloaded batch mint: {:#?}", + &batch_mint_to_verify ) } } &RollupPersistingState::SuccessfullyValidate => { - if let Some(r) = &rollup { - // TODO: Add retry? - if let Err(e) = self.store_rollup_update(&mut rollup_to_verify, r).await { - error!("Store rollup update: {}", e) + if let Some(r) = &batch_mint { + if let Err(e) = self + .store_batch_mint_update(&mut batch_mint_to_verify, r) + .await + { + error!("Store batch mint update: {}", e) }; } else { error!( - "Trying to store update for non downloaded rollup: {:#?}", - &rollup_to_verify + "Trying to store update for non downloaded batch mint: {:#?}", + &batch_mint_to_verify ) } } &RollupPersistingState::FailedToPersist | &RollupPersistingState::StoredUpdate => { - if let Err(e) = self.drop_rollup_from_queue(&rollup_to_verify).await { - error!("failed to drop rollup from queue: {}", e); + if let Err(e) = self.drop_batch_mint_from_queue(&batch_mint_to_verify).await { + error!("failed to drop batch mint from queue: {}", e); }; info!( - "Finish processing {} rollup file with {:?} state", - &rollup_to_verify.url, &rollup_to_verify.rollup_persisting_state + "Finish processing {} batch mint file with {:?} state", + &batch_mint_to_verify.url, &batch_mint_to_verify.rollup_persisting_state ); statsd_histogram!( - "rollup.persisting_latency", + "batch_mint.persisting_latency", start_time.elapsed().as_millis() as u64 ); - statsd_count!("rollup.total_processed", 1); + statsd_count!("batch_mint.total_processed", 1); return; } } } } - pub async fn get_rollup_to_verify( + pub async fn get_batch_mint_to_verify( &self, ) -> Result<(Option, Option), ProgramTransformerError> { @@ -299,16 +307,16 @@ impl RollupPersister .ne(RollupPersistingState::StartProcessing), ); - let rollup_to_verify = rollup_to_verify::Entity::find() + let batch_mint_verify = rollup_to_verify::Entity::find() .filter(condition) .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) .lock(LockType::Update) .one(&multi_txn) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; - let mut rollup = None; - if let Some(ref r) = rollup_to_verify { - rollup = rollup::Entity::find() + let mut batch_mint = None; + if let Some(ref r) = batch_mint_verify { + batch_mint = rollup::Entity::find() .filter(rollup::Column::FileHash.eq(r.file_hash.clone())) .one(self.txn.as_ref()) .await @@ -330,29 +338,29 @@ impl RollupPersister } multi_txn.commit().await?; - Ok((rollup_to_verify, rollup)) + Ok((batch_mint_verify, batch_mint)) } - async fn download_rollup( + async fn download_batch_mint( &self, - rollup_to_verify: &mut rollup_to_verify::Model, - rollup: &mut Option>, + batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint: &mut Option>, ) -> Result<(), ProgramTransformerError> { - if rollup.is_some() { + if batch_mint.is_some() { return Ok(()); } match self .downloader - .download_rollup_and_check_checksum( - rollup_to_verify.url.as_ref(), - &rollup_to_verify.file_hash, + .download_batch_mint_and_check_checksum( + batch_mint_to_verify.url.as_ref(), + &batch_mint_to_verify.file_hash, ) .await { Ok(r) => { let query = rollup::Entity::insert(rollup::ActiveModel { - file_hash: Set(rollup_to_verify.file_hash.clone()), - rollup_binary_bincode: Set(bincode::serialize(rollup) + file_hash: Set(batch_mint_to_verify.file_hash.clone()), + rollup_binary_bincode: Set(bincode::serialize(batch_mint) .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), }) .on_conflict( @@ -364,57 +372,63 @@ impl RollupPersister if let Err(e) = self.txn.execute(query).await { return Err(e.into()); } - *rollup = Some(r); - rollup_to_verify.rollup_persisting_state = + *batch_mint = Some(r); + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyDownload; - statsd_count!("rollup.successfully_download", 1); + statsd_count!("batch_mint.successfully_download", 1); } Err(e) => { - statsd_count!("rollup.download_fail", 1); - if let RollupValidationError::InvalidDataHash(expected, actual) = e { - rollup_to_verify.rollup_persisting_state = + statsd_count!("batch_mint.download_fail", 1); + if let BatchMintValidationError::InvalidDataHash(expected, actual) = e { + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - self.save_rollup_as_failed( + self.save_batch_mint_as_failed( RollupFailStatus::ChecksumVerifyFailed, - rollup_to_verify, + batch_mint_to_verify, ) .await?; - statsd_count!("rollup.checksum_verify_fail", 1); - return Err(ProgramTransformerError::RollupValidation( - RollupValidationError::FileChecksumMismatch(expected, actual), + statsd_count!("batch_mint.checksum_verify_fail", 1); + return Err(ProgramTransformerError::BatchMintValidation( + BatchMintValidationError::FileChecksumMismatch(expected, actual), )); } - if let RollupValidationError::Serialization(e) = e { - rollup_to_verify.rollup_persisting_state = + if let BatchMintValidationError::Serialization(e) = e { + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - self.save_rollup_as_failed( + self.save_batch_mint_as_failed( RollupFailStatus::FileSerialization, - rollup_to_verify, + batch_mint_to_verify, ) .await?; - statsd_count!("rollup.file_deserialization_fail", 1); + statsd_count!("batch_mint.file_deserialization_fail", 1); return Err(ProgramTransformerError::SerializatonError(e)); } - if rollup_to_verify.download_attempts + 1 > MAX_ROLLUP_DOWNLOAD_ATTEMPTS as i32 { - rollup_to_verify.rollup_persisting_state = + if batch_mint_to_verify.download_attempts + 1 + > MAX_BATCH_MINT_DOWNLOAD_ATTEMPTS as i32 + { + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; - self.save_rollup_as_failed(RollupFailStatus::DownloadFailed, rollup_to_verify) - .await?; + self.save_batch_mint_as_failed( + RollupFailStatus::DownloadFailed, + batch_mint_to_verify, + ) + .await?; } else { - rollup_to_verify.download_attempts = rollup_to_verify.download_attempts + 1; + batch_mint_to_verify.download_attempts = + batch_mint_to_verify.download_attempts + 1; if let Err(e) = (rollup_to_verify::ActiveModel { - file_hash: Set(rollup_to_verify.file_hash.clone()), - url: Set(rollup_to_verify.url.clone()), - created_at_slot: Set(rollup_to_verify.created_at_slot), - signature: Set(rollup_to_verify.signature.clone()), - staker: Set(rollup_to_verify.staker.clone()), - download_attempts: Set(rollup_to_verify.download_attempts + 1), - rollup_persisting_state: Set(rollup_to_verify + file_hash: Set(batch_mint_to_verify.file_hash.clone()), + url: Set(batch_mint_to_verify.url.clone()), + created_at_slot: Set(batch_mint_to_verify.created_at_slot), + signature: Set(batch_mint_to_verify.signature.clone()), + staker: Set(batch_mint_to_verify.staker.clone()), + download_attempts: Set(batch_mint_to_verify.download_attempts + 1), + rollup_persisting_state: Set(batch_mint_to_verify .rollup_persisting_state .clone()), - rollup_fail_status: Set(rollup_to_verify.rollup_fail_status.clone()), + rollup_fail_status: Set(batch_mint_to_verify.rollup_fail_status.clone()), } .insert(self.txn.as_ref())) .await @@ -422,88 +436,91 @@ impl RollupPersister return Err(e.into()); } } - return Err(ProgramTransformerError::RollupValidation(e)); + return Err(ProgramTransformerError::BatchMintValidation(e)); } } Ok(()) } - async fn validate_rollup( + async fn validate_batch_mint( &self, - rollup_to_verify: &mut rollup_to_verify::Model, - rollup: &Rollup, + batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint: &BatchMint, ) { - if let Err(e) = validate_rollup(rollup).await { - error!("Error while validating rollup: {}", e.to_string()); + if let Err(e) = validate_batch_mint(batch_mint).await { + error!("Error while validating batch mint: {}", e.to_string()); - statsd_count!("rollup.validating_fail", 1); - rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; + statsd_count!("batch_mint.validating_fail", 1); + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; if let Err(err) = self - .save_rollup_as_failed(RollupFailStatus::RollupVerifyFailed, rollup_to_verify) + .save_batch_mint_as_failed( + RollupFailStatus::RollupVerifyFailed, + batch_mint_to_verify, + ) .await { - error!("Save rollup as failed: {}", err); + error!("Save batch mint as failed: {}", err); }; return; } - statsd_count!("rollup.validating_success", 1); - rollup_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyValidate; + statsd_count!("batch_mint.validating_success", 1); + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyValidate; } - async fn store_rollup_update( + async fn store_batch_mint_update( &self, - rollup_to_verify: &mut rollup_to_verify::Model, - rollup: &Rollup, + batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint: &BatchMint, ) -> Result<(), ProgramTransformerError> { - if store_rollup_update( - rollup_to_verify.created_at_slot as u64, - rollup_to_verify.signature.clone(), - rollup, + if store_batch_mint_update( + batch_mint_to_verify.created_at_slot as u64, + batch_mint_to_verify.signature.clone(), + batch_mint, self.txn.as_ref(), ) .await .is_err() { - statsd_count!("rollup.store_update_fail", 1); - rollup_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; + statsd_count!("batch_mint.store_update_fail", 1); + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; return Ok(()); } - statsd_count!("rollup.store_update_success", 1); - rollup_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; + statsd_count!("batch_mint.store_update_success", 1); + batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; Ok(()) } - async fn save_rollup_as_failed( + async fn save_batch_mint_as_failed( &self, status: RollupFailStatus, - rollup: &rollup_to_verify::Model, + batch_mint: &rollup_to_verify::Model, ) -> Result<(), ProgramTransformerError> { rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { - file_hash: Set(rollup.file_hash.clone()), - url: Set(rollup.url.clone()), - created_at_slot: Set(rollup.created_at_slot), - signature: Set(rollup.signature.clone()), - staker: Set(rollup.staker.clone()), - download_attempts: Set(rollup.download_attempts), - rollup_persisting_state: Set(rollup.rollup_persisting_state.clone()), + file_hash: Set(batch_mint.file_hash.clone()), + url: Set(batch_mint.url.clone()), + created_at_slot: Set(batch_mint.created_at_slot), + signature: Set(batch_mint.signature.clone()), + staker: Set(batch_mint.staker.clone()), + download_attempts: Set(batch_mint.download_attempts), + rollup_persisting_state: Set(batch_mint.rollup_persisting_state.clone()), rollup_fail_status: Set(Some(status)), }) - .filter(rollup_to_verify::Column::FileHash.eq(rollup.file_hash.clone())) + .filter(rollup_to_verify::Column::FileHash.eq(batch_mint.file_hash.clone())) .exec(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; Ok(()) } - async fn drop_rollup_from_queue( + async fn drop_batch_mint_from_queue( &self, - rollup_to_verify: &rollup_to_verify::Model, + batch_mint_to_verify: &rollup_to_verify::Model, ) -> Result<(), ProgramTransformerError> { rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { - rollup_persisting_state: Set(rollup_to_verify.rollup_persisting_state.clone()), - ..rollup_to_verify.clone().into_active_model() + rollup_persisting_state: Set(batch_mint_to_verify.rollup_persisting_state.clone()), + ..batch_mint_to_verify.clone().into_active_model() }) - .filter(rollup_to_verify::Column::FileHash.eq(rollup_to_verify.file_hash.clone())) + .filter(rollup_to_verify::Column::FileHash.eq(batch_mint_to_verify.file_hash.clone())) .exec(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; @@ -512,10 +529,10 @@ impl RollupPersister } } -pub async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationError> { +pub async fn validate_batch_mint(batch_mint: &BatchMint) -> Result<(), BatchMintValidationError> { let mut leaf_hashes = Vec::new(); - for asset in rollup.rolled_mints.iter() { - let leaf_hash = match get_leaf_hash(asset, &rollup.tree_id) { + for asset in batch_mint.batch_mints.iter() { + let leaf_hash = match get_leaf_hash(asset, &batch_mint.tree_id) { Ok(leaf_hash) => leaf_hash, Err(e) => { return Err(e); @@ -525,20 +542,20 @@ pub async fn validate_rollup(rollup: &Rollup) -> Result<(), RollupValidationErro } merkle_tree_wrapper::validate_change_logs( - rollup.max_depth, - rollup.max_buffer_size, + batch_mint.max_depth, + batch_mint.max_buffer_size, &leaf_hashes, - rollup, + batch_mint, ) } fn get_leaf_hash( - asset: &RolledMintInstruction, + asset: &BatchedMintInstruction, tree_id: &Pubkey, -) -> Result<[u8; 32], RollupValidationError> { +) -> Result<[u8; 32], BatchMintValidationError> { let asset_id = get_asset_id(tree_id, asset.leaf_update.nonce()); if asset_id != asset.leaf_update.id() { - return Err(RollupValidationError::PDACheckFail( + return Err(BatchMintValidationError::PDACheckFail( asset_id.to_string(), asset.leaf_update.id().to_string(), )); @@ -552,7 +569,7 @@ fn get_leaf_hash( &asset.mint_args.seller_fee_basis_points.to_le_bytes(), ]); if asset.leaf_update.data_hash() != data_hash.to_bytes() { - return Err(RollupValidationError::InvalidDataHash( + return Err(BatchMintValidationError::InvalidDataHash( data_hash.to_string(), Hash::new(asset.leaf_update.data_hash().as_slice()).to_string(), )); @@ -576,7 +593,7 @@ fn get_leaf_hash( .as_ref(), ); if asset.leaf_update.creator_hash() != creator_hash.to_bytes() { - return Err(RollupValidationError::InvalidCreatorsHash( + return Err(BatchMintValidationError::InvalidCreatorsHash( creator_hash.to_string(), Hash::new(asset.leaf_update.creator_hash().as_slice()).to_string(), )); @@ -585,18 +602,18 @@ fn get_leaf_hash( Ok(asset.leaf_update.hash()) } -pub async fn store_rollup_update( +pub async fn store_batch_mint_update( slot: u64, signature: String, - rollup: &Rollup, + batch_mint: &BatchMint, txn: &T, ) -> ProgramTransformerResult<()> where T: ConnectionTrait + TransactionTrait, { - for rolled_mint in rollup.rolled_mints.iter() { + for batched_mint in batch_mint.batch_mints.iter() { bubblegum::mint_v1::mint_v1( - &rolled_mint.into(), + &batched_mint.into(), &InstructionBundle { txn_id: &signature, program: Default::default(), diff --git a/program_transformers/src/rollups/merkle_tree_wrapper.rs b/program_transformers/src/batch_minting/merkle_tree_wrapper.rs similarity index 87% rename from program_transformers/src/rollups/merkle_tree_wrapper.rs rename to program_transformers/src/batch_minting/merkle_tree_wrapper.rs index 6454f4ed1..5fc903b47 100644 --- a/program_transformers/src/rollups/merkle_tree_wrapper.rs +++ b/program_transformers/src/batch_minting/merkle_tree_wrapper.rs @@ -1,6 +1,6 @@ -use crate::error::RollupValidationError; -use crate::rollups::rollup_persister; -use crate::rollups::rollup_persister::Rollup; +use crate::batch_minting::batch_mint_persister; +use crate::batch_minting::batch_mint_persister::BatchMint; +use crate::error::BatchMintValidationError; use anchor_lang::solana_program::keccak::Hash; use spl_account_compression::{ConcurrentMerkleTree, ConcurrentMerkleTreeError, Node}; use spl_concurrent_merkle_tree::changelog::ChangeLog; @@ -176,9 +176,9 @@ make_tree_creator_funcs!( ); pub fn make_concurrent_merkle_tree( - max_dapth: u32, + max_depth: u32, max_buf_size: u32, -) -> Result, RollupValidationError> { +) -> Result, BatchMintValidationError> { // Note: We do not create ConcurrentMerkleTree object right inside of match statement // because of how Rust compiler reserves space for functions: // the total size of function in memory (i.e. frame size) is as big as total size of @@ -191,7 +191,7 @@ pub fn make_concurrent_merkle_tree( // Though, we need the debug to not fail with the stack overflow, // that's why we had to move creation of an exact ConcurrentMerkleTree objects // into separate function that return trait objects. - match (max_dapth, max_buf_size) { + match (max_depth, max_buf_size) { (3, 8) => Ok(make_concurrent_merkle_tree_3_8()), (5, 8) => Ok(make_concurrent_merkle_tree_5_8()), (6, 16) => Ok(make_concurrent_merkle_tree_6_16()), @@ -226,7 +226,7 @@ pub fn make_concurrent_merkle_tree( (30, 512) => Ok(make_concurrent_merkle_tree_30_512()), (30, 1024) => Ok(make_concurrent_merkle_tree_30_1024()), (30, 2048) => Ok(make_concurrent_merkle_tree_30_2048()), - (d, s) => Err(RollupValidationError::UnexpectedTreeSize(d, s)), + (d, s) => Err(BatchMintValidationError::UnexpectedTreeSize(d, s)), } } @@ -235,12 +235,12 @@ make_changelog_impls!(3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, pub fn validate_change_logs( max_depth: u32, max_buffer_size: u32, - leafs: &[[u8; 32]], - rollup: &Rollup, -) -> Result<(), RollupValidationError> { + leaves: &[[u8; 32]], + batch_mint: &BatchMint, +) -> Result<(), BatchMintValidationError> { let mut tree = make_concurrent_merkle_tree(max_depth, max_buffer_size)?; tree.initialize()?; - for (i, leaf_hash) in leafs.iter().enumerate() { + for (i, leaf_hash) in leaves.iter().enumerate() { tree.append(*leaf_hash)?; let changelog = tree.change_logs(tree.active_index() as usize); let path_len = changelog.path_len() as u32; @@ -259,40 +259,40 @@ pub fn validate_change_logs( 1, )); - match rollup.rolled_mints.get(i) { + match batch_mint.batch_mints.get(i) { Some(mint) => { if mint.tree_update.path != path .into_iter() - .map(Into::::into) + .map(Into::::into) .collect::>() { - return Err(RollupValidationError::WrongAssetPath( + return Err(BatchMintValidationError::WrongAssetPath( mint.leaf_update.id().to_string(), )); } - if mint.tree_update.id != rollup.tree_id { - return Err(RollupValidationError::WrongTreeIdForChangeLog( + if mint.tree_update.id != batch_mint.tree_id { + return Err(BatchMintValidationError::WrongTreeIdForChangeLog( mint.leaf_update.id().to_string(), - rollup.tree_id.to_string(), + batch_mint.tree_id.to_string(), mint.tree_update.id.to_string(), )); } if mint.tree_update.index != changelog.index() { - return Err(RollupValidationError::WrongChangeLogIndex( + return Err(BatchMintValidationError::WrongChangeLogIndex( mint.leaf_update.id().to_string(), changelog.index(), mint.tree_update.index, )); } } - None => return Err(RollupValidationError::NoRelevantRolledMint(i as u64)), + None => return Err(BatchMintValidationError::NoRelevantRolledMint(i as u64)), } } - if tree.get_root() != rollup.merkle_root { - return Err(RollupValidationError::InvalidRoot( + if tree.get_root() != batch_mint.merkle_root { + return Err(BatchMintValidationError::InvalidRoot( Hash::new(tree.get_root().as_slice()).to_string(), - Hash::new(rollup.merkle_root.as_slice()).to_string(), + Hash::new(batch_mint.merkle_root.as_slice()).to_string(), )); } Ok(()) diff --git a/program_transformers/src/rollups/mod.rs b/program_transformers/src/batch_minting/mod.rs similarity index 57% rename from program_transformers/src/rollups/mod.rs rename to program_transformers/src/batch_minting/mod.rs index 6b85d8dd2..95aac533b 100644 --- a/program_transformers/src/rollups/mod.rs +++ b/program_transformers/src/batch_minting/mod.rs @@ -1,3 +1,3 @@ +pub mod batch_mint_persister; mod merkle_tree_wrapper; -pub mod rollup_persister; pub mod tests; diff --git a/program_transformers/src/rollups/tests.rs b/program_transformers/src/batch_minting/tests.rs similarity index 60% rename from program_transformers/src/rollups/tests.rs rename to program_transformers/src/batch_minting/tests.rs index 8e0626c45..68e3b1d14 100644 --- a/program_transformers/src/rollups/tests.rs +++ b/program_transformers/src/batch_minting/tests.rs @@ -1,7 +1,7 @@ -use crate::error::RollupValidationError; -use crate::rollups::rollup_persister::{ - validate_rollup, ChangeLogEventV1, PathNode, RolledMintInstruction, Rollup, +use crate::batch_minting::batch_mint_persister::{ + validate_batch_mint, BatchMint, BatchedMintInstruction, ChangeLogEventV1, PathNode, }; +use crate::error::BatchMintValidationError; use anchor_lang::AnchorSerialize; use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; use rand::{thread_rng, Rng}; @@ -11,7 +11,7 @@ use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; use std::collections::HashMap; use std::str::FromStr; -pub fn generate_rollup(size: usize) -> Rollup { +pub fn generate_batch_mint(size: usize) -> BatchMint { let authority = Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(); let tree = Pubkey::from_str("HxhCw9g3kZvrdg9zZvctmh6qpSDg1FfsBXfFvRkbCHB7").unwrap(); let mut mints = Vec::new(); @@ -124,7 +124,7 @@ pub fn generate_rollup(size: usize) -> Rollup { 1, )); - let rolled_mint = RolledMintInstruction { + let rolled_mint = BatchedMintInstruction { tree_update: ChangeLogEventV1 { id: tree, path: path.into_iter().map(Into::into).collect::>(), @@ -144,112 +144,112 @@ pub fn generate_rollup(size: usize) -> Rollup { }; mints.push(rolled_mint); } - let rollup = Rollup { + let batch_mint = BatchMint { tree_id: tree, raw_metadata_map: HashMap::new(), max_depth: 10, - rolled_mints: mints, + batch_mints: mints, merkle_root: merkle.get_root(), last_leaf_hash, max_buffer_size: 32, }; - rollup + batch_mint } #[tokio::test] -async fn rollup_validation_test() { - let mut rollup = generate_rollup(1000); +async fn batch_mint_validation_test() { + let mut batch_mint = generate_batch_mint(1000); - let validation_result = validate_rollup(&rollup).await; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!(validation_result, Ok(())); - let old_root = rollup.merkle_root; + let old_root = batch_mint.merkle_root; let new_root = Pubkey::new_unique(); - rollup.merkle_root = new_root.to_bytes(); + batch_mint.merkle_root = new_root.to_bytes(); - let validation_result = validate_rollup(&rollup).await; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::InvalidRoot( + Err(BatchMintValidationError::InvalidRoot( Pubkey::from(old_root).to_string(), new_root.to_string() )) ); - rollup.merkle_root = old_root; + batch_mint.merkle_root = old_root; let leaf_idx = 111; - let old_leaf_data_hash = rollup.rolled_mints[leaf_idx].leaf_update.data_hash(); + let old_leaf_data_hash = batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(); let new_leaf_data_hash = Pubkey::new_unique(); - rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: rollup.rolled_mints[leaf_idx].leaf_update.id(), - owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), - delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), - nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: batch_mint.batch_mints[leaf_idx].leaf_update.id(), + owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), + delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), + nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), data_hash: new_leaf_data_hash.to_bytes(), - creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let validation_result = validate_rollup(&rollup).await; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::InvalidDataHash( + Err(BatchMintValidationError::InvalidDataHash( Pubkey::from(old_leaf_data_hash).to_string(), new_leaf_data_hash.to_string() )) ); - rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: rollup.rolled_mints[leaf_idx].leaf_update.id(), - owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), - delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), - nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), + batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { + id: batch_mint.batch_mints[leaf_idx].leaf_update.id(), + owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), + delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), + nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), data_hash: old_leaf_data_hash, - creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let old_tree_depth = rollup.max_depth; + let old_tree_depth = batch_mint.max_depth; let new_tree_depth = 100; - rollup.max_depth = new_tree_depth; - let validation_result = validate_rollup(&rollup).await; + batch_mint.max_depth = new_tree_depth; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::UnexpectedTreeSize( + Err(BatchMintValidationError::UnexpectedTreeSize( new_tree_depth, - rollup.max_buffer_size + batch_mint.max_buffer_size )) ); - rollup.max_depth = old_tree_depth; + batch_mint.max_depth = old_tree_depth; let new_asset_id = Pubkey::new_unique(); - let old_asset_id = rollup.rolled_mints[leaf_idx].leaf_update.id(); - rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + let old_asset_id = batch_mint.batch_mints[leaf_idx].leaf_update.id(); + batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { id: new_asset_id, - owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), - delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), - nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), - data_hash: rollup.rolled_mints[leaf_idx].leaf_update.data_hash(), - creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), + delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), + nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), + data_hash: batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(), + creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let validation_result = validate_rollup(&rollup).await; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::PDACheckFail( + Err(BatchMintValidationError::PDACheckFail( old_asset_id.to_string(), new_asset_id.to_string() )) ); - rollup.rolled_mints[leaf_idx].leaf_update = LeafSchema::V1 { + batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { id: old_asset_id, - owner: rollup.rolled_mints[leaf_idx].leaf_update.owner(), - delegate: rollup.rolled_mints[leaf_idx].leaf_update.delegate(), - nonce: rollup.rolled_mints[leaf_idx].leaf_update.nonce(), - data_hash: rollup.rolled_mints[leaf_idx].leaf_update.data_hash(), - creator_hash: rollup.rolled_mints[leaf_idx].leaf_update.creator_hash(), + owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), + delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), + nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), + data_hash: batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(), + creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let old_path = rollup.rolled_mints[leaf_idx] + let old_path = batch_mint.batch_mints[leaf_idx] .tree_update .path .iter() @@ -259,41 +259,50 @@ async fn rollup_validation_test() { }) .collect::>(); let new_path = Vec::new(); - rollup.rolled_mints[leaf_idx].tree_update.path = new_path; - let validation_result = validate_rollup(&rollup).await; + batch_mint.batch_mints[leaf_idx].tree_update.path = new_path; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::WrongAssetPath( - rollup.rolled_mints[leaf_idx].leaf_update.id().to_string() + Err(BatchMintValidationError::WrongAssetPath( + batch_mint.batch_mints[leaf_idx] + .leaf_update + .id() + .to_string() )) ); - rollup.rolled_mints[leaf_idx].tree_update.path = old_path; - let old_tree_id = rollup.rolled_mints[leaf_idx].tree_update.id; + batch_mint.batch_mints[leaf_idx].tree_update.path = old_path; + let old_tree_id = batch_mint.batch_mints[leaf_idx].tree_update.id; let new_tree_id = Pubkey::new_unique(); - rollup.rolled_mints[leaf_idx].tree_update.id = new_tree_id; - let validation_result = validate_rollup(&rollup).await; + batch_mint.batch_mints[leaf_idx].tree_update.id = new_tree_id; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::WrongTreeIdForChangeLog( - rollup.rolled_mints[leaf_idx].leaf_update.id().to_string(), + Err(BatchMintValidationError::WrongTreeIdForChangeLog( + batch_mint.batch_mints[leaf_idx] + .leaf_update + .id() + .to_string(), old_tree_id.to_string(), new_tree_id.to_string() )) ); - rollup.rolled_mints[leaf_idx].tree_update.id = old_tree_id; - let old_index = rollup.rolled_mints[leaf_idx].tree_update.index; + batch_mint.batch_mints[leaf_idx].tree_update.id = old_tree_id; + let old_index = batch_mint.batch_mints[leaf_idx].tree_update.index; let new_index = 1; - rollup.rolled_mints[leaf_idx].tree_update.index = new_index; - let validation_result = validate_rollup(&rollup).await; + batch_mint.batch_mints[leaf_idx].tree_update.index = new_index; + let validation_result = validate_batch_mint(&batch_mint).await; assert_eq!( validation_result, - Err(RollupValidationError::WrongChangeLogIndex( - rollup.rolled_mints[leaf_idx].leaf_update.id().to_string(), + Err(BatchMintValidationError::WrongChangeLogIndex( + batch_mint.batch_mints[leaf_idx] + .leaf_update + .id() + .to_string(), old_index, new_index )) diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 04115914a..3c8d0be86 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -30,20 +30,19 @@ where }, ) .on_conflict( - OnConflict::columns([digital_asset_types::dao::rollup_to_verify::Column::FileHash]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Url]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Signature]) - .update_columns([ - digital_asset_types::dao::rollup_to_verify::Column::DownloadAttempts, - ]) - .update_columns([ - digital_asset_types::dao::rollup_to_verify::Column::RollupFailStatus, - ]) - .update_columns([ - digital_asset_types::dao::rollup_to_verify::Column::RollupPersistingState, - ]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::CreatedAtSlot]) - .to_owned(), + OnConflict::columns([ + digital_asset_types::dao::rollup_to_verify::Column::FileHash, + digital_asset_types::dao::rollup_to_verify::Column::Staker, + ]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Url]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Signature]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::DownloadAttempts]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::RollupFailStatus]) + .update_columns([ + digital_asset_types::dao::rollup_to_verify::Column::RollupPersistingState, + ]) + .update_columns([digital_asset_types::dao::rollup_to_verify::Column::CreatedAtSlot]) + .to_owned(), ) .build(DbBackend::Postgres); txn.execute(query) diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index 4abf80042..3b804e286 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -22,8 +22,8 @@ pub enum ProgramTransformerError { AssetIndexError(String), #[error("Failed to notify about download metadata: {0}")] DownloadMetadataNotify(Box), - #[error("RollupValidation: {0}")] - RollupValidation(#[from] RollupValidationError), + #[error("BatchMintValidation: {0}")] + BatchMintValidation(#[from] BatchMintValidationError), } impl From for ProgramTransformerError { @@ -39,7 +39,7 @@ impl From for ProgramTransformerError { } #[derive(thiserror::Error, Debug, PartialEq, Eq)] -pub enum RollupValidationError { +pub enum BatchMintValidationError { #[error("PDACheckFail: expected: {0}, got: {1}")] PDACheckFail(String, String), #[error("InvalidDataHash: expected: {0}, got: {1}")] @@ -72,17 +72,17 @@ pub enum RollupValidationError { Reqwest(String), } -impl From for RollupValidationError { +impl From for BatchMintValidationError { fn from(err: std::io::Error) -> Self { - RollupValidationError::StdIo(err.to_string()) + BatchMintValidationError::StdIo(err.to_string()) } } -impl From for RollupValidationError { +impl From for BatchMintValidationError { fn from(value: serde_json::Error) -> Self { Self::Serialization(value.to_string()) } } -impl From for RollupValidationError { +impl From for BatchMintValidationError { fn from(value: reqwest::Error) -> Self { Self::Reqwest(value.to_string()) } diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index 1d15d3de0..c43c13528 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -29,10 +29,10 @@ use { }; mod asset_upserts; +pub mod batch_minting; mod bubblegum; pub mod error; mod mpl_core_program; -pub mod rollups; mod token; mod token_metadata; From acf874ec00156d0169141ce54fd00b98f3d9b9e8 Mon Sep 17 00:00:00 2001 From: requesco Date: Fri, 26 Jul 2024 10:08:20 +0300 Subject: [PATCH 31/34] wip --- .../generated/{rollup.rs => batch_mint.rs} | 8 +- ...p_to_verify.rs => batch_mint_to_verify.rs} | 18 +- digital_asset_types/src/dao/generated/mod.rs | 4 +- .../src/dao/generated/prelude.rs | 4 +- .../src/dao/generated/sea_orm_active_enums.rs | 188 +++++++++--------- ...alize_tree_with_root_instruction_handle.rs | 100 +++++----- nft_ingester/src/batch_mint_updates.rs | 3 +- .../src/batch_minting/batch_mint_persister.rs | 150 +++++++------- .../src/bubblegum/finalize_tree_with_root.rs | 30 +-- 9 files changed, 266 insertions(+), 239 deletions(-) rename digital_asset_types/src/dao/generated/{rollup.rs => batch_mint.rs} (87%) rename digital_asset_types/src/dao/generated/{rollup_to_verify.rs => batch_mint_to_verify.rs} (77%) diff --git a/digital_asset_types/src/dao/generated/rollup.rs b/digital_asset_types/src/dao/generated/batch_mint.rs similarity index 87% rename from digital_asset_types/src/dao/generated/rollup.rs rename to digital_asset_types/src/dao/generated/batch_mint.rs index f9105bcc1..8f9dc809e 100644 --- a/digital_asset_types/src/dao/generated/rollup.rs +++ b/digital_asset_types/src/dao/generated/batch_mint.rs @@ -8,20 +8,20 @@ pub struct Entity; impl EntityName for Entity { fn table_name(&self) -> &str { - "rollup" + "batch_mint" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)] pub struct Model { pub file_hash: String, - pub rollup_binary_bincode: Vec, + pub batch_mint_binary_bincode: Vec, } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] pub enum Column { FileHash, - RollupBinaryBincode, + BatchMintBinaryBincode, } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] @@ -44,7 +44,7 @@ impl ColumnTrait for Column { fn def(&self) -> ColumnDef { match self { Self::FileHash => ColumnType::String(None).def(), - Self::RollupBinaryBincode => ColumnType::Binary.def(), + Self::BatchMintBinaryBincode => ColumnType::Binary.def(), } } } diff --git a/digital_asset_types/src/dao/generated/rollup_to_verify.rs b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs similarity index 77% rename from digital_asset_types/src/dao/generated/rollup_to_verify.rs rename to digital_asset_types/src/dao/generated/batch_mint_to_verify.rs index 87bccc8ca..5ace93414 100644 --- a/digital_asset_types/src/dao/generated/rollup_to_verify.rs +++ b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs @@ -1,7 +1,7 @@ //! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 -use super::sea_orm_active_enums::RollupFailStatus; -use super::sea_orm_active_enums::RollupPersistingState; +use super::sea_orm_active_enums::BatchMintFailStatus; +use super::sea_orm_active_enums::BatchMintPersistingState; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; @@ -10,7 +10,7 @@ pub struct Entity; impl EntityName for Entity { fn table_name(&self) -> &str { - "rollup_to_verify" + "batch_mint_to_verify" } } @@ -22,8 +22,8 @@ pub struct Model { pub signature: String, pub staker: Vec, pub download_attempts: i32, - pub rollup_persisting_state: RollupPersistingState, - pub rollup_fail_status: Option, + pub batch_mint_persisting_state: BatchMintPersistingState, + pub batch_mint_fail_status: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] @@ -34,8 +34,8 @@ pub enum Column { Signature, Staker, DownloadAttempts, - RollupPersistingState, - RollupFailStatus, + BatchMintPersistingState, + BatchMintFailStatus, } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] @@ -63,8 +63,8 @@ impl ColumnTrait for Column { Self::Signature => ColumnType::String(None).def(), Self::Staker => ColumnType::Binary.def(), Self::DownloadAttempts => ColumnType::Integer.def(), - Self::RollupPersistingState => RollupPersistingState::db_type(), - Self::RollupFailStatus => RollupFailStatus::db_type().null(), + Self::BatchMintPersistingState => BatchMintPersistingState::db_type(), + Self::BatchMintFailStatus => BatchMintFailStatus::db_type().null(), } } } diff --git a/digital_asset_types/src/dao/generated/mod.rs b/digital_asset_types/src/dao/generated/mod.rs index bc6869ff4..42dcb52e1 100644 --- a/digital_asset_types/src/dao/generated/mod.rs +++ b/digital_asset_types/src/dao/generated/mod.rs @@ -9,11 +9,11 @@ pub mod asset_data; pub mod asset_grouping; pub mod asset_v1_account_attachments; pub mod backfill_items; +pub mod batch_mint; +pub mod batch_mint_to_verify; pub mod cl_audits_v2; pub mod cl_items; pub mod raw_txn; -pub mod rollup; -pub mod rollup_to_verify; pub mod sea_orm_active_enums; pub mod tasks; pub mod token_accounts; diff --git a/digital_asset_types/src/dao/generated/prelude.rs b/digital_asset_types/src/dao/generated/prelude.rs index 3d9e7a882..e361cc145 100644 --- a/digital_asset_types/src/dao/generated/prelude.rs +++ b/digital_asset_types/src/dao/generated/prelude.rs @@ -9,11 +9,11 @@ pub use super::asset_data::Entity as AssetData; pub use super::asset_grouping::Entity as AssetGrouping; pub use super::asset_v1_account_attachments::Entity as AssetV1AccountAttachments; pub use super::backfill_items::Entity as BackfillItems; +pub use super::batch_mint::Entity as BatchMint; +pub use super::batch_mint_to_verify::Entity as BatchMintToVerify; pub use super::cl_audits_v2::Entity as ClAuditsV2; pub use super::cl_items::Entity as ClItems; pub use super::raw_txn::Entity as RawTxn; -pub use super::rollup::Entity as Rollup; -pub use super::rollup_to_verify::Entity as RollupToVerify; pub use super::tasks::Entity as Tasks; pub use super::token_accounts::Entity as TokenAccounts; pub use super::tokens::Entity as Tokens; diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index ae880a38c..ce89fcd7a 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -4,40 +4,44 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] -pub enum Instruction { - #[sea_orm(string_value = "burn")] - Burn, - #[sea_orm(string_value = "cancel_redeem")] - CancelRedeem, - #[sea_orm(string_value = "compress")] - Compress, - #[sea_orm(string_value = "decompress_v1")] - DecompressV1, - #[sea_orm(string_value = "delegate")] - Delegate, - #[sea_orm(string_value = "mint_to_collection_v1")] - MintToCollectionV1, - #[sea_orm(string_value = "mint_v1")] - MintV1, - #[sea_orm(string_value = "redeem")] - Redeem, - #[sea_orm(string_value = "set_and_verify_collection")] - SetAndVerifyCollection, - #[sea_orm(string_value = "transfer")] - Transfer, +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "v1_account_attachments" +)] +pub enum V1AccountAttachments { + #[sea_orm(string_value = "edition")] + Edition, + #[sea_orm(string_value = "edition_marker")] + EditionMarker, + #[sea_orm(string_value = "master_edition_v1")] + MasterEditionV1, + #[sea_orm(string_value = "master_edition_v2")] + MasterEditionV2, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] +pub enum TaskStatus { + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "running")] + Running, + #[sea_orm(string_value = "success")] + Success, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] +pub enum OwnerType { + #[sea_orm(string_value = "single")] + Single, + #[sea_orm(string_value = "token")] + Token, #[sea_orm(string_value = "unknown")] Unknown, - #[sea_orm(string_value = "unverify_collection")] - UnverifyCollection, - #[sea_orm(string_value = "unverify_creator")] - UnverifyCreator, - #[sea_orm(string_value = "update_metadata")] - UpdateMetadata, - #[sea_orm(string_value = "verify_collection")] - VerifyCollection, - #[sea_orm(string_value = "verify_creator")] - VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( @@ -88,32 +92,8 @@ pub enum RoyaltyTargetType { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "rollup_fail_status")] -pub enum RollupFailStatus { - #[sea_orm(string_value = "checksum_verify_failed")] - ChecksumVerifyFailed, - #[sea_orm(string_value = "download_failed")] - DownloadFailed, - #[sea_orm(string_value = "file_serialization")] - FileSerialization, - #[sea_orm(string_value = "rollup_verify_failed")] - RollupVerifyFailed, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] -pub enum TaskStatus { - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "running")] - Running, - #[sea_orm(string_value = "success")] - Success, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] -pub enum ChainMutability { +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] +pub enum Mutability { #[sea_orm(string_value = "immutable")] Immutable, #[sea_orm(string_value = "mutable")] @@ -122,32 +102,40 @@ pub enum ChainMutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "v1_account_attachments" -)] -pub enum V1AccountAttachments { - #[sea_orm(string_value = "edition")] - Edition, - #[sea_orm(string_value = "edition_marker")] - EditionMarker, - #[sea_orm(string_value = "master_edition_v1")] - MasterEditionV1, - #[sea_orm(string_value = "master_edition_v2")] - MasterEditionV2, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] -pub enum Mutability { - #[sea_orm(string_value = "immutable")] - Immutable, - #[sea_orm(string_value = "mutable")] - Mutable, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] +pub enum Instruction { + #[sea_orm(string_value = "burn")] + Burn, + #[sea_orm(string_value = "cancel_redeem")] + CancelRedeem, + #[sea_orm(string_value = "compress")] + Compress, + #[sea_orm(string_value = "decompress_v1")] + DecompressV1, + #[sea_orm(string_value = "delegate")] + Delegate, + #[sea_orm(string_value = "mint_to_collection_v1")] + MintToCollectionV1, + #[sea_orm(string_value = "mint_v1")] + MintV1, + #[sea_orm(string_value = "redeem")] + Redeem, + #[sea_orm(string_value = "set_and_verify_collection")] + SetAndVerifyCollection, + #[sea_orm(string_value = "transfer")] + Transfer, #[sea_orm(string_value = "unknown")] Unknown, + #[sea_orm(string_value = "unverify_collection")] + UnverifyCollection, + #[sea_orm(string_value = "unverify_creator")] + UnverifyCreator, + #[sea_orm(string_value = "update_metadata")] + UpdateMetadata, + #[sea_orm(string_value = "verify_collection")] + VerifyCollection, + #[sea_orm(string_value = "verify_creator")] + VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( @@ -166,12 +154,22 @@ pub enum SpecificationVersions { V2, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] +pub enum ChainMutability { + #[sea_orm(string_value = "immutable")] + Immutable, + #[sea_orm(string_value = "mutable")] + Mutable, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", - enum_name = "rollup_persisting_state" + enum_name = "batch_mint_persisting_state" )] -pub enum RollupPersistingState { +pub enum BatchMintPersistingState { #[sea_orm(string_value = "failed_to_persist")] FailedToPersist, #[sea_orm(string_value = "received_transaction")] @@ -186,12 +184,18 @@ pub enum RollupPersistingState { SuccessfullyValidate, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] -pub enum OwnerType { - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "token")] - Token, - #[sea_orm(string_value = "unknown")] - Unknown, +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "batch_mint_fail_status" +)] +pub enum BatchMintFailStatus { + #[sea_orm(string_value = "batch_mint_verify_failed")] + BatchMintVerifyFailed, + #[sea_orm(string_value = "checksum_verify_failed")] + ChecksumVerifyFailed, + #[sea_orm(string_value = "download_failed")] + DownloadFailed, + #[sea_orm(string_value = "file_serialization")] + FileSerialization, } diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 596ed9bfd..32c6b6cf5 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -14,12 +14,12 @@ impl MigrationTrait for Migration { manager .create_type( Type::create() - .as_enum(RollupToVerify::RollupFailStatus) + .as_enum(BatchMintToVerify::BatchMintFailStatus) .values([ - FailedRollupState::ChecksumVerifyFailed, - FailedRollupState::RollupVerifyFailed, - FailedRollupState::DownloadFailed, - FailedRollupState::FileSerialization, + FailedBatchMintState::ChecksumVerifyFailed, + FailedBatchMintState::BatchMintVerifyFailed, + FailedBatchMintState::DownloadFailed, + FailedBatchMintState::FileSerialization, ]) .to_owned(), ) @@ -28,14 +28,14 @@ impl MigrationTrait for Migration { manager .create_type( Type::create() - .as_enum(RollupToVerify::RollupPersistingState) + .as_enum(BatchMintToVerify::BatchMintPersistingState) .values([ - PersistingRollupState::ReceivedTransaction, - PersistingRollupState::StartProcessing, - PersistingRollupState::FailedToPersist, - PersistingRollupState::SuccessfullyDownload, - PersistingRollupState::SuccessfullyValidate, - PersistingRollupState::StoredUpdate, + PersistingBatchMintState::ReceivedTransaction, + PersistingBatchMintState::StartProcessing, + PersistingBatchMintState::FailedToPersist, + PersistingBatchMintState::SuccessfullyDownload, + PersistingBatchMintState::SuccessfullyValidate, + PersistingBatchMintState::StoredUpdate, ]) .to_owned(), ) @@ -44,44 +44,48 @@ impl MigrationTrait for Migration { manager .create_table( Table::create() - .table(RollupToVerify::Table) + .table(BatchMintToVerify::Table) .if_not_exists() .col( - ColumnDef::new(RollupToVerify::FileHash) + ColumnDef::new(BatchMintToVerify::FileHash) .string() .not_null() .primary_key(), ) - .col(ColumnDef::new(RollupToVerify::Url).string().not_null()) + .col(ColumnDef::new(BatchMintToVerify::Url).string().not_null()) .col( - ColumnDef::new(RollupToVerify::CreatedAtSlot) + ColumnDef::new(BatchMintToVerify::CreatedAtSlot) .big_integer() .not_null(), ) .col( - ColumnDef::new(RollupToVerify::Signature) + ColumnDef::new(BatchMintToVerify::Signature) .string() .not_null(), ) - .col(ColumnDef::new(RollupToVerify::Staker).binary().not_null()) .col( - ColumnDef::new(RollupToVerify::DownloadAttempts) + ColumnDef::new(BatchMintToVerify::Staker) + .binary() + .not_null(), + ) + .col( + ColumnDef::new(BatchMintToVerify::DownloadAttempts) .unsigned() .not_null(), ) .col( - ColumnDef::new(RollupToVerify::RollupPersistingState) + ColumnDef::new(BatchMintToVerify::BatchMintPersistingState) .enumeration( - RollupToVerify::RollupPersistingState, - all::().collect::>(), + BatchMintToVerify::BatchMintPersistingState, + all::().collect::>(), ) .not_null(), ) .col( - ColumnDef::new(RollupToVerify::RollupFailStatus) + ColumnDef::new(BatchMintToVerify::BatchMintFailStatus) .enumeration( - RollupToVerify::RollupFailStatus, - all::().collect::>(), + BatchMintToVerify::BatchMintFailStatus, + all::().collect::>(), ) .null(), ) @@ -93,9 +97,9 @@ impl MigrationTrait for Migration { .create_index( Index::create() .name("idx_created_at_slot") - .table(RollupToVerify::Table) - .col(RollupToVerify::CreatedAtSlot) - .col(RollupToVerify::RollupPersistingState) + .table(BatchMintToVerify::Table) + .col(BatchMintToVerify::CreatedAtSlot) + .col(BatchMintToVerify::BatchMintPersistingState) .to_owned(), ) .await?; @@ -103,16 +107,16 @@ impl MigrationTrait for Migration { manager .create_table( Table::create() - .table(Rollup::Table) + .table(BatchMint::Table) .if_not_exists() .col( - ColumnDef::new(Rollup::FileHash) + ColumnDef::new(BatchMint::FileHash) .string() .not_null() .primary_key(), ) .col( - ColumnDef::new(Rollup::RollupBinaryBincode) + ColumnDef::new(BatchMint::BatchMintBinaryBincode) .binary() .not_null(), ) @@ -123,15 +127,15 @@ impl MigrationTrait for Migration { .get_connection() .execute(Statement::from_string( DatabaseBackend::Postgres, - "CREATE FUNCTION notify_new_rollup() RETURNS trigger LANGUAGE plpgsql AS $$ + "CREATE FUNCTION notify_new_batch_mint() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - PERFORM pg_notify('new_rollup', NEW::text); + PERFORM pg_notify('new_batch_mint', NEW::text); RETURN NEW; END; $$; - CREATE TRIGGER rollup_to_verify_trigger - AFTER INSERT ON rollup_to_verify - FOR EACH ROW EXECUTE FUNCTION notify_new_rollup();" + CREATE TRIGGER batch_mint_to_verify_trigger + AFTER INSERT ON batch_mint_to_verify + FOR EACH ROW EXECUTE FUNCTION notify_new_batch_mint();" .to_string(), )) .await?; @@ -144,36 +148,36 @@ impl MigrationTrait for Migration { .get_connection() .execute(Statement::from_string( DatabaseBackend::Postgres, - "DROP TRIGGER IF EXISTS rollup_to_verify_trigger ON rollup_to_verify; - DROP FUNCTION IF EXISTS notify_new_rollup;" + "DROP TRIGGER IF EXISTS batch_mint_to_verify_trigger ON batch_mint_to_verify; + DROP FUNCTION IF EXISTS notify_new_batch_mint;" .to_string(), )) .await?; manager - .drop_table(Table::drop().table(RollupToVerify::Table).to_owned()) + .drop_table(Table::drop().table(BatchMintToVerify::Table).to_owned()) .await?; manager - .drop_table(Table::drop().table(Rollup::Table).to_owned()) + .drop_table(Table::drop().table(BatchMint::Table).to_owned()) .await?; Ok(()) } } #[derive(Iden)] -enum RollupToVerify { +enum BatchMintToVerify { Table, Url, FileHash, CreatedAtSlot, Signature, DownloadAttempts, - RollupPersistingState, - RollupFailStatus, + BatchMintPersistingState, + BatchMintFailStatus, Staker, } #[derive(Iden, Debug, PartialEq, Sequence)] -enum PersistingRollupState { +enum PersistingBatchMintState { ReceivedTransaction, FailedToPersist, StartProcessing, @@ -183,16 +187,16 @@ enum PersistingRollupState { } #[derive(Iden, Debug, PartialEq, Sequence)] -enum FailedRollupState { +enum FailedBatchMintState { DownloadFailed, ChecksumVerifyFailed, - RollupVerifyFailed, + BatchMintVerifyFailed, FileSerialization, } #[derive(Iden)] -enum Rollup { +enum BatchMint { Table, FileHash, - RollupBinaryBincode, + BatchMintBinaryBincode, } diff --git a/nft_ingester/src/batch_mint_updates.rs b/nft_ingester/src/batch_mint_updates.rs index 418efcee0..3f773bf6e 100644 --- a/nft_ingester/src/batch_mint_updates.rs +++ b/nft_ingester/src/batch_mint_updates.rs @@ -2,10 +2,9 @@ use crate::error::IngesterError; use async_channel::Receiver; use log::error; use sqlx::postgres::PgListener; -use std::time::Duration; use tokio::task::{JoinError, JoinSet}; -const BATCH_MINT_LISTEN_KEY: &str = "new_rollup"; +const BATCH_MINT_LISTEN_KEY: &str = "new_batch_mint"; pub async fn create_batch_mint_notification_channel( database_url: &str, diff --git a/program_transformers/src/batch_minting/batch_mint_persister.rs b/program_transformers/src/batch_minting/batch_mint_persister.rs index ad41e3b08..28f2d07e7 100644 --- a/program_transformers/src/batch_minting/batch_mint_persister.rs +++ b/program_transformers/src/batch_minting/batch_mint_persister.rs @@ -10,8 +10,10 @@ use async_trait::async_trait; use blockbuster::instruction::InstructionBundle; use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; use cadence_macros::{statsd_count, statsd_histogram}; -use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; -use digital_asset_types::dao::{rollup, rollup_to_verify}; +use digital_asset_types::dao::sea_orm_active_enums::{ + BatchMintFailStatus, BatchMintPersistingState, +}; +use digital_asset_types::dao::{batch_mint, batch_mint_to_verify}; use mockall::automock; use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; use mpl_bubblegum::utils::get_asset_id; @@ -206,7 +208,7 @@ impl BatchMintPer }; let Ok((batch_mint_to_verify, batch_mint)) = self.get_batch_mint_to_verify().await else { - statsd_count!("batch_mint.fail_get_rollup", 1); + statsd_count!("batch_mint.fail_get_batch_mint", 1); continue; }; let Some(batch_mint_to_verify) = batch_mint_to_verify else { @@ -214,7 +216,7 @@ impl BatchMintPer continue; }; let batch_mint = batch_mint - .map(|r| bincode::deserialize::(r.rollup_binary_bincode.as_slice())) + .map(|r| bincode::deserialize::(r.batch_mint_binary_bincode.as_slice())) .transpose() .unwrap_or_default(); self.persist_batch_mint(batch_mint_to_verify, batch_mint.map(Box::new)) @@ -224,19 +226,19 @@ impl BatchMintPer pub async fn persist_batch_mint( &self, - mut batch_mint_to_verify: rollup_to_verify::Model, + mut batch_mint_to_verify: batch_mint_to_verify::Model, mut batch_mint: Option>, ) { let start_time = Instant::now(); info!("Persisting {} batch mint", &batch_mint_to_verify.url); loop { - match &batch_mint_to_verify.rollup_persisting_state { - &RollupPersistingState::ReceivedTransaction => { + match &batch_mint_to_verify.batch_mint_persisting_state { + &BatchMintPersistingState::ReceivedTransaction => { // We get ReceivedTransaction state on the start of processing - batch_mint_to_verify.rollup_persisting_state = - RollupPersistingState::StartProcessing; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::StartProcessing; } - &RollupPersistingState::StartProcessing => { + &BatchMintPersistingState::StartProcessing => { if let Err(err) = self .download_batch_mint(&mut batch_mint_to_verify, &mut batch_mint) .await @@ -244,7 +246,7 @@ impl BatchMintPer error!("Error during batch mint downloading: {}", err) }; } - &RollupPersistingState::SuccessfullyDownload => { + &BatchMintPersistingState::SuccessfullyDownload => { if let Some(r) = &batch_mint { self.validate_batch_mint(&mut batch_mint_to_verify, r).await; } else { @@ -254,7 +256,7 @@ impl BatchMintPer ) } } - &RollupPersistingState::SuccessfullyValidate => { + &BatchMintPersistingState::SuccessfullyValidate => { if let Some(r) = &batch_mint { if let Err(e) = self .store_batch_mint_update(&mut batch_mint_to_verify, r) @@ -269,13 +271,15 @@ impl BatchMintPer ) } } - &RollupPersistingState::FailedToPersist | &RollupPersistingState::StoredUpdate => { + &BatchMintPersistingState::FailedToPersist + | &BatchMintPersistingState::StoredUpdate => { if let Err(e) = self.drop_batch_mint_from_queue(&batch_mint_to_verify).await { error!("failed to drop batch mint from queue: {}", e); }; info!( "Finish processing {} batch mint file with {:?} state", - &batch_mint_to_verify.url, &batch_mint_to_verify.rollup_persisting_state + &batch_mint_to_verify.url, + &batch_mint_to_verify.batch_mint_persisting_state ); statsd_histogram!( "batch_mint.persisting_latency", @@ -290,48 +294,53 @@ impl BatchMintPer pub async fn get_batch_mint_to_verify( &self, - ) -> Result<(Option, Option), ProgramTransformerError> - { + ) -> Result< + ( + Option, + Option, + ), + ProgramTransformerError, + > { let multi_txn = self.txn.begin().await?; let condition = Condition::all() .add( - rollup_to_verify::Column::RollupPersistingState - .ne(RollupPersistingState::FailedToPersist), + batch_mint_to_verify::Column::BatchMintPersistingState + .ne(BatchMintPersistingState::FailedToPersist), ) .add( - rollup_to_verify::Column::RollupPersistingState - .ne(RollupPersistingState::StoredUpdate), + batch_mint_to_verify::Column::BatchMintPersistingState + .ne(BatchMintPersistingState::StoredUpdate), ) .add( - rollup_to_verify::Column::RollupPersistingState - .ne(RollupPersistingState::StartProcessing), + batch_mint_to_verify::Column::BatchMintPersistingState + .ne(BatchMintPersistingState::StartProcessing), ); - let batch_mint_verify = rollup_to_verify::Entity::find() + let batch_mint_verify = batch_mint_to_verify::Entity::find() .filter(condition) - .order_by_asc(rollup_to_verify::Column::CreatedAtSlot) + .order_by_asc(batch_mint_to_verify::Column::CreatedAtSlot) .lock(LockType::Update) .one(&multi_txn) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; let mut batch_mint = None; if let Some(ref r) = batch_mint_verify { - batch_mint = rollup::Entity::find() - .filter(rollup::Column::FileHash.eq(r.file_hash.clone())) + batch_mint = batch_mint::Entity::find() + .filter(batch_mint::Column::FileHash.eq(r.file_hash.clone())) .one(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; - rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { + batch_mint_to_verify::Entity::update(batch_mint_to_verify::ActiveModel { file_hash: Set(r.file_hash.clone()), url: Set(r.url.clone()), created_at_slot: Set(r.created_at_slot), signature: Set(r.signature.clone()), staker: Set(r.staker.clone()), download_attempts: Set(r.download_attempts), - rollup_persisting_state: Set(RollupPersistingState::StartProcessing), - rollup_fail_status: Set(r.rollup_fail_status.clone()), + batch_mint_persisting_state: Set(BatchMintPersistingState::StartProcessing), + batch_mint_fail_status: Set(r.batch_mint_fail_status.clone()), }) - .filter(rollup_to_verify::Column::FileHash.eq(r.file_hash.clone())) + .filter(batch_mint_to_verify::Column::FileHash.eq(r.file_hash.clone())) .exec(&multi_txn) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; @@ -343,7 +352,7 @@ impl BatchMintPer async fn download_batch_mint( &self, - batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint_to_verify: &mut batch_mint_to_verify::Model, batch_mint: &mut Option>, ) -> Result<(), ProgramTransformerError> { if batch_mint.is_some() { @@ -358,14 +367,14 @@ impl BatchMintPer .await { Ok(r) => { - let query = rollup::Entity::insert(rollup::ActiveModel { + let query = batch_mint::Entity::insert(batch_mint::ActiveModel { file_hash: Set(batch_mint_to_verify.file_hash.clone()), - rollup_binary_bincode: Set(bincode::serialize(batch_mint) + batch_mint_binary_bincode: Set(bincode::serialize(batch_mint) .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), }) .on_conflict( - OnConflict::columns([rollup::Column::FileHash]) - .update_columns([rollup::Column::RollupBinaryBincode]) + OnConflict::columns([batch_mint::Column::FileHash]) + .update_columns([batch_mint::Column::BatchMintBinaryBincode]) .to_owned(), ) .build(DbBackend::Postgres); @@ -373,17 +382,17 @@ impl BatchMintPer return Err(e.into()); } *batch_mint = Some(r); - batch_mint_to_verify.rollup_persisting_state = - RollupPersistingState::SuccessfullyDownload; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::SuccessfullyDownload; statsd_count!("batch_mint.successfully_download", 1); } Err(e) => { statsd_count!("batch_mint.download_fail", 1); if let BatchMintValidationError::InvalidDataHash(expected, actual) = e { - batch_mint_to_verify.rollup_persisting_state = - RollupPersistingState::FailedToPersist; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; self.save_batch_mint_as_failed( - RollupFailStatus::ChecksumVerifyFailed, + BatchMintFailStatus::ChecksumVerifyFailed, batch_mint_to_verify, ) .await?; @@ -394,10 +403,10 @@ impl BatchMintPer )); } if let BatchMintValidationError::Serialization(e) = e { - batch_mint_to_verify.rollup_persisting_state = - RollupPersistingState::FailedToPersist; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; self.save_batch_mint_as_failed( - RollupFailStatus::FileSerialization, + BatchMintFailStatus::FileSerialization, batch_mint_to_verify, ) .await?; @@ -408,27 +417,29 @@ impl BatchMintPer if batch_mint_to_verify.download_attempts + 1 > MAX_BATCH_MINT_DOWNLOAD_ATTEMPTS as i32 { - batch_mint_to_verify.rollup_persisting_state = - RollupPersistingState::FailedToPersist; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; self.save_batch_mint_as_failed( - RollupFailStatus::DownloadFailed, + BatchMintFailStatus::DownloadFailed, batch_mint_to_verify, ) .await?; } else { batch_mint_to_verify.download_attempts = batch_mint_to_verify.download_attempts + 1; - if let Err(e) = (rollup_to_verify::ActiveModel { + if let Err(e) = (batch_mint_to_verify::ActiveModel { file_hash: Set(batch_mint_to_verify.file_hash.clone()), url: Set(batch_mint_to_verify.url.clone()), created_at_slot: Set(batch_mint_to_verify.created_at_slot), signature: Set(batch_mint_to_verify.signature.clone()), staker: Set(batch_mint_to_verify.staker.clone()), download_attempts: Set(batch_mint_to_verify.download_attempts + 1), - rollup_persisting_state: Set(batch_mint_to_verify - .rollup_persisting_state + batch_mint_persisting_state: Set(batch_mint_to_verify + .batch_mint_persisting_state + .clone()), + batch_mint_fail_status: Set(batch_mint_to_verify + .batch_mint_fail_status .clone()), - rollup_fail_status: Set(batch_mint_to_verify.rollup_fail_status.clone()), } .insert(self.txn.as_ref())) .await @@ -444,17 +455,18 @@ impl BatchMintPer async fn validate_batch_mint( &self, - batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint_to_verify: &mut batch_mint_to_verify::Model, batch_mint: &BatchMint, ) { if let Err(e) = validate_batch_mint(batch_mint).await { error!("Error while validating batch mint: {}", e.to_string()); statsd_count!("batch_mint.validating_fail", 1); - batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; if let Err(err) = self .save_batch_mint_as_failed( - RollupFailStatus::RollupVerifyFailed, + BatchMintFailStatus::BatchMintVerifyFailed, batch_mint_to_verify, ) .await @@ -464,12 +476,13 @@ impl BatchMintPer return; } statsd_count!("batch_mint.validating_success", 1); - batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::SuccessfullyValidate; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::SuccessfullyValidate; } async fn store_batch_mint_update( &self, - batch_mint_to_verify: &mut rollup_to_verify::Model, + batch_mint_to_verify: &mut batch_mint_to_verify::Model, batch_mint: &BatchMint, ) -> Result<(), ProgramTransformerError> { if store_batch_mint_update( @@ -482,30 +495,31 @@ impl BatchMintPer .is_err() { statsd_count!("batch_mint.store_update_fail", 1); - batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::FailedToPersist; + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; return Ok(()); } statsd_count!("batch_mint.store_update_success", 1); - batch_mint_to_verify.rollup_persisting_state = RollupPersistingState::StoredUpdate; + batch_mint_to_verify.batch_mint_persisting_state = BatchMintPersistingState::StoredUpdate; Ok(()) } async fn save_batch_mint_as_failed( &self, - status: RollupFailStatus, - batch_mint: &rollup_to_verify::Model, + status: BatchMintFailStatus, + batch_mint: &batch_mint_to_verify::Model, ) -> Result<(), ProgramTransformerError> { - rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { + batch_mint_to_verify::Entity::update(batch_mint_to_verify::ActiveModel { file_hash: Set(batch_mint.file_hash.clone()), url: Set(batch_mint.url.clone()), created_at_slot: Set(batch_mint.created_at_slot), signature: Set(batch_mint.signature.clone()), staker: Set(batch_mint.staker.clone()), download_attempts: Set(batch_mint.download_attempts), - rollup_persisting_state: Set(batch_mint.rollup_persisting_state.clone()), - rollup_fail_status: Set(Some(status)), + batch_mint_persisting_state: Set(batch_mint.batch_mint_persisting_state.clone()), + batch_mint_fail_status: Set(Some(status)), }) - .filter(rollup_to_verify::Column::FileHash.eq(batch_mint.file_hash.clone())) + .filter(batch_mint_to_verify::Column::FileHash.eq(batch_mint.file_hash.clone())) .exec(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; @@ -514,13 +528,15 @@ impl BatchMintPer async fn drop_batch_mint_from_queue( &self, - batch_mint_to_verify: &rollup_to_verify::Model, + batch_mint_to_verify: &batch_mint_to_verify::Model, ) -> Result<(), ProgramTransformerError> { - rollup_to_verify::Entity::update(rollup_to_verify::ActiveModel { - rollup_persisting_state: Set(batch_mint_to_verify.rollup_persisting_state.clone()), + batch_mint_to_verify::Entity::update(batch_mint_to_verify::ActiveModel { + batch_mint_persisting_state: Set(batch_mint_to_verify + .batch_mint_persisting_state + .clone()), ..batch_mint_to_verify.clone().into_active_model() }) - .filter(rollup_to_verify::Column::FileHash.eq(batch_mint_to_verify.file_hash.clone())) + .filter(batch_mint_to_verify::Column::FileHash.eq(batch_mint_to_verify.file_hash.clone())) .exec(self.txn.as_ref()) .await .map_err(|e| ProgramTransformerError::DatabaseError(e.to_string()))?; diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 3c8d0be86..124dc59e6 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -1,5 +1,5 @@ use blockbuster::programs::bubblegum::Payload; -use digital_asset_types::dao::sea_orm_active_enums::RollupPersistingState; +use digital_asset_types::dao::sea_orm_active_enums::BatchMintPersistingState; use sea_orm::sea_query::OnConflict; use sea_orm::{DbBackend, EntityTrait, QueryTrait, Set}; use { @@ -17,31 +17,35 @@ where T: ConnectionTrait + TransactionTrait, { if let Some(Payload::CreateTreeWithRoot { args, .. }) = &parsing_result.payload { - let query = digital_asset_types::dao::rollup_to_verify::Entity::insert( - digital_asset_types::dao::rollup_to_verify::ActiveModel { + let query = digital_asset_types::dao::batch_mint_to_verify::Entity::insert( + digital_asset_types::dao::batch_mint_to_verify::ActiveModel { file_hash: Set(args.metadata_hash.clone()), url: Set(args.metadata_url.clone()), created_at_slot: Set(bundle.slot as i64), signature: Set(bundle.txn_id.to_string()), staker: Set(args.staker.to_bytes().to_vec()), download_attempts: Set(0), - rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), - rollup_fail_status: Set(None), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), }, ) .on_conflict( OnConflict::columns([ - digital_asset_types::dao::rollup_to_verify::Column::FileHash, - digital_asset_types::dao::rollup_to_verify::Column::Staker, + digital_asset_types::dao::batch_mint_to_verify::Column::FileHash, + digital_asset_types::dao::batch_mint_to_verify::Column::Staker, ]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Url]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::Signature]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::DownloadAttempts]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::RollupFailStatus]) + .update_columns([digital_asset_types::dao::batch_mint_to_verify::Column::Url]) + .update_columns([digital_asset_types::dao::batch_mint_to_verify::Column::Signature]) .update_columns([ - digital_asset_types::dao::rollup_to_verify::Column::RollupPersistingState, + digital_asset_types::dao::batch_mint_to_verify::Column::DownloadAttempts, ]) - .update_columns([digital_asset_types::dao::rollup_to_verify::Column::CreatedAtSlot]) + .update_columns([ + digital_asset_types::dao::batch_mint_to_verify::Column::BatchMintFailStatus, + ]) + .update_columns([ + digital_asset_types::dao::batch_mint_to_verify::Column::BatchMintPersistingState, + ]) + .update_columns([digital_asset_types::dao::batch_mint_to_verify::Column::CreatedAtSlot]) .to_owned(), ) .build(DbBackend::Postgres); From d37f4c9a63bbea35def414edfeeb2c1e79e6cee9 Mon Sep 17 00:00:00 2001 From: Vadim <31490938+n00m4d@users.noreply.github.com> Date: Wed, 14 Aug 2024 09:59:49 +0200 Subject: [PATCH 32/34] Creators and collection batch mint verifications (#204) * feat: add creators and collection bath mint verifications * style: fmt * Update blockbuster/blockbuster/src/programs/bubblegum/mod.rs Co-authored-by: Stanislav Cherviakov * chore: dependency change * chore: renaming --------- Co-authored-by: Stanislav Cherviakov --- .gitmodules | 4 - Cargo.toml | 11 +- blockbuster/blockbuster/Cargo.toml | 8 +- .../blockbuster/src/programs/bubblegum/mod.rs | 53 +- .../src/dao/generated/batch_mint_to_verify.rs | 3 + .../src/dao/generated/prelude.rs | 2 - .../src/dao/generated/sea_orm_active_enums.rs | 204 ++--- digital_asset_types/tests/json_parsing.rs | 2 +- integration_tests/Cargo.toml | 3 + .../integration_tests/batch_mint_tests.rs | 773 +++++++++++++++++- ...alize_tree_with_root_instruction_handle.rs | 6 + program_transformers/Cargo.toml | 2 + .../src/batch_minting/batch_mint_persister.rs | 74 +- .../src/batch_minting/tests.rs | 23 +- .../src/bubblegum/finalize_tree_with_root.rs | 3 +- program_transformers/src/bubblegum/mod.rs | 8 +- program_transformers/src/error.rs | 8 + 17 files changed, 1000 insertions(+), 187 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0df22b35f..000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "mpl-bubblegum"] - path = mpl-bubblegum - url = git@github.com:adm-metaex/mpl-bubblegum.git - branch = feat/staker-role-reference diff --git a/Cargo.toml b/Cargo.toml index e9de00676..01848e610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,7 @@ log = "0.4.17" metrics = "0.20.1" migration = {path = "migration"} mime_guess = "2.0.4" -mpl-bubblegum = { path = "blockbuster/mpl-bubblegum/clients/rust", features = ["serde"] } +mpl-bubblegum = { git = "https://github.com/adm-metaex/mpl-bubblegum.git", branch = "feature/cleanup", features = ["serde"] } mpl-core = { git = "https://github.com/RequescoS/mpl-core.git", features = ["serde"] } mpl-token-metadata = "4.1.1" nft_ingester = {path = "nft_ingester"} @@ -100,10 +100,10 @@ solana-program = "1.18.11" solana-sdk = "1.18.11" solana-transaction-status = "1.18.11" solana-zk-token-sdk = "1.17.16" -spl-account-compression = { path = "blockbuster/mpl-bubblegum/solana-program-library/account-compression/programs/account-compression", features = ["no-entrypoint"] } +spl-account-compression = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root", features = ["no-entrypoint"] } spl-associated-token-account = ">= 1.1.3, < 3.0" -spl-concurrent-merkle-tree = { path = "blockbuster/mpl-bubblegum/solana-program-library/libraries/concurrent-merkle-tree"} -spl-noop = { path = "blockbuster/mpl-bubblegum/solana-program-library/account-compression/programs/noop", features = ["no-entrypoint"] } +spl-concurrent-merkle-tree = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root" } +spl-noop = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root", features = ["no-entrypoint"] } spl-pod = {version = "0.1.0", features = ["serde-traits"]} spl-token = ">= 3.5.0, < 5.0" spl-token-2022 = {version = "1.0", features = ["no-entrypoint"]} @@ -111,7 +111,7 @@ spl-token-group-interface = "0.1.0" spl-token-metadata-interface = "0.2.0" sqlx = "0.6.2" stretto = "0.8.4" -thiserror = "1.0.31" +thiserror = "1.0.63" tokio = "1.30.0" tokio-stream = "0.1.14" tower = "0.4.13" @@ -131,6 +131,7 @@ serde_with = "3.8.1" bincode = "1.3.3" tempfile = "3.10.1" async-channel = "2.3.1" +bubblegum-batch-sdk = { git = "https://github.com/metaplex-foundation/bubblegum-batch-sdk.git", branch = "main" } [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/blockbuster/blockbuster/Cargo.toml b/blockbuster/blockbuster/Cargo.toml index c9c949611..9919a3e44 100644 --- a/blockbuster/blockbuster/Cargo.toml +++ b/blockbuster/blockbuster/Cargo.toml @@ -11,9 +11,9 @@ readme = "../README.md" [dependencies] bytemuck = { version = "1.14.0", features = ["derive"] } spl-token-2022 = { version = "1.0", features = ["no-entrypoint"] } -spl-account-compression = { path = "../mpl-bubblegum/solana-program-library/account-compression/programs/account-compression", features = ["no-entrypoint"] } -spl-noop = { path = "../mpl-bubblegum/solana-program-library/account-compression/programs/noop", features = ["no-entrypoint"] } -mpl-bubblegum = { path = "../mpl-bubblegum/clients/rust" } +spl-account-compression = { git = "https://github.com/StanChe/solana-program-library.git", branch = "feature/init_with_root", features = ["no-entrypoint"] } +spl-noop = { workspace = true } +mpl-bubblegum = { workspace = true } mpl-core = { git = "https://github.com/RequescoS/mpl-core.git", features = ["serde"] } mpl-token-metadata = { version = "4.1.1", features = ["serde"] } spl-token = { version = "4.0.0", features = ["no-entrypoint"] } @@ -21,7 +21,7 @@ async-trait = "0.1.57" bs58 = "0.4.0" lazy_static = "1.4.0" borsh = "~0.10.3" -thiserror = "1.0.32" +thiserror = "1.0.63" log = "0.4.17" solana-sdk = "~1.18.11" solana-transaction-status = "~1.18.11" diff --git a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs index e1f50a553..d074bc0ee 100644 --- a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs @@ -9,8 +9,9 @@ use log::warn; use mpl_bubblegum::{ get_instruction_type, instructions::{ - FinalizeTreeWithRootInstructionArgs, UnverifyCreatorInstructionArgs, - UpdateMetadataInstructionArgs, VerifyCreatorInstructionArgs, + FinalizeTreeWithRootAndCollectionInstructionArgs, FinalizeTreeWithRootInstructionArgs, + UnverifyCreatorInstructionArgs, UpdateMetadataInstructionArgs, + VerifyCreatorInstructionArgs, }, types::{BubblegumEventType, MetadataArgs, UpdateArgs}, }; @@ -29,25 +30,28 @@ use spl_noop; #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FinalizeTreeWithRootInstructionArgsWithStaker { - pub rightmost_root: [u8; 32], + pub root: [u8; 32], pub rightmost_leaf: [u8; 32], pub rightmost_index: u32, pub metadata_url: String, pub metadata_hash: String, pub staker: Pubkey, + pub collection_mint: Option, } impl FinalizeTreeWithRootInstructionArgsWithStaker { fn build_finalize_tree_with_root_instruction_args_with_staker( args: FinalizeTreeWithRootInstructionArgs, staker: Pubkey, + collection_mint: Option, ) -> Self { Self { - rightmost_root: args.rightmost_root, + root: args.root, rightmost_leaf: args.rightmost_leaf, rightmost_index: args.rightmost_index, metadata_url: args.metadata_url, metadata_hash: args.metadata_hash, staker, + collection_mint, } } } @@ -80,7 +84,7 @@ pub enum Payload { update_args: UpdateArgs, tree_id: Pubkey, }, - CreateTreeWithRoot { + FinalizeTreeWithRoot { args: FinalizeTreeWithRootInstructionArgsWithStaker, tree_id: Pubkey, }, @@ -237,9 +241,14 @@ impl ProgramParser for BubblegumParser { InstructionName::UpdateMetadata => { b_inst.payload = Some(build_update_metadata_payload(keys, ix_data)?); } - InstructionName::CreateTreeWithRoot => { + InstructionName::FinalizeTreeWithRoot => { b_inst.payload = Some(build_create_tree_with_root_payload(keys, ix_data)?); } + InstructionName::FinalizeTreeWithRootAndCollection => { + b_inst.payload = Some(build_create_tree_with_root_and_collection_payload( + keys, ix_data, + )?); + } _ => {} }; } @@ -348,7 +357,35 @@ fn build_create_tree_with_root_payload( let staker = *keys .get(4) .ok_or(BlockbusterError::InstructionParsingError)?; - let args = FinalizeTreeWithRootInstructionArgsWithStaker::build_finalize_tree_with_root_instruction_args_with_staker(args, staker); + let args = FinalizeTreeWithRootInstructionArgsWithStaker::build_finalize_tree_with_root_instruction_args_with_staker(args, staker, None); + + Ok(Payload::FinalizeTreeWithRoot { args, tree_id }) +} + +// See Bubblegum for offsets and positions: +// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md +fn build_create_tree_with_root_and_collection_payload( + keys: &[Pubkey], + ix_data: &[u8], +) -> Result { + let args = FinalizeTreeWithRootAndCollectionInstructionArgs::try_from_slice(ix_data)?; + + let tree_id = *keys + .get(1) + .ok_or(BlockbusterError::InstructionParsingError)?; + let staker = *keys + .get(4) + .ok_or(BlockbusterError::InstructionParsingError)?; + let collection_mint = *keys + .get(11) + .ok_or(BlockbusterError::InstructionParsingError)?; + let args = FinalizeTreeWithRootInstructionArgsWithStaker::build_finalize_tree_with_root_instruction_args_with_staker(FinalizeTreeWithRootInstructionArgs { + root: args.root, + rightmost_leaf: args.rightmost_leaf, + rightmost_index: args.rightmost_index, + metadata_url: args.metadata_url, + metadata_hash: args.metadata_hash, + }, staker, Some(collection_mint)); - Ok(Payload::CreateTreeWithRoot { args, tree_id }) + Ok(Payload::FinalizeTreeWithRoot { args, tree_id }) } diff --git a/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs index 5ace93414..5be802e9c 100644 --- a/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs +++ b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs @@ -21,6 +21,7 @@ pub struct Model { pub created_at_slot: i64, pub signature: String, pub staker: Vec, + pub collection: Option>, pub download_attempts: i32, pub batch_mint_persisting_state: BatchMintPersistingState, pub batch_mint_fail_status: Option, @@ -33,6 +34,7 @@ pub enum Column { CreatedAtSlot, Signature, Staker, + Collection, DownloadAttempts, BatchMintPersistingState, BatchMintFailStatus, @@ -62,6 +64,7 @@ impl ColumnTrait for Column { Self::CreatedAtSlot => ColumnType::BigInteger.def(), Self::Signature => ColumnType::String(None).def(), Self::Staker => ColumnType::Binary.def(), + Self::Collection => ColumnType::Binary.def().null(), Self::DownloadAttempts => ColumnType::Integer.def(), Self::BatchMintPersistingState => BatchMintPersistingState::db_type(), Self::BatchMintFailStatus => BatchMintFailStatus::db_type().null(), diff --git a/digital_asset_types/src/dao/generated/prelude.rs b/digital_asset_types/src/dao/generated/prelude.rs index e361cc145..37cc418af 100644 --- a/digital_asset_types/src/dao/generated/prelude.rs +++ b/digital_asset_types/src/dao/generated/prelude.rs @@ -1,7 +1,5 @@ //! SeaORM Entity. Generated by sea-orm-codegen 0.9.3 -#![allow(unused_imports)] - pub use super::asset::Entity as Asset; pub use super::asset_authority::Entity as AssetAuthority; pub use super::asset_creators::Entity as AssetCreators; diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index ce89fcd7a..737607aee 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -7,31 +7,53 @@ use serde::{Deserialize, Serialize}; #[sea_orm( rs_type = "String", db_type = "Enum", - enum_name = "v1_account_attachments" + enum_name = "specification_versions" )] -pub enum V1AccountAttachments { - #[sea_orm(string_value = "edition")] - Edition, - #[sea_orm(string_value = "edition_marker")] - EditionMarker, - #[sea_orm(string_value = "master_edition_v1")] - MasterEditionV1, - #[sea_orm(string_value = "master_edition_v2")] - MasterEditionV2, +pub enum SpecificationVersions { #[sea_orm(string_value = "unknown")] Unknown, + #[sea_orm(string_value = "v0")] + V0, + #[sea_orm(string_value = "v1")] + V1, + #[sea_orm(string_value = "v2")] + V2, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] -pub enum TaskStatus { - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "running")] - Running, - #[sea_orm(string_value = "success")] - Success, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] +pub enum Instruction { + #[sea_orm(string_value = "burn")] + Burn, + #[sea_orm(string_value = "cancel_redeem")] + CancelRedeem, + #[sea_orm(string_value = "compress")] + Compress, + #[sea_orm(string_value = "decompress_v1")] + DecompressV1, + #[sea_orm(string_value = "delegate")] + Delegate, + #[sea_orm(string_value = "mint_to_collection_v1")] + MintToCollectionV1, + #[sea_orm(string_value = "mint_v1")] + MintV1, + #[sea_orm(string_value = "redeem")] + Redeem, + #[sea_orm(string_value = "set_and_verify_collection")] + SetAndVerifyCollection, + #[sea_orm(string_value = "transfer")] + Transfer, + #[sea_orm(string_value = "unknown")] + Unknown, + #[sea_orm(string_value = "unverify_collection")] + UnverifyCollection, + #[sea_orm(string_value = "unverify_creator")] + UnverifyCreator, + #[sea_orm(string_value = "update_metadata")] + UpdateMetadata, + #[sea_orm(string_value = "verify_collection")] + VerifyCollection, + #[sea_orm(string_value = "verify_creator")] + VerifyCreator, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] @@ -44,6 +66,44 @@ pub enum OwnerType { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "batch_mint_persisting_state" +)] +pub enum BatchMintPersistingState { + #[sea_orm(string_value = "failed_to_persist")] + FailedToPersist, + #[sea_orm(string_value = "received_transaction")] + ReceivedTransaction, + #[sea_orm(string_value = "start_processing")] + StartProcessing, + #[sea_orm(string_value = "stored_update")] + StoredUpdate, + #[sea_orm(string_value = "successfully_download")] + SuccessfullyDownload, + #[sea_orm(string_value = "successfully_validate")] + SuccessfullyValidate, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "v1_account_attachments" +)] +pub enum V1AccountAttachments { + #[sea_orm(string_value = "edition")] + Edition, + #[sea_orm(string_value = "edition_marker")] + EditionMarker, + #[sea_orm(string_value = "master_edition_v1")] + MasterEditionV1, + #[sea_orm(string_value = "master_edition_v2")] + MasterEditionV2, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", @@ -76,24 +136,8 @@ pub enum SpecificationAssetClass { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "royalty_target_type" -)] -pub enum RoyaltyTargetType { - #[sea_orm(string_value = "creators")] - Creators, - #[sea_orm(string_value = "fanout")] - Fanout, - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] -pub enum Mutability { +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] +pub enum ChainMutability { #[sea_orm(string_value = "immutable")] Immutable, #[sea_orm(string_value = "mutable")] @@ -102,60 +146,36 @@ pub enum Mutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "instruction")] -pub enum Instruction { - #[sea_orm(string_value = "burn")] - Burn, - #[sea_orm(string_value = "cancel_redeem")] - CancelRedeem, - #[sea_orm(string_value = "compress")] - Compress, - #[sea_orm(string_value = "decompress_v1")] - DecompressV1, - #[sea_orm(string_value = "delegate")] - Delegate, - #[sea_orm(string_value = "mint_to_collection_v1")] - MintToCollectionV1, - #[sea_orm(string_value = "mint_v1")] - MintV1, - #[sea_orm(string_value = "redeem")] - Redeem, - #[sea_orm(string_value = "set_and_verify_collection")] - SetAndVerifyCollection, - #[sea_orm(string_value = "transfer")] - Transfer, - #[sea_orm(string_value = "unknown")] - Unknown, - #[sea_orm(string_value = "unverify_collection")] - UnverifyCollection, - #[sea_orm(string_value = "unverify_creator")] - UnverifyCreator, - #[sea_orm(string_value = "update_metadata")] - UpdateMetadata, - #[sea_orm(string_value = "verify_collection")] - VerifyCollection, - #[sea_orm(string_value = "verify_creator")] - VerifyCreator, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] +pub enum TaskStatus { + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "running")] + Running, + #[sea_orm(string_value = "success")] + Success, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", - enum_name = "specification_versions" + enum_name = "royalty_target_type" )] -pub enum SpecificationVersions { +pub enum RoyaltyTargetType { + #[sea_orm(string_value = "creators")] + Creators, + #[sea_orm(string_value = "fanout")] + Fanout, + #[sea_orm(string_value = "single")] + Single, #[sea_orm(string_value = "unknown")] Unknown, - #[sea_orm(string_value = "v0")] - V0, - #[sea_orm(string_value = "v1")] - V1, - #[sea_orm(string_value = "v2")] - V2, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] -pub enum ChainMutability { +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] +pub enum Mutability { #[sea_orm(string_value = "immutable")] Immutable, #[sea_orm(string_value = "mutable")] @@ -164,26 +184,6 @@ pub enum ChainMutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "batch_mint_persisting_state" -)] -pub enum BatchMintPersistingState { - #[sea_orm(string_value = "failed_to_persist")] - FailedToPersist, - #[sea_orm(string_value = "received_transaction")] - ReceivedTransaction, - #[sea_orm(string_value = "start_processing")] - StartProcessing, - #[sea_orm(string_value = "stored_update")] - StoredUpdate, - #[sea_orm(string_value = "successfully_download")] - SuccessfullyDownload, - #[sea_orm(string_value = "successfully_validate")] - SuccessfullyValidate, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", db_type = "Enum", diff --git a/digital_asset_types/tests/json_parsing.rs b/digital_asset_types/tests/json_parsing.rs index e630c91ff..ba0a3126a 100644 --- a/digital_asset_types/tests/json_parsing.rs +++ b/digital_asset_types/tests/json_parsing.rs @@ -10,7 +10,7 @@ use solana_sdk::signature::Keypair; use solana_sdk::signer::Signer; pub async fn load_test_json(file_name: &str) -> serde_json::Value { - let json = tokio::fs::read_to_string(format!("tools/data/{}", file_name)) + let json = tokio::fs::read_to_string(format!("tests/data/{}", file_name)) .await .unwrap(); serde_json::from_str(&json).unwrap() diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index a100b83c9..c389b61a6 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -37,3 +37,6 @@ mpl-bubblegum = { workspace = true } spl-concurrent-merkle-tree = { workspace = true } tempfile = { workspace = true } async-channel = { workspace = true } +cadence = { workspace = true } +cadence-macros = { workspace = true } +bubblegum-batch-sdk = { workspace = true } \ No newline at end of file diff --git a/integration_tests/tests/integration_tests/batch_mint_tests.rs b/integration_tests/tests/integration_tests/batch_mint_tests.rs index 1c57bf958..585949579 100644 --- a/integration_tests/tests/integration_tests/batch_mint_tests.rs +++ b/integration_tests/tests/integration_tests/batch_mint_tests.rs @@ -1,11 +1,19 @@ use crate::common::TestSetup; use borsh::BorshSerialize; +use bubblegum_batch_sdk::batch_mint_client::BatchMintClient; +use bubblegum_batch_sdk::model::CollectionConfig; +use cadence::{NopMetricSink, StatsdClient}; +use cadence_macros::set_global_default; use das_api::api::ApiContract; use das_api::api::GetAssetProof; -use digital_asset_types::dao::sea_orm_active_enums::{RollupFailStatus, RollupPersistingState}; -use digital_asset_types::dao::{rollup, rollup_to_verify}; +use digital_asset_types::dao::sea_orm_active_enums::{ + BatchMintFailStatus, BatchMintPersistingState, +}; +use digital_asset_types::dao::{batch_mint, batch_mint_to_verify}; use flatbuffers::FlatBufferBuilder; -use mpl_bubblegum::types::LeafSchema; +use mpl_bubblegum::types::Collection; +use mpl_bubblegum::types::Creator; +use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; use nft_ingester::batch_mint_updates::create_batch_mint_notification_channel; use nft_ingester::plerkle::PlerkleTransactionInfo; use plerkle_serialization::root_as_transaction_info; @@ -18,20 +26,32 @@ use program_transformers::error::BatchMintValidationError; use sea_orm::sea_query::OnConflict; use sea_orm::{ColumnTrait, ConnectionTrait, DbBackend, IntoActiveModel, QueryTrait, Set}; use sea_orm::{EntityTrait, QueryFilter}; +use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::instruction::CompiledInstruction; use solana_sdk::keccak; use solana_sdk::message::{Message, MessageHeader}; use solana_sdk::pubkey::Pubkey; +use solana_sdk::signature::Keypair; use solana_sdk::signature::Signature; +use solana_sdk::signer::Signer; use solana_sdk::transaction::{SanitizedTransaction, Transaction}; use solana_transaction_status::{InnerInstruction, InnerInstructions, TransactionStatusMeta}; use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; +use std::collections::HashMap; use std::fs::File; use std::str::FromStr; +use std::sync::Arc; +use std::time::Duration; use tokio::task::JoinSet; #[tokio::test] async fn save_batch_mint_to_queue_test() { + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + let setup = TestSetup::new("save_batch_mint_to_queue_test".to_string()).await; let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); @@ -39,7 +59,7 @@ async fn save_batch_mint_to_queue_test() { // arbitrary data let batch_mint_instruction_data = mpl_bubblegum::instructions::FinalizeTreeWithRootInstructionArgs { - rightmost_root: [1; 32], + root: [1; 32], rightmost_leaf: [1; 32], rightmost_index: 99, metadata_url: metadata_url.clone(), @@ -112,8 +132,8 @@ async fn save_batch_mint_to_queue_test() { .await .unwrap(); - let r = rollup_to_verify::Entity::find() - .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + let r = batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) .one(setup.db.as_ref()) .await .unwrap() @@ -166,8 +186,14 @@ fn generate_merkle_tree_from_batch_mint(batch_mint: &BatchMint) -> ConcurrentMer #[tokio::test] async fn batch_mint_persister_test() { + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + let setup = TestSetup::new("batch_mint_persister_test".to_string()).await; - let test_batch_mint = generate_batch_mint(10); + let test_batch_mint = generate_batch_mint(10, false); let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); @@ -175,27 +201,28 @@ async fn batch_mint_persister_test() { let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); - let batch_mint_to_verify = rollup_to_verify::ActiveModel { + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { file_hash: Set(metadata_hash.clone()), url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(0), - rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), - rollup_fail_status: Set(None), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(None), } .into_active_model(); - let query = rollup_to_verify::Entity::insert(batch_mint_to_verify) + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) .on_conflict( - OnConflict::columns([rollup_to_verify::Column::FileHash]) - .update_columns([rollup_to_verify::Column::Url]) - .update_columns([rollup_to_verify::Column::Signature]) - .update_columns([rollup_to_verify::Column::DownloadAttempts]) - .update_columns([rollup_to_verify::Column::RollupFailStatus]) - .update_columns([rollup_to_verify::Column::RollupPersistingState]) - .update_columns([rollup_to_verify::Column::CreatedAtSlot]) + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) .to_owned(), ) .build(DbBackend::Postgres); @@ -264,19 +291,19 @@ async fn batch_mint_persister_test() { ); assert_eq!( - rollup_to_verify::Entity::find() - .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) .one(setup.db.as_ref()) .await .unwrap() .unwrap() - .rollup_persisting_state, - RollupPersistingState::StoredUpdate + .batch_mint_persisting_state, + BatchMintPersistingState::StoredUpdate ); assert_eq!( - rollup::Entity::find() - .filter(rollup::Column::FileHash.eq(metadata_hash.clone())) + batch_mint::Entity::find() + .filter(batch_mint::Column::FileHash.eq(metadata_hash.clone())) .one(setup.db.as_ref()) .await .unwrap() @@ -287,8 +314,14 @@ async fn batch_mint_persister_test() { #[tokio::test] async fn batch_mint_persister_download_fail_test() { + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + let setup = TestSetup::new("batch_mint_persister_download_fail_test".to_string()).await; - let test_batch_mint = generate_batch_mint(10); + let test_batch_mint = generate_batch_mint(10, false); let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); serde_json::to_writer(tmp_file, &test_batch_mint).unwrap(); @@ -296,27 +329,28 @@ async fn batch_mint_persister_download_fail_test() { let download_attempts = 0; let metadata_url = "url".to_string(); let metadata_hash = "hash".to_string(); - let batch_mint_to_verify = rollup_to_verify::ActiveModel { + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { file_hash: Set(metadata_hash.clone()), url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), - rollup_persisting_state: Set(RollupPersistingState::ReceivedTransaction), - rollup_fail_status: Set(None), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(None), } .into_active_model(); - let query = rollup_to_verify::Entity::insert(batch_mint_to_verify) + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) .on_conflict( - OnConflict::columns([rollup_to_verify::Column::FileHash]) - .update_columns([rollup_to_verify::Column::Url]) - .update_columns([rollup_to_verify::Column::Signature]) - .update_columns([rollup_to_verify::Column::DownloadAttempts]) - .update_columns([rollup_to_verify::Column::RollupFailStatus]) - .update_columns([rollup_to_verify::Column::RollupPersistingState]) - .update_columns([rollup_to_verify::Column::CreatedAtSlot]) + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) .to_owned(), ) .build(DbBackend::Postgres); @@ -345,23 +379,674 @@ async fn batch_mint_persister_download_fail_test() { .await; assert_eq!( - rollup_to_verify::Entity::find() - .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .batch_mint_persisting_state, + BatchMintPersistingState::FailedToPersist + ); + assert_eq!( + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .batch_mint_fail_status, + Some(BatchMintFailStatus::DownloadFailed) + ); +} + +#[tokio::test] +async fn batch_mint_with_verified_creators_test() { + // For this test it's necessary to use Solana mainnet RPC + let url = "https://api.mainnet-beta.solana.com".to_string(); + let solana_client = Arc::new(RpcClient::new_with_timeout(url, Duration::from_secs(3))); + // Merkle tree created in mainnet for testing purposes + let tree_key = Pubkey::from_str("AGMiLKtXX7PiVneM8S1KkTmCnF7X5zh6bKq4t1Mhrwpb").unwrap(); + + // First we have to create offchain Merkle tree with SDK + + let batch_mint_client = BatchMintClient::new(solana_client); + let mut batch_mint_builder = batch_mint_client + .create_batch_mint_builder(&tree_key) + .await + .unwrap(); + + let asset_creator = Keypair::new(); + let owner = Keypair::new(); + let delegate = Keypair::new(); + + let asset = MetadataArgs { + name: "Name".to_string(), + symbol: "Symbol".to_string(), + uri: "https://immutable-storage/asset/".to_string(), + seller_fee_basis_points: 0, + primary_sale_happened: false, + is_mutable: false, + edition_nonce: None, + token_standard: Some(mpl_bubblegum::types::TokenStandard::NonFungible), + collection: None, + uses: None, + token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, + creators: vec![Creator { + address: asset_creator.pubkey(), + verified: true, + share: 100, + }], + }; + + let metadata_hash_arg = batch_mint_builder + .add_asset(&owner.pubkey(), &delegate.pubkey(), &asset) + .unwrap(); + + let signature = asset_creator.sign_message(&metadata_hash_arg.get_message()); + + let mut creators_signatures = HashMap::new(); + creators_signatures.insert(asset_creator.pubkey(), signature); + + let mut message_and_signatures = HashMap::new(); + message_and_signatures.insert(metadata_hash_arg.get_nonce(), creators_signatures); + + batch_mint_builder + .add_signatures_for_verified_creators(message_and_signatures) + .unwrap(); + + let finalized_batch_mint = batch_mint_builder.build_batch_mint().unwrap(); + + // Offchain Merkle tree creation is finished + // Start to process it + + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let setup = TestSetup::new("batch_mint_with_verified_creators_test".to_string()).await; + + let tmp_dir = tempfile::TempDir::new().unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint.json")).unwrap(); + serde_json::to_writer(tmp_file, &finalized_batch_mint).unwrap(); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), + download_attempts: Set(download_attempts), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(None), + } + .into_active_model(); + + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) + .on_conflict( + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockBatchMintDownloader::new(); + mocked_downloader + .expect_download_batch_mint_and_check_checksum() + .returning(move |_, _| { + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let mut tasks = JoinSet::new(); + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) + .await; + + assert_eq!( + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .batch_mint_persisting_state, + BatchMintPersistingState::StoredUpdate + ); + + assert_eq!( + batch_mint::Entity::find() + .filter(batch_mint::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .is_some(), + true + ); +} + +#[tokio::test] +async fn batch_mint_with_unverified_creators_test() { + let setup = TestSetup::new("batch_mint_with_unverified_creators_test".to_string()).await; + // generate batch mint with creators verified value set to true + // but signatures will not be attached + // batch should not be saved + let test_batch_mint = generate_batch_mint(10, true); + let tmp_dir = tempfile::TempDir::new().unwrap(); + + let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); + serde_json::to_writer(tmp_file, &test_batch_mint).unwrap(); + + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), + download_attempts: Set(download_attempts), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(None), + } + .into_active_model(); + + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) + .on_conflict( + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockBatchMintDownloader::new(); + mocked_downloader + .expect_download_batch_mint_and_check_checksum() + .returning(move |_, _| { + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint-10.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let mut tasks = JoinSet::new(); + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) + .await; + + assert_eq!( + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) .one(setup.db.as_ref()) .await .unwrap() .unwrap() - .rollup_persisting_state, - RollupPersistingState::FailedToPersist + .batch_mint_persisting_state, + BatchMintPersistingState::FailedToPersist ); +} + +#[tokio::test] +async fn batch_mint_with_verified_collection_test() { + // For this test it's necessary to use Solana mainnet RPC + let url = "https://api.mainnet-beta.solana.com".to_string(); + let solana_client = Arc::new(RpcClient::new_with_timeout(url, Duration::from_secs(3))); + // Merkle tree created in mainnet for testing purposes + let tree_key = Pubkey::from_str("AGMiLKtXX7PiVneM8S1KkTmCnF7X5zh6bKq4t1Mhrwpb").unwrap(); + + // First we have to create offchain Merkle tree with SDK + + let batch_mint_client = BatchMintClient::new(solana_client); + let mut batch_mint_builder = batch_mint_client + .create_batch_mint_builder(&tree_key) + .await + .unwrap(); + + let asset_creator = Keypair::new(); + let owner = Keypair::new(); + let delegate = Keypair::new(); + let collection_key = Pubkey::new_unique(); + + let collection_config = CollectionConfig { + collection_authority: Keypair::from_bytes(asset_creator.to_bytes().as_ref()).unwrap(), + collection_authority_record_pda: None, + collection_mint: collection_key, + collection_metadata: Pubkey::new_unique(), // doesn't matter in this case + edition_account: Pubkey::new_unique(), // doesn't matter in this case + }; + batch_mint_builder.setup_collection_config(collection_config); + + let asset = MetadataArgs { + name: "Name".to_string(), + symbol: "Symbol".to_string(), + uri: "https://immutable-storage/asset/".to_string(), + seller_fee_basis_points: 0, + primary_sale_happened: false, + is_mutable: false, + edition_nonce: None, + token_standard: Some(mpl_bubblegum::types::TokenStandard::NonFungible), + collection: Some(Collection { + verified: true, + key: collection_key, + }), + uses: None, + token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, + creators: vec![Creator { + address: asset_creator.pubkey(), + verified: false, + share: 100, + }], + }; + + let _ = batch_mint_builder + .add_asset(&owner.pubkey(), &delegate.pubkey(), &asset) + .unwrap(); + + let finalized_batch_mint = batch_mint_builder.build_batch_mint().unwrap(); + + // Offchain Merkle tree creation is finished + // Start to process it + + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let setup = TestSetup::new("batch_mint_with_verified_collection_test".to_string()).await; + + let tmp_dir = tempfile::TempDir::new().unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint.json")).unwrap(); + serde_json::to_writer(tmp_file, &finalized_batch_mint).unwrap(); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), + download_attempts: Set(download_attempts), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(Some(collection_key.to_bytes().to_vec())), + } + .into_active_model(); + + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) + .on_conflict( + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockBatchMintDownloader::new(); + mocked_downloader + .expect_download_batch_mint_and_check_checksum() + .returning(move |_, _| { + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let mut tasks = JoinSet::new(); + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) + .await; + + assert_eq!( + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .batch_mint_persisting_state, + BatchMintPersistingState::StoredUpdate + ); + + assert_eq!( + batch_mint::Entity::find() + .filter(batch_mint::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .is_some(), + true + ); +} + +#[tokio::test] +async fn batch_mint_with_wrong_collection_test() { + // For this test it's necessary to use Solana mainnet RPC + let url = "https://api.mainnet-beta.solana.com".to_string(); + let solana_client = Arc::new(RpcClient::new_with_timeout(url, Duration::from_secs(3))); + // Merkle tree created in mainnet for testing purposes + let tree_key = Pubkey::from_str("AGMiLKtXX7PiVneM8S1KkTmCnF7X5zh6bKq4t1Mhrwpb").unwrap(); + + // First we have to create offchain Merkle tree with SDK + + let batch_mint_client = BatchMintClient::new(solana_client); + let mut batch_mint_builder = batch_mint_client + .create_batch_mint_builder(&tree_key) + .await + .unwrap(); + + let asset_creator = Keypair::new(); + let owner = Keypair::new(); + let delegate = Keypair::new(); + let collection_key = Pubkey::new_unique(); + + let wrong_collection_key = Pubkey::new_unique(); + + let collection_config = CollectionConfig { + collection_authority: Keypair::from_bytes(asset_creator.to_bytes().as_ref()).unwrap(), + collection_authority_record_pda: None, + collection_mint: collection_key, + collection_metadata: Pubkey::new_unique(), // doesn't matter in this case + edition_account: Pubkey::new_unique(), // doesn't matter in this case + }; + batch_mint_builder.setup_collection_config(collection_config); + + let asset = MetadataArgs { + name: "Name".to_string(), + symbol: "Symbol".to_string(), + uri: "https://immutable-storage/asset/".to_string(), + seller_fee_basis_points: 0, + primary_sale_happened: false, + is_mutable: false, + edition_nonce: None, + token_standard: Some(mpl_bubblegum::types::TokenStandard::NonFungible), + collection: Some(Collection { + verified: true, + key: collection_key, + }), + uses: None, + token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, + creators: vec![Creator { + address: asset_creator.pubkey(), + verified: false, + share: 100, + }], + }; + + let _ = batch_mint_builder + .add_asset(&owner.pubkey(), &delegate.pubkey(), &asset) + .unwrap(); + + let finalized_batch_mint = batch_mint_builder.build_batch_mint().unwrap(); + + // Offchain Merkle tree creation is finished + // Start to process it + + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let setup = TestSetup::new("batch_mint_with_verified_collection_test".to_string()).await; + + let tmp_dir = tempfile::TempDir::new().unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint.json")).unwrap(); + serde_json::to_writer(tmp_file, &finalized_batch_mint).unwrap(); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), + download_attempts: Set(download_attempts), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(Some(wrong_collection_key.to_bytes().to_vec())), + } + .into_active_model(); + + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) + .on_conflict( + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockBatchMintDownloader::new(); + mocked_downloader + .expect_download_batch_mint_and_check_checksum() + .returning(move |_, _| { + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let mut tasks = JoinSet::new(); + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) + .await; + + assert_eq!( + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) + .one(setup.db.as_ref()) + .await + .unwrap() + .unwrap() + .batch_mint_persisting_state, + BatchMintPersistingState::FailedToPersist + ); +} + +#[tokio::test] +async fn batch_mint_with_unverified_collection_test() { + // For this test it's necessary to use Solana mainnet RPC + let url = "https://api.mainnet-beta.solana.com".to_string(); + let solana_client = Arc::new(RpcClient::new_with_timeout(url, Duration::from_secs(3))); + // Merkle tree created in mainnet for testing purposes + let tree_key = Pubkey::from_str("AGMiLKtXX7PiVneM8S1KkTmCnF7X5zh6bKq4t1Mhrwpb").unwrap(); + + // First we have to create offchain Merkle tree with SDK + + let batch_mint_client = BatchMintClient::new(solana_client); + let mut batch_mint_builder = batch_mint_client + .create_batch_mint_builder(&tree_key) + .await + .unwrap(); + + let asset_creator = Keypair::new(); + let owner = Keypair::new(); + let delegate = Keypair::new(); + let collection_key = Pubkey::new_unique(); + + let collection_config = CollectionConfig { + collection_authority: Keypair::from_bytes(asset_creator.to_bytes().as_ref()).unwrap(), + collection_authority_record_pda: None, + collection_mint: collection_key, + collection_metadata: Pubkey::new_unique(), // doesn't matter in this case + edition_account: Pubkey::new_unique(), // doesn't matter in this case + }; + batch_mint_builder.setup_collection_config(collection_config); + + let asset = MetadataArgs { + name: "Name".to_string(), + symbol: "Symbol".to_string(), + uri: "https://immutable-storage/asset/".to_string(), + seller_fee_basis_points: 0, + primary_sale_happened: false, + is_mutable: false, + edition_nonce: None, + token_standard: Some(mpl_bubblegum::types::TokenStandard::NonFungible), + collection: Some(Collection { + verified: true, + key: collection_key, + }), + uses: None, + token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, + creators: vec![Creator { + address: asset_creator.pubkey(), + verified: false, + share: 100, + }], + }; + + let _ = batch_mint_builder + .add_asset(&owner.pubkey(), &delegate.pubkey(), &asset) + .unwrap(); + + let finalized_batch_mint = batch_mint_builder.build_batch_mint().unwrap(); + + // Offchain Merkle tree creation is finished + // Start to process it + + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let setup = TestSetup::new("batch_mint_with_verified_collection_test".to_string()).await; + + let tmp_dir = tempfile::TempDir::new().unwrap(); + let tmp_file = File::create(tmp_dir.path().join("batch-mint.json")).unwrap(); + serde_json::to_writer(tmp_file, &finalized_batch_mint).unwrap(); + + let download_attempts = 0; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + let batch_mint_to_verify = batch_mint_to_verify::ActiveModel { + file_hash: Set(metadata_hash.clone()), + url: Set(metadata_url.clone()), + created_at_slot: Set(10), + signature: Set(Signature::new_unique().to_string()), + staker: Set(Pubkey::default().to_bytes().to_vec()), + download_attempts: Set(download_attempts), + batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), + batch_mint_fail_status: Set(None), + collection: Set(None), + } + .into_active_model(); + + let query = batch_mint_to_verify::Entity::insert(batch_mint_to_verify) + .on_conflict( + OnConflict::columns([batch_mint_to_verify::Column::FileHash]) + .update_columns([batch_mint_to_verify::Column::Url]) + .update_columns([batch_mint_to_verify::Column::Signature]) + .update_columns([batch_mint_to_verify::Column::DownloadAttempts]) + .update_columns([batch_mint_to_verify::Column::BatchMintFailStatus]) + .update_columns([batch_mint_to_verify::Column::BatchMintPersistingState]) + .update_columns([batch_mint_to_verify::Column::CreatedAtSlot]) + .to_owned(), + ) + .build(DbBackend::Postgres); + setup.db.execute(query).await.unwrap(); + + let mut mocked_downloader = MockBatchMintDownloader::new(); + mocked_downloader + .expect_download_batch_mint_and_check_checksum() + .returning(move |_, _| { + let json_file = + std::fs::read_to_string(tmp_dir.path().join("batch-mint.json")).unwrap(); + Ok(Box::new(serde_json::from_str(&json_file).unwrap())) + }); + + let mut tasks = JoinSet::new(); + let r = create_batch_mint_notification_channel(&setup.database_test_url, &mut tasks) + .await + .unwrap(); + let batch_mint_persister = BatchMintPersister::new(setup.db.clone(), r, mocked_downloader); + let (batch_mint_to_verify, _) = batch_mint_persister + .get_batch_mint_to_verify() + .await + .unwrap(); + batch_mint_persister + .persist_batch_mint(batch_mint_to_verify.unwrap(), None) + .await; + assert_eq!( - rollup_to_verify::Entity::find() - .filter(rollup_to_verify::Column::FileHash.eq(metadata_hash.clone())) + batch_mint_to_verify::Entity::find() + .filter(batch_mint_to_verify::Column::FileHash.eq(metadata_hash.clone())) .one(setup.db.as_ref()) .await .unwrap() .unwrap() - .rollup_fail_status, - Some(RollupFailStatus::DownloadFailed) + .batch_mint_persisting_state, + BatchMintPersistingState::FailedToPersist ); } diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 32c6b6cf5..8e491675b 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -68,6 +68,11 @@ impl MigrationTrait for Migration { .binary() .not_null(), ) + .col( + ColumnDef::new(BatchMintToVerify::Collection) + .binary() + .null(), + ) .col( ColumnDef::new(BatchMintToVerify::DownloadAttempts) .unsigned() @@ -174,6 +179,7 @@ enum BatchMintToVerify { BatchMintPersistingState, BatchMintFailStatus, Staker, + Collection, } #[derive(Iden, Debug, PartialEq, Sequence)] diff --git a/program_transformers/Cargo.toml b/program_transformers/Cargo.toml index 94929bbd3..86b25f22d 100644 --- a/program_transformers/Cargo.toml +++ b/program_transformers/Cargo.toml @@ -40,6 +40,8 @@ serde_with = { workspace = true } bincode = { workspace = true } rand = { workspace = true } async-channel = { workspace = true } +bubblegum-batch-sdk = { workspace = true } +solana-client = { workspace = true } [lints] workspace = true diff --git a/program_transformers/src/batch_minting/batch_mint_persister.rs b/program_transformers/src/batch_minting/batch_mint_persister.rs index 28f2d07e7..33b73810e 100644 --- a/program_transformers/src/batch_minting/batch_mint_persister.rs +++ b/program_transformers/src/batch_minting/batch_mint_persister.rs @@ -1,5 +1,7 @@ use anchor_lang::AnchorSerialize; use async_channel::Receiver; +use bubblegum_batch_sdk::batch_mint_builder::{verify_signature, MetadataArgsHash}; +use solana_sdk::signature::Signature; use std::collections::HashMap; use std::sync::Arc; @@ -26,6 +28,7 @@ use sea_orm::{ }; use serde::{Deserialize, Serialize}; use serde_json::value::RawValue; +use serde_with::DisplayFromStr; use solana_sdk::keccak; use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; @@ -55,6 +58,8 @@ pub struct BatchedMintInstruction { pub mint_args: MetadataArgs, #[serde(with = "serde_with::As::")] pub authority: Pubkey, + #[serde(with = "serde_with::As::>>")] + pub creator_signature: Option>, // signatures of the asset with the creator pubkey to ensure verified creator } #[derive(Default, Clone)] @@ -339,6 +344,7 @@ impl BatchMintPer download_attempts: Set(r.download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::StartProcessing), batch_mint_fail_status: Set(r.batch_mint_fail_status.clone()), + collection: Set(r.collection.clone()), }) .filter(batch_mint_to_verify::Column::FileHash.eq(r.file_hash.clone())) .exec(&multi_txn) @@ -440,6 +446,7 @@ impl BatchMintPer batch_mint_fail_status: Set(batch_mint_to_verify .batch_mint_fail_status .clone()), + collection: Set(batch_mint_to_verify.collection.clone()), } .insert(self.txn.as_ref())) .await @@ -458,7 +465,9 @@ impl BatchMintPer batch_mint_to_verify: &mut batch_mint_to_verify::Model, batch_mint: &BatchMint, ) { - if let Err(e) = validate_batch_mint(batch_mint).await { + if let Err(e) = + validate_batch_mint(batch_mint, batch_mint_to_verify.collection.clone()).await + { error!("Error while validating batch mint: {}", e.to_string()); statsd_count!("batch_mint.validating_fail", 1); @@ -518,6 +527,7 @@ impl BatchMintPer download_attempts: Set(batch_mint.download_attempts), batch_mint_persisting_state: Set(batch_mint.batch_mint_persisting_state.clone()), batch_mint_fail_status: Set(Some(status)), + collection: Set(batch_mint.collection.clone()), }) .filter(batch_mint_to_verify::Column::FileHash.eq(batch_mint.file_hash.clone())) .exec(self.txn.as_ref()) @@ -545,9 +555,39 @@ impl BatchMintPer } } -pub async fn validate_batch_mint(batch_mint: &BatchMint) -> Result<(), BatchMintValidationError> { +pub async fn validate_batch_mint( + batch_mint: &BatchMint, + collection_mint: Option>, +) -> Result<(), BatchMintValidationError> { let mut leaf_hashes = Vec::new(); for asset in batch_mint.batch_mints.iter() { + verify_creators_signatures( + &batch_mint.tree_id, + asset, + asset.creator_signature.clone().unwrap_or_default(), + )?; + + if let Some(ref collection) = asset.mint_args.collection { + match &collection_mint { + None => { + if collection.verified { + return Err(BatchMintValidationError::WrongCollectionVerified( + collection.key.to_string(), + )); + } + } + Some(collection_mint) => { + if collection.verified && collection_mint != collection.key.to_bytes().as_ref() + { + return Err(BatchMintValidationError::VerifiedCollectionMismatch( + bs58::encode(collection_mint.clone()).into_string(), + collection.key.to_string(), + )); + } + } + } + } + let leaf_hash = match get_leaf_hash(asset, &batch_mint.tree_id) { Ok(leaf_hash) => leaf_hash, Err(e) => { @@ -565,6 +605,34 @@ pub async fn validate_batch_mint(batch_mint: &BatchMint) -> Result<(), BatchMint ) } +// TODO: move this func to SDK once this crate will import data types from SDK +fn verify_creators_signatures( + tree_key: &Pubkey, + rolled_mint: &BatchedMintInstruction, + creator_signatures: HashMap, +) -> Result<(), BatchMintValidationError> { + let metadata_hash = + MetadataArgsHash::new(&rolled_mint.leaf_update, tree_key, &rolled_mint.mint_args); + + for creator in &rolled_mint.mint_args.creators { + if creator.verified { + if let Some(signature) = creator_signatures.get(&creator.address) { + if !verify_signature(&creator.address, &metadata_hash.get_message(), signature) { + return Err(BatchMintValidationError::FailedCreatorVerification( + creator.address.to_string(), + )); + } + } else { + return Err(BatchMintValidationError::MissingCreatorSignature( + creator.address.to_string(), + )); + } + } + } + + Ok(()) +} + fn get_leaf_hash( asset: &BatchedMintInstruction, tree_id: &Pubkey, @@ -639,7 +707,7 @@ where slot, }, txn, - "CreateTreeWithRoot", + "FinalizeTreeWithRoot", false, ) .await?; diff --git a/program_transformers/src/batch_minting/tests.rs b/program_transformers/src/batch_minting/tests.rs index 68e3b1d14..6fe0dcabf 100644 --- a/program_transformers/src/batch_minting/tests.rs +++ b/program_transformers/src/batch_minting/tests.rs @@ -11,7 +11,7 @@ use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; use std::collections::HashMap; use std::str::FromStr; -pub fn generate_batch_mint(size: usize) -> BatchMint { +pub fn generate_batch_mint(size: usize, creators_verified: bool) -> BatchMint { let authority = Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(); let tree = Pubkey::from_str("HxhCw9g3kZvrdg9zZvctmh6qpSDg1FfsBXfFvRkbCHB7").unwrap(); let mut mints = Vec::new(); @@ -66,7 +66,7 @@ pub fn generate_batch_mint(size: usize) -> BatchMint { creators: (0..thread_rng().sample(rand::distributions::Uniform::new(1, 5))) .map(|_| mpl_bubblegum::types::Creator { address: Pubkey::new_unique(), - verified: false, + verified: creators_verified, share: thread_rng().sample(rand::distributions::Uniform::new(0, 100)), }) .collect(), @@ -141,6 +141,7 @@ pub fn generate_batch_mint(size: usize) -> BatchMint { }, mint_args, authority, + creator_signature: None, }; mints.push(rolled_mint); } @@ -159,16 +160,16 @@ pub fn generate_batch_mint(size: usize) -> BatchMint { #[tokio::test] async fn batch_mint_validation_test() { - let mut batch_mint = generate_batch_mint(1000); + let mut batch_mint = generate_batch_mint(1000, false); - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!(validation_result, Ok(())); let old_root = batch_mint.merkle_root; let new_root = Pubkey::new_unique(); batch_mint.merkle_root = new_root.to_bytes(); - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, Err(BatchMintValidationError::InvalidRoot( @@ -189,7 +190,7 @@ async fn batch_mint_validation_test() { data_hash: new_leaf_data_hash.to_bytes(), creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, @@ -210,7 +211,7 @@ async fn batch_mint_validation_test() { let old_tree_depth = batch_mint.max_depth; let new_tree_depth = 100; batch_mint.max_depth = new_tree_depth; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, @@ -231,7 +232,7 @@ async fn batch_mint_validation_test() { data_hash: batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(), creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), }; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, @@ -260,7 +261,7 @@ async fn batch_mint_validation_test() { .collect::>(); let new_path = Vec::new(); batch_mint.batch_mints[leaf_idx].tree_update.path = new_path; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, @@ -276,7 +277,7 @@ async fn batch_mint_validation_test() { let old_tree_id = batch_mint.batch_mints[leaf_idx].tree_update.id; let new_tree_id = Pubkey::new_unique(); batch_mint.batch_mints[leaf_idx].tree_update.id = new_tree_id; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, @@ -294,7 +295,7 @@ async fn batch_mint_validation_test() { let old_index = batch_mint.batch_mints[leaf_idx].tree_update.index; let new_index = 1; batch_mint.batch_mints[leaf_idx].tree_update.index = new_index; - let validation_result = validate_batch_mint(&batch_mint).await; + let validation_result = validate_batch_mint(&batch_mint, None).await; assert_eq!( validation_result, diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 124dc59e6..5b2cbab48 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -16,7 +16,7 @@ pub async fn finalize_tree_with_root<'c, T>( where T: ConnectionTrait + TransactionTrait, { - if let Some(Payload::CreateTreeWithRoot { args, .. }) = &parsing_result.payload { + if let Some(Payload::FinalizeTreeWithRoot { args, .. }) = &parsing_result.payload { let query = digital_asset_types::dao::batch_mint_to_verify::Entity::insert( digital_asset_types::dao::batch_mint_to_verify::ActiveModel { file_hash: Set(args.metadata_hash.clone()), @@ -27,6 +27,7 @@ where download_attempts: Set(0), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), batch_mint_fail_status: Set(None), + collection: Set(args.collection_mint.map(|k| k.to_bytes().to_vec())), }, ) .on_conflict( diff --git a/program_transformers/src/bubblegum/mod.rs b/program_transformers/src/bubblegum/mod.rs index fd18a305f..aadf692a5 100644 --- a/program_transformers/src/bubblegum/mod.rs +++ b/program_transformers/src/bubblegum/mod.rs @@ -59,7 +59,10 @@ where InstructionName::SetAndVerifyCollection => "SetAndVerifyCollection", InstructionName::SetDecompressibleState => "SetDecompressibleState", InstructionName::UpdateMetadata => "UpdateMetadata", - InstructionName::CreateTreeWithRoot => "CreateTreeWithRoot", + InstructionName::PrepareTree => "PrepareTree", + InstructionName::AddCanopy => "AddCanopy", + InstructionName::FinalizeTreeWithRoot => "FinalizeTreeWithRoot", + InstructionName::FinalizeTreeWithRootAndCollection => "FinalizeTreeWithRootAndCollection", }; info!("BGUM instruction txn={:?}: {:?}", ix_str, bundle.txn_id); @@ -111,7 +114,8 @@ where .map_err(ProgramTransformerError::DownloadMetadataNotify)?; } } - InstructionName::CreateTreeWithRoot => { + InstructionName::FinalizeTreeWithRoot + | InstructionName::FinalizeTreeWithRootAndCollection => { finalize_tree_with_root::finalize_tree_with_root(parsing_result, bundle, txn).await? } _ => debug!("Bubblegum: Not Implemented Instruction"), diff --git a/program_transformers/src/error.rs b/program_transformers/src/error.rs index 3b804e286..5193b51f8 100644 --- a/program_transformers/src/error.rs +++ b/program_transformers/src/error.rs @@ -70,6 +70,14 @@ pub enum BatchMintValidationError { Serialization(String), #[error("Reqwest: {0}")] Reqwest(String), + #[error("WrongCollectionVerified: {0}")] + WrongCollectionVerified(String), + #[error("VerifiedCollectionMismatch: expected :{0}, got :{1}")] + VerifiedCollectionMismatch(String, String), + #[error("Failed creator's signature verification: {0}")] + FailedCreatorVerification(String), + #[error("Missing creator's signature in batch mint: {0}")] + MissingCreatorSignature(String), } impl From for BatchMintValidationError { From dc14c21857be9e60105b3370edf53395c170652c Mon Sep 17 00:00:00 2001 From: Vadim <31490938+n00m4d@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:28:05 +0200 Subject: [PATCH 33/34] feat: use bubblegum batch mint sdk for batch mint verification (#205) --- blockbuster/blockbuster/Cargo.toml | 1 + .../blockbuster/src/programs/bubblegum/mod.rs | 23 +- .../integration_tests/batch_mint_tests.rs | 19 +- .../src/batch_minting/batch_mint_persister.rs | 308 +++-------------- .../src/batch_minting/merkle_tree_wrapper.rs | 299 ----------------- program_transformers/src/batch_minting/mod.rs | 2 - .../src/batch_minting/tests.rs | 311 ------------------ 7 files changed, 76 insertions(+), 887 deletions(-) delete mode 100644 program_transformers/src/batch_minting/merkle_tree_wrapper.rs delete mode 100644 program_transformers/src/batch_minting/tests.rs diff --git a/blockbuster/blockbuster/Cargo.toml b/blockbuster/blockbuster/Cargo.toml index 9919a3e44..c385ed6a9 100644 --- a/blockbuster/blockbuster/Cargo.toml +++ b/blockbuster/blockbuster/Cargo.toml @@ -31,6 +31,7 @@ spl-pod = { version = "0.1.0", features = ["serde-traits"] } serde = "1.0.140" solana-zk-token-sdk = "~1.18.11" anchor-lang = { version = "0.29.0" } +bubblegum-batch-sdk = { workspace = true } [dev-dependencies] flatbuffers = "23.1.21" diff --git a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs index d074bc0ee..582becdbf 100644 --- a/blockbuster/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/blockbuster/src/programs/bubblegum/mod.rs @@ -5,6 +5,7 @@ use crate::{ programs::ProgramParseResult, }; use borsh::{BorshDeserialize, BorshSerialize}; +use bubblegum_batch_sdk::model::BatchMintInstruction; use log::warn; use mpl_bubblegum::{ get_instruction_type, @@ -13,7 +14,7 @@ use mpl_bubblegum::{ UnverifyCreatorInstructionArgs, UpdateMetadataInstructionArgs, VerifyCreatorInstructionArgs, }, - types::{BubblegumEventType, MetadataArgs, UpdateArgs}, + types::{BubblegumEventType, MetadataArgs, UpdateArgs, Version}, }; pub use mpl_bubblegum::{ types::{LeafSchema, UseMethod}, @@ -97,6 +98,26 @@ pub struct BubblegumInstruction { pub payload: Option, } +impl From<&BatchMintInstruction> for BubblegumInstruction { + fn from(value: &BatchMintInstruction) -> Self { + let hash = value.leaf_update.hash(); + Self { + instruction: InstructionName::MintV1, + tree_update: Some((&value.tree_update).into()), + leaf_update: Some(LeafSchemaEvent::new( + Version::V1, + value.leaf_update.clone(), + hash, + )), + payload: Some(Payload::MintV1 { + args: value.mint_args.clone(), + authority: value.authority, + tree_id: value.tree_update.id, + }), + } + } +} + impl BubblegumInstruction { pub fn new(ix: InstructionName) -> Self { BubblegumInstruction { diff --git a/integration_tests/tests/integration_tests/batch_mint_tests.rs b/integration_tests/tests/integration_tests/batch_mint_tests.rs index 585949579..2a4853b22 100644 --- a/integration_tests/tests/integration_tests/batch_mint_tests.rs +++ b/integration_tests/tests/integration_tests/batch_mint_tests.rs @@ -1,6 +1,8 @@ use crate::common::TestSetup; use borsh::BorshSerialize; use bubblegum_batch_sdk::batch_mint_client::BatchMintClient; +use bubblegum_batch_sdk::batch_mint_validations::generate_batch_mint; +use bubblegum_batch_sdk::model::BatchMint; use bubblegum_batch_sdk::model::CollectionConfig; use cadence::{NopMetricSink, StatsdClient}; use cadence_macros::set_global_default; @@ -19,9 +21,8 @@ use nft_ingester::plerkle::PlerkleTransactionInfo; use plerkle_serialization::root_as_transaction_info; use plerkle_serialization::serializer::serialize_transaction; use program_transformers::batch_minting::batch_mint_persister::{ - BatchMint, BatchMintPersister, MockBatchMintDownloader, + BatchMintPersister, MockBatchMintDownloader, }; -use program_transformers::batch_minting::tests::generate_batch_mint; use program_transformers::error::BatchMintValidationError; use sea_orm::sea_query::OnConflict; use sea_orm::{ColumnTrait, ConnectionTrait, DbBackend, IntoActiveModel, QueryTrait, Set}; @@ -193,7 +194,7 @@ async fn batch_mint_persister_test() { set_global_default(client); let setup = TestSetup::new("batch_mint_persister_test".to_string()).await; - let test_batch_mint = generate_batch_mint(10, false); + let test_batch_mint = generate_batch_mint(10); let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); @@ -321,7 +322,7 @@ async fn batch_mint_persister_download_fail_test() { set_global_default(client); let setup = TestSetup::new("batch_mint_persister_download_fail_test".to_string()).await; - let test_batch_mint = generate_batch_mint(10, false); + let test_batch_mint = generate_batch_mint(10); let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); serde_json::to_writer(tmp_file, &test_batch_mint).unwrap(); @@ -552,7 +553,15 @@ async fn batch_mint_with_unverified_creators_test() { // generate batch mint with creators verified value set to true // but signatures will not be attached // batch should not be saved - let test_batch_mint = generate_batch_mint(10, true); + let mut test_batch_mint = generate_batch_mint(10); + + // set creators verified to true for this test case + for b_mint in test_batch_mint.batch_mints.iter_mut() { + for creator in b_mint.mint_args.creators.iter_mut() { + creator.verified = true; + } + } + let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_file = File::create(tmp_dir.path().join("batch-mint-10.json")).unwrap(); diff --git a/program_transformers/src/batch_minting/batch_mint_persister.rs b/program_transformers/src/batch_minting/batch_mint_persister.rs index 33b73810e..4668f8d6e 100644 --- a/program_transformers/src/batch_minting/batch_mint_persister.rs +++ b/program_transformers/src/batch_minting/batch_mint_persister.rs @@ -1,151 +1,29 @@ -use anchor_lang::AnchorSerialize; use async_channel::Receiver; -use bubblegum_batch_sdk::batch_mint_builder::{verify_signature, MetadataArgsHash}; -use solana_sdk::signature::Signature; -use std::collections::HashMap; use std::sync::Arc; -use crate::batch_minting::merkle_tree_wrapper; use crate::bubblegum; use crate::error::{BatchMintValidationError, ProgramTransformerError, ProgramTransformerResult}; use async_trait::async_trait; use blockbuster::instruction::InstructionBundle; -use blockbuster::programs::bubblegum::{BubblegumInstruction, Payload}; +use bubblegum_batch_sdk::{batch_mint_validations::validate_batch_mint, model::BatchMint}; use cadence_macros::{statsd_count, statsd_histogram}; use digital_asset_types::dao::sea_orm_active_enums::{ BatchMintFailStatus, BatchMintPersistingState, }; use digital_asset_types::dao::{batch_mint, batch_mint_to_verify}; use mockall::automock; -use mpl_bubblegum::types::{LeafSchema, MetadataArgs, Version}; -use mpl_bubblegum::utils::get_asset_id; -use mpl_bubblegum::{InstructionName, LeafSchemaEvent}; use sea_orm::sea_query::{LockType, OnConflict}; use sea_orm::ActiveValue::Set; use sea_orm::{ ActiveModelTrait, ColumnTrait, Condition, ConnectionTrait, DbBackend, EntityTrait, IntoActiveModel, QueryFilter, QueryOrder, QuerySelect, QueryTrait, TransactionTrait, }; -use serde::{Deserialize, Serialize}; -use serde_json::value::RawValue; -use serde_with::DisplayFromStr; -use solana_sdk::keccak; -use solana_sdk::keccak::Hash; use solana_sdk::pubkey::Pubkey; use tokio::time::Instant; use tracing::{error, info}; pub const MAX_BATCH_MINT_DOWNLOAD_ATTEMPTS: u8 = 5; -#[derive(Serialize, Deserialize, Clone)] -pub struct BatchMint { - #[serde(with = "serde_with::As::")] - pub tree_id: Pubkey, - pub batch_mints: Vec, - pub raw_metadata_map: HashMap>, // map by uri - pub max_depth: u32, - pub max_buffer_size: u32, - - // derived data - pub merkle_root: [u8; 32], - pub last_leaf_hash: [u8; 32], -} - -#[derive(Serialize, Deserialize, Clone)] -pub struct BatchedMintInstruction { - pub tree_update: ChangeLogEventV1, - pub leaf_update: LeafSchema, - pub mint_args: MetadataArgs, - #[serde(with = "serde_with::As::")] - pub authority: Pubkey, - #[serde(with = "serde_with::As::>>")] - pub creator_signature: Option>, // signatures of the asset with the creator pubkey to ensure verified creator -} - -#[derive(Default, Clone)] -pub struct BatchMintInstruction { - pub max_depth: u32, - pub max_buffer_size: u32, - pub num_minted: u64, - pub root: [u8; 32], - pub leaf: [u8; 32], - pub index: u32, - pub metadata_url: String, - pub file_checksum: String, -} - -#[derive(Serialize, Deserialize, Clone)] -pub struct ChangeLogEventV1 { - #[serde(with = "serde_with::As::")] - pub id: Pubkey, - pub path: Vec, - pub seq: u64, - pub index: u32, -} - -#[derive(Serialize, Deserialize, PartialEq, Copy, Clone)] -pub struct PathNode { - pub node: [u8; 32], - pub index: u32, -} - -impl From<&PathNode> for spl_account_compression::state::PathNode { - fn from(value: &PathNode) -> Self { - Self { - node: value.node, - index: value.index, - } - } -} -impl From for PathNode { - fn from(value: spl_account_compression::state::PathNode) -> Self { - Self { - node: value.node, - index: value.index, - } - } -} -impl From<&ChangeLogEventV1> for blockbuster::programs::bubblegum::ChangeLogEventV1 { - fn from(value: &ChangeLogEventV1) -> Self { - Self { - id: value.id, - path: value.path.iter().map(Into::into).collect::>(), - seq: value.seq, - index: value.index, - } - } -} -impl From for ChangeLogEventV1 { - fn from(value: blockbuster::programs::bubblegum::ChangeLogEventV1) -> Self { - Self { - id: value.id, - path: value.path.into_iter().map(Into::into).collect::>(), - seq: value.seq, - index: value.index, - } - } -} - -impl From<&BatchedMintInstruction> for BubblegumInstruction { - fn from(value: &BatchedMintInstruction) -> Self { - let hash = value.leaf_update.hash(); - Self { - instruction: InstructionName::MintV1, - tree_update: Some((&value.tree_update).into()), - leaf_update: Some(LeafSchemaEvent::new( - Version::V1, - value.leaf_update.clone(), - hash, - )), - payload: Some(Payload::MintV1 { - args: value.mint_args.clone(), - authority: value.authority, - tree_id: value.tree_update.id, - }), - } - } -} - #[automock] #[async_trait] pub trait BatchMintDownloader { @@ -375,8 +253,12 @@ impl BatchMintPer Ok(r) => { let query = batch_mint::Entity::insert(batch_mint::ActiveModel { file_hash: Set(batch_mint_to_verify.file_hash.clone()), - batch_mint_binary_bincode: Set(bincode::serialize(batch_mint) - .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), + batch_mint_binary_bincode: Set( + bincode::serialize(&r) + .map_err(|e| { + ProgramTransformerError::SerializatonError(e.to_string()) + })?, + ), }) .on_conflict( OnConflict::columns([batch_mint::Column::FileHash]) @@ -465,23 +347,27 @@ impl BatchMintPer batch_mint_to_verify: &mut batch_mint_to_verify::Model, batch_mint: &BatchMint, ) { + let collection_raw_key: Option<[u8; 32]> = + if let Some(key) = batch_mint_to_verify.collection.clone() { + match key.try_into() { + Ok(key_as_array) => Some(key_as_array), + Err(e) => { + error!("Could not convert collection key received from DB: {:?}", e); + + self.mark_persisting_failed(batch_mint_to_verify).await; + return; + } + } + } else { + None + }; + if let Err(e) = - validate_batch_mint(batch_mint, batch_mint_to_verify.collection.clone()).await + validate_batch_mint(batch_mint, collection_raw_key.map(|key| Pubkey::from(key))).await { error!("Error while validating batch mint: {}", e.to_string()); - statsd_count!("batch_mint.validating_fail", 1); - batch_mint_to_verify.batch_mint_persisting_state = - BatchMintPersistingState::FailedToPersist; - if let Err(err) = self - .save_batch_mint_as_failed( - BatchMintFailStatus::BatchMintVerifyFailed, - batch_mint_to_verify, - ) - .await - { - error!("Save batch mint as failed: {}", err); - }; + self.mark_persisting_failed(batch_mint_to_verify).await; return; } statsd_count!("batch_mint.validating_success", 1); @@ -489,6 +375,21 @@ impl BatchMintPer BatchMintPersistingState::SuccessfullyValidate; } + async fn mark_persisting_failed(&self, batch_mint_to_verify: &mut batch_mint_to_verify::Model) { + statsd_count!("batch_mint.validating_fail", 1); + batch_mint_to_verify.batch_mint_persisting_state = + BatchMintPersistingState::FailedToPersist; + if let Err(err) = self + .save_batch_mint_as_failed( + BatchMintFailStatus::BatchMintVerifyFailed, + batch_mint_to_verify, + ) + .await + { + error!("Save batch mint as failed: {}", err); + } + } + async fn store_batch_mint_update( &self, batch_mint_to_verify: &mut batch_mint_to_verify::Model, @@ -555,137 +456,6 @@ impl BatchMintPer } } -pub async fn validate_batch_mint( - batch_mint: &BatchMint, - collection_mint: Option>, -) -> Result<(), BatchMintValidationError> { - let mut leaf_hashes = Vec::new(); - for asset in batch_mint.batch_mints.iter() { - verify_creators_signatures( - &batch_mint.tree_id, - asset, - asset.creator_signature.clone().unwrap_or_default(), - )?; - - if let Some(ref collection) = asset.mint_args.collection { - match &collection_mint { - None => { - if collection.verified { - return Err(BatchMintValidationError::WrongCollectionVerified( - collection.key.to_string(), - )); - } - } - Some(collection_mint) => { - if collection.verified && collection_mint != collection.key.to_bytes().as_ref() - { - return Err(BatchMintValidationError::VerifiedCollectionMismatch( - bs58::encode(collection_mint.clone()).into_string(), - collection.key.to_string(), - )); - } - } - } - } - - let leaf_hash = match get_leaf_hash(asset, &batch_mint.tree_id) { - Ok(leaf_hash) => leaf_hash, - Err(e) => { - return Err(e); - } - }; - leaf_hashes.push(leaf_hash); - } - - merkle_tree_wrapper::validate_change_logs( - batch_mint.max_depth, - batch_mint.max_buffer_size, - &leaf_hashes, - batch_mint, - ) -} - -// TODO: move this func to SDK once this crate will import data types from SDK -fn verify_creators_signatures( - tree_key: &Pubkey, - rolled_mint: &BatchedMintInstruction, - creator_signatures: HashMap, -) -> Result<(), BatchMintValidationError> { - let metadata_hash = - MetadataArgsHash::new(&rolled_mint.leaf_update, tree_key, &rolled_mint.mint_args); - - for creator in &rolled_mint.mint_args.creators { - if creator.verified { - if let Some(signature) = creator_signatures.get(&creator.address) { - if !verify_signature(&creator.address, &metadata_hash.get_message(), signature) { - return Err(BatchMintValidationError::FailedCreatorVerification( - creator.address.to_string(), - )); - } - } else { - return Err(BatchMintValidationError::MissingCreatorSignature( - creator.address.to_string(), - )); - } - } - } - - Ok(()) -} - -fn get_leaf_hash( - asset: &BatchedMintInstruction, - tree_id: &Pubkey, -) -> Result<[u8; 32], BatchMintValidationError> { - let asset_id = get_asset_id(tree_id, asset.leaf_update.nonce()); - if asset_id != asset.leaf_update.id() { - return Err(BatchMintValidationError::PDACheckFail( - asset_id.to_string(), - asset.leaf_update.id().to_string(), - )); - } - - // @dev: seller_fee_basis points is encoded twice so that it can be passed to marketplace - // instructions, without passing the entire, un-hashed MetadataArgs struct - let metadata_args_hash = keccak::hashv(&[asset.mint_args.try_to_vec()?.as_slice()]); - let data_hash = keccak::hashv(&[ - &metadata_args_hash.to_bytes(), - &asset.mint_args.seller_fee_basis_points.to_le_bytes(), - ]); - if asset.leaf_update.data_hash() != data_hash.to_bytes() { - return Err(BatchMintValidationError::InvalidDataHash( - data_hash.to_string(), - Hash::new(asset.leaf_update.data_hash().as_slice()).to_string(), - )); - } - - // Use the metadata auth to check whether we can allow `verified` to be set to true in the - // creator Vec. - let creator_data = asset - .mint_args - .creators - .iter() - .map(|c| [c.address.as_ref(), &[c.verified as u8], &[c.share]].concat()) - .collect::>(); - - // Calculate creator hash. - let creator_hash = keccak::hashv( - creator_data - .iter() - .map(|c| c.as_slice()) - .collect::>() - .as_ref(), - ); - if asset.leaf_update.creator_hash() != creator_hash.to_bytes() { - return Err(BatchMintValidationError::InvalidCreatorsHash( - creator_hash.to_string(), - Hash::new(asset.leaf_update.creator_hash().as_slice()).to_string(), - )); - } - - Ok(asset.leaf_update.hash()) -} - pub async fn store_batch_mint_update( slot: u64, signature: String, diff --git a/program_transformers/src/batch_minting/merkle_tree_wrapper.rs b/program_transformers/src/batch_minting/merkle_tree_wrapper.rs deleted file mode 100644 index 5fc903b47..000000000 --- a/program_transformers/src/batch_minting/merkle_tree_wrapper.rs +++ /dev/null @@ -1,299 +0,0 @@ -use crate::batch_minting::batch_mint_persister; -use crate::batch_minting::batch_mint_persister::BatchMint; -use crate::error::BatchMintValidationError; -use anchor_lang::solana_program::keccak::Hash; -use spl_account_compression::{ConcurrentMerkleTree, ConcurrentMerkleTreeError, Node}; -use spl_concurrent_merkle_tree::changelog::ChangeLog; -use std::slice::Iter; - -/// Interface that abstract [ConcurrentMerkleTree] -/// regardless const generic parameters. -pub trait ITree { - fn initialize(&mut self) -> Result; - fn append(&mut self, node: Node) -> Result; - fn active_index(&self) -> u64; - fn change_logs(&self, ind: usize) -> Box; - fn sequence_number(&self) -> u64; - fn get_root(&self) -> [u8; 32]; -} - -#[macro_export] -macro_rules! make_tree_impls { - ( $( ($x:literal, $y:literal) ),* ) => { - $( - impl ITree for ConcurrentMerkleTree<$x,$y> { - fn initialize(&mut self) -> Result { - self.initialize() - } - fn append(&mut self, node: Node) -> Result { - self.append(node) - } - fn active_index(&self) -> u64 { - self.active_index - } - fn change_logs(&self, ind: usize) -> Box { - Box::new(self.change_logs[ind]) - } - fn sequence_number(&self) -> u64 { - self.sequence_number - } - fn get_root(&self) -> [u8; 32] { - self.get_root() - } - } - )* - } -} - -// Building implementations of ITree -// for all possible instances of ConcurrentMerkleTreeError. -make_tree_impls!( - (3, 8), - (5, 8), - (6, 16), - (7, 16), - (8, 16), - (9, 16), - (10, 32), - (11, 32), - (12, 32), - (13, 32), - (14, 64), - (14, 256), - (14, 1024), - (14, 2048), - (15, 64), - (16, 64), - (17, 64), - (18, 64), - (19, 64), - (20, 64), - (20, 256), - (20, 1024), - (20, 2048), - (24, 64), - (24, 256), - (24, 512), - (24, 1024), - (24, 2048), - (26, 512), - (26, 1024), - (26, 2048), - (30, 512), - (30, 1024), - (30, 2048) -); - -/// An abstraction for [ChangeLog] -/// that abstracts over const generic parameter. -/// Similar to [ITree]. -pub trait IChangeLog { - fn index(&self) -> u32; - fn root(&self) -> [u8; 32]; - fn path_iter(&self) -> Iter; - fn path_slice(&self) -> &[Node]; - fn path_len(&self) -> u32; -} - -#[macro_export] -macro_rules! make_changelog_impls { - ( $( $x:literal ),* ) => { - $( - impl IChangeLog for ChangeLog<$x> { - fn index(&self) -> u32 { - self.index - } - - fn root(&self) -> [u8; 32] { - self.root - } - - fn path_iter(&self) -> Iter { - self.path.iter() - } - - fn path_slice(&self) -> &[Node] { - &self.path - } - - fn path_len(&self) -> u32 { - self.path.len() as u32 - } - } - )* - } -} - -#[macro_export] -macro_rules! make_tree_creator_funcs { - ( $( ($x:literal, $y:literal) ),* ) => { - $( - paste::item! { - #[inline(never)] - fn [< make_concurrent_merkle_tree_ $x _ $y >]() -> Box { - Box::new(ConcurrentMerkleTree::<$x,$y>::new()) - } - } - )* - } -} - -make_tree_creator_funcs!( - (3, 8), - (5, 8), - (6, 16), - (7, 16), - (8, 16), - (9, 16), - (10, 32), - (11, 32), - (12, 32), - (13, 32), - (14, 64), - (14, 256), - (14, 1024), - (14, 2048), - (15, 64), - (16, 64), - (17, 64), - (18, 64), - (19, 64), - (20, 64), - (20, 256), - (20, 1024), - (20, 2048), - (24, 64), - (24, 256), - (24, 512), - (24, 1024), - (24, 2048), - (26, 512), - (26, 1024), - (26, 2048), - (30, 512), - (30, 1024), - (30, 2048) -); - -pub fn make_concurrent_merkle_tree( - max_depth: u32, - max_buf_size: u32, -) -> Result, BatchMintValidationError> { - // Note: We do not create ConcurrentMerkleTree object right inside of match statement - // because of how Rust compiler reserves space for functions: - // the total size of function in memory (i.e. frame size) is as big as total size of - // all possible ConcurrentMerkleTree objects created in all branches. - // Because they are allocated on stack. - // And since these objects are quite big (up to 2MB), - // the total size of function becomes so big, it cannot fit in the thread stack. - // This all applies only for debug build, for release the compiler is smart enough - // to optimize this. - // Though, we need the debug to not fail with the stack overflow, - // that's why we had to move creation of an exact ConcurrentMerkleTree objects - // into separate function that return trait objects. - match (max_depth, max_buf_size) { - (3, 8) => Ok(make_concurrent_merkle_tree_3_8()), - (5, 8) => Ok(make_concurrent_merkle_tree_5_8()), - (6, 16) => Ok(make_concurrent_merkle_tree_6_16()), - (7, 16) => Ok(make_concurrent_merkle_tree_7_16()), - (8, 16) => Ok(make_concurrent_merkle_tree_8_16()), - (9, 16) => Ok(make_concurrent_merkle_tree_9_16()), - (10, 32) => Ok(make_concurrent_merkle_tree_10_32()), - (11, 32) => Ok(make_concurrent_merkle_tree_11_32()), - (12, 32) => Ok(make_concurrent_merkle_tree_12_32()), - (13, 32) => Ok(make_concurrent_merkle_tree_13_32()), - (14, 64) => Ok(make_concurrent_merkle_tree_14_64()), - (14, 256) => Ok(make_concurrent_merkle_tree_14_256()), - (14, 1024) => Ok(make_concurrent_merkle_tree_14_1024()), - (14, 2048) => Ok(make_concurrent_merkle_tree_14_2048()), - (15, 64) => Ok(make_concurrent_merkle_tree_15_64()), - (16, 64) => Ok(make_concurrent_merkle_tree_16_64()), - (17, 64) => Ok(make_concurrent_merkle_tree_17_64()), - (18, 64) => Ok(make_concurrent_merkle_tree_18_64()), - (19, 64) => Ok(make_concurrent_merkle_tree_19_64()), - (20, 64) => Ok(make_concurrent_merkle_tree_20_64()), - (20, 256) => Ok(make_concurrent_merkle_tree_20_256()), - (20, 1024) => Ok(make_concurrent_merkle_tree_20_1024()), - (20, 2048) => Ok(make_concurrent_merkle_tree_20_2048()), - (24, 64) => Ok(make_concurrent_merkle_tree_24_64()), - (24, 256) => Ok(make_concurrent_merkle_tree_24_256()), - (24, 512) => Ok(make_concurrent_merkle_tree_24_512()), - (24, 1024) => Ok(make_concurrent_merkle_tree_24_1024()), - (24, 2048) => Ok(make_concurrent_merkle_tree_24_2048()), - (26, 512) => Ok(make_concurrent_merkle_tree_26_512()), - (26, 1024) => Ok(make_concurrent_merkle_tree_26_1024()), - (26, 2048) => Ok(make_concurrent_merkle_tree_26_2048()), - (30, 512) => Ok(make_concurrent_merkle_tree_30_512()), - (30, 1024) => Ok(make_concurrent_merkle_tree_30_1024()), - (30, 2048) => Ok(make_concurrent_merkle_tree_30_2048()), - (d, s) => Err(BatchMintValidationError::UnexpectedTreeSize(d, s)), - } -} - -make_changelog_impls!(3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 26, 30); - -pub fn validate_change_logs( - max_depth: u32, - max_buffer_size: u32, - leaves: &[[u8; 32]], - batch_mint: &BatchMint, -) -> Result<(), BatchMintValidationError> { - let mut tree = make_concurrent_merkle_tree(max_depth, max_buffer_size)?; - tree.initialize()?; - for (i, leaf_hash) in leaves.iter().enumerate() { - tree.append(*leaf_hash)?; - let changelog = tree.change_logs(tree.active_index() as usize); - let path_len = changelog.path_len() as u32; - let mut path: Vec = changelog - .path_iter() - .enumerate() - .map(|(lvl, n)| { - spl_account_compression::state::PathNode::new( - *n, - (1 << (path_len - lvl as u32)) + (changelog.index() >> lvl), - ) - }) - .collect(); - path.push(spl_account_compression::state::PathNode::new( - changelog.root(), - 1, - )); - - match batch_mint.batch_mints.get(i) { - Some(mint) => { - if mint.tree_update.path - != path - .into_iter() - .map(Into::::into) - .collect::>() - { - return Err(BatchMintValidationError::WrongAssetPath( - mint.leaf_update.id().to_string(), - )); - } - if mint.tree_update.id != batch_mint.tree_id { - return Err(BatchMintValidationError::WrongTreeIdForChangeLog( - mint.leaf_update.id().to_string(), - batch_mint.tree_id.to_string(), - mint.tree_update.id.to_string(), - )); - } - if mint.tree_update.index != changelog.index() { - return Err(BatchMintValidationError::WrongChangeLogIndex( - mint.leaf_update.id().to_string(), - changelog.index(), - mint.tree_update.index, - )); - } - } - None => return Err(BatchMintValidationError::NoRelevantRolledMint(i as u64)), - } - } - if tree.get_root() != batch_mint.merkle_root { - return Err(BatchMintValidationError::InvalidRoot( - Hash::new(tree.get_root().as_slice()).to_string(), - Hash::new(batch_mint.merkle_root.as_slice()).to_string(), - )); - } - Ok(()) -} diff --git a/program_transformers/src/batch_minting/mod.rs b/program_transformers/src/batch_minting/mod.rs index 95aac533b..163029285 100644 --- a/program_transformers/src/batch_minting/mod.rs +++ b/program_transformers/src/batch_minting/mod.rs @@ -1,3 +1 @@ pub mod batch_mint_persister; -mod merkle_tree_wrapper; -pub mod tests; diff --git a/program_transformers/src/batch_minting/tests.rs b/program_transformers/src/batch_minting/tests.rs deleted file mode 100644 index 6fe0dcabf..000000000 --- a/program_transformers/src/batch_minting/tests.rs +++ /dev/null @@ -1,311 +0,0 @@ -use crate::batch_minting::batch_mint_persister::{ - validate_batch_mint, BatchMint, BatchedMintInstruction, ChangeLogEventV1, PathNode, -}; -use crate::error::BatchMintValidationError; -use anchor_lang::AnchorSerialize; -use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; -use rand::{thread_rng, Rng}; -use solana_sdk::keccak; -use solana_sdk::pubkey::Pubkey; -use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; -use std::collections::HashMap; -use std::str::FromStr; - -pub fn generate_batch_mint(size: usize, creators_verified: bool) -> BatchMint { - let authority = Pubkey::from_str("3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM").unwrap(); - let tree = Pubkey::from_str("HxhCw9g3kZvrdg9zZvctmh6qpSDg1FfsBXfFvRkbCHB7").unwrap(); - let mut mints = Vec::new(); - let mut merkle = ConcurrentMerkleTree::<10, 32>::new(); - merkle.initialize().unwrap(); - - let mut last_leaf_hash = [0u8; 32]; - for i in 0..size { - let mint_args = MetadataArgs { - name: thread_rng() - .sample_iter(rand::distributions::Alphanumeric) - .take(15) - .map(char::from) - .collect(), - symbol: thread_rng() - .sample_iter(rand::distributions::Alphanumeric) - .take(5) - .map(char::from) - .collect(), - uri: format!( - "https://arweave.net/{}", - thread_rng() - .sample_iter(rand::distributions::Alphanumeric) - .take(43) - .map(char::from) - .collect::() - ), - seller_fee_basis_points: thread_rng() - .sample(rand::distributions::Uniform::new(0, 10000)), - primary_sale_happened: thread_rng().gen_bool(0.5), - is_mutable: thread_rng().gen_bool(0.5), - edition_nonce: if thread_rng().gen_bool(0.5) { - None - } else { - Some(thread_rng().sample(rand::distributions::Uniform::new(0, 255))) - }, - token_standard: if thread_rng().gen_bool(0.5) { - None - } else { - Some(mpl_bubblegum::types::TokenStandard::NonFungible) - }, - collection: if thread_rng().gen_bool(0.5) { - None - } else { - Some(mpl_bubblegum::types::Collection { - verified: false, - key: Pubkey::new_unique(), - }) - }, - uses: None, // todo - token_program_version: mpl_bubblegum::types::TokenProgramVersion::Original, - creators: (0..thread_rng().sample(rand::distributions::Uniform::new(1, 5))) - .map(|_| mpl_bubblegum::types::Creator { - address: Pubkey::new_unique(), - verified: creators_verified, - share: thread_rng().sample(rand::distributions::Uniform::new(0, 100)), - }) - .collect(), - }; - let nonce = i as u64; - let id = mpl_bubblegum::utils::get_asset_id(&tree, nonce); - let owner = authority.clone(); - let delegate = authority.clone(); - - let metadata_args_hash = keccak::hashv(&[mint_args.try_to_vec().unwrap().as_slice()]); - let data_hash = keccak::hashv(&[ - &metadata_args_hash.to_bytes(), - &mint_args.seller_fee_basis_points.to_le_bytes(), - ]); - let creator_data = mint_args - .creators - .iter() - .map(|c| [c.address.as_ref(), &[c.verified as u8], &[c.share]].concat()) - .collect::>(); - let creator_hash = keccak::hashv( - creator_data - .iter() - .map(|c| c.as_slice()) - .collect::>() - .as_ref(), - ); - - let hashed_leaf = keccak::hashv(&[ - &[1], //self.version().to_bytes() - id.as_ref(), - owner.as_ref(), - delegate.as_ref(), - nonce.to_le_bytes().as_ref(), - data_hash.as_ref(), - creator_hash.as_ref(), - ]) - .to_bytes(); - merkle.append(hashed_leaf).unwrap(); - last_leaf_hash = hashed_leaf; - let changelog = merkle.change_logs[merkle.active_index as usize]; - let path_len = changelog.path.len() as u32; - let mut path: Vec = changelog - .path - .iter() - .enumerate() - .map(|(lvl, n)| { - spl_account_compression::state::PathNode::new( - *n, - (1 << (path_len - lvl as u32)) + (changelog.index >> lvl), - ) - }) - .collect(); - path.push(spl_account_compression::state::PathNode::new( - changelog.root, - 1, - )); - - let rolled_mint = BatchedMintInstruction { - tree_update: ChangeLogEventV1 { - id: tree, - path: path.into_iter().map(Into::into).collect::>(), - seq: merkle.sequence_number, - index: changelog.index, - }, - leaf_update: LeafSchema::V1 { - id, - owner, - delegate, - nonce, - data_hash: data_hash.to_bytes(), - creator_hash: creator_hash.to_bytes(), - }, - mint_args, - authority, - creator_signature: None, - }; - mints.push(rolled_mint); - } - let batch_mint = BatchMint { - tree_id: tree, - raw_metadata_map: HashMap::new(), - max_depth: 10, - batch_mints: mints, - merkle_root: merkle.get_root(), - last_leaf_hash, - max_buffer_size: 32, - }; - - batch_mint -} - -#[tokio::test] -async fn batch_mint_validation_test() { - let mut batch_mint = generate_batch_mint(1000, false); - - let validation_result = validate_batch_mint(&batch_mint, None).await; - assert_eq!(validation_result, Ok(())); - - let old_root = batch_mint.merkle_root; - let new_root = Pubkey::new_unique(); - batch_mint.merkle_root = new_root.to_bytes(); - - let validation_result = validate_batch_mint(&batch_mint, None).await; - assert_eq!( - validation_result, - Err(BatchMintValidationError::InvalidRoot( - Pubkey::from(old_root).to_string(), - new_root.to_string() - )) - ); - - batch_mint.merkle_root = old_root; - let leaf_idx = 111; - let old_leaf_data_hash = batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(); - let new_leaf_data_hash = Pubkey::new_unique(); - batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: batch_mint.batch_mints[leaf_idx].leaf_update.id(), - owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), - delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), - nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), - data_hash: new_leaf_data_hash.to_bytes(), - creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), - }; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::InvalidDataHash( - Pubkey::from(old_leaf_data_hash).to_string(), - new_leaf_data_hash.to_string() - )) - ); - - batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: batch_mint.batch_mints[leaf_idx].leaf_update.id(), - owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), - delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), - nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), - data_hash: old_leaf_data_hash, - creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), - }; - let old_tree_depth = batch_mint.max_depth; - let new_tree_depth = 100; - batch_mint.max_depth = new_tree_depth; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::UnexpectedTreeSize( - new_tree_depth, - batch_mint.max_buffer_size - )) - ); - - batch_mint.max_depth = old_tree_depth; - let new_asset_id = Pubkey::new_unique(); - let old_asset_id = batch_mint.batch_mints[leaf_idx].leaf_update.id(); - batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: new_asset_id, - owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), - delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), - nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), - data_hash: batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(), - creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), - }; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::PDACheckFail( - old_asset_id.to_string(), - new_asset_id.to_string() - )) - ); - - batch_mint.batch_mints[leaf_idx].leaf_update = LeafSchema::V1 { - id: old_asset_id, - owner: batch_mint.batch_mints[leaf_idx].leaf_update.owner(), - delegate: batch_mint.batch_mints[leaf_idx].leaf_update.delegate(), - nonce: batch_mint.batch_mints[leaf_idx].leaf_update.nonce(), - data_hash: batch_mint.batch_mints[leaf_idx].leaf_update.data_hash(), - creator_hash: batch_mint.batch_mints[leaf_idx].leaf_update.creator_hash(), - }; - let old_path = batch_mint.batch_mints[leaf_idx] - .tree_update - .path - .iter() - .map(|path| PathNode { - node: path.node, - index: path.index, - }) - .collect::>(); - let new_path = Vec::new(); - batch_mint.batch_mints[leaf_idx].tree_update.path = new_path; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::WrongAssetPath( - batch_mint.batch_mints[leaf_idx] - .leaf_update - .id() - .to_string() - )) - ); - - batch_mint.batch_mints[leaf_idx].tree_update.path = old_path; - let old_tree_id = batch_mint.batch_mints[leaf_idx].tree_update.id; - let new_tree_id = Pubkey::new_unique(); - batch_mint.batch_mints[leaf_idx].tree_update.id = new_tree_id; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::WrongTreeIdForChangeLog( - batch_mint.batch_mints[leaf_idx] - .leaf_update - .id() - .to_string(), - old_tree_id.to_string(), - new_tree_id.to_string() - )) - ); - - batch_mint.batch_mints[leaf_idx].tree_update.id = old_tree_id; - let old_index = batch_mint.batch_mints[leaf_idx].tree_update.index; - let new_index = 1; - batch_mint.batch_mints[leaf_idx].tree_update.index = new_index; - let validation_result = validate_batch_mint(&batch_mint, None).await; - - assert_eq!( - validation_result, - Err(BatchMintValidationError::WrongChangeLogIndex( - batch_mint.batch_mints[leaf_idx] - .leaf_update - .id() - .to_string(), - old_index, - new_index - )) - ); -} From 3b292f1067b4e03d237065ae17dc87446aae6b68 Mon Sep 17 00:00:00 2001 From: Vadim <31490938+n00m4d@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:47:41 +0200 Subject: [PATCH 34/34] MTG-404 Skip batch mint indexing feature (#207) * feat: add skip batch mint indexing feature * fix: small fixes * chore: add comment and variable renaming --- .../src/dao/generated/batch_mint_to_verify.rs | 3 + integration_tests/Cargo.toml | 3 +- .../integration_tests/batch_mint_tests.rs | 324 +++++++++++++++++- .../tests/integration_tests/cnft_tests.rs | 8 + .../tests/integration_tests/common.rs | 17 +- .../tests/integration_tests/mpl_core_tests.rs | 14 + ...alize_tree_with_root_instruction_handle.rs | 24 ++ nft_ingester/src/account_updates.rs | 16 +- nft_ingester/src/config.rs | 2 +- nft_ingester/src/main.rs | 3 +- nft_ingester/src/transaction_notifications.rs | 15 +- .../src/batch_minting/batch_mint_persister.rs | 17 +- .../src/bubblegum/finalize_tree_with_root.rs | 13 +- program_transformers/src/bubblegum/mod.rs | 12 +- program_transformers/src/lib.rs | 60 +++- 15 files changed, 497 insertions(+), 34 deletions(-) diff --git a/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs index 5be802e9c..d563a3107 100644 --- a/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs +++ b/digital_asset_types/src/dao/generated/batch_mint_to_verify.rs @@ -20,6 +20,7 @@ pub struct Model { pub url: String, pub created_at_slot: i64, pub signature: String, + pub merkle_tree: Vec, pub staker: Vec, pub collection: Option>, pub download_attempts: i32, @@ -33,6 +34,7 @@ pub enum Column { Url, CreatedAtSlot, Signature, + MerkleTree, Staker, Collection, DownloadAttempts, @@ -63,6 +65,7 @@ impl ColumnTrait for Column { Self::Url => ColumnType::String(None).def(), Self::CreatedAtSlot => ColumnType::BigInteger.def(), Self::Signature => ColumnType::String(None).def(), + Self::MerkleTree => ColumnType::Binary.def(), Self::Staker => ColumnType::Binary.def(), Self::Collection => ColumnType::Binary.def().null(), Self::DownloadAttempts => ColumnType::Integer.def(), diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index c389b61a6..cbbc9c253 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -39,4 +39,5 @@ tempfile = { workspace = true } async-channel = { workspace = true } cadence = { workspace = true } cadence-macros = { workspace = true } -bubblegum-batch-sdk = { workspace = true } \ No newline at end of file +bubblegum-batch-sdk = { workspace = true } +spl-account-compression = { workspace = true } \ No newline at end of file diff --git a/integration_tests/tests/integration_tests/batch_mint_tests.rs b/integration_tests/tests/integration_tests/batch_mint_tests.rs index 2a4853b22..0ef24f33e 100644 --- a/integration_tests/tests/integration_tests/batch_mint_tests.rs +++ b/integration_tests/tests/integration_tests/batch_mint_tests.rs @@ -1,4 +1,6 @@ +use crate::common::Network; use crate::common::TestSetup; +use crate::common::TestSetupOptions; use borsh::BorshSerialize; use bubblegum_batch_sdk::batch_mint_client::BatchMintClient; use bubblegum_batch_sdk::batch_mint_validations::generate_batch_mint; @@ -8,6 +10,7 @@ use cadence::{NopMetricSink, StatsdClient}; use cadence_macros::set_global_default; use das_api::api::ApiContract; use das_api::api::GetAssetProof; +use digital_asset_types::dao::asset; use digital_asset_types::dao::sea_orm_active_enums::{ BatchMintFailStatus, BatchMintPersistingState, }; @@ -15,7 +18,11 @@ use digital_asset_types::dao::{batch_mint, batch_mint_to_verify}; use flatbuffers::FlatBufferBuilder; use mpl_bubblegum::types::Collection; use mpl_bubblegum::types::Creator; +use mpl_bubblegum::types::TokenProgramVersion; +use mpl_bubblegum::types::Version; use mpl_bubblegum::types::{LeafSchema, MetadataArgs}; +use mpl_bubblegum::utils::get_asset_id; +use mpl_bubblegum::LeafSchemaEvent; use nft_ingester::batch_mint_updates::create_batch_mint_notification_channel; use nft_ingester::plerkle::PlerkleTransactionInfo; use plerkle_serialization::root_as_transaction_info; @@ -24,6 +31,7 @@ use program_transformers::batch_minting::batch_mint_persister::{ BatchMintPersister, MockBatchMintDownloader, }; use program_transformers::error::BatchMintValidationError; +use program_transformers::ProgramTransformer; use sea_orm::sea_query::OnConflict; use sea_orm::{ColumnTrait, ConnectionTrait, DbBackend, IntoActiveModel, QueryTrait, Set}; use sea_orm::{EntityTrait, QueryFilter}; @@ -37,6 +45,12 @@ use solana_sdk::signature::Signature; use solana_sdk::signer::Signer; use solana_sdk::transaction::{SanitizedTransaction, Transaction}; use solana_transaction_status::{InnerInstruction, InnerInstructions, TransactionStatusMeta}; +use spl_account_compression::events::ApplicationDataEvent; +use spl_account_compression::events::ApplicationDataEventV1; +use spl_account_compression::events::ChangeLogEventV1; +use spl_account_compression::state::PathNode; +use spl_account_compression::AccountCompressionEvent; +use spl_account_compression::ChangeLogEvent; use spl_concurrent_merkle_tree::concurrent_merkle_tree::ConcurrentMerkleTree; use std::collections::HashMap; use std::fs::File; @@ -69,7 +83,7 @@ async fn save_batch_mint_to_queue_test() { // took it from Bubblegum client // this value is generated by Anchor library, it's instruction identifier - let mut instruction_data = vec![101, 214, 253, 135, 176, 170, 11, 235]; + let mut instruction_data = vec![77, 73, 220, 153, 126, 225, 64, 204]; instruction_data.extend(batch_mint_instruction_data.try_to_vec().unwrap().iter()); let transaction = SanitizedTransaction::from_transaction_for_tests(Transaction { @@ -85,11 +99,13 @@ async fn save_batch_mint_to_queue_test() { Pubkey::from_str("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY").unwrap(), Pubkey::new_unique(), Pubkey::new_unique(), + Pubkey::new_unique(), + Pubkey::new_unique(), ], recent_blockhash: [1; 32].into(), instructions: vec![CompiledInstruction { program_id_index: 1, - accounts: vec![2, 3], + accounts: vec![0, 4, 2, 3, 5], data: instruction_data, }], }, @@ -144,6 +160,303 @@ async fn save_batch_mint_to_queue_test() { assert_eq!(r.url, metadata_url); } +#[tokio::test] +async fn skip_batched_minted_trees_test() { + let client = StatsdClient::builder("batch_mint.test", NopMetricSink) + .with_error_handler(|e| eprintln!("metric error: {}", e)) + .build(); + + set_global_default(client); + + let setup = TestSetup::new_with_options( + "skip_batched_minted_trees_test".to_string(), + TestSetupOptions { + network: Some(Network::Devnet), + skip_batch_minted_trees: false, + }, + ) + .await; + let metadata_url = "url".to_string(); + let metadata_hash = "hash".to_string(); + + // arbitrary data + let batch_mint_instruction_data = + mpl_bubblegum::instructions::FinalizeTreeWithRootInstructionArgs { + root: [1; 32], + rightmost_leaf: [1; 32], + rightmost_index: 99, + metadata_url: metadata_url.clone(), + metadata_hash: metadata_hash.clone(), + }; + + // took it from Bubblegum client + // this value is generated by Anchor library, it's instruction identifier + let mut instruction_data = vec![77, 73, 220, 153, 126, 225, 64, 204]; + instruction_data.extend(batch_mint_instruction_data.try_to_vec().unwrap().iter()); + + let merkle_tree_id = Pubkey::new_unique(); + + let transaction = SanitizedTransaction::from_transaction_for_tests(Transaction { + signatures: vec![Signature::new_unique()], + message: Message { + header: MessageHeader { + num_required_signatures: 1, + num_readonly_signed_accounts: 0, + num_readonly_unsigned_accounts: 0, + }, + account_keys: vec![ + Pubkey::new_unique(), + Pubkey::from_str("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY").unwrap(), + Pubkey::new_unique(), + Pubkey::new_unique(), + merkle_tree_id, + Pubkey::new_unique(), + ], + recent_blockhash: [1; 32].into(), + instructions: vec![CompiledInstruction { + program_id_index: 1, + // here important only 1th index - 4 + accounts: vec![0, 4, 2, 3, 5], + data: instruction_data, + }], + }, + }); + + // inner instruction is useless here but required by transaction parser + let transaction_status_meta = TransactionStatusMeta { + inner_instructions: Some(vec![InnerInstructions { + index: 0, + instructions: vec![InnerInstruction { + instruction: CompiledInstruction { + program_id_index: 2, + accounts: vec![], + data: vec![], + }, + stack_height: None, + }], + }]), + ..Default::default() + }; + + let transaction_info = + plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaTransactionInfoV2 { + signature: &Signature::new_unique(), + is_vote: false, + transaction: &transaction, + transaction_status_meta: &transaction_status_meta, + index: 0, + }; + let builder = FlatBufferBuilder::new(); + let builder = serialize_transaction(builder, &transaction_info, 10); + let transaction_info = PlerkleTransactionInfo( + root_as_transaction_info(builder.finished_data().to_vec().as_slice()).unwrap(), + ) + .try_into() + .unwrap(); + + setup + .transformer + .handle_transaction(&transaction_info) + .await + .unwrap(); + + // mint asset and make sure we save it because program transformer is configured + // to save batched minted updates + mint_asset_to_tree(merkle_tree_id, &setup.transformer, 1, 1).await; + + let assets = asset::Entity::find().all(setup.db.as_ref()).await.unwrap(); + + assert_eq!(assets.len(), 1); + + // now we change program transformer and tell it not to save updates related to batched minted trees + // at this moment there is only 1 such tree + // also we make sure that during initialization program transformer selects all the batched tree ids from the DB + let setup = TestSetup::new_with_options( + "skip_batched_minted_trees_test".to_string(), + TestSetupOptions { + network: Some(Network::Devnet), + skip_batch_minted_trees: true, + }, + ) + .await; + + mint_asset_to_tree(merkle_tree_id, &setup.transformer, 2, 2).await; + + let assets = asset::Entity::find().all(setup.db.as_ref()).await.unwrap(); + + assert_eq!(assets.len(), 1); + + // now we switch back to saving batched mint tree updates and check if it works + let setup = TestSetup::new_with_options( + "skip_batched_minted_trees_test".to_string(), + TestSetupOptions { + network: Some(Network::Devnet), + skip_batch_minted_trees: false, + }, + ) + .await; + + mint_asset_to_tree(merkle_tree_id, &setup.transformer, 3, 3).await; + + let assets = asset::Entity::find().all(setup.db.as_ref()).await.unwrap(); + + assert_eq!(assets.len(), 2); +} + +async fn mint_asset_to_tree( + merkle_tree: Pubkey, + transformer: &ProgramTransformer, + index: u64, + sequence: u64, +) { + let mint_instruction_data = mpl_bubblegum::instructions::MintV1InstructionArgs { + metadata: MetadataArgs { + name: "name".to_string(), + symbol: "symbol".to_string(), + uri: "uri".to_string(), + seller_fee_basis_points: 1, + primary_sale_happened: false, + is_mutable: false, + edition_nonce: None, + token_standard: None, + collection: None, + uses: None, + token_program_version: TokenProgramVersion::Original, + creators: vec![], + }, + }; + + // took it from Bubblegum client + // this value is generated by Anchor library, it's instruction identifier + let mut instruction_data = vec![145, 98, 192, 118, 184, 147, 118, 104]; + instruction_data.extend(mint_instruction_data.try_to_vec().unwrap().iter()); + + let transaction = SanitizedTransaction::from_transaction_for_tests(Transaction { + signatures: vec![Signature::new_unique()], + message: Message { + header: MessageHeader { + num_required_signatures: 1, + num_readonly_signed_accounts: 0, + num_readonly_unsigned_accounts: 0, + }, + account_keys: vec![ + Pubkey::new_unique(), + Pubkey::from_str("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY").unwrap(), + Pubkey::from_str("noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV").unwrap(), + Pubkey::new_unique(), + merkle_tree, + Pubkey::new_unique(), + ], + recent_blockhash: [1; 32].into(), + instructions: vec![CompiledInstruction { + program_id_index: 1, + // here important only 3th index - 4 + accounts: vec![0, 3, 2, 4, 5], + data: instruction_data, + }], + }, + }); + + let change_log = ChangeLogEventV1 { + id: merkle_tree, + path: vec![ + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 32, + }, + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 16, + }, + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 8, + }, + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 4, + }, + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 2, + }, + PathNode { + node: Pubkey::new_unique().to_bytes(), + index: 1, + }, + ], + seq: sequence, + index: index as u32, + }; + + let change_log_event = AccountCompressionEvent::ChangeLog(ChangeLogEvent::V1(change_log)); + + let leaf_schema = LeafSchemaEvent::new( + Version::V1, + LeafSchema::V1 { + id: get_asset_id(&merkle_tree, index), + owner: Pubkey::new_unique(), + delegate: Pubkey::new_unique(), + nonce: index, + data_hash: Pubkey::new_unique().to_bytes(), + creator_hash: Pubkey::new_unique().to_bytes(), + }, + Pubkey::new_unique().to_bytes(), + ); + let leaf_schema_event = AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1( + ApplicationDataEventV1 { + application_data: leaf_schema.try_to_vec().unwrap(), + }, + )); + + // inner instruction is useless here but required by transaction parser + let transaction_status_meta = TransactionStatusMeta { + inner_instructions: Some(vec![InnerInstructions { + index: 0, + instructions: vec![ + InnerInstruction { + instruction: CompiledInstruction { + program_id_index: 2, + accounts: vec![], + data: change_log_event.try_to_vec().unwrap(), + }, + stack_height: None, + }, + InnerInstruction { + instruction: CompiledInstruction { + program_id_index: 2, + accounts: vec![], + data: leaf_schema_event.try_to_vec().unwrap(), + }, + stack_height: None, + }, + ], + }]), + ..Default::default() + }; + + let transaction_info = + plerkle_serialization::solana_geyser_plugin_interface_shims::ReplicaTransactionInfoV2 { + signature: &Signature::new_unique(), + is_vote: false, + transaction: &transaction, + transaction_status_meta: &transaction_status_meta, + index: 0, + }; + let builder = FlatBufferBuilder::new(); + let builder = serialize_transaction(builder, &transaction_info, 10); + let transaction_info = PlerkleTransactionInfo( + root_as_transaction_info(builder.finished_data().to_vec().as_slice()).unwrap(), + ) + .try_into() + .unwrap(); + + transformer + .handle_transaction(&transaction_info) + .await + .unwrap(); +} + fn generate_merkle_tree_from_batch_mint(batch_mint: &BatchMint) -> ConcurrentMerkleTree<10, 32> { let mut merkle_tree = ConcurrentMerkleTree::<10, 32>::new(); merkle_tree.initialize().unwrap(); @@ -207,6 +520,7 @@ async fn batch_mint_persister_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(0), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -335,6 +649,7 @@ async fn batch_mint_persister_download_fail_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -481,6 +796,7 @@ async fn batch_mint_with_verified_creators_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -581,6 +897,7 @@ async fn batch_mint_with_unverified_creators_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -718,6 +1035,7 @@ async fn batch_mint_with_verified_collection_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -867,6 +1185,7 @@ async fn batch_mint_with_wrong_collection_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), @@ -1004,6 +1323,7 @@ async fn batch_mint_with_unverified_collection_test() { url: Set(metadata_url.clone()), created_at_slot: Set(10), signature: Set(Signature::new_unique().to_string()), + merkle_tree: Set(Pubkey::default().to_bytes().to_vec()), staker: Set(Pubkey::default().to_bytes().to_vec()), download_attempts: Set(download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), diff --git a/integration_tests/tests/integration_tests/cnft_tests.rs b/integration_tests/tests/integration_tests/cnft_tests.rs index 5c772d30d..7868ed194 100644 --- a/integration_tests/tests/integration_tests/cnft_tests.rs +++ b/integration_tests/tests/integration_tests/cnft_tests.rs @@ -70,6 +70,7 @@ async fn test_cnft_scenario_mint_update_metadata() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -95,6 +96,7 @@ async fn test_cnft_scenario_mint_update_metadata_remove_creators() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -180,6 +182,7 @@ async fn test_mint_delegate_transfer() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -204,6 +207,7 @@ async fn test_mint_redeem_cancel_redeem() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -246,6 +250,7 @@ async fn test_mint_transfer_burn() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -288,6 +293,7 @@ async fn test_mint_transfer_transfer() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -312,6 +318,7 @@ async fn test_mint_verify_creator() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -335,6 +342,7 @@ async fn test_mint_verify_collection() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index 3e328c734..19ce409ee 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -85,7 +85,8 @@ impl TestSetup { let pool = setup_pg_pool(database_test_url.clone()).await; let db = SqlxPostgresConnector::from_sqlx_postgres_pool(pool.clone()); - let transformer = load_ingest_program_transformer(pool.clone()).await; + let transformer = + load_ingest_program_transformer(pool.clone(), opts.skip_batch_minted_trees).await; let rpc_url = match opts.network.unwrap_or_default() { Network::Mainnet => std::env::var("MAINNET_RPC_URL").unwrap(), @@ -115,6 +116,7 @@ impl TestSetup { #[derive(Clone, Copy, Default)] pub struct TestSetupOptions { pub network: Option, + pub skip_batch_minted_trees: bool, } pub async fn setup_pg_pool(database_url: String) -> PgPool { @@ -163,8 +165,17 @@ pub async fn apply_migrations_and_delete_data(db: Arc) { .unwrap(); } -async fn load_ingest_program_transformer(pool: sqlx::Pool) -> ProgramTransformer { - ProgramTransformer::new(pool, Box::new(|_info| ready(Ok(())).boxed()), false) +async fn load_ingest_program_transformer( + pool: sqlx::Pool, + skip_batch_minted_trees: bool, +) -> ProgramTransformer { + ProgramTransformer::new( + pool, + Box::new(|_info| ready(Ok(())).boxed()), + false, + skip_batch_minted_trees, + ) + .await } pub async fn get_transaction( diff --git a/integration_tests/tests/integration_tests/mpl_core_tests.rs b/integration_tests/tests/integration_tests/mpl_core_tests.rs index a8630e84c..b6699018a 100644 --- a/integration_tests/tests/integration_tests/mpl_core_tests.rs +++ b/integration_tests/tests/integration_tests/mpl_core_tests.rs @@ -17,6 +17,7 @@ async fn test_mpl_core_get_asset() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -46,6 +47,7 @@ async fn test_mpl_core_get_collection() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -75,6 +77,7 @@ async fn test_mpl_core_get_assets_by_authority() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -117,6 +120,7 @@ async fn test_mpl_core_get_assets_by_group() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -158,6 +162,7 @@ async fn test_mpl_core_get_assets_by_owner() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -196,6 +201,7 @@ async fn test_mpl_core_get_asset_with_edition() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -225,6 +231,7 @@ async fn test_mpl_core_get_asset_with_pubkey_in_rule_set() { name.clone(), TestSetupOptions { network: Some(Network::Mainnet), + skip_batch_minted_trees: false, }, ) .await; @@ -254,6 +261,7 @@ async fn test_mpl_core_get_asset_with_two_oracle_external_plugins() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -283,6 +291,7 @@ async fn test_mpl_core_get_asset_with_oracle_external_plugin_on_collection() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -312,6 +321,7 @@ async fn test_mpl_core_get_asset_with_oracle_multiple_lifecycle_events() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -341,6 +351,7 @@ async fn test_mpl_core_get_asset_with_oracle_custom_offset_and_base_address_conf name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -370,6 +381,7 @@ async fn test_mpl_core_get_asset_with_oracle_no_offset() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -399,6 +411,7 @@ async fn test_mpl_core_get_assets_by_group_with_oracle_and_custom_pda_all_seeds( name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; @@ -438,6 +451,7 @@ async fn test_mpl_core_get_asset_with_multiple_internal_and_external_plugins() { name.clone(), TestSetupOptions { network: Some(Network::Devnet), + skip_batch_minted_trees: false, }, ) .await; diff --git a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs index 8e491675b..f45bb86c8 100644 --- a/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs +++ b/migration/src/m20240720_120101_add_finalize_tree_with_root_instruction_handle.rs @@ -63,6 +63,11 @@ impl MigrationTrait for Migration { .string() .not_null(), ) + .col( + ColumnDef::new(BatchMintToVerify::MerkleTree) + .binary() + .not_null(), + ) .col( ColumnDef::new(BatchMintToVerify::Staker) .binary() @@ -109,6 +114,24 @@ impl MigrationTrait for Migration { ) .await?; + manager + .create_index( + Index::create() + .name("idx_batch_mint_tree") + .table(BatchMintToVerify::Table) + .col(BatchMintToVerify::MerkleTree) + .to_owned(), + ) + .await?; + + manager + .get_connection() + .execute(Statement::from_string( + DatabaseBackend::Postgres, + "ALTER TABLE batch_mint_to_verify ADD CONSTRAINT unique_filehash_staker UNIQUE (file_hash, staker);".to_string(), + )) + .await?; + manager .create_table( Table::create() @@ -175,6 +198,7 @@ enum BatchMintToVerify { FileHash, CreatedAtSlot, Signature, + MerkleTree, DownloadAttempts, BatchMintPersistingState, BatchMintFailStatus, diff --git a/nft_ingester/src/account_updates.rs b/nft_ingester/src/account_updates.rs index 6d5372555..1a53bfc58 100644 --- a/nft_ingester/src/account_updates.rs +++ b/nft_ingester/src/account_updates.rs @@ -31,11 +31,17 @@ pub fn account_worker( tokio::spawn(async move { let source = T::new(config).await; if let Ok(mut msg) = source { - let manager = Arc::new(ProgramTransformer::new( - pool, - create_download_metadata_notifier(bg_task_sender), - false, - )); + let manager = Arc::new( + // here we hardcode cl_audits and skip_batch_minted_trees to false because that flags are not + // used during accounts processing and that values can be arbitrary + ProgramTransformer::new( + pool, + create_download_metadata_notifier(bg_task_sender), + false, + false, + ) + .await, + ); loop { let e = msg.recv(stream_key, consumption_type.clone()).await; let mut tasks = JoinSet::new(); diff --git a/nft_ingester/src/config.rs b/nft_ingester/src/config.rs index 5fd5cacd6..b7e8c6d62 100644 --- a/nft_ingester/src/config.rs +++ b/nft_ingester/src/config.rs @@ -31,7 +31,7 @@ pub struct IngesterConfig { pub code_version: Option<&'static str>, pub background_task_runner_config: Option, pub cl_audits: Option, // save transaction logs for compressed nfts - pub skip_rollup_indexing: bool, + pub skip_batch_mint_indexing: bool, } #[derive(Deserialize, PartialEq, Debug, Clone)] diff --git a/nft_ingester/src/main.rs b/nft_ingester/src/main.rs index 2b2e31823..3cf830d2e 100644 --- a/nft_ingester/src/main.rs +++ b/nft_ingester/src/main.rs @@ -104,7 +104,7 @@ pub async fn main() -> Result<(), IngesterError> { let mut rollup_persister: Option< Arc>, > = None; - if !config.skip_rollup_indexing { + if !config.skip_batch_mint_indexing { let r = batch_mint_updates::create_batch_mint_notification_channel( &config.get_database_url(), &mut tasks, @@ -170,6 +170,7 @@ pub async fn main() -> Result<(), IngesterError> { }, config.cl_audits.unwrap_or(false), stream_name, + config.skip_batch_mint_indexing, ); } WorkerType::Rollup => { diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index df005bc56..3351ee6fb 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -28,15 +28,20 @@ pub fn transaction_worker( consumption_type: ConsumptionType, cl_audits: bool, stream_key: &'static str, + skip_batch_minted_trees: bool, ) -> JoinHandle<()> { tokio::spawn(async move { let source = T::new(config).await; if let Ok(mut msg) = source { - let manager = Arc::new(ProgramTransformer::new( - pool, - create_download_metadata_notifier(bg_task_sender), - cl_audits, - )); + let manager = Arc::new( + ProgramTransformer::new( + pool, + create_download_metadata_notifier(bg_task_sender), + cl_audits, + skip_batch_minted_trees, + ) + .await, + ); loop { let e = msg.recv(stream_key, consumption_type.clone()).await; let mut tasks = JoinSet::new(); diff --git a/program_transformers/src/batch_minting/batch_mint_persister.rs b/program_transformers/src/batch_minting/batch_mint_persister.rs index 4668f8d6e..eb3ad6655 100644 --- a/program_transformers/src/batch_minting/batch_mint_persister.rs +++ b/program_transformers/src/batch_minting/batch_mint_persister.rs @@ -218,6 +218,7 @@ impl BatchMintPer url: Set(r.url.clone()), created_at_slot: Set(r.created_at_slot), signature: Set(r.signature.clone()), + merkle_tree: Set(r.merkle_tree.clone()), staker: Set(r.staker.clone()), download_attempts: Set(r.download_attempts), batch_mint_persisting_state: Set(BatchMintPersistingState::StartProcessing), @@ -253,12 +254,8 @@ impl BatchMintPer Ok(r) => { let query = batch_mint::Entity::insert(batch_mint::ActiveModel { file_hash: Set(batch_mint_to_verify.file_hash.clone()), - batch_mint_binary_bincode: Set( - bincode::serialize(&r) - .map_err(|e| { - ProgramTransformerError::SerializatonError(e.to_string()) - })?, - ), + batch_mint_binary_bincode: Set(bincode::serialize(&r) + .map_err(|e| ProgramTransformerError::SerializatonError(e.to_string()))?), }) .on_conflict( OnConflict::columns([batch_mint::Column::FileHash]) @@ -320,6 +317,7 @@ impl BatchMintPer url: Set(batch_mint_to_verify.url.clone()), created_at_slot: Set(batch_mint_to_verify.created_at_slot), signature: Set(batch_mint_to_verify.signature.clone()), + merkle_tree: Set(batch_mint_to_verify.merkle_tree.clone()), staker: Set(batch_mint_to_verify.staker.clone()), download_attempts: Set(batch_mint_to_verify.download_attempts + 1), batch_mint_persisting_state: Set(batch_mint_to_verify @@ -424,6 +422,7 @@ impl BatchMintPer url: Set(batch_mint.url.clone()), created_at_slot: Set(batch_mint.created_at_slot), signature: Set(batch_mint.signature.clone()), + merkle_tree: Set(batch_mint.merkle_tree.clone()), staker: Set(batch_mint.staker.clone()), download_attempts: Set(batch_mint.download_attempts), batch_mint_persisting_state: Set(batch_mint.batch_mint_persisting_state.clone()), @@ -468,13 +467,11 @@ where for batched_mint in batch_mint.batch_mints.iter() { bubblegum::mint_v1::mint_v1( &batched_mint.into(), + // only signature and slot will be used &InstructionBundle { txn_id: &signature, - program: Default::default(), - instruction: None, - inner_ix: None, - keys: &[], slot, + ..Default::default() }, txn, "FinalizeTreeWithRoot", diff --git a/program_transformers/src/bubblegum/finalize_tree_with_root.rs b/program_transformers/src/bubblegum/finalize_tree_with_root.rs index 5b2cbab48..96ef47cb7 100644 --- a/program_transformers/src/bubblegum/finalize_tree_with_root.rs +++ b/program_transformers/src/bubblegum/finalize_tree_with_root.rs @@ -1,7 +1,11 @@ +use std::collections::HashSet; + use blockbuster::programs::bubblegum::Payload; use digital_asset_types::dao::sea_orm_active_enums::BatchMintPersistingState; use sea_orm::sea_query::OnConflict; use sea_orm::{DbBackend, EntityTrait, QueryTrait, Set}; +use solana_sdk::pubkey::Pubkey; +use tokio::sync::RwLock; use { crate::error::{ProgramTransformerError, ProgramTransformerResult}, blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}, @@ -12,17 +16,24 @@ pub async fn finalize_tree_with_root<'c, T>( parsing_result: &BubblegumInstruction, bundle: &InstructionBundle<'c>, txn: &'c T, + batched_trees: &Option>>, ) -> ProgramTransformerResult<()> where T: ConnectionTrait + TransactionTrait, { - if let Some(Payload::FinalizeTreeWithRoot { args, .. }) = &parsing_result.payload { + if let Some(Payload::FinalizeTreeWithRoot { args, tree_id }) = &parsing_result.payload { + if let Some(batched_trees) = batched_trees { + let mut b_trees = batched_trees.write().await; + b_trees.insert(tree_id.clone()); + } + let query = digital_asset_types::dao::batch_mint_to_verify::Entity::insert( digital_asset_types::dao::batch_mint_to_verify::ActiveModel { file_hash: Set(args.metadata_hash.clone()), url: Set(args.metadata_url.clone()), created_at_slot: Set(bundle.slot as i64), signature: Set(bundle.txn_id.to_string()), + merkle_tree: Set(tree_id.to_bytes().to_vec()), staker: Set(args.staker.to_bytes().to_vec()), download_attempts: Set(0), batch_mint_persisting_state: Set(BatchMintPersistingState::ReceivedTransaction), diff --git a/program_transformers/src/bubblegum/mod.rs b/program_transformers/src/bubblegum/mod.rs index aadf692a5..d3402bbb7 100644 --- a/program_transformers/src/bubblegum/mod.rs +++ b/program_transformers/src/bubblegum/mod.rs @@ -11,6 +11,9 @@ use { token_metadata::types::UseMethod as TokenMetadataUseMethod, }, sea_orm::{ConnectionTrait, TransactionTrait}, + solana_sdk::pubkey::Pubkey, + std::collections::HashSet, + tokio::sync::RwLock, tracing::{debug, info}, }; @@ -32,6 +35,7 @@ pub async fn handle_bubblegum_instruction<'c, T>( txn: &T, download_metadata_notifier: &DownloadMetadataNotifier, cl_audits: bool, + batched_trees: &Option>>, ) -> ProgramTransformerResult<()> where T: ConnectionTrait + TransactionTrait, @@ -116,7 +120,13 @@ where } InstructionName::FinalizeTreeWithRoot | InstructionName::FinalizeTreeWithRootAndCollection => { - finalize_tree_with_root::finalize_tree_with_root(parsing_result, bundle, txn).await? + finalize_tree_with_root::finalize_tree_with_root( + parsing_result, + bundle, + txn, + batched_trees, + ) + .await? } _ => debug!("Bubblegum: Not Implemented Instruction"), } diff --git a/program_transformers/src/lib.rs b/program_transformers/src/lib.rs index c43c13528..5620c68ca 100644 --- a/program_transformers/src/lib.rs +++ b/program_transformers/src/lib.rs @@ -15,16 +15,20 @@ use { ProgramParseResult, }, }, + digital_asset_types::dao::batch_mint_to_verify, futures::future::BoxFuture, sea_orm::{ entity::EntityTrait, query::Select, ConnectionTrait, DatabaseConnection, DbErr, - SqlxPostgresConnector, TransactionTrait, + QuerySelect, SqlxPostgresConnector, TransactionTrait, }, solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature}, solana_transaction_status::InnerInstructions, sqlx::PgPool, std::collections::{HashMap, HashSet, VecDeque}, - tokio::time::{sleep, Duration}, + tokio::{ + sync::RwLock, + time::{sleep, Duration}, + }, tracing::{debug, error, info}, }; @@ -86,13 +90,15 @@ pub struct ProgramTransformer { parsers: HashMap>, key_set: HashSet, cl_audits: bool, + batched_trees: Option>>, } impl ProgramTransformer { - pub fn new( + pub async fn new( pool: PgPool, download_metadata_notifier: DownloadMetadataNotifier, cl_audits: bool, + skip_batch_minted_trees: bool, ) -> Self { let mut parsers: HashMap> = HashMap::with_capacity(3); let bgum = BubblegumParser {}; @@ -108,12 +114,47 @@ impl ProgramTransformer { acc }); let pool: PgPool = pool; + + let storage = SqlxPostgresConnector::from_sqlx_postgres_pool(pool); + + let batched_trees = { + if !skip_batch_minted_trees { + None + } else { + match batch_mint_to_verify::Entity::find() + .column(batch_mint_to_verify::Column::MerkleTree) + .all(&storage) + .await + { + Ok(models) => { + let trees_result: Result, _> = models + .iter() + .map(|m| Pubkey::try_from(m.merkle_tree.clone())) + .collect(); + + match trees_result { + Ok(trees) => Some(RwLock::new(trees)), + Err(e) => { + error!("Failed to convert merkle_tree to Pubkey: {:?}", e); + None + } + } + } + Err(e) => { + error!("Failed to fetch batch_mint_to_verify models: {:?}", e); + None + } + } + } + }; + ProgramTransformer { - storage: SqlxPostgresConnector::from_sqlx_postgres_pool(pool), + storage, download_metadata_notifier, parsers, key_set: hs, cl_audits, + batched_trees, } } @@ -182,12 +223,23 @@ impl ProgramTransformer { let concrete = result.result_type(); match concrete { ProgramParseResult::Bubblegum(parsing_result) => { + if let Some(batched_trees) = &self.batched_trees { + if let Some(change_log) = &parsing_result.tree_update { + let batched_trees = batched_trees.read().await; + + if let Some(_tree) = batched_trees.get(&change_log.id) { + continue; + } + } + } + handle_bubblegum_instruction( parsing_result, &ix, &self.storage, &self.download_metadata_notifier, self.cl_audits, + &self.batched_trees, ) .await .map_err(|err| {