diff --git a/Cargo.lock b/Cargo.lock index e1d32cb3cb..d670ed3fe3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1034,7 +1034,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" dependencies = [ "lab", - "phf", + "phf 0.11.3", ] [[package]] @@ -1471,6 +1471,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + [[package]] name = "fancy-regex" version = "0.11.0" @@ -1533,6 +1539,18 @@ dependencies = [ "zlib-rs", ] +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1737,7 +1755,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -2367,6 +2385,15 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "inventory" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" +dependencies = [ + "rustversion", +] + [[package]] name = "ipnet" version = "2.12.0" @@ -2743,6 +2770,16 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" +[[package]] +name = "md-5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" +dependencies = [ + "cfg-if", + "digest 0.11.3", +] + [[package]] name = "memchr" version = "2.8.1" @@ -2848,7 +2885,7 @@ checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.61.2", ] @@ -2878,6 +2915,15 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom 0.2.17", +] + [[package]] name = "native-tls" version = "0.2.18" @@ -3029,6 +3075,24 @@ dependencies = [ "libc", ] +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.1", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "objc2-core-foundation", +] + [[package]] name = "object" version = "0.37.3" @@ -3258,7 +3322,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_shared 0.13.1", + "serde", ] [[package]] @@ -3268,7 +3342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.11.3", ] [[package]] @@ -3277,7 +3351,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared", + "phf_shared 0.11.3", "rand 0.8.6", ] @@ -3288,7 +3362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.11.3", "proc-macro2", "quote 1.0.45", "syn 2.0.117", @@ -3303,6 +3377,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.13" @@ -3351,6 +3434,35 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +[[package]] +name = "postgres-protocol" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56201207dac53e2f38e848e31b4b91616a6bb6e0c7205b77718994a7f49e70fc" +dependencies = [ + "base64 0.22.1", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand 0.10.1", + "sha2 0.11.0", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc729a129e682e8d24170cd30ae1aa01b336b096cbb56df6d534ffec133d186" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + [[package]] name = "potential_utf" version = "0.1.5" @@ -3482,7 +3594,7 @@ dependencies = [ "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -4583,6 +4695,24 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "slipstream-plugin-postgres" +version = "0.1.0" +source = "git+ssh://git@github.com/ProvableHQ/slipstream-plugin-postgres.git?rev=0cafd01966#0cafd019661bfbc9ba78884198ba413db4da013a" +dependencies = [ + "anyhow", + "bytes", + "flume", + "futures", + "inventory", + "json5", + "serde", + "serde_json", + "snarkvm", + "tokio", + "tokio-postgres", +] + [[package]] name = "smallvec" version = "1.15.1" @@ -4712,6 +4842,8 @@ dependencies = [ "futures-util", "http 1.3.1", "indexmap 2.14.0", + "inventory", + "json5", "locktick", "lru", "num_cpus", @@ -4722,6 +4854,7 @@ dependencies = [ "rand_chacha 0.10.0", "reqwest", "serde_json", + "slipstream-plugin-postgres", "snarkos-account", "snarkos-node-bft", "snarkos-node-cdn", @@ -5096,8 +5229,7 @@ dependencies = [ [[package]] name = "snarkvm" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd43c5dc721398f60bd4e9f15cef51bb8b10ab5699443d2ae6e116bc9d569bdb" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "dotenvy", @@ -5122,8 +5254,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71391e6d41b7c9e1e3e702f53a72ef8a8aa87e480576e4794fdc48a6ccf76e44" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5151,8 +5282,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3f6cd7685b8e387eaddcb4a2320b11eb2826fda9343445eb633233430328e9" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "blst", "cc", @@ -5163,8 +5293,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d265ef0f4603215dbb055fa8e0d4002aedf071eb3e817f78605ed0ac8d76b5c6" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -5178,8 +5307,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d1b2bcebc71fbb181f36ce4e9dda131425a7d3124bb0899c6f5f8ede4de5f4" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-network", "snarkvm-circuit-types", @@ -5189,8 +5317,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b0ca6b622ca924812c282c4af1f5900c1582b392b08f9a0fab1ddea12032d2" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -5200,8 +5327,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba683043b9a29c4ec902951ca038aee57b5baab1c873682b35fe44ced88d34ed" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -5211,8 +5337,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a5b2ee3698fb6f30ec418f42f2c76bc112f456c16be4f467972d2f6414bfae" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "indexmap 2.14.0", @@ -5232,14 +5357,12 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f9297db3916e80ab3d234b020489c466951790e49c02358a42b8c3d4e4efd4" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" [[package]] name = "snarkvm-circuit-network" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfe787dfa985f9440023f2092655b8a3b7a39cc001d8f49e55316ff3bae813c" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -5250,8 +5373,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c62e77c12f69e61cb51ca03d11c516b0f620566fb50d85d05aa0a9eb25da79c" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -5265,8 +5387,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1435b136e2c7b7343de81395dc3be6586e32e9b115df2185731198693d4ff864" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -5281,8 +5402,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "073dcdefeba03189e1ccc1048f9ef4e193dcfae15265bb8ac99c10b490b16b7f" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5295,8 +5415,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8a9923b0860feab7f4bc582b6d943c2b4657856cf2bbd9a771c2402437e456" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -5305,8 +5424,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677799ebe3769c916bab7bf8b1bfff39d344028ca6877dacc8398df201b72401" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5316,8 +5434,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53ef111c07dbba0b6b8ced0f8997bb83e7f26ea7f32ef985b18adcd490eb8d7c" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5329,8 +5446,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe4e31d4961333859313bd80f931a812df9a1486a9f9de68797be657ae0c47d" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5342,8 +5458,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9596b7bc9d807ba2c8a12498968011c16c1cdd6056dcc15523112b1877da4c" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5354,8 +5469,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd0fbfa75b4fa7620644fd9d9f0eeb34bba10f50c1d6669fb0c29e1355d2d48" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -5367,8 +5481,7 @@ dependencies = [ [[package]] name = "snarkvm-console" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2c7135997bd289c4833ccea44b660f0eb4463e27bf6daf0af0b7c92e08cc17" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -5381,8 +5494,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9344d174c15d2897b5178e1245c8371e79efe033017ce95aac7897bf6f120a7" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "bs58", "snarkvm-console-network", @@ -5393,8 +5505,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e03658558fcd7d9a07c3ccabda3345f392c6eb49b4eb239321a902ea02f968" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "blake2s_simd", "hex", @@ -5410,8 +5521,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cb811b5cbc266602aab5087771788c955e883b8234f5cbf828ea9eba0af2ab" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "locktick", @@ -5425,8 +5535,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e140132e6c203a911d1eb540fa2449a50fd3fc01a989e715fcdc78a0d1dcb4" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "enum-iterator", @@ -5446,8 +5555,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6d8a938b2ea5368a4e1bcbfbaf5406de4cf4776259ac404db31a0ad4469187" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "bech32", @@ -5465,8 +5573,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c83b58cddd528096528972e89e87bae93a96393e195e8f42efee42c1d01c46" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "enum-iterator", "enum_index", @@ -5487,8 +5594,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3bfba455ea0d06fb30fb76f09e5a0cf2f561287efdc4fd13d2ae1f9a31373e" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -5503,8 +5609,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d7593a5a7be012670bd5f25951c58e33ab61660926f4b7a17151838f454291" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5515,8 +5620,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4effc5da9957abfeef3eb3c11990ec02172cb334cc525aafa71e16d1b8bb598" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", ] @@ -5524,8 +5628,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a32ff8db10684a25cdba8868d667b3512612065b91606a8c323813116732d5" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5535,8 +5638,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00684faf1e2128e3168b6384a9cc910d61b4ea8c61a24f5e3cabdc11bffaf389" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5547,8 +5649,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d6695fae259623bad0cf3ef83f2ef631460dfc96ee4c4734ccc8fd51c9fe98" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5559,8 +5660,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d581ca16b44162d4d73b6abc99ad513c35f76e4e1a2fba9579af979ca86f3cc5" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5571,8 +5671,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce69dc5368ece183938f2e80e242176bb3b10981813f4a1207a351409fec214" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -5583,8 +5682,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86429f2af060974ee91deb525daa86b7ce95c62d981ab32d0d7542fe998431d1" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "rand 0.10.1", "rustc_version", @@ -5597,8 +5695,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d03ad8f583bee8ac19e0648e9b327960748b780748fa7ab9b57de595d085f26" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5615,11 +5712,11 @@ dependencies = [ [[package]] name = "snarkvm-ledger" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbd3ba89c54e84a74027255b2edfab7eb1044c7609c0e89edb06fa650545e07" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", + "cfg-if", "indexmap 2.14.0", "locktick", "lru", @@ -5648,8 +5745,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a10d21327b85caf5ec94d15a4848ddfdcbf0e8f050a7b8dc22446a5f7119a2c" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "rand 0.10.1", @@ -5661,8 +5757,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16533468e48ce58b9bac93b83faa009ea3e8cde92694e1f74b1dec0dd1efca3d" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "indexmap 2.14.0", @@ -5686,8 +5781,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff9aeb8757f15c7dd698265b6f2bdaab850f7737337a59d3c3589537bceac95" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "indexmap 2.14.0", @@ -5706,8 +5800,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4ae3bff93a459ab5a85db3ad12f394d643d28abf6e32cdd40274ceb1ba9eae" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-header", @@ -5720,8 +5813,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4806d55f70a9252bfa6eb1233fc4fac07e51d9208a08df0868a6d5799f900297" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "indexmap 2.14.0", "rayon", @@ -5734,8 +5826,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e8a4f3f0e81bfb3acc5db3eb00b367dcbb6a9aeda823813af1e7e96c1db6a2" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "indexmap 2.14.0", "rayon", @@ -5747,8 +5838,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2708ffd18723b9739ce2b30df8037d30b47f1c10f668f7f3979740a0c09f3f8" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "bytes", "serde_json", @@ -5759,8 +5849,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73f616ff9e8b650f7f9707ffe1e9c6b1dd1d0acd9ff8614861ace3424421ab7" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "indexmap 2.14.0", "rayon", @@ -5775,8 +5864,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6afce387ff6055a01ff3218f8b22f471e2f9c5fcbe633820b676c6196216bc" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "bytes", "serde_json", @@ -5789,8 +5877,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "860101cbe832fb5246f062c0aacc4c2117bf51cbc2787783c08ff120d39fcf7f" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "snarkvm-console", "snarkvm-ledger-puzzle", @@ -5799,8 +5886,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0baaeefec2b0fc7df7afffc9644dd343d028fe1c94874382ce7448231c9fa88" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5821,8 +5907,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle-epoch" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f7f30fbb625063d36575505c01563b27dbe7237369ce487b0a6ab8e655b599" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5845,8 +5930,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63f5f02b2ed55802aa7bd753f06093817dca26ce9add6335a7d6d4beb9b9039" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "async-trait", @@ -5863,8 +5947,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f83232d79e9ece01d84c571e9b6ea7e6dbd4217853ec7d4e6bd6be621a1ce5" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std-storage", "anyhow", @@ -5893,8 +5976,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4c315d4a4ff502abf956a4036aa1a7123e02b2275570a69522fab38a8500a3" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5912,8 +5994,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066c7b501e5b0a4b2b99e46787bcdac880cfa3af44a215c427759bcde73b0a1a" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "metrics", ] @@ -5921,8 +6002,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6953e5b2092ebd763ff3406b50976565ccf8e6768b6956dcb9e9cae65dcb79" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -5945,22 +6025,18 @@ dependencies = [ [[package]] name = "snarkvm-slipstream-plugin-interface" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1239c3406cc068093532a4c5c83f8b3cc16320642756be0c3ed3d3d56a40fb2" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", + "inventory", ] [[package]] name = "snarkvm-slipstream-plugin-manager" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22effdb2f0a271b01a6a5a7696da8a8e7a8f0254eb1b87fbdcfa866b8281356" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", - "json5", - "libloading", - "serde_json", "snarkvm-slipstream-plugin-interface", "thiserror 2.0.18", "tracing", @@ -5969,8 +6045,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db919cb726fdef30913f758ddd14dc8fc9881bfaf00ed2c1edc9d71794091232" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -6005,8 +6080,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-error" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1105ae1de382800f35a25eb8f625cdc228668eb46877a9f513a15f61435e9a2a" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "anyhow", "snarkvm-circuit-environment", @@ -6018,8 +6092,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4660400b8f689f4ecb166fc6d33cf2c9050249e2e8b6a68cef74bf6277ee261b" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "colored 3.1.1", @@ -6046,8 +6119,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508e4f3e0275ad282c21f3b8a126639ebe7446bbb44f271d38197f431733c466" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "enum-iterator", "indexmap 2.14.0", @@ -6068,8 +6140,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdaa14705a5077479175389272f5681b6e258c0e5c0f41aa670c3b544d02d2f5" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "bincode", "serde_json", @@ -6082,8 +6153,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a8f158c1c74f748262e24e5c5835d6144ac8487f05fb67edede4366d1be93d" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "aleo-std", "anyhow", @@ -6106,8 +6176,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b004c0e85a52c4ced0a6880e9715d966bdc4d4cd722bf2ddaac99134eb1a9c2b" +source = "git+https://github.com/ProvableHQ/snarkVM.git?rev=27e97c5c2ec7033fbc21986603898f65c187ffc9#27e97c5c2ec7033fbc21986603898f65c187ffc9" dependencies = [ "proc-macro2", "quote 1.0.45", @@ -6145,6 +6214,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "spinning_top" version = "0.3.0" @@ -6186,6 +6264,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + [[package]] name = "strsim" version = "0.11.1" @@ -6379,7 +6468,7 @@ checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" dependencies = [ "fnv", "nom", - "phf", + "phf 0.11.3", "phf_codegen", ] @@ -6422,7 +6511,7 @@ dependencies = [ "ordered-float", "pest", "pest_derive", - "phf", + "phf 0.11.3", "sha2 0.10.9", "signal-hook", "siphasher", @@ -6681,6 +6770,32 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-postgres" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd8df5ef180f6364759a6f00f7aadda4fbbac86cdee37480826a6ff9f3574ce" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf 0.13.1", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand 0.10.1", + "socket2 0.6.3", + "tokio", + "tokio-util", + "whoami", +] + [[package]] name = "tokio-rustls" version = "0.26.4" @@ -7012,12 +7127,33 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + [[package]] name = "unicode-segmentation" version = "1.13.2" @@ -7211,6 +7347,15 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + [[package]] name = "wasip2" version = "1.0.3+wasi-0.2.9" @@ -7229,6 +7374,15 @@ dependencies = [ "wit-bindgen 0.51.0", ] +[[package]] +name = "wasite" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42" +dependencies = [ + "wasi 0.14.7+wasi-0.2.4", +] + [[package]] name = "wasm-bindgen" version = "0.2.122" @@ -7449,6 +7603,19 @@ dependencies = [ "libc", ] +[[package]] +name = "whoami" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998767ef88740d1f5b0682a9c53c24431453923962269c2db68ee43788c5a40d" +dependencies = [ + "libc", + "libredox", + "objc2-system-configuration", + "wasite", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index fffeb78d96..1ed37f8903 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,9 +47,9 @@ default-features = false [workspace.dependencies.snarkvm] #path = "../snarkVM" -#git = "https://github.com/ProvableHQ/snarkVM.git" -#rev = "d41232f" -version = "=4.7.1" +git = "https://github.com/ProvableHQ/snarkVM.git" +rev = "27e97c5c2ec7033fbc21986603898f65c187ffc9" # NOTE: CHANGE BACK +# version = "=4.7.1" default-features = false diff --git a/cli/src/commands/start.rs b/cli/src/commands/start.rs index 290db8d160..91a65bd9a4 100644 --- a/cli/src/commands/start.rs +++ b/cli/src/commands/start.rs @@ -302,11 +302,11 @@ pub struct Start { #[clap(long)] pub auto_migrate_node_data: bool, - /// Paths to Slipstream plugin config files (JSON5). May be repeated for multiple plugins. - /// Requires the node to be compiled with --features slipstream-plugins. + /// Specify paths to slipstream plugin config files (JSON5). May be provided multiple times. + /// Only available when the node is built with the `slipstream-plugins` feature. #[cfg(feature = "slipstream-plugins")] - #[clap(long = "slipstream-config", value_name = "PATH", verbatim_doc_comment)] - pub slipstream_configs: Vec, + #[clap(long = "slipstream-plugins", num_args = 0.., value_delimiter = ',')] + pub slipstream_plugins: Vec, } impl Start { @@ -864,18 +864,17 @@ impl Start { // Register the signal handler. let signal_handler = SignalHandler::new(Some(handle)); - // Collect slipstream plugin config paths (empty slice when feature is disabled). + // Collect slipstream plugin config paths (empty when feature is disabled). #[cfg(feature = "slipstream-plugins")] - let slipstream_configs: &[PathBuf] = &self.slipstream_configs; + let slipstream_plugin_configs = self.slipstream_plugins.clone(); #[cfg(not(feature = "slipstream-plugins"))] - let slipstream_configs: &[PathBuf] = &[]; + let slipstream_plugin_configs: Vec = vec![]; // Initialize the node. let node = match node_type { - // NodeType::Validator => Node::new_validator(node_ip, self.bft, rest_ip, self.rest_rps, account, &trusted_peers, &trusted_validators, genesis, cdn, storage_mode, node_data_dir, self.trusted_peers_only, self.auto_db_checkpoints.clone(), dev_txs, self.dev, slipstream_configs, signal_handler.clone()).await, - NodeType::Validator => Node::new_validator(node_ip, self.bft, rest_ip, self.rest_rps, account, &trusted_peers, &trusted_validators, genesis, cdn, storage_mode, node_data_dir, self.trusted_peers_only, self.auto_db_checkpoints.clone(), dev_txs, self.dev, slipstream_configs, dev_num_validators_for_committee_hotswap, signal_handler.clone()).await, + NodeType::Validator => Node::new_validator(node_ip, self.bft, rest_ip, self.rest_rps, account, &trusted_peers, &trusted_validators, genesis, cdn, storage_mode, node_data_dir, self.trusted_peers_only, self.auto_db_checkpoints.clone(), dev_txs, self.dev, dev_num_validators_for_committee_hotswap, signal_handler.clone(), slipstream_plugin_configs).await, NodeType::Prover => Node::new_prover(node_ip, account, &trusted_peers, genesis, node_data_dir, self.trusted_peers_only, self.dev, signal_handler.clone()).await, - NodeType::Client => Node::new_client(node_ip, rest_ip, self.rest_rps, account, &trusted_peers, genesis, cdn, storage_mode, node_data_dir, self.trusted_peers_only, self.auto_db_checkpoints.clone(), self.dev, slipstream_configs, signal_handler.clone()).await, + NodeType::Client => Node::new_client(node_ip, rest_ip, self.rest_rps, account, &trusted_peers, genesis, cdn, storage_mode, node_data_dir, self.trusted_peers_only, self.auto_db_checkpoints.clone(), self.dev, signal_handler.clone(), slipstream_plugin_configs).await, NodeType::BootstrapClient => Node::new_bootstrap_client(node_ip, account, *genesis.header(), self.dev).await, }?; diff --git a/cli/src/helpers/logger.rs b/cli/src/helpers/logger.rs index 785aa37818..4ccc6642a0 100644 --- a/cli/src/helpers/logger.rs +++ b/cli/src/helpers/logger.rs @@ -80,6 +80,7 @@ fn parse_log_verbosity(verbosity: u8) -> Result { .add_directive("axum=warn".parse().unwrap()) .add_directive("ureq=warn".parse().unwrap()) .add_directive("rustls=warn".parse().unwrap()) + .add_directive("tokio_postgres=warn".parse().unwrap()) } else { // Disable logs from third-party crates by default. filter @@ -93,6 +94,7 @@ fn parse_log_verbosity(verbosity: u8) -> Result { .add_directive("axum=off".parse().unwrap()) .add_directive("ureq=off".parse().unwrap()) .add_directive("rustls=off".parse().unwrap()) + .add_directive("tokio_postgres=off".parse().unwrap()) }; let filter = if verbosity >= 5 { diff --git a/docs/slipstream_plugins.md b/docs/slipstream_plugins.md index 82f084ba9a..8008d7c60e 100644 --- a/docs/slipstream_plugins.md +++ b/docs/slipstream_plugins.md @@ -8,14 +8,15 @@ real time, without modifying node code. ## Overview -Slipstream plugins are dynamically loaded shared libraries (`.so` / `.dylib` / `.dll`) that -implement the `SlipstreamPlugin` trait from `snarkvm-slipstream-plugin-interface`. The plugin -manager inside `snarkVM`'s `FinalizeStore` calls plugin hooks every time canonical finalize runs. +Slipstream plugins are statically linked into the `snarkos` binary at compile time. Each plugin +implements the `SlipstreamPlugin` trait from `snarkvm-slipstream-plugin-interface` and +self-registers via `inventory::submit!` at link time. The plugin manager inside `snarkVM`'s +`FinalizeStore` calls plugin hooks every time canonical finalize runs. Plugins can subscribe to: - **Mapping updates** — every key/value write that occurs during canonical finalize. -- **Staking rewards** — per-staker reward notifications +- **Staking rewards** — per-staker reward notifications. Only **Validator** and **Client** nodes finalize blocks and therefore support plugins. Prover nodes do not. @@ -24,46 +25,75 @@ Prover nodes do not. ## Building a Plugin -Use `snarkvm-slipstream-plugin-interface` as a dependency and implement the `SlipstreamPlugin` -trait. Compile your crate as a `cdylib`: +### 1. Implement the trait + +Add `snarkvm-slipstream-plugin-interface` and `inventory` as dependencies: ```toml # Cargo.toml -[lib] -crate-type = ["cdylib"] - [dependencies] -snarkvm-slipstream-plugin-interface = { git = "https://github.com/ProvableHQ/snarkVM.git", branch = "stream_plugin_testing" } +snarkvm-slipstream-plugin-interface = { git = "https://github.com/ProvableHQ/snarkVM.git" } +inventory = "0.3" ``` -Export the constructor with the exact symbol name `_create_plugin`: +Implement `SlipstreamPlugin` and register with `inventory::submit!`: ```rust -#[no_mangle] -pub extern "C" fn _create_plugin() -> *mut dyn SlipstreamPlugin { - Box::into_raw(Box::new(MyPlugin::new())) +use snarkvm_slipstream_plugin_interface::slipstream_plugin_interface::{ + SlipstreamPlugin, PluginRegistration, +}; + +struct MyPlugin; + +impl SlipstreamPlugin for MyPlugin { + fn name(&self) -> &'static str { "my-plugin" } + // override on_load, on_broadcast, on_unload as needed } + +inventory::submit! { + PluginRegistration { + name: "my-plugin", + factory: || Box::new(MyPlugin::new()), + } +} +``` + +### 2. Add the plugin to snarkOS + +Add your crate as an optional dependency in `snarkOS/node/Cargo.toml` under the +`slipstream-plugins` feature: + +```toml +[dependencies.my-plugin] +path = "../../my-plugin" +optional = true + +[features] +slipstream-plugins = [ + "snarkvm/slipstream-plugins", + "dep:my-plugin", + # ... +] ``` -See `slipstream-plugin-postgres` in the snarkVM repository for a complete reference -implementation. +No other snarkOS or snarkVM code changes are required. snarkOS discovers all registered plugins +at startup via `inventory::iter::()`. + +See `slipstream-plugin-postgres` for a complete reference implementation. --- ## Plugin Config File (JSON5) -Each plugin is configured via a JSON5 file. The required field is `libpath`, which can be -absolute or relative to the config file's directory. +Each plugin is configured via a JSON5 file. The `name` field must match the name passed to +`inventory::submit!` in the plugin crate. ```json5 { - // Required: path to the compiled .so / .dylib - libpath: "./libslipstream_postgres_example.so", + // Required: must match the name registered via inventory::submit! in the plugin crate. + name: "my-plugin", - // Optional: override the plugin name reported by name() - name: "postgres", - - // Plugin-specific fields (passed verbatim to on_load) + // Plugin-specific fields — read by the plugin's own on_load implementation. connection_string: "postgres://user:pass@localhost/aleo", batch_size: 100, } @@ -73,39 +103,37 @@ absolute or relative to the config file's directory. ## Starting a Node with Plugins -Compile snarkOS with the `slipstream-plugins` feature +Build snarkOS with the `slipstream-plugins` feature: ```bash -cargo build --features slipstream-plugins +cargo build --release --features slipstream-plugins ``` -Pass one or more `--slipstream-config` flags at startup: +Pass one or more config file paths at startup (comma-separated or repeated): ```bash # Single plugin -snarkos start --client \ - --slipstream-config ~/.aleo/plugins/postgres/plugin.json5 +snarkos start --nodetype validator \ + --slipstream-plugins ~/.aleo/plugins/postgres.json5 # Multiple plugins -snarkos start --validator \ - --slipstream-config ~/.aleo/plugins/postgres/plugin.json5 \ - --slipstream-config ~/.aleo/plugins/metrics/plugin.json5 +snarkos start --nodetype validator \ + --slipstream-plugins ~/.aleo/plugins/postgres.json5,~/.aleo/plugins/metrics.json5 ``` -Plugins are loaded synchronously before the REST server starts. If any plugin fails to load, -the node exits with an error. +Plugins are initialized synchronously before the REST server and consensus engine start. +If any plugin's `on_load` returns an error, the node exits immediately — there is no +"start without the plugin" fallback. --- -## Runtime Management via REST API +## REST API -> **Authentication required.** All slipstream management endpoints are protected by JWT -> authentication. Every request must include an `Authorization: Bearer ` header. +> **Authentication required.** All slipstream endpoints require a JWT bearer token. > The token is printed to stdout at node startup and written to -> `/jwt_secret_
.txt`. To disable auth entirely, start the node -> with `--nojwt` (not recommended in production). +> `/jwt_secret_
.txt`. -### List loaded plugins +### List active plugins ``` GET /{network}/slipstream/plugins @@ -116,70 +144,24 @@ Response (200): ["postgres", "metrics"] ``` -### Load a plugin at runtime - -``` -POST /{network}/slipstream/plugins -Content-Type: application/json - -{ "config_file": "/path/to/plugin.json5" } -``` - -Response (200): -```json -{ "loaded": "postgres" } -``` - -Returns **422 Unprocessable Entity** if a plugin with that name is already loaded. - -### Unload a plugin - -``` -DELETE /{network}/slipstream/plugins/{name} -``` - -Response (200): -```json -{ "unloaded": true } -``` - -Returns **404 Not Found** if no plugin with that name is loaded. - -### Reload a plugin (not yet implemented) - -`PUT /{network}/slipstream/plugins/{name}` is not currently available. To update a plugin's -config during runtime, unload it with DELETE and reload it with POST. Otherwise, stop the snarkos service, update the config, and restart it, pointing at the new config. - --- ## Example: curl Commands ```bash BASE="http://localhost:3030/mainnet" -TOKEN="" # printed at startup or found in /jwt_secret_
.txt (e.g. `~/.aleo/storage/jwt_secrect_{address}.txt`) +TOKEN="" -# List +# List active plugins curl -H "Authorization: Bearer $TOKEN" "$BASE/slipstream/plugins" - -# Load -curl -X POST \ - -H "Authorization: Bearer $TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"config_file":"/path/to/plugin.json5"}' \ - "$BASE/slipstream/plugins" - -# Unload -curl -X DELETE -H "Authorization: Bearer $TOKEN" "$BASE/slipstream/plugins/postgres" ``` --- ## Notes -- Plugins are loaded in startup order and unloaded in reverse order on shutdown. -- The `on_unload` method is called on every plugin during graceful shutdown. -- Plugin errors during `notify_mapping_update` / `notify_staking_reward` are logged as warnings - and never propagated to the node — a misbehaving plugin cannot crash the node. -- The plugin manager uses a `std::sync::RwLock`; `notify_*` calls acquire a read lock, while - load/unload/reload operations acquire the write lock. Avoid long-running operations inside - plugin callbacks. +- Plugins are initialized in the order config files are provided and unloaded in reverse on shutdown. +- `on_unload` is called for every plugin during graceful shutdown. +- Errors returned from `on_broadcast` are logged as warnings and never propagated to the node — + a misbehaving plugin cannot affect consensus. +- To update a plugin's config, stop the node, update the config file, and restart. diff --git a/node/Cargo.toml b/node/Cargo.toml index 5e8de8d693..6da9b43666 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -38,9 +38,14 @@ metrics = [ "snarkos-node-router/metrics", "snarkos-node-tcp/metrics" ] -history = [ "snarkos-node-rest/history", "snarkvm/history" ] -history-staking-rewards = [ "snarkos-node-rest/history-staking-rewards", "snarkvm/history-staking-rewards" ] -slipstream-plugins = [ "snarkos-node-rest/slipstream-plugins", "snarkvm/slipstream-plugins" ] +history = [ "snarkos-node-rest/history" ] +history-staking-rewards = [ "snarkos-node-rest/history-staking-rewards" ] +slipstream-plugins = [ + "snarkvm/slipstream-plugins", + "dep:slipstream-plugin-postgres", + "dep:json5", + "dep:inventory", +] telemetry = [ "snarkos-node-bft/telemetry", "snarkos-node-consensus/telemetry", "snarkos-node-rest/telemetry" ] cuda = [ "snarkvm/cuda", @@ -139,6 +144,19 @@ workspace = true [dependencies.snarkvm] workspace = true +[dependencies.slipstream-plugin-postgres] +git = "ssh://git@github.com/ProvableHQ/slipstream-plugin-postgres.git" +rev = "0cafd01966" +optional = true + +[dependencies.json5] +version = "0.4" +optional = true + +[dependencies.inventory] +version = "0.3" +optional = true + [dependencies.time] workspace = true diff --git a/node/rest/src/lib.rs b/node/rest/src/lib.rs index 4081d5c1b8..ed54b3021e 100644 --- a/node/rest/src/lib.rs +++ b/node/rest/src/lib.rs @@ -150,7 +150,7 @@ impl, R: Routing> Rest { fn build_routes(&self, rest_rps: u32) -> axum::Router { let cors = CorsLayer::new() .allow_origin(Any) - .allow_methods([Method::GET, Method::POST, Method::DELETE, Method::OPTIONS]) + .allow_methods([Method::GET, Method::POST, Method::OPTIONS]) .allow_headers([CONTENT_TYPE]); // Prepare the rate limiting setup. @@ -182,12 +182,7 @@ impl, R: Routing> Rest { // Slipstream plugin management endpoints require auth. #[cfg(feature = "slipstream-plugins")] let auth_routes = auth_routes - .route("/slipstream/plugins", get(Self::slipstream_list_plugins).post(Self::slipstream_load_plugin)) - .route( - "/slipstream/plugins/{name}", - // TODO: PUT (reload) is not yet implemented. - axum::routing::delete(Self::slipstream_unload_plugin), - ); + .route("/slipstream/plugins", get(Self::slipstream_list_plugins)); let routes = axum::Router::new() .merge(auth_routes.route_layer(middleware::from_fn(auth_middleware))) diff --git a/node/rest/src/routes.rs b/node/rest/src/routes.rs index 620e85adaf..c54a56b271 100644 --- a/node/rest/src/routes.rs +++ b/node/rest/src/routes.rs @@ -1213,71 +1213,6 @@ impl, R: Routing> Rest { Ok((StatusCode::OK, ErasedJson::pretty(plugins))) } - /// POST /{network}/slipstream/plugins - #[cfg(feature = "slipstream-plugins")] - pub(crate) async fn slipstream_load_plugin( - State(rest): State, - Json(body): Json, - ) -> Result { - use snarkvm::slipstream_plugin_manager::slipstream_manager::SlipstreamPluginManagerError; - - let config_file = body - .get("config_file") - .and_then(|v| v.as_str()) - .ok_or_else(|| RestError::bad_request(anyhow!("Missing required field: config_file")))? - .to_owned(); - let mgr_arc = rest.ledger.vm().finalize_store().slipstream_plugin_manager(); - if mgr_arc.read().is_none() { - return Err(RestError::service_unavailable(anyhow!("No Slipstream plugin manager is installed"))); - } - let name = tokio::task::spawn_blocking(move || -> Result { - // Safety: manager is set exactly once and never cleared; verified Some above. - mgr_arc.write().as_mut().expect("plugin manager verified present").load_plugin(&config_file) - }) - .await - .map_err(|e| RestError::internal_server_error(anyhow!("Task join error: {e}")))? - .map_err(|e| match e { - SlipstreamPluginManagerError::PluginAlreadyLoaded(_) => RestError::unprocessable_entity(anyhow!("{e}")), - other => RestError::internal_server_error(anyhow!("{other}")), - })?; - Ok((StatusCode::OK, ErasedJson::pretty(serde_json::json!({ "loaded": name })))) - } - - /// DELETE /{network}/slipstream/plugins/{name} - #[cfg(feature = "slipstream-plugins")] - pub(crate) async fn slipstream_unload_plugin( - State(rest): State, - Path(name): Path, - ) -> Result { - use snarkvm::slipstream_plugin_manager::slipstream_manager::SlipstreamPluginManagerError; - - let mgr_arc = rest.ledger.vm().finalize_store().slipstream_plugin_manager(); - if mgr_arc.read().is_none() { - return Err(RestError::service_unavailable(anyhow!("No Slipstream plugin manager is installed"))); - } - tokio::task::spawn_blocking(move || -> anyhow::Result<()> { - // Safety: manager is set exactly once and never cleared; verified Some above. - mgr_arc.write().as_mut().expect("plugin manager verified present").unload_plugin(&name).map_err( - |e: SlipstreamPluginManagerError| match e { - SlipstreamPluginManagerError::PluginNotLoaded(_) => anyhow!("404: {e}"), - other => anyhow!("{other}"), - }, - ) - }) - .await - .map_err(|e| RestError::internal_server_error(anyhow!("Task join error: {e}")))? - .map_err(|e| { - let msg = e.to_string(); - if let Some(stripped) = msg.strip_prefix("404: ") { - RestError::not_found(anyhow!("{stripped}")) - } else { - RestError::internal_server_error(e) - } - })?; - Ok((StatusCode::OK, ErasedJson::pretty(serde_json::json!({ "unloaded": true })))) - } - - // TODO: PUT /{network}/slipstream/plugins/{name} (reload) is not yet implemented. } #[cfg(all(test, feature = "history"))] diff --git a/node/src/client/mod.rs b/node/src/client/mod.rs index 643676db32..6aedb23bbe 100644 --- a/node/src/client/mod.rs +++ b/node/src/client/mod.rs @@ -144,8 +144,9 @@ impl> Client { node_data_dir: NodeDataDir, trusted_peers_only: bool, dev: Option, - _slipstream_configs: &[std::path::PathBuf], signal_handler: Arc, + #[cfg(feature = "slipstream-plugins")] slipstream_plugin_configs: Vec, + #[cfg(not(feature = "slipstream-plugins"))] _slipstream_plugin_configs: Vec, ) -> Result { // Initialize the ledger. let ledger = { @@ -156,15 +157,24 @@ impl> Client { } .with_context(|| "Failed to initialize the ledger")?; - // Initialize the Slipstream plugin manager (if any config files were provided). + // Initialize slipstream plugins (if any are configured). #[cfg(feature = "slipstream-plugins")] - if !_slipstream_configs.is_empty() { - let manager = - snarkvm::slipstream_plugin_manager::SlipstreamPluginManager::from_config_files(_slipstream_configs) - .context("Failed to initialize Slipstream plugin manager")?; + if !slipstream_plugin_configs.is_empty() { + let mut manager = snarkvm::slipstream_plugin_manager::SlipstreamPluginManager::new(); + for config_path in &slipstream_plugin_configs { + let raw = std::fs::read_to_string(config_path) + .with_context(|| format!("Failed to read slipstream config {config_path:?}"))?; + let val: serde_json::Value = json5::from_str(&raw) + .with_context(|| format!("Invalid JSON5 in slipstream config {config_path:?}"))?; + let plugin = crate::build_static_slipstream_plugin(&val).ok_or_else(|| { + let name = val.get("name").and_then(|v| v.as_str()).unwrap_or(""); + anyhow::anyhow!("Unknown static slipstream plugin '{name}' in {config_path:?}") + })?; + manager + .register(plugin, config_path) + .map_err(|e| anyhow::anyhow!("Failed to register slipstream plugin: {e}"))?; + } ledger.vm().finalize_store().set_slipstream_plugin_manager(manager); - let num_plugins = _slipstream_configs.len(); - tracing::info!(target: "slipstream", "Slipstream plugin manager registered ({num_plugins} plugin(s))"); } // Initialize the ledger service. diff --git a/node/src/lib.rs b/node/src/lib.rs index fd67d4ee65..bedf68fa6a 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -50,6 +50,27 @@ pub use node::*; mod traits; pub use traits::*; +/// Returns a boxed static slipstream plugin instance for the given config, or +/// `None` if the plugin name is not recognized. +/// +/// The config is already parsed from the JSON5 file; the `name` field selects +/// the plugin to instantiate. Plugins self-register via `inventory::submit!` at +/// link time — no per-plugin code is needed here. +// Force the linker to include each plugin crate so their inventory::submit! +// registrations are not dead-stripped from the final binary. +#[cfg(feature = "slipstream-plugins")] +extern crate slipstream_plugin_postgres; + +#[cfg(feature = "slipstream-plugins")] +pub(crate) fn build_static_slipstream_plugin( + config: &serde_json::Value, +) -> Option> +{ + use snarkvm::slipstream_plugin_interface::slipstream_plugin_interface::PluginRegistration; + let name = config.get("name").and_then(|v| v.as_str())?; + inventory::iter::().find(|r| r.name == name).map(|r| (r.factory)()) +} + use aleo_std::StorageMode; /// A helper to log instructions to recover. diff --git a/node/src/node.rs b/node/src/node.rs index b5c74cd576..3fd18d6db6 100644 --- a/node/src/node.rs +++ b/node/src/node.rs @@ -98,9 +98,9 @@ impl Node { auto_db_checkpoints: Option, dev_txs: bool, dev: Option, - slipstream_configs: &[PathBuf], dev_num_validators_for_committee_hotswap: Option, signal_handler: Arc, + slipstream_plugin_configs: Vec, ) -> Result { let validator = Arc::new( Validator::new( @@ -118,9 +118,9 @@ impl Node { trusted_peers_only, dev_txs, dev, - slipstream_configs, dev_num_validators_for_committee_hotswap, signal_handler, + slipstream_plugin_configs, ) .await?, ); @@ -177,8 +177,8 @@ impl Node { trusted_peers_only: bool, auto_db_checkpoints: Option, dev: Option, - slipstream_configs: &[PathBuf], signal_handler: Arc, + slipstream_plugin_configs: Vec, ) -> Result { let client = Arc::new( Client::new( @@ -193,8 +193,8 @@ impl Node { node_data_dir, trusted_peers_only, dev, - slipstream_configs, signal_handler, + slipstream_plugin_configs, ) .await?, ); diff --git a/node/src/validator/mod.rs b/node/src/validator/mod.rs index c6714b2c23..51dea77e1c 100644 --- a/node/src/validator/mod.rs +++ b/node/src/validator/mod.rs @@ -92,10 +92,11 @@ impl> Validator { trusted_peers_only: bool, dev_txs: bool, dev: Option, - _slipstream_configs: &[std::path::PathBuf], #[cfg(feature = "test_network")] dev_num_validators_for_committee_hotswap: Option, #[cfg(not(feature = "test_network"))] _dev_num_validators_for_committee_hotswap: Option, signal_handler: Arc, + #[cfg(feature = "slipstream-plugins")] slipstream_plugin_configs: Vec, + #[cfg(not(feature = "slipstream-plugins"))] _slipstream_plugin_configs: Vec, ) -> Result { // Initialize the ledger. let ledger = { @@ -106,15 +107,24 @@ impl> Validator { } .with_context(|| "Failed to initialize the ledger")?; - // Initialize the Slipstream plugin manager (if any config files were provided). + // Initialize slipstream plugins (if any are configured). #[cfg(feature = "slipstream-plugins")] - if !_slipstream_configs.is_empty() { - let manager = - snarkvm::slipstream_plugin_manager::SlipstreamPluginManager::from_config_files(_slipstream_configs) - .context("Failed to initialize Slipstream plugin manager")?; + if !slipstream_plugin_configs.is_empty() { + let mut manager = snarkvm::slipstream_plugin_manager::SlipstreamPluginManager::new(); + for config_path in &slipstream_plugin_configs { + let raw = std::fs::read_to_string(config_path) + .with_context(|| format!("Failed to read slipstream config {config_path:?}"))?; + let val: serde_json::Value = json5::from_str(&raw) + .with_context(|| format!("Invalid JSON5 in slipstream config {config_path:?}"))?; + let plugin = crate::build_static_slipstream_plugin(&val).ok_or_else(|| { + let name = val.get("name").and_then(|v| v.as_str()).unwrap_or(""); + anyhow::anyhow!("Unknown static slipstream plugin '{name}' in {config_path:?}") + })?; + manager + .register(plugin, config_path) + .map_err(|e| anyhow::anyhow!("Failed to register slipstream plugin: {e}"))?; + } ledger.vm().finalize_store().set_slipstream_plugin_manager(manager); - let num_plugins = _slipstream_configs.len(); - tracing::info!(target: "slipstream", "Slipstream plugin manager registered ({num_plugins} plugin(s))"); } // Initialize the ledger service.