From 13c3e2dfb27040a6ce4b366d00d82788ec6a99b5 Mon Sep 17 00:00:00 2001 From: Collin Chin Date: Mon, 12 Dec 2022 15:38:57 -0800 Subject: [PATCH] Feature - log program metrics (#433) * wip output metrics from package run * improve constraint formatting and function counter * clippy * update snarkvm tag v0.9.11 --- Cargo.lock | 321 +++++++++++++++++++++++--------------------- Cargo.toml | 9 +- cli/commands/run.rs | 40 +++++- 3 files changed, 211 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eaaba458b..3c10c84ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -37,6 +37,7 @@ dependencies = [ "anyhow", "clap", "colored", + "num-format", "parking_lot", "rand", "rand_chacha", @@ -115,7 +116,7 @@ checksum = "6118baab6285accf088b31d5ea5029c37bbf9d98e62b4d8720a0a5a66bc2e427" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -266,15 +267,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cc" -version = "1.0.76" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" [[package]] name = "cfg-if" @@ -324,7 +325,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -434,9 +435,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.11" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ "autocfg", "cfg-if", @@ -447,9 +448,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", ] @@ -502,14 +503,14 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", "crypto-common", @@ -594,9 +595,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "miniz_oxide", @@ -892,9 +893,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -925,9 +926,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" [[package]] name = "itertools" @@ -961,9 +962,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libz-sys" @@ -1004,9 +1005,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] @@ -1035,9 +1036,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -1125,7 +1126,17 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", ] [[package]] @@ -1171,9 +1182,9 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" dependencies = [ "bitflags", "cfg-if", @@ -1192,7 +1203,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -1203,9 +1214,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" dependencies = [ "autocfg", "cc", @@ -1216,9 +1227,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "parking_lot" @@ -1232,9 +1243,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if", "libc", @@ -1245,9 +1256,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" [[package]] name = "percent-encoding" @@ -1272,7 +1283,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -1295,9 +1306,9 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "portable-atomic" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15eb2c6e362923af47e13c23ca5afb859e83d54452c55b0b9ac763b8f7c1ac16" +checksum = "ac662b3a6490de378b0ee15cf2dfff7127aebfe0b19acc65e7fbca3d299c3788" [[package]] name = "ppv-lite86" @@ -1314,7 +1325,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", "version_check", ] @@ -1427,21 +1438,19 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1497,9 +1506,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ "base64", "bytes", @@ -1690,29 +1699,29 @@ checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" [[package]] name = "serde" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "itoa", "ryu", @@ -1733,9 +1742,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", @@ -1781,9 +1790,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "snarkvm" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "013af4df75ac663ff6fd542b0d46660d4a2dc9a4bf63e774f33ba86d8f5c1edf" +checksum = "ec21412f7a051816213c7d73e067fb5c2e42b88b705b8bfdedb276427827fae3" dependencies = [ "anyhow", "clap", @@ -1809,9 +1818,9 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab6f17a3bfcc5ef54e923cb69b64c1270d6ef2a51293977e98024664e791e0b0" +checksum = "dd0fe2c1262048c41cd9dcfa53997b1fc9cf78dd67cc83a951a9c7a841ed21c4" dependencies = [ "aleo-std", "anyhow", @@ -1836,9 +1845,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f6003e7e2c04eab4d0ec1f86410a6f0463160bc32fb13b73be33e2fe078c2a" +checksum = "3c7b222c81bd09d9404e067bd48fcb02ea8d937e4f5f5e6fcd1bda8b7c7ffa98" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -1851,9 +1860,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818690afd662700d128dfcffd404e5a7c002746eccca5e3f04778c1ea2e59e2f" +checksum = "70c7ad2fd776cf98958c5368c040e65f49990383c27f4e32db7eef4a85ea6a7a" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-network", @@ -1863,9 +1872,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413f0e0f559b4536636219bc4099039206c99cb113b7fe909a65e530297e455" +checksum = "25117c432721ad2e1b4bb630e2dbb369037417caa6e368e55075db3e104a020e" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -1874,9 +1883,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25034795092f5383ca06adc167108a0eb2844cafb57f4924eafb2c64a706518c" +checksum = "6723911bd977a8ac3210dfa033627316eca172c8a60d7dd5fbd1bed177e1849f" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -1885,9 +1894,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cdccedae232012dc29cf1e961a7ffeebfb790b3a848466b6efbe3673f4bbb5" +checksum = "c4e17af823a117a5a2726e20f5a2ae11f1429dff3c48ac1bc84f965534319f7d" dependencies = [ "indexmap", "itertools", @@ -1904,15 +1913,15 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612990cef245d43ab975b75bc7b6cb069b5e985f2b45a4691c65d1b3e4bb9922" +checksum = "51710f55cf51a5412bc65a039b4897f60b47511f4ddf9932a29fdfe170427dc4" [[package]] name = "snarkvm-circuit-network" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94033b76989575d404ea11dc6c4aa9e43b0e906b76e7c6e66a7531657189cdc" +checksum = "008791abfdab67dbc18ed3151346ce36dd65d0548c5ac2d38732597df9339798" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -1922,9 +1931,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f5b51c284249deb1d3107f1e9502ee167e2dc5acc74af71e59c4e3b23249ec" +checksum = "aeb63d11693caf808a22c03126dae38d0bef7e397d1f1cd0747ea975f943216f" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-collections", @@ -1936,9 +1945,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30828919b5046b92f0d4fa96210745c89df3a8697b7a9d51569b2b1fb7843586" +checksum = "faa65fdbcae5f6a49878b517df351d9370aab99b07d758fb3df5541ab8fcc212" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -1952,9 +1961,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03588ccdb0462a3694674f8ba1a80a7e45560aab1f681a5e8d6aa81dc50559ce" +checksum = "68a9d7fed666d82986091453b11aa07340cf50c87b48e3864a3813ef4e38436e" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -1966,9 +1975,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97da778a5acb02f55cad0eada09f5bef073d1ad2341c0cfd06fa69c58960cbce" +checksum = "0555b096fa6b23283e7150ad6a4b55e4c50fe1e3dc9d75e7effa8eab07664777" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -1976,9 +1985,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e3b537b6597225b152180c067a89756d97564558c4309864511f2cf3bc27d1" +checksum = "1ff8b17699dd8a611b5ab8727e041a2e1dfb84a4fe6ce9149d003ca9e5234c24" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -1987,9 +1996,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f870135215aea56b08a150a6568100e0d60fcc5f652b38f25e0e2b5be00376" +checksum = "3a14a576f96a675cf9a7c195cfcfdccb50db352774b3953c73fab9762ac1a048" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2000,9 +2009,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1e895affaa4503a08c88a8382dbc19b1309459ff5baa7a478c7ac1a3fa06c" +checksum = "b1eefb9303860d45c385ee63df905f7f5f878a2c11c8cf20cb3274f89046d557" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2012,9 +2021,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787f2c535478ad51cc22beda66868ddd7aff24e39d9057d3d60935ad02593b0" +checksum = "a95c55874bd82500165d8ddf67d0f9a2c56d2ed61127443d51c2bc0c159be920" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2024,9 +2033,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc962ffd7673096a73cd4d0ec90325cc32abbeb9322af10ef8c0455d396e1463" +checksum = "603706d5441ed672705ceb343aa30027b8816b078a36eef684fc903d3d00bdf1" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2037,9 +2046,9 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd429b0b19762c1c87097d94495d1cb4d74323ae4710ece62173f9750682e447" +checksum = "d110d536127ecbf3f098a50e0302c3c9fb9bf653cdbeed78c9305c879fcc679d" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2051,9 +2060,9 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b577a54fafe65db1f02ac4a3f9b6bd05e2a35accecb9aa9ac37bfcc04a2bb42d" +checksum = "f2b5d2522e1ec3a3d7e7d8b93b9539ac2ffe47151dd8a971bcacf3c4b4d64c87" dependencies = [ "bs58", "snarkvm-console-network", @@ -2062,9 +2071,9 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53d801829816af87b537505b85a82d5b6e1e5815a174d55484b46ffc9915721" +checksum = "3879a8c76bb99460eccb41f827ab330c912ffca89b3f6d37597b4836728d4a31" dependencies = [ "blake2s_simd", "smallvec", @@ -2075,9 +2084,9 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01358566b823aa77fe1d61b825c8e0c812238f091c8311dfa571c6195a6581cf" +checksum = "cd07882fe4ca9dc6ce9de5519f71ee8a8ceda974653e2326c01396430e85400e" dependencies = [ "aleo-std", "rayon", @@ -2087,9 +2096,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45cb7cd4d0c52d73dc891cdf557b9114561ba9949a46099b96401b201fe1fdd0" +checksum = "713476959db38d5b035cb63bf51680507197725f5e8c2ca64e92025778c637ed" dependencies = [ "anyhow", "indexmap", @@ -2111,9 +2120,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9cae3cc04ee4d4b90d754aa38fb792a949178ea74e20f4f586daf4608f16518" +checksum = "fc5a0a2a367aa14c185a6bbad79ac3552dfe82edb3b86375631f043f33c10bd4" dependencies = [ "anyhow", "bech32", @@ -2129,9 +2138,9 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d0dd970fe030fcfeaa0929fd69682ce25343a7c6570b0c585676599bdd14df" +checksum = "9e6267227867047e59d0530a9969808625184d940ea1bd454ec8382d3a811add" dependencies = [ "enum_index", "enum_index_derive", @@ -2148,9 +2157,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306d43ebfae7b537f3e70959f0195f7572722437ba693261a6444ca04e64ea9a" +checksum = "2117e8c13b6741264e65b9d661e2f4a88d32e59f6564ed7db64439a833cafaac" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -2164,9 +2173,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4814ea1fc021f09fa360990668986862bfdd3cbec9fea2d5d298959764894e0d" +checksum = "b7c21a6ca2a02ddedd749e1dbe484a0e4211a9336e867bb3c08bda1a1fa5e9bb" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2176,18 +2185,18 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38656e2914ac9e457bf2d3dd6997e7118182afe8485929787e847d1071a5e73" +checksum = "bc0647c0dd3811ce62bdf3caf1fa5d5bb1bc9e357ac49fcf9b5d3d678405b3d1" dependencies = [ "snarkvm-console-network-environment", ] [[package]] name = "snarkvm-console-types-field" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c81acd1d36d413ee62ecf5ecd22ed27f05bea46aa3bc828b0c3aeb123fc8c84" +checksum = "19a4ff5200f5b0ae367b33659170a41ebfa6842bd7defae7294330e2431bb354" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2195,9 +2204,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839a71396560a122db6785bbfcfda75d76692c06acced36bc5c614b5abff5db9" +checksum = "a6ebf87a7a17730e600b97f7c8d7321d3fff4ce2bed9a88287bec9cae13b52ff" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2207,9 +2216,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940be406f3cac8ab3b9b914171c920c5322148fdc02423d11e5856b60df4740" +checksum = "f1a61b380a2f6882bbbb48b723824212d2819e336064ffd9057e890083b72d06" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2218,9 +2227,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b71af9c038a84714f19a9e1761736de983900b6837be2ae144f98610529157" +checksum = "f4a94c7020b98af7288af249cbe65e787dc789ba54d54e4a9553bc9215f7d842" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2229,9 +2238,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5463846e8a031eeed2271fe1f4f0d7491c4d31461a9fc9d79f544cdf11d0469" +checksum = "43b9a880d537c92e07b29e1d52ab9ffb23b3d5f14106957a1758e37ce332ade2" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2241,9 +2250,9 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cd683c142fe10686a0cfedcd22d262ce3f442843e9cf124b4802d394055361" +checksum = "3ef36625c04250a46edd128a4df521997afdc1ed437f917e568cc7d7f967ed1e" dependencies = [ "rand", "rustc_version", @@ -2255,9 +2264,9 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c63451df92ff0a741a22affdea8057d2c15017fc1f987eba141b7e9cd1cbdf28" +checksum = "aa0742d3e08b5ab9752f0077378351a9b2e9bba17f1339b62d5a072aa8433760" dependencies = [ "aleo-std", "anyhow", @@ -2273,9 +2282,9 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a66dc87a7453b1d1cf6ca4f8aee71b5feb913af592da783b26af696fbde3f6" +checksum = "e3545b90190616ebc11e3060504becdbf869937255032fdfbd6df2b4be1d8c15" dependencies = [ "aleo-std", "anyhow", @@ -2301,9 +2310,9 @@ dependencies = [ [[package]] name = "snarkvm-r1cs" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f6b98f5f09c8bfff3206ba885a5698ebb196bfc8ed7a331094c1dc6823edbe" +checksum = "312df899761cfee519040873869a46f35a813e38606154c16af1d2a270da5ad5" dependencies = [ "anyhow", "cfg-if", @@ -2318,9 +2327,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143155ee59b25954bb20f47b9dc50b1d4cbc3d8a698e85daf3a9757d3b82b7c9" +checksum = "202cf04eb33d6c9c4a7b3c0372618ce83319faf9f6b295981cd9d333675191ed" dependencies = [ "aleo-std", "anyhow", @@ -2346,9 +2355,9 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27308001f04a0ceb0a22f68abd4ed1bace6536f2aea5f6a75ffe044884f1093" +checksum = "dd899565644669400f5398ef5066416420c5d2793558bbf9ec39c2ce6b4da2c7" dependencies = [ "aleo-std", "anyhow", @@ -2365,20 +2374,20 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85ab3a492f904c732fd1e108742c53c4a8601683f2f505d256887db1079cb9c" +checksum = "bc114d50c627a9917f815ad9666746ee09cb4c08c9d46f130331af4e42e121e3" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] name = "snarkvm-wasm" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0626245bd7f09b56dd2c72f66cedee3fa90ff81fcc2d41f32159f8180fc50ed5" +checksum = "d6105442f938f3ba118ffb9cfd1d39f351e275669ee2d65cf8a4fd29a1f81bd5" dependencies = [ "getrandom", "rand", @@ -2442,9 +2451,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", @@ -2516,7 +2525,7 @@ checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -2536,9 +2545,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", @@ -2548,7 +2557,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -2634,7 +2643,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", ] [[package]] @@ -2682,9 +2691,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" @@ -2869,7 +2878,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", "wasm-bindgen-shared", ] @@ -2903,7 +2912,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.104", + "syn 1.0.105", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2960,9 +2969,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] diff --git a/Cargo.toml b/Cargo.toml index d608a37a6..376d5bc1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,10 +21,12 @@ edition = "2018" members = [ "rust/account", "wasm" ] [workspace.dependencies.snarkvm] -version = "0.9.9" +version = "0.9.11" +#git = "https://github.com/AleoHQ/snarkVM" [workspace.dependencies.snarkvm-wasm] -version = "0.9.9" +version = "0.9.11" +#git = "https://github.com/AleoHQ/snarkVM" [lib] path = "cli/lib.rs" @@ -38,6 +40,9 @@ default = [ ] account = [ "aleo-account" ] wasm = [ "aleo-wasm" ] +[dependencies] +num-format = "0.4.4" + [dependencies.aleo-account] path = "rust/account" version = "0.3.1" diff --git a/cli/commands/run.rs b/cli/commands/run.rs index b384b68cb..6aba40f00 100644 --- a/cli/commands/run.rs +++ b/cli/commands/run.rs @@ -24,6 +24,9 @@ use anyhow::Result; use clap::Parser; use colored::Colorize; use core::str::FromStr; +use std::collections::HashMap; + +pub const LOCALE: &num_format::Locale = &num_format::Locale::en; /// Executes an Aleo program function. #[derive(Debug, Parser)] @@ -56,7 +59,7 @@ impl Run { let rng = &mut rand::thread_rng(); // Execute the request. - let (response, _transition, _inclusion) = package.run::( + let (response, _transition, _inclusion, metrics) = package.run::( self.endpoint, package.manifest_file().development_private_key(), self.function, @@ -64,6 +67,41 @@ impl Run { rng, )?; + // Count the number of times a function is called. + let mut program_frequency = HashMap::::new(); + for metric in metrics.iter() { + // Prepare the function name string. + let function_name_string = format!("'{}/{}'", metric.program_id, metric.function_name).bold(); + + // Prepare the function constraints string + let function_constraints_string = format!( + "{function_name_string} - {} constraints", + metric.num_function_constraints.to_formatted_string(LOCALE) + ); + + // Increment the counter for the function call. + match program_frequency.get_mut(&function_constraints_string) { + Some(counter) => *counter += 1, + None => { + let _ = program_frequency.insert(function_constraints_string, 1); + } + } + } + + // Log the metrics. + use num_format::ToFormattedString; + + println!("\n⛓ Constraints\n"); + for (function_constraints, counter) in program_frequency { + // Log the constraints + let counter_string = match counter { + 1 => "(called 1 time)".to_string().dimmed(), + counter => format!("(called {} times)", counter).dimmed(), + }; + + println!(" • {function_constraints} {counter_string}",) + } + // Log the outputs. match response.outputs().len() { 0 => (),