bump snarkvm module versions to 0.3.1

This commit is contained in:
collin 2021-05-18 21:08:19 -07:00
parent c936ca5f11
commit c4461f4ef4
8 changed files with 284 additions and 532 deletions

300
Cargo.lock generated
View File

@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96e669320c520d87931e752d603dd442b4709c73b1b8b1fcba838f9c5acc1791" checksum = "96e669320c520d87931e752d603dd442b4709c73b1b8b1fcba838f9c5acc1791"
dependencies = [ dependencies = [
"abnf-core", "abnf-core",
"nom 6.1.2", "nom",
] ]
[[package]] [[package]]
@ -18,7 +18,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b514944cb7199c4201f54406bc58676a3e4f37d40bf8e3dbe30652ca82e3ddb4" checksum = "b514944cb7199c4201f54406bc58676a3e4f37d40bf8e3dbe30652ca82e3ddb4"
dependencies = [ dependencies = [
"nom 6.1.2", "nom",
] ]
[[package]] [[package]]
@ -153,25 +153,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "bindgen"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d"
dependencies = [
"bitflags",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2 1.0.24",
"quote 1.0.9",
"regex",
"rustc-hash",
"shlex",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.2.1"
@ -302,18 +283,6 @@ name = "cc"
version = "1.0.67" version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd"
dependencies = [
"jobserver",
]
[[package]]
name = "cexpr"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27"
dependencies = [
"nom 5.1.2",
]
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -350,17 +319,6 @@ dependencies = [
"envmnt", "envmnt",
] ]
[[package]]
name = "clang-sys"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]] [[package]]
name = "clap" name = "clap"
version = "2.33.3" version = "2.33.3"
@ -549,36 +507,6 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "curl"
version = "0.4.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adba2012502267c1fdde381e0e3acc44bf8be96b2f7d455089dcc2c8ad2f67bd"
dependencies = [
"curl-sys",
"libc",
"openssl-probe",
"openssl-sys",
"schannel",
"socket2 0.4.0",
"winapi 0.3.9",
]
[[package]]
name = "curl-sys"
version = "0.4.43+curl-7.76.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a802c7a9828b7d139efaed1bc92471ab6681ed86d19a105605f5eadcb0837d11"
dependencies = [
"cc",
"libc",
"libz-sys",
"openssl-sys",
"pkg-config",
"vcpkg",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "derivative" name = "derivative"
version = "2.2.0" version = "2.2.0"
@ -940,12 +868,6 @@ version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.0" version = "0.3.0"
@ -1052,7 +974,7 @@ dependencies = [
"httpdate", "httpdate",
"itoa", "itoa",
"pin-project", "pin-project",
"socket2 0.3.19", "socket2",
"tokio", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
@ -1126,15 +1048,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "instant"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
dependencies = [
"cfg-if 1.0.0",
]
[[package]] [[package]]
name = "iovec" name = "iovec"
version = "0.1.4" version = "0.1.4"
@ -1183,15 +1096,6 @@ version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
[[package]]
name = "jobserver"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.47" version = "0.3.47"
@ -1414,7 +1318,6 @@ dependencies = [
"rand 0.8.3", "rand 0.8.3",
"rand_core 0.6.2", "rand_core 0.6.2",
"rand_xorshift", "rand_xorshift",
"snarkos-storage",
"snarkvm-algorithms", "snarkvm-algorithms",
"snarkvm-curves", "snarkvm-curves",
"snarkvm-dpc", "snarkvm-dpc",
@ -1463,55 +1366,12 @@ version = "0.2.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6"
[[package]]
name = "libloading"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a"
dependencies = [
"cfg-if 1.0.0",
"winapi 0.3.9",
]
[[package]]
name = "librocksdb-sys"
version = "6.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9"
dependencies = [
"bindgen",
"cc",
"glob",
"libc",
]
[[package]]
name = "libz-sys"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]] [[package]]
name = "linked-hash-map" name = "linked-hash-map"
version = "0.5.4" version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]]
name = "lock_api"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312"
dependencies = [
"scopeguard",
]
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.14" version = "0.4.14"
@ -1660,7 +1520,7 @@ version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897"
dependencies = [ dependencies = [
"socket2 0.3.19", "socket2",
"winapi 0.3.9", "winapi 0.3.9",
] ]
@ -1705,16 +1565,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0" checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0"
[[package]]
name = "nom"
version = "5.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
dependencies = [
"memchr",
"version_check",
]
[[package]] [[package]]
name = "nom" name = "nom"
version = "6.1.2" version = "6.1.2"
@ -1864,37 +1714,6 @@ dependencies = [
"vcpkg", "vcpkg",
] ]
[[package]]
name = "parking_lot"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
dependencies = [
"instant",
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
dependencies = [
"cfg-if 1.0.0",
"instant",
"libc",
"redox_syscall",
"smallvec",
"winapi 0.3.9",
]
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.1.0" version = "2.1.0"
@ -2345,28 +2164,12 @@ dependencies = [
"winreg", "winreg",
] ]
[[package]]
name = "rocksdb"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3"
dependencies = [
"libc",
"librocksdb-sys",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.18" version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]] [[package]]
name = "rustc_version" name = "rustc_version"
version = "0.2.3" version = "0.2.3"
@ -2601,12 +2404,6 @@ dependencies = [
"lazy_static", "lazy_static",
] ]
[[package]]
name = "shlex"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
[[package]] [[package]]
name = "single" name = "single"
version = "1.0.0" version = "1.0.0"
@ -2628,45 +2425,11 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
name = "snarkos-parameters"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ffbd442c79697ffa4afdf0e59819aed38b8db98d4d5856c410851f9411a9874"
dependencies = [
"curl",
"snarkvm-algorithms",
"snarkvm-parameters",
"snarkvm-utilities",
]
[[package]]
name = "snarkos-storage"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2b763aa12f3efcb908aa7f2a0146088471468360ec32e7cb1890f0ddb470c07"
dependencies = [
"anyhow",
"bincode",
"hex",
"parking_lot",
"rand 0.8.3",
"rocksdb",
"serde",
"snarkos-parameters",
"snarkvm-algorithms",
"snarkvm-dpc",
"snarkvm-objects",
"snarkvm-parameters",
"snarkvm-utilities",
"thiserror",
]
[[package]] [[package]]
name = "snarkvm-algorithms" name = "snarkvm-algorithms"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd2ac089982b3ae11f9d69c7254c4c6b67059b2b724df17305073b6cdc680ee4" checksum = "99f8349fad4f4e9a05ab4fde6baa99aad8542fcaf10320128114fdc26798a0ad"
dependencies = [ dependencies = [
"blake2", "blake2",
"derivative", "derivative",
@ -2687,9 +2450,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-curves" name = "snarkvm-curves"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "328025aad33955af198ad2591286e43243c51af4890723a61fcd20325ca29b03" checksum = "3a8f71e6243e588507a7935512bcd79e28906ad89553671151eaf721e42b1513"
dependencies = [ dependencies = [
"derivative", "derivative",
"rand 0.8.3", "rand 0.8.3",
@ -2703,9 +2466,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-derives" name = "snarkvm-derives"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96216fe6b9dc0121dc05dc5b41125120b06202d3b3d1a677fe231a640e5a3d1f" checksum = "d1b3ad83bcd981531a29e8e70bac4cf34126b1031f42bc529975a46e49100383"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro-error", "proc-macro-error",
@ -2716,9 +2479,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-dpc" name = "snarkvm-dpc"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acd5496c7ff31ddda9605bd4cdb6484480e40bc4f3a78bae72d1e51f6f4c23d7" checksum = "54268e972e18e7a1508418f29fe3f64201f86acf2131ed28b1bc9f8891fc1bbb"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base58", "base58",
@ -2742,9 +2505,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-fields" name = "snarkvm-fields"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b40a2f49b94eef144a85f54e40a7c59c6a175d4f770fb7a27f665cd1e55739d0" checksum = "04b885226e300d6a237905038fba681eaa2a851e5cb45a22b685c0bc87c574b6"
dependencies = [ dependencies = [
"bincode", "bincode",
"derivative", "derivative",
@ -2757,9 +2520,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-gadgets" name = "snarkvm-gadgets"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5c780c450bb9cbc66fe3463aca9850b597acc2674b0417255559f1679ec46c1" checksum = "0322e4fd5fe0b0b7499a6b1dbd47d20cf65e0904a23094ba087662253ed60ff0"
dependencies = [ dependencies = [
"derivative", "derivative",
"digest 0.9.0", "digest 0.9.0",
@ -2774,9 +2537,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-objects" name = "snarkvm-objects"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6353482ee2d847ee0c76fa0d99678595f3aba0d8757afef941a7b96b5b00533d" checksum = "345b2dd86a3d036d09608e7493c7a14bf17a59648e567cd08414d2520a627d07"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -2795,11 +2558,10 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-parameters" name = "snarkvm-parameters"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd970f3d8ff520f759ba35a388d1afdb20d8878b727c991c6f6e25cf15391aec" checksum = "7932c7d7fd7b9572a1acaad3c9622f6849c414e5ac8bdb599a504ef4330bb857"
dependencies = [ dependencies = [
"curl",
"hex", "hex",
"snarkvm-algorithms", "snarkvm-algorithms",
"snarkvm-utilities", "snarkvm-utilities",
@ -2808,15 +2570,15 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-profiler" name = "snarkvm-profiler"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cadf6a3ea53a2c48ca057bc63f764b6aa31713868825fd6fdec5c7ab0595732e" checksum = "877f7ee215903aa4da2343f6d82fd5ec7426210a33f4773770ab35dbdddd3bd9"
[[package]] [[package]]
name = "snarkvm-r1cs" name = "snarkvm-r1cs"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d08856c746cbc323a559b64f8d30ff5b69c841c3288366264e2cdd5bbd10d964" checksum = "f5695a57009b1b79f32df22d88f5d5dabf7a84f6a953280896ae4edb8b9db76d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"fxhash", "fxhash",
@ -2829,9 +2591,9 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-utilities" name = "snarkvm-utilities"
version = "0.2.3" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c958e97a15f6d64d168f6eb61bfa435d93d7bd72acd76500f6caf3b8e86c3b" checksum = "996ba23293c9288d983003c224450db8a6acd875f9fe7f6d839ab91897023b5b"
dependencies = [ dependencies = [
"bincode", "bincode",
"rand 0.8.3", "rand 0.8.3",
@ -2850,16 +2612,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "socket2"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
dependencies = [
"libc",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "static_assertions" name = "static_assertions"
version = "1.1.0" version = "1.1.0"

View File

@ -70,22 +70,22 @@ path = "./synthesizer"
version = "1.4.0" version = "1.4.0"
[dependencies.snarkvm-algorithms] [dependencies.snarkvm-algorithms]
version = "0.2.3" version = "0.3.1"
[dependencies.snarkvm-curves] [dependencies.snarkvm-curves]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-gadgets] [dependencies.snarkvm-gadgets]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-r1cs] [dependencies.snarkvm-r1cs]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-utilities] [dependencies.snarkvm-utilities]
version = "0.2.3" version = "0.3.1"
[dependencies.anyhow] [dependencies.anyhow]
version = "1.0" version = "1.0"

View File

@ -53,27 +53,27 @@ version = "1.4.0"
version = "0.4" version = "0.4"
[dependencies.snarkvm-curves] [dependencies.snarkvm-curves]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-fields] [dependencies.snarkvm-fields]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-dpc] [dependencies.snarkvm-dpc]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-gadgets] [dependencies.snarkvm-gadgets]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-r1cs] [dependencies.snarkvm-r1cs]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-utilities] [dependencies.snarkvm-utilities]
version = "0.2.3" version = "0.3.1"
[dependencies.bincode] [dependencies.bincode]
version = "1.3" version = "1.3"
@ -114,7 +114,7 @@ version = "0.3"
default-features = false default-features = false
[dev-dependencies.snarkvm-algorithms] [dev-dependencies.snarkvm-algorithms]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dev-dependencies.tempfile] [dev-dependencies.tempfile]

View File

@ -26,18 +26,18 @@ path = "../ast"
version = "1.4.0" version = "1.4.0"
[dependencies.snarkvm-algorithms] [dependencies.snarkvm-algorithms]
version = "0.2.3" version = "0.3.1"
[dependencies.snarkvm-curves] [dependencies.snarkvm-curves]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-dpc] [dependencies.snarkvm-dpc]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-utilities] [dependencies.snarkvm-utilities]
version = "0.2.3" version = "0.3.1"
[dependencies.indexmap] [dependencies.indexmap]
version = "1.6.2" version = "1.6.2"
@ -52,8 +52,8 @@ version = "0.3"
[dependencies.thiserror] [dependencies.thiserror]
version = "1.0" version = "1.0"
[dev-dependencies.snarkos-storage] #[dev-dependencies.snarkos-storage]
version = "1.3.3" #version = "1.3.3"
[dev-dependencies.rand_core] [dev-dependencies.rand_core]
version = "0.6.2" version = "0.6.2"

View File

@ -14,6 +14,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
mod test_verify_local_data_commitment; // mod test_verify_local_data_commitment;
mod test_verify_record_commitment; // mod test_verify_record_commitment;

View File

@ -14,206 +14,206 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use leo_ast::Input; // use leo_ast::Input;
use leo_input::LeoInputParser; // use leo_input::LeoInputParser;
use leo_state::verify_local_data_commitment; // use leo_state::verify_local_data_commitment;
//
use snarkvm_algorithms::traits::{CommitmentScheme, CRH}; // use snarkos_storage::{mem::MemDb, Ledger};
use snarkvm_dpc::{ // use snarkvm_algorithms::traits::{CommitmentScheme, CRH};
base_dpc::{instantiated::*, record_payload::RecordPayload, DPC}, // use snarkvm_dpc::{
Account, // base_dpc::{instantiated::*, record_payload::RecordPayload, DPC},
AccountScheme, // traits::DPCScheme,
Record, // Account,
}; // AccountScheme,
use snarkvm_utilities::{bytes::ToBytes, to_bytes}; // Record,
// };
use rand::Rng; // use snarkvm_utilities::{bytes::ToBytes, to_bytes};
use rand_core::SeedableRng; //
use rand_xorshift::XorShiftRng; // use rand::Rng;
use snarkos_storage::Ledger; // use rand_core::SeedableRng;
use snarkvm_dpc::DPCScheme; // use rand_xorshift::XorShiftRng;
//
// TODO (Collin): Update input to reflect new parameter ordering. // // TODO (Collin): Update input to reflect new parameter ordering.
#[test] // #[test]
#[ignore] // #[ignore]
fn test_verify_local_data_commitment_from_file() { // fn test_verify_local_data_commitment_from_file() {
let mut rng = XorShiftRng::seed_from_u64(1231275789u64); // let mut rng = XorShiftRng::seed_from_u64(1231275789u64);
//
// Generate parameters for the record commitment scheme // // Generate parameters for the record commitment scheme
let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap(); // let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap();
//
// Load test record state file from `inputs/test.state` // // Load test record state file from `inputs/test.state`
let file_bytes = include_bytes!("inputs/test_state.state"); // let file_bytes = include_bytes!("inputs/test_state.state");
let file_string = String::from_utf8_lossy(file_bytes); // let file_string = String::from_utf8_lossy(file_bytes);
let file = LeoInputParser::parse_file(&file_string).unwrap(); // let file = LeoInputParser::parse_file(&file_string).unwrap();
//
let mut program_input = Input::new(); // let mut program_input = Input::new();
program_input.parse_state(file).unwrap(); // program_input.parse_state(file).unwrap();
//
// check record state is correct by verifying commitment // // check record state is correct by verifying commitment
let result = verify_local_data_commitment(&system_parameters, &program_input).unwrap(); // let result = verify_local_data_commitment(&system_parameters, &program_input).unwrap();
//
assert!(result); // assert!(result);
} // }
//
#[test] // #[test]
#[ignore] // #[ignore]
fn test_generate_values_from_dpc() { // fn test_generate_values_from_dpc() {
type L = Ledger<Tx, CommitmentMerkleParameters>; // type L = Ledger<Tx, CommitmentMerkleParameters, MemDb>;
//
let mut rng = XorShiftRng::seed_from_u64(1231275789u64); // let mut rng = XorShiftRng::seed_from_u64(1231275789u64);
//
// Specify network_id // // Specify network_id
let network_id: u8 = 0; // let network_id: u8 = 0;
//
// Generate parameters for the ledger, commitment schemes, CRH, and the // // Generate parameters for the ledger, commitment schemes, CRH, and the
// "always-accept" program. // // "always-accept" program.
let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap(); // let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap();
let noop_program_snark_pp = // let noop_program_snark_pp =
InstantiatedDPC::generate_noop_program_snark_parameters(&system_parameters, &mut rng).unwrap(); // InstantiatedDPC::generate_noop_program_snark_parameters(&system_parameters, &mut rng).unwrap();
//
let noop_program_id = to_bytes![ // let noop_program_id = to_bytes![
ProgramVerificationKeyCRH::hash( // ProgramVerificationKeyCRH::hash(
&system_parameters.program_verification_key_crh, // &system_parameters.program_verification_key_crh,
&to_bytes![noop_program_snark_pp.verification_key].unwrap() // &to_bytes![noop_program_snark_pp.verification_key].unwrap()
) // )
.unwrap() // .unwrap()
] // ]
.unwrap(); // .unwrap();
//
let signature_parameters = &system_parameters.account_signature; // let signature_parameters = &system_parameters.account_signature;
let commitment_parameters = &system_parameters.account_commitment; // let commitment_parameters = &system_parameters.account_commitment;
let encryption_parameters = &system_parameters.account_encryption; // let encryption_parameters = &system_parameters.account_encryption;
//
// Generate metadata and an account for a dummy initial record. // // Generate metadata and an account for a dummy initial record.
let dummy_account = Account::new( // let dummy_account = Account::new(
signature_parameters, // signature_parameters,
commitment_parameters, // commitment_parameters,
encryption_parameters, // encryption_parameters,
&mut rng, // &mut rng,
) // )
.unwrap(); // .unwrap();
//
let sn_nonce = SerialNumberNonce::hash(&system_parameters.serial_number_nonce, &[0u8; 1]).unwrap(); // let sn_nonce = SerialNumberNonce::hash(&system_parameters.serial_number_nonce, &[0u8; 1]).unwrap();
let value = rng.gen(); // let value = rng.gen();
let payload: [u8; 32] = rng.gen(); // let payload: [u8; 32] = rng.gen();
//
let old_record = DPC::generate_record( // let old_record = DPC::generate_record(
&system_parameters, // &system_parameters,
sn_nonce, // sn_nonce,
dummy_account.address, // dummy_account.address,
false, // false,
value, // value,
RecordPayload::from_bytes(&payload), // RecordPayload::from_bytes(&payload),
noop_program_id.clone(), // noop_program_id.clone(),
noop_program_id.clone(), // noop_program_id.clone(),
&mut rng, // &mut rng,
) // )
.unwrap(); // .unwrap();
//
// Set the input records for our transaction to be the initial dummy records. // // Set the input records for our transaction to be the initial dummy records.
let old_records = vec![old_record; NUM_INPUT_RECORDS]; // let old_records = vec![old_record; NUM_INPUT_RECORDS];
let old_account_private_keys = vec![dummy_account.private_key; NUM_INPUT_RECORDS]; // let old_account_private_keys = vec![dummy_account.private_key; NUM_INPUT_RECORDS];
//
// Construct new records. // // Construct new records.
//
// Create an account for an actual new record. // // Create an account for an actual new record.
//
let new_account = Account::new( // let new_account = Account::new(
signature_parameters, // signature_parameters,
commitment_parameters, // commitment_parameters,
encryption_parameters, // encryption_parameters,
&mut rng, // &mut rng,
) // )
.unwrap(); // .unwrap();
//
// Set the new record's program to be the "always-accept" program. // // Set the new record's program to be the "always-accept" program.
//
let new_record_owners = vec![new_account.address; NUM_OUTPUT_RECORDS]; // let new_record_owners = vec![new_account.address; NUM_OUTPUT_RECORDS];
let new_is_dummy_flags = vec![false; NUM_OUTPUT_RECORDS]; // let new_is_dummy_flags = vec![false; NUM_OUTPUT_RECORDS];
let new_values = vec![10; NUM_OUTPUT_RECORDS]; // let new_values = vec![10; NUM_OUTPUT_RECORDS];
let new_payloads = vec![RecordPayload::default(); NUM_OUTPUT_RECORDS]; // let new_payloads = vec![RecordPayload::default(); NUM_OUTPUT_RECORDS];
let new_birth_program_ids = vec![noop_program_id.clone(); NUM_OUTPUT_RECORDS]; // let new_birth_program_ids = vec![noop_program_id.clone(); NUM_OUTPUT_RECORDS];
let new_death_program_ids = vec![noop_program_id; NUM_OUTPUT_RECORDS]; // let new_death_program_ids = vec![noop_program_id; NUM_OUTPUT_RECORDS];
let memo = [0u8; 32]; // let memo = [0u8; 32];
//
let context = <InstantiatedDPC as DPCScheme<L>>::execute_offline( // let context = <InstantiatedDPC as DPCScheme<L>>::execute_offline(
system_parameters.clone(), // system_parameters.clone(),
old_records, // old_records,
old_account_private_keys, // old_account_private_keys,
new_record_owners, // new_record_owners,
&new_is_dummy_flags, // &new_is_dummy_flags,
&new_values, // &new_values,
new_payloads, // new_payloads,
new_birth_program_ids, // new_birth_program_ids,
new_death_program_ids, // new_death_program_ids,
memo, // memo,
network_id, // network_id,
&mut rng, // &mut rng,
) // )
.unwrap(); // .unwrap();
//
let local_data = context.into_local_data(); // let local_data = context.into_local_data();
let leaf_index = 0; // let leaf_index = 0;
let record = &local_data.old_records[leaf_index]; // let record = &local_data.old_records[leaf_index];
//
let root = local_data.local_data_merkle_tree.root(); // let root = local_data.local_data_merkle_tree.root();
//
let serial_number = local_data.old_serial_numbers[0]; // let serial_number = local_data.old_serial_numbers[0];
let serial_number_bytes = to_bytes![serial_number].unwrap(); // let serial_number_bytes = to_bytes![serial_number].unwrap();
//
let memorandum = local_data.memorandum; // let memorandum = local_data.memorandum;
let network_id = local_data.network_id; // let network_id = local_data.network_id;
let input_bytes = to_bytes![serial_number, record.commitment(), memorandum, network_id].unwrap(); // let input_bytes = to_bytes![serial_number, record.commitment(), memorandum, network_id].unwrap();
let leaf_randomness = local_data.local_data_commitment_randomizers[0]; // let leaf_randomness = local_data.local_data_commitment_randomizers[0];
//
let old_record_leaf = <LocalDataCommitment as CommitmentScheme>::commit( // let old_record_leaf = <LocalDataCommitment as CommitmentScheme>::commit(
&system_parameters.local_data_commitment, // &system_parameters.local_data_commitment,
&input_bytes, // &input_bytes,
&leaf_randomness, // &leaf_randomness,
) // )
.unwrap(); // .unwrap();
//
// generate the path // // generate the path
//
let path = local_data // let path = local_data
.local_data_merkle_tree // .local_data_merkle_tree
.generate_proof(&old_record_leaf) // .generate_proof(&old_record_leaf)
.unwrap(); // .unwrap();
//
println!("////////////////////////////////////////////////////"); // println!("////////////////////////////////////////////////////");
println!(); // println!();
println!("[state]"); // println!("[state]");
println!("leaf index {}", leaf_index); // println!("leaf index {}", leaf_index);
println!("root {:?}", to_bytes![root].unwrap()); // println!("root {:?}", to_bytes![root].unwrap());
println!(); // println!();
println!("[record]"); // println!("[record]");
println!( // println!(
"serial number {:?} len {}", // "serial number {:?} len {}",
serial_number_bytes, // serial_number_bytes,
serial_number_bytes.len() // serial_number_bytes.len()
); // );
println!("commitment {:?}", to_bytes![record.commitment()].unwrap()); // println!("commitment {:?}", to_bytes![record.commitment()].unwrap());
println!("owner {}", record.owner()); // println!("owner {}", record.owner());
println!("is_dummy {:?}", record.is_dummy()); // println!("is_dummy {:?}", record.is_dummy());
println!("value {:?}", record.value()); // println!("value {:?}", record.value());
println!("payload {:?}", record.payload()); // println!("payload {:?}", record.payload());
println!("birth_program_id {:?}", record.birth_program_id()); // println!("birth_program_id {:?}", record.birth_program_id());
println!("death_program_id {:?}", record.death_program_id()); // println!("death_program_id {:?}", record.death_program_id());
println!( // println!(
"serial number nonce {:?}", // "serial number nonce {:?}",
to_bytes![record.serial_number_nonce()].unwrap() // to_bytes![record.serial_number_nonce()].unwrap()
); // );
println!( // println!(
"commitment randomness {:?}", // "commitment randomness {:?}",
to_bytes![record.commitment_randomness()].unwrap() // to_bytes![record.commitment_randomness()].unwrap()
); // );
println!(); // println!();
println!("[state_leaf]"); // println!("[state_leaf]");
println!("path {:?}", to_bytes![path].unwrap()); // println!("path {:?}", to_bytes![path].unwrap());
println!("memo {:?}", memorandum); // println!("memo {:?}", memorandum);
println!("network id {:?}", network_id); // println!("network id {:?}", network_id);
println!("leaf randomness {:?}", to_bytes![leaf_randomness].unwrap()); // println!("leaf randomness {:?}", to_bytes![leaf_randomness].unwrap());
println!(); // println!();
println!("////////////////////////////////////////////////////"); // println!("////////////////////////////////////////////////////");
} // }

View File

@ -14,34 +14,34 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use leo_ast::Input; // use leo_ast::Input;
use leo_input::LeoInputParser; // use leo_input::LeoInputParser;
use leo_state::verify_record_commitment; // use leo_state::verify_record_commitment;
//
use snarkvm_dpc::base_dpc::instantiated::*; // use snarkvm_dpc::base_dpc::instantiated::*;
//
use rand_core::SeedableRng; // use rand_core::SeedableRng;
use rand_xorshift::XorShiftRng; // use rand_xorshift::XorShiftRng;
//
// TODO (Collin): Update input to reflect new parameter ordering. // // TODO (Collin): Update input to reflect new parameter ordering.
#[test] // #[test]
#[ignore] // #[ignore]
fn test_verify_record_from_file() { // fn test_verify_record_from_file() {
let mut rng = XorShiftRng::seed_from_u64(1231275789u64); // let mut rng = XorShiftRng::seed_from_u64(1231275789u64);
//
// Generate parameters for the record commitment scheme // // Generate parameters for the record commitment scheme
let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap(); // let system_parameters = InstantiatedDPC::generate_system_parameters(&mut rng).unwrap();
//
// Load test record state file from `inputs/test.state` // // Load test record state file from `inputs/test.state`
let file_bytes = include_bytes!("inputs/test_record.state"); // let file_bytes = include_bytes!("inputs/test_record.state");
let file_string = String::from_utf8_lossy(file_bytes); // let file_string = String::from_utf8_lossy(file_bytes);
let file = LeoInputParser::parse_file(&file_string).unwrap(); // let file = LeoInputParser::parse_file(&file_string).unwrap();
//
let mut program_input = Input::new(); // let mut program_input = Input::new();
program_input.parse_state(file).unwrap(); // program_input.parse_state(file).unwrap();
//
let typed_record = program_input.get_record(); // let typed_record = program_input.get_record();
//
// check record state is correct by verifying commitment // // check record state is correct by verifying commitment
let _values = verify_record_commitment(&system_parameters, typed_record).unwrap(); // let _values = verify_record_commitment(&system_parameters, typed_record).unwrap();
} // }

View File

@ -18,18 +18,18 @@ license = "GPL-3.0"
edition = "2018" edition = "2018"
[dependencies.snarkvm-curves] [dependencies.snarkvm-curves]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-fields] [dependencies.snarkvm-fields]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.snarkvm-gadgets] [dependencies.snarkvm-gadgets]
version = "0.2.3" version = "0.3.1"
[dependencies.snarkvm-r1cs] [dependencies.snarkvm-r1cs]
version = "0.2.3" version = "0.3.1"
default-features = false default-features = false
[dependencies.num-bigint] [dependencies.num-bigint]