diff --git a/Cargo.lock b/Cargo.lock index a3dc900..4489abf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,18 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.5" @@ -19,7 +31,7 @@ dependencies = [ [[package]] name = "aleo-devnode" -version = "0.3.0" +version = "0.4.0" dependencies = [ "aleo-std-storage", "anyhow", @@ -45,9 +57,9 @@ dependencies = [ [[package]] name = "aleo-std" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869be259eeb00852087ad36e9a68c67959c2811dc8fc6c680fcac98948c4f172" +checksum = "d7c26e03c99bac238b3454ec6c654bc066a0e4e7eae00608ec76c2279bc8f2cf" dependencies = [ "aleo-std-cpu", "aleo-std-profiler", @@ -60,21 +72,21 @@ dependencies = [ [[package]] name = "aleo-std-cpu" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9881417111e9266cf47bb2fec0e7ef32454fa2ac05763a48f25c1d50f260e1b9" +checksum = "835cb3594485055c842d6a8992141aada6c290649d6d9a12c3156ec91806c209" [[package]] name = "aleo-std-profiler" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d53500befe6ecd23f8fc11ccf510b680516b3a6aff08d60f12e1dda00b77787" +checksum = "64476704cd7d71c43623839197bea87e477cfa03006853328fd5c9e07d8f48cc" [[package]] name = "aleo-std-storage" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f6571ae16ee20c1e9a95b6ba685ca7156d519400f597c5e59f53b641637225" +checksum = "67efc024835a2e9c648b300c2fac67856d3f99897e4cb02a710cdf2842ed72e9" dependencies = [ "dirs", "tempfile", @@ -82,9 +94,9 @@ dependencies = [ [[package]] name = "aleo-std-time" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ebd144c81671193ed85aa2db9bb5e183421843e0485de8fffc07e5cf50e18a" +checksum = "61a095fa7b4400ec1de315603c16c1084ece0b7926cbb0333a1ba115732fc35b" dependencies = [ "proc-macro2", "quote 1.0.47", @@ -93,9 +105,9 @@ dependencies = [ [[package]] name = "aleo-std-timed" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f6ff9e4c36858fa2c29e5284b77527b5a7466743976e1ba1f5824e16683545" +checksum = "a77792a0cf06cc8efdabf5cb355a2f1e9172ae3ab5d30147ff440e1c9e8a03d0" dependencies = [ "proc-macro2", "quote 1.0.47", @@ -104,9 +116,9 @@ dependencies = [ [[package]] name = "aleo-std-timer" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12aca1021aef2c476bad30d2f681e891b2be4f07dbc230a96df09cb693bfb3cb" +checksum = "d9fbc20b310af70d896f74cdccc2f12b5d6d9cd7edea5abfd823038279703b30" [[package]] name = "allocator-api2" @@ -422,12 +434,6 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.12.1" @@ -1221,15 +1227,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -3084,9 +3081,9 @@ dependencies = [ [[package]] name = "snarkvm" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234b5b08ce096d004ca1ef881cf6e1d4611e6461a3ea56fec523ca4f80a7d6c8" +checksum = "fd795694fbefcc6ff1ce79db91e5c1c970cef74ad9a0e5789251eed087dac48e" dependencies = [ "anyhow", "dotenvy", @@ -3100,20 +3097,19 @@ dependencies = [ "snarkvm-synthesizer", "snarkvm-utilities", "ureq", - "walkdir", ] [[package]] name = "snarkvm-algorithms" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c605020960fd2c06f921973fcac92bec594fc2bcc7a20a17392dae9c059f3040" +checksum = "d4ced171e99752ee5869fafbb7baae11a4f576f90989e7bbfd7051c89cd3e3f7" dependencies = [ + "ahash", "aleo-std", "anyhow", "blake2", "cfg-if", - "fxhash", "hashbrown 0.15.5", "hex", "indexmap", @@ -3133,9 +3129,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b99a80884dce9e72770fa16d71c4b3cc0e0ff3d54bcf140c29fda86961d418" +checksum = "a7ab595105044a2048dc74bef0a44cc96c7150e146775b31e51244c42150c6bd" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -3148,9 +3144,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2598cf3ed064568821ecc4fbdb95447c2ccf1915aae0c7ff5ee0037de27318bf" +checksum = "a287171f1b36e89b4d2b2281bfb1f608cbd4ee0fb2cb9f51a8feec7296fae5c0" dependencies = [ "snarkvm-circuit-network", "snarkvm-circuit-types", @@ -3159,9 +3155,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "892563fe5ead3638cf08b004718216e814bfc3b7f5586af3e619235a126131cd" +checksum = "407af5ecb720c8f4edc581cbb82ac0c25c8383566b7a6291969f6d06637b0b7a" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -3170,9 +3166,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f729b2573de7ee30fedb8d78b9d05e6846f4e829afe9f8f0e0390fb90b771007" +checksum = "15f7cce936bd4d4fa320f3cb1de047d1eba7ac679d23d9ea013e9ea144baa6ce" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -3181,9 +3177,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b35b01a58379d03eb005d584110ce42a38f472faea3a756db9b1a917a35d8a3" +checksum = "4fe3ff74f3b0f8a76cc5ffabea7a187a626d6d36785e15b9a8ead99c0d630341" dependencies = [ "anyhow", "indexmap", @@ -3202,15 +3198,15 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776abdace810bb9d10064c83f4d49c22c160d29206ae39182e7b91df187036fa" +checksum = "e0e3a4fdb6bcd2050dbcb006c71d5f9e455f18e149b2f3bca056cb40176a95b8" [[package]] name = "snarkvm-circuit-network" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bd83480f27d3d032a467b4c6ff39253e28150a2fe7cdd3a90911c55ab25612" +checksum = "844726c79f7ac08f5953da6609722a329da9f83b2579396939a88110ebf61d0b" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -3220,9 +3216,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c0bf9eb1121b940d88302eb936c552d8257a90620230b11e50c11ac687a914" +checksum = "5ff3af1b7dfc9f8d7cfc817d857c59cb5685160d74be20452347503612f15052" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -3235,9 +3231,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a7fc169b567e91f961d45786ba259214631f7f4b33b6f51805eae51db604c4" +checksum = "7634f55e4e8b320c7b229ec3c0d924531d3f01557e17f269bf707c4945890b96" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -3251,9 +3247,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a52f7ff50d7e5e803cad3686e65d370af63ac3f4161bbbb44c8fddd4aefde533" +checksum = "30d1c9980a5dad5e753923452afab007203a790291315dad3dd230e59652d2f2" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3265,9 +3261,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1724845c17261565a48fa95333021392fd7754de99b10bf1c3f070f04e34415e" +checksum = "3c87a6469761f8a136bc790c33ffba97d8da5546996bab75f9e43d6bcd87bfb3" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -3275,9 +3271,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48a129a22841af1f5d9d0eb8f87631b42342ca46f7b715425b7695243d2c05" +checksum = "e0d3e855179dcc88bd4f2295463bc5a214515da9713edcb7b44baacda5f0186e" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3286,9 +3282,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b58025b820772f56c98a181e02ce1d6d1f1d7ec4417e99c1b7da44c2bd0a0a8" +checksum = "1c96ad7e42a76fbe207c0ed592f40613b31517e587d5b2405ae03919fad745fe" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3299,9 +3295,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629904982ec86b215d7aa0c2e2c6734174221d1016f03207016b235092373273" +checksum = "c1c16e92770014c651f5c795719186fd6de6d265092fcaa0d52ce1369c782e7d" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3312,9 +3308,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b293c3baa943a748cc31750f90698f7b1fa424b81b12a45824940e169286f1" +checksum = "4be015329a4c8826e5afa9a73dc41e72edfe9dd688b689c94b0b3e05467fff13" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3324,9 +3320,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167a377fe206d26847dc06923d024e6b8a498705d7fad8c702ba417aa5d4321b" +checksum = "e5fee38d08f13acafa8cfadf52106bdb2b5e28e9407f38f860d5f799eb5e4adf" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3337,9 +3333,9 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6992b369b610f77283b724dc500c63c17ac8ca698ea885a049da25508a43d7dc" +checksum = "6ec0c861d670152e50b7a14d73de28f9abd8793abdaf18f3897266957f5b9542" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -3351,9 +3347,9 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1ec666ac895bbfdc9817cd9f2f4aa54cb88022df58aed2e61ab6091dcb9acb" +checksum = "d1da71ef12e3e0a074538535877b6d33c10d4a7f9ff565a70a02e32b5cbb50df" dependencies = [ "bs58", "snarkvm-console-network", @@ -3363,9 +3359,9 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524a6dfc87137561d70255fe87137ba1e9fa10f3aef981e6c140155cb021a309" +checksum = "a1420cc3003f2d9e56ab556ac53ea1ef800ba84741bb08c64b09a78d6c5bf5b4" dependencies = [ "blake2s_simd", "hex", @@ -3381,9 +3377,9 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0232bd60bbfaba4d0ba4899d6e3fd9831ab7523788637742d25e17498642bea4" +checksum = "aee81e41a369472a4533473ed3f5fcc6ca39ef2f979753ad3046c039a7c2826a" dependencies = [ "aleo-std", "parking_lot", @@ -3395,9 +3391,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0255f577f91facf2f6f7b82e0259f37555a4a62d027c1ce70ef5af1c9ff6255f" +checksum = "0a07ac7c51c0ab88036b98145d8db30f0d483e39ae862c15d032b77c9fc2a30b" dependencies = [ "anyhow", "enum-iterator", @@ -3416,9 +3412,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f45305a1a428c1277fab0ebcdb2c94535f746562be798b48090cf0524346af9" +checksum = "57bf56e4f47917b318ca4b5336d0904c921d0c5a97282e0629a46e9784860394" dependencies = [ "anyhow", "bech32", @@ -3435,9 +3431,9 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40edbbad1e231ea27a1468c16700dc1199b56e988feb08b92791515993a8e7d" +checksum = "cfb4f99937ac85a9f7b6199cda277b1c7542f7d150fe16e2d5537d49fe238c03" dependencies = [ "enum-iterator", "enum_index", @@ -3457,9 +3453,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46505c95db8e2f2f84fe9d3587b93def234e1f0896a543e4b4241df095008ae7" +checksum = "61b54d340a19e818026e74e07f665ece04d7e6db43e0db260fbbda0b907a5670" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -3473,9 +3469,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df528e831c8af771c9ffaabda969854aac14ce176d8980a39ddf9c11f3121c1a" +checksum = "8b08dcfc33c165a22ad093de94db6b8e4609ce94de2827bace8b15426c4ad9c3" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3485,18 +3481,18 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45297adc35931dfb421fc450e154d93f62bda470882327bd145c78704048bd0c" +checksum = "377d096db65e8503f4311a48e73ba1f92f0130f78710b7b85156a13af726d9d8" dependencies = [ "snarkvm-console-network-environment", ] [[package]] name = "snarkvm-console-types-field" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cca53b3ceb065a72e91641aa7678adedbc817a19ba9db2459905184c83cfcc8" +checksum = "17b40ccfacafbf0ea28f15dc7e235e5019e4f530064806462c098c4d11d299ea" dependencies = [ "smallvec", "snarkvm-console-network-environment", @@ -3506,9 +3502,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b6b4f01a789d8eb0167af3e7a9cca1893f862e137cec2ec77b13c606c2d0c0" +checksum = "c7bc5617a8a200a2ee98651df587fde366f0cad0f04f19922088fb581ec96aff" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3518,9 +3514,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c72ace9dd65e40d223c5ccf5ca967c191fd19cd006bd71c8e36721f0b5546a" +checksum = "51bff0480009e12c335e710a776408102fc70d6877d34f5bb3b6145d80f8afab" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3530,9 +3526,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455e278861a573234b24974df3335dc724d8078782175b42e79b9d0116456def" +checksum = "1ffdde112ca999d9dbd9c343280ca3b9f69296e979b00371a165066f464a06d2" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3542,9 +3538,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2637b3581c5e2791985524f0e5b78eb5cb68508fa553dc39306307258b3b686b" +checksum = "2a5f9cfdad4243d694940a8f25f412aae103b81a07d4085c3d894c506340d4e1" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3554,12 +3550,11 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e067c483f1a8e3450aea5577994d7a6dfd29025dc4336f4338899375db0501c1" +checksum = "be3e4d256abd2eb1e87d06c8fbf055a423ea5a68525f45d638670c0c6503f338" dependencies = [ "rand 0.10.3", - "rustc_version", "serde", "snarkvm-fields", "snarkvm-utilities", @@ -3568,9 +3563,9 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e25f2ff7bb31ae6c2e8c172fa630f5e1b9caaa496c518d820e9d4bae0503e19" +checksum = "52053a4cbbca92d9849e62fcd022892bd7ecd4d462dcb7253fbdd78bf0fb719e" dependencies = [ "aleo-std", "anyhow", @@ -3586,9 +3581,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0742ed199ee0a58e8deec106d1554a2bff94c926127ffcd00bc6bd9595392570" +checksum = "05b9f49ed211c70f7dd0ab73956b916a77503ae1ee90c2314186ba201a095d24" dependencies = [ "aleo-std", "anyhow", @@ -3617,9 +3612,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d28b82c5fe07b49191f21fb3ac397ecd02dd4b6838abf00bbe615841a2399a1" +checksum = "38f52f93d27bc0716eb1434746f312ee6e33a77b8256be24c91033235435681a" dependencies = [ "anyhow", "rand 0.10.3", @@ -3630,9 +3625,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b3c7d57a3694f4c109b3cf0d695e4c257a01016c4361bb375fa6a91b06c65d" +checksum = "9845e51a239c1e5034c719c4200ec0691fd2da0baa3372444ba30a0d74ee17fe" dependencies = [ "anyhow", "indexmap", @@ -3655,9 +3650,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6c7e7a3c6a23b5db248ebbd3abb99e53d9f886b73c5cbac6f6ab5d57e0588b9" +checksum = "97f600c46d4c342acba7cf7fe77d984c0876963adffddd18cd0ddf8e3c1485b1" dependencies = [ "indexmap", "rayon", @@ -3668,9 +3663,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "178b297168ef860e0478121128827d87b937725c568cf465c1d5fa2035066698" +checksum = "67f4c6be52bc1f2cd9c73080deb117264b6a2017dc0400cc32707f4e734c398a" dependencies = [ "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-header", @@ -3682,9 +3677,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b334acf3f8ed707f3ce1746ac73ef95f28f4ef1bafb24c8f0f3685b6874acf9" +checksum = "709f119b3fd9594ed3d772ecef830d15577a5b1d037ae0b0281d575c6c52cb44" dependencies = [ "indexmap", "rayon", @@ -3696,9 +3691,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9654ccbc21fe731ee6fe18c7104a055e10dca2a064480291d89867503d1610" +checksum = "9bdd8a444f8cc0e873604fbe291ace2f34c0b422ae9c2b39b292537c3374715d" dependencies = [ "indexmap", "rayon", @@ -3709,9 +3704,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5161ac69974153850a3d4cc58ab919d7dbb550d96f9f9569f879a400a4ef4dd5" +checksum = "29fb406568d65ece9bd85e17e07d67f37ef5d3df243cd5a26a77e7baa6b3d41e" dependencies = [ "bytes", "serde_json", @@ -3721,9 +3716,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5adc331890704d7bb91698b0c4deee0773518f188e5c4f2baefbbc6f738589" +checksum = "6081996054f7c60d9d214b39609fbfb6f50e521b80a71b5fdc9e85a9a9ade188" dependencies = [ "indexmap", "rayon", @@ -3737,9 +3732,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ce6e659433ddc53ff6c50b227f1591113f18dec75f10da8580ec89f91cded" +checksum = "d416c31f6d62df91d088d09f93328636d76b05b2fc72bb964cb0ed2d2f7b638c" dependencies = [ "bytes", "serde_json", @@ -3751,9 +3746,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2326cdc6c1743434aae590f17a29344929d37ee8fd4bedbd52ac8b2151ed5fa5" +checksum = "de45d1924310af68c6bb224e98bc9863be13a8c939d439e6820e9e7cf1d61669" dependencies = [ "snarkvm-console", "snarkvm-ledger-puzzle", @@ -3761,9 +3756,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b430ac8eea1255f588f198973ebfe75f637049b71e7c9b9b5dfd315f3d39e17" +checksum = "8c2aead2c8c7c373d5c3560bccbbecd639c4a2400214e201c7c7b902caa0aeac" dependencies = [ "aleo-std", "anyhow", @@ -3782,9 +3777,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-puzzle-epoch" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbaff32c5ab7f413f590732dba1c9a07656e2b13fad9ac7020b69e326b7efc86" +checksum = "cde9d3a06d7d8e57820d986e1bd9ba903a86f8add4f08825f5dcfad64d212292" dependencies = [ "aleo-std", "anyhow", @@ -3805,9 +3800,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc28b884ec34f6adea2f7648bdf414fad4bb5c9075b05868398306e7eb699ea" +checksum = "c744136415e7acf8f4bea673346c8dedf44368b0be1123fa39c3aaa0c7420f67" dependencies = [ "anyhow", "async-trait", @@ -3823,9 +3818,9 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0660353ec7b10ca3b7aa2bb10abdf49044ae049e4df045da11026ca4c4956d53" +checksum = "59805380f1b728a8a55a2f046194c529d471631db46db1b67a4bad5fe238b956" dependencies = [ "aleo-std-storage", "anyhow", @@ -3851,9 +3846,9 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5b831d9feb2da7ff96be1ae05d5f0e8f4018e2ef895ea14d4eee4773f528c0" +checksum = "4ec5d0d584e4d225e92492f76733a4f57d573f1190c157ee6c12d147b26bbee2" dependencies = [ "aleo-std", "anyhow", @@ -3874,9 +3869,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a5d5e010df257122387f535ddaf648b68ddfd555a715bf83372c9981d117a1d" +checksum = "704aa853644e6c2d4f50b77f168d0ef4a4a3271d8ef1334549d8eccad6b76cbe" dependencies = [ "aleo-std", "anyhow", @@ -3886,6 +3881,7 @@ dependencies = [ "parking_lot", "rand 0.10.3", "rayon", + "serde", "serde_json", "snarkvm-algorithms", "snarkvm-circuit", @@ -3910,9 +3906,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-error" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c713e221f1a9dfb131862729ddf49f02147d14bb27a8f1f533b81c49748576d7" +checksum = "3ccd40ba6005f1a756badb7c2b8f0de5ea7b50f95b4421fcaa51d4822bf27ed0" dependencies = [ "anyhow", "snarkvm-circuit-environment", @@ -3923,9 +3919,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7ae176623039b2dd3304dd645c9aa231cb310784fbbf1f08fa2a13c3304b42" +checksum = "48fd18ea15a024419e9096de25a0926d563abaa9d01646fd495a16d602206075" dependencies = [ "aleo-std", "colored", @@ -3950,9 +3946,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae72cc1a3b3dd05cece0635c5b73b854de3f51db10ec1c0c0e28ec61e0e0400d" +checksum = "add22caff25f1239b5ef2d74255172f2f0d72c20fa213b42d4bc9ea50043e76e" dependencies = [ "enum-iterator", "indexmap", @@ -3972,9 +3968,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea353b8ec0cfa129f998dc4f7d553b0b27608ab715ca7bb8e569eebad8335e58" +checksum = "a07bea5e35742c63ede2b959ad66565a114654238b7f6ae60e862d42cadd1581" dependencies = [ "bincode", "serde_json", @@ -3986,9 +3982,9 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2269d32fbd350808a0dc97f54ecbd82a12c7a81088997471e1fcafc84214e80" +checksum = "b9430213c74c633a2b6f4839c56d903693b404c149241ed0949c49b25355d8b8" dependencies = [ "aleo-std", "anyhow", @@ -4010,13 +4006,13 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e81d3351f48ef6692f87790298c125fc79a5a4ea99db47c8c4674560d0fe9f" +checksum = "3352df769e44f2624fa3f9196a6faf55bf34ae7d1b47a4e1b0377033d8578290" dependencies = [ "proc-macro2", "quote 1.0.47", - "syn 2.0.119", + "syn 3.0.6", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bc0c5e4..b0473a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleo-devnode" -version = "0.3.0" +version = "0.4.0" edition = "2021" [[bin]] @@ -8,7 +8,7 @@ name = "aleo-devnode" path = "src/main.rs" [dependencies] -aleo-std-storage = { version = "1.0.3", default-features = false } +aleo-std-storage = { version = "1.0.4", default-features = false } anyhow = "1.0" axum = "0.8" axum-extra = { version = "0.12", features = ["erased-json"] } @@ -21,7 +21,7 @@ reqwest = { version = "0.13", features = ["blocking", "json"] } self_update = { version = "0.41.0", features = ["archive-zip", "compression-zip-deflate"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -snarkvm = { version = "4.11.0", features = ["rocks", "test_consensus_heights", "dev_skip_checks", "test_targets", "history"] } +snarkvm = { version = "4.12.0", features = ["rocks", "test_consensus_heights", "dev_skip_checks", "test_targets"] } tokio = { version = "1.52.3", features = ["full"] } tower-http = { version = "0.6.10", features = ["cors", "trace"] } tower_governor = "0.8" diff --git a/docs/rest-api.md b/docs/rest-api.md index 18b8b02..ba1a674 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -24,6 +24,7 @@ Important endpoint families include: - Blocks: `/block/height/latest`, `/block/latest`, `/block/{height_or_hash}`, `/block/create` - Transactions: `/transaction/broadcast`, `/transaction/{id}`, confirmed and unconfirmed lookups - Programs and mappings: `/program/{id}`, `/program/{id}/mapping/{name}/{key}`, `/program/{id}/mapping/{name}` +- View functions: `POST /program/{id}/view/{function}` evaluates against the latest state. `POST /program/{id}/view/{function}/{height}` only accepts the latest height; any other height is an error (404 under `/v2`, a plain-string 500 under the legacy prefixes — see Route Prefixes) because snarkVM 4.12.0 removed the `history` feature and the per-height mapping record that historical view evaluation relied on. - State and find helpers: `/stateRoot/latest`, `/statePath/{commitment}`, `/find/...` - Devnode controls: `/transaction/broadcast`, `/block/create`, `/snapshot`, `/snapshots`, `/shutdown` diff --git a/src/rest/routes.rs b/src/rest/routes.rs index 3fcd9e5..64e83b6 100644 --- a/src/rest/routes.rs +++ b/src/rest/routes.rs @@ -7,7 +7,7 @@ use super::*; use crate::restore::snapshots_sibling_dir; use snarkvm::{ - ledger::narwhal::BatchHeader, + ledger::authority::Authority, prelude::{ Block, ConsensusVersion, Deployment, Identifier, LimitedWriter, Plaintext, Program, ToBytes, Transaction, VM, Value, @@ -34,30 +34,14 @@ fn ledger_err(err: anyhow::Error) -> RestError { } /// Returns the spend and synthesis limits for a minimally dense beacon block. +/// +/// Since snarkVM 4.12.0 the ledger applies these limits itself when it prepares and verifies beacon blocks +/// (`Subdag::min_spend_limit` / `Subdag::min_synthesis_limit`). The devnode still filters candidates up front so +/// that it can report every aborted transaction ID in a single pass. fn beacon_block_limits(block_height: u32) -> anyhow::Result<(Option, Option)> { - let consensus_version = N::CONSENSUS_VERSION(block_height)?; - let max_certificates = active_consensus_value(&N::MAX_CERTIFICATES, consensus_version) - .map(u64::from) - .ok_or_else(|| anyhow!("Missing MAX_CERTIFICATES for consensus version {consensus_version}"))?; - // Match snarkVM PR #3350. A minimal subdag has two rounds. Each round has an availability threshold of - // ceil(MAX_CERTIFICATES / 3), so this is not ceil(2 * MAX_CERTIFICATES / 3). - let min_certificates = max_certificates.saturating_add(2).saturating_div(3).saturating_mul(2); - - let spend_limit = if consensus_version >= ConsensusVersion::V16 { - Some(min_certificates.saturating_mul(BatchHeader::::batch_spend_limit(block_height))) - } else { - None - }; - let v19_height = N::CONSENSUS_HEIGHT(ConsensusVersion::V19)?; - let synthesis_limit = if consensus_version >= ConsensusVersion::V18 && block_height <= v19_height { - let synthesis_per_round = 5_f64 * N::SYNTHESIS_PER_SECOND_OF_RUNTIME as f64; - let synthesis_per_certificate = synthesis_per_round / max_certificates as f64; - Some((synthesis_per_certificate * min_certificates as f64) as u64) - } else { - None - }; - - Ok((spend_limit, synthesis_limit)) + // Fail early with a clear error if the height is not covered by the consensus height table. + N::CONSENSUS_VERSION(block_height)?; + Ok(Authority::::beacon_limits(block_height)) } /// Returns the value that applies at the given consensus version. @@ -194,7 +178,7 @@ fn extend_snarkvm_aborted_transaction_ids( Ok(()) } -/// Prepares a beacon block and enforces the limits that snarkVM skips for beacon blocks. +/// Prepares a beacon block, filtering out transactions that exceed the beacon block limits up front. fn prepare_beacon_block_with_limits, R: rand::Rng + rand::CryptoRng>( ledger: &Ledger, private_key: &PrivateKey, @@ -960,7 +944,14 @@ impl> Rest { /// POST /{network}/program/{id}/view/{functionName}/{height} /// - /// Evaluates a view function against the ledger state at the given block `height`. + /// Evaluates a view function at the given block `height`, which must be the latest height. + /// + /// snarkVM 4.12.0 removed the `history` feature and with it the per-height mapping record that + /// `VM::evaluate_view_at_height` evaluated against, so views at a past height can no longer be served + /// (snarkOS answers this route with 404 in its history compatibility mode). The route is kept so that + /// clients which first read `/block/height/latest` and then pass that height keep working; any other + /// height is a 404 that points at the latest-height route (the legacy `/{network}` and `/v1/{network}` + /// prefixes flatten it to a 500, as they do every error). pub(crate) async fn evaluate_view( State(rest): State, Path((program_id, view_name, height)): Path>, @@ -973,42 +964,40 @@ impl> Rest { let inputs = parse_view_inputs(&raw_inputs)?; - let outputs = match tokio::task::spawn_blocking(move || { - rest.ledger.vm().evaluate_view_at_height(program_id, view_name, inputs, height) - }) - .await - { - Ok(Ok(outputs)) => outputs, - Ok(Err(err)) => { - return Err(RestError::bad_request( - err.context(format!("Failed to evaluate view '{view_name}' for '{program_id}' at height {height}")), - )); - } - Err(err) => return Err(RestError::internal_server_error(anyhow!("Tokio error: {err}"))), + let height_unavailable = |latest_height: u32| { + RestError::not_found(anyhow!( + "Cannot evaluate '{program_id}/{view_name}' at height {height}: since snarkVM 4.12.0 views can only \ + be evaluated at the latest height, which is {latest_height}; use POST \ + /{{network}}/program/{program_id}/view/{view_name} (same prefix, no height) for the latest height" + )) }; + // Reject heights that are already known not to be the latest without evaluating anything. + let latest_height = rest.ledger.latest_height(); + if height != latest_height { + return Err(height_unavailable(latest_height)); + } + + // The ledger may have advanced between the check above and the evaluation (auto block creation runs + // on every broadcast), so only answer if the evaluated height is the one that was asked for. + let (outputs, evaluated_height) = + Self::evaluate_view_at_latest_height(rest, program_id, view_name, inputs).await?; + if evaluated_height != height { + return Err(height_unavailable(evaluated_height)); + } let output_strings: Vec = outputs.iter().map(|v| v.to_string()).collect(); Ok(ErasedJson::new(output_strings)) } - /// POST /{network}/program/{id}/view/{functionName} - /// - /// Evaluates a view function against the ledger state at the latest block height. - pub(crate) async fn evaluate_view_latest( - State(rest): State, - Path((program_id, view_name)): Path<(ProgramID, Identifier)>, - metadata: Query, - json_result: Result>, JsonRejection>, - ) -> Result { - let Json(raw_inputs) = match json_result { - Ok(json) => json, - Err(err) => return Err(RestError::unprocessable_entity(anyhow!("Invalid request body: {err}"))), - }; - - let inputs = parse_view_inputs(&raw_inputs)?; - - let (outputs, height) = match tokio::task::spawn_blocking(move || { + /// Evaluates a view function against the latest ledger state, returning the outputs and the height used. + async fn evaluate_view_at_latest_height( + rest: Self, + program_id: ProgramID, + view_name: Identifier, + inputs: Vec>, + ) -> Result<(Vec>, u32), RestError> { + match tokio::task::spawn_blocking(move || { let block = rest.ledger.latest_block(); let height = block.height(); @@ -1032,15 +1021,31 @@ impl> Rest { }) .await { - Ok(Ok(result)) => result, - Ok(Err(err)) => { - return Err(RestError::bad_request(err.context(format!( - "Failed to evaluate view '{view_name}' for '{program_id}' at the latest height" - )))); - } - Err(err) => return Err(RestError::internal_server_error(anyhow!("Tokio error: {err}"))), + Ok(Ok(result)) => Ok(result), + Ok(Err(err)) => Err(RestError::bad_request( + err.context(format!("Failed to evaluate view '{view_name}' for '{program_id}' at the latest height")), + )), + Err(err) => Err(RestError::internal_server_error(anyhow!("Tokio error: {err}"))), + } + } + + /// POST /{network}/program/{id}/view/{functionName} + /// + /// Evaluates a view function against the ledger state at the latest block height. + pub(crate) async fn evaluate_view_latest( + State(rest): State, + Path((program_id, view_name)): Path<(ProgramID, Identifier)>, + metadata: Query, + json_result: Result>, JsonRejection>, + ) -> Result { + let Json(raw_inputs) = match json_result { + Ok(json) => json, + Err(err) => return Err(RestError::unprocessable_entity(anyhow!("Invalid request body: {err}"))), }; + let inputs = parse_view_inputs(&raw_inputs)?; + + let (outputs, height) = Self::evaluate_view_at_latest_height(rest, program_id, view_name, inputs).await?; let output_strings: Vec = outputs.iter().map(|v| v.to_string()).collect(); if metadata.metadata.unwrap_or(false) { @@ -1061,7 +1066,7 @@ mod tests { use aleo_std_storage::StorageMode; use axum::response::IntoResponse; use snarkvm::{ - ledger::store::helpers::memory::ConsensusMemory, + ledger::{narwhal::BatchHeader, store::helpers::memory::ConsensusMemory}, prelude::{ Address, Certificate, Deployment, Fee, FromBytes, Ledger, PrivateKey, ProgramOwner, TestnetV0, VerifyingKey, deployment_cost, @@ -1181,7 +1186,10 @@ mod tests { assert!(spend_limit.is_some()); assert_eq!(synthesis_limit, None); - let max_certificates = TestnetV0::MAX_CERTIFICATES.last().unwrap().1 as u64; + // Use the value active at V18: snarkVM 4.12.0 lowers testnet `MAX_CERTIFICATES` at V22, + // so the last table entry is not the one that applies here. + let max_certificates = + active_consensus_value(&TestnetV0::MAX_CERTIFICATES, ConsensusVersion::V18).unwrap() as u64; // A minimal subdag contains two availability thresholds, one for each round. let min_certificates = max_certificates.saturating_add(2).saturating_div(3).saturating_mul(2); let expected_spend_limit = @@ -1239,12 +1247,14 @@ mod tests { ) .unwrap(); + // Since snarkVM 4.12.0 the ledger applies the beacon block synthesis limit itself, so the second + // deployment (which overflows the limit) is aborted by snarkVM and the third one still fits. assert_eq!(block.height(), v18_height); - assert_eq!(block.transactions().num_accepted(), 3); + assert_eq!(block.transactions().num_accepted(), 2); assert_eq!(block.transactions().num_rejected(), 0); - assert!(block.aborted_transaction_ids().is_empty()); + assert_eq!(block.aborted_transaction_ids(), &[second_id]); assert!(block.transactions().get(&first_id).is_some()); - assert!(block.transactions().get(&second_id).is_some()); + assert!(block.transactions().get(&second_id).is_none()); assert!(block.transactions().get(&third_id).is_some()); let consensus_version = TestnetV0::CONSENSUS_VERSION(v18_height).unwrap(); @@ -1426,4 +1436,49 @@ mod tests { assert!(String::from_utf8(response_body.to_vec()).unwrap().contains(&transaction_id.to_string())); } } + + #[test] + fn test_view_at_height_only_serves_the_latest_height() { + let genesis = Block::from_bytes_le(include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/resources/genesis_8d710d7e2_40val_snarkos_dev_network.bin" + ))) + .unwrap(); + let ledger: Ledger> = + Ledger::load(genesis, StorageMode::new_test(None)).unwrap(); + let beacon_key = PrivateKey::from_str(FUNDED_ACCOUNTS[0].1).unwrap(); + let rest = test_rest(&ledger, beacon_key, false, vec![]); + let runtime = tokio::runtime::Runtime::new().unwrap(); + let program_id = ProgramID::::from_str("credits.aleo").unwrap(); + let view_name = Identifier::::from_str("anything").unwrap(); + let latest_height = ledger.latest_height(); + + let evaluate = |height: u32| { + runtime.block_on(async { + match Rest::evaluate_view( + State(rest.clone()), + Path((program_id, view_name, height)), + Ok(Json(Vec::::new())), + ) + .await + { + Ok(_) => panic!("view evaluation of a missing view succeeded"), + Err(error) => error.into_response(), + } + }) + }; + + // A past (or future) height is refused with a pointer to the latest-height route. + let response = evaluate(latest_height + 1); + assert_eq!(response.status(), StatusCode::NOT_FOUND); + let response_body = runtime.block_on(axum::body::to_bytes(response.into_body(), usize::MAX)).unwrap(); + let response_body = String::from_utf8(response_body.to_vec()).unwrap(); + assert!(response_body.contains("latest height"), "{response_body}"); + assert!(response_body.contains("/program/credits.aleo/view/anything"), "{response_body}"); + + // The latest height is evaluated: `credits.aleo` has no view named `anything`, so this fails in + // evaluation (400) rather than being refused up front (404). + let response = evaluate(latest_height); + assert_eq!(response.status(), StatusCode::BAD_REQUEST); + } } diff --git a/src/start.rs b/src/start.rs index 33a3871..c8f9b88 100644 --- a/src/start.rs +++ b/src/start.rs @@ -95,7 +95,9 @@ async fn start_devnode(command: Start, private_key: Option) -> Result<() println!("Cleaned ledger directory: {}", path.display()); } println!("Using persistent ledger at: {}", path.display()); - let storage_mode = StorageMode::Custom(path.clone()); + // The second path would open RocksDB in read-only secondary mode (aleo-std-storage 1.0.4); the devnode + // always owns its ledger, so no secondary path is used. + let storage_mode = StorageMode::Custom(path.clone(), None); let ledger: Ledger> = tokio::task::spawn_blocking(move || Ledger::load(genesis_block, storage_mode)) .await