diff --git a/Cargo.lock b/Cargo.lock index 98c9e1b5..ae82e339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,7 +203,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43975e01fb4293021af4950366a6f80c45d7301d499622359c7533bd7af19592" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 2.0.70", @@ -264,7 +264,7 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.70", @@ -720,12 +720,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -881,16 +875,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.22" @@ -1031,29 +1015,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -1147,7 +1108,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] @@ -1161,15 +1131,15 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "4e99090d12f6182924499253aaa1e73bf15c69cea8d2774c3c781e35badc3548" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", - "parking_lot", + "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -1179,9 +1149,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "7879eb018ac754bba32cb0eec7526391c02c14a093121857ed09fbf1d1057d41" dependencies = [ "once_cell", "target-lexicon", @@ -1189,9 +1159,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "ce2baa5559a411fc1cf519295f24c34b53d5d725818bc96b5abf94762da09041" dependencies = [ "libc", "pyo3-build-config", @@ -1199,9 +1169,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "049621c20a23f2def20f4fe67978d1da8d8a883d64b9c21362f3b776e254edc7" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1211,11 +1181,11 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "0e969ee2e025435f1819d31a275ba4bb9cbbdf3ac535227fdbd85b9322ffe144" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "pyo3-build-config", "quote", @@ -1281,15 +1251,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags", -] - [[package]] name = "regex" version = "1.10.5" @@ -1319,6 +1280,12 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + [[package]] name = "rfc6979" version = "0.4.0" @@ -1331,9 +1298,9 @@ dependencies = [ [[package]] name = "rstest" -version = "0.17.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1bb486a691878cd320c2f0d319ba91eeaa2e894066d8b5f8f117c000e9d962" +checksum = "9afd55a67069d6e434a95161415f5beeada95a01c7b815508a82dcb0e1593682" dependencies = [ "futures", "futures-timer", @@ -1343,15 +1310,19 @@ dependencies = [ [[package]] name = "rstest_macros" -version = "0.17.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290ca1a1c8ca7edb7c3283bd44dc35dd54fdec6253a3912e201ba1072018fca8" +checksum = "4165dfae59a39dd41d8dec720d3cbfbc71f69744efb480a3920f5d4e0cc6798d" dependencies = [ "cfg-if", + "glob", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", + "regex", + "relative-path", "rustc_version", - "syn 1.0.109", + "syn 2.0.70", "unicode-ident", ] @@ -1385,12 +1356,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "sec1" version = "0.7.3" @@ -1483,12 +1448,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - [[package]] name = "spki" version = "0.7.3" @@ -1595,6 +1554,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "typenum" version = "1.17.0" diff --git a/Cargo.toml b/Cargo.toml index 427cd005..652cbc03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,9 @@ openssl = ["dep:openssl"] lto = "thin" [dependencies] -lazy_static = "1.4.0" -num-bigint = "0.4.4" -num-traits = "0.2.15" +lazy_static = "1.5.0" +num-bigint = "0.4.6" +num-traits = "0.2.19" num-integer = "0.1.46" chia-bls = "0.10.0" sha2 = "0.10.8" @@ -47,7 +47,7 @@ k256 = { version = "0.13.3", features = ["ecdsa"] } p256 = { version = "0.13.2", features = ["ecdsa"] } [dev-dependencies] -rstest = "0.17.0" +rstest = "0.21.0" criterion = "0.5.1" hex = "0.4.3" diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 932ffdc1..d545190c 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -12,15 +12,15 @@ readme = "README.md" [dependencies] hex-literal = "0.4.1" hex = "0.4.3" -rand = "0.8.4" +rand = "0.8.5" sha1 = "0.10.6" linreg = "0.2.0" clvmr = { path = ".." } chia-bls = "0.10.0" -num-bigint = "0.4.4" -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.96" -clap = { version = "4.4.18", features = ["derive"] } +num-bigint = "0.4.6" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" +clap = { version = "4.5.9", features = ["derive"] } [[bin]] name = "generate-fuzz-corpus" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index d62ec91b..7d97bbba 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -16,7 +16,7 @@ path = "src/lib.rs" [dependencies] clvmr = { path = ".." } -wasm-bindgen = "0.2.87" -wasm-bindgen-test = "0.3.37" -js-sys = "0.3.61" -getrandom = { version = "0.2.9", features = ["js"] } +wasm-bindgen = "0.2.92" +wasm-bindgen-test = "0.3.42" +js-sys = "0.3.69" +getrandom = { version = "0.2.15", features = ["js"] } diff --git a/wheel/Cargo.toml b/wheel/Cargo.toml index 013962ae..baf63a0e 100644 --- a/wheel/Cargo.toml +++ b/wheel/Cargo.toml @@ -16,7 +16,7 @@ path = "src/lib.rs" [dependencies] clvmr = { path = ".." } -pyo3 = { version = "0.21.2", features = ["abi3-py38", "extension-module"] } +pyo3 = { version = "0.22.1", features = ["abi3-py38", "extension-module"] } [features] openssl = ["clvmr/openssl"] diff --git a/wheel/src/adapt_response.rs b/wheel/src/adapt_response.rs index 6b30886a..3816034b 100644 --- a/wheel/src/adapt_response.rs +++ b/wheel/src/adapt_response.rs @@ -21,7 +21,7 @@ pub fn adapt_response( Err(eval_err) => { let sexp = LazyNode::new(Rc::new(allocator), eval_err.0).to_object(py); let msg = eval_err.1.to_object(py); - let tuple = PyTuple::new(py, [msg, sexp]); + let tuple = PyTuple::new_bound(py, [msg, sexp]); let value_error: PyErr = PyValueError::new_err(tuple.to_object(py)); Err(value_error) } diff --git a/wheel/src/api.rs b/wheel/src/api.rs index e3eebc6f..07ef0a45 100644 --- a/wheel/src/api.rs +++ b/wheel/src/api.rs @@ -48,12 +48,12 @@ fn tuple_for_parsed_triple(py: Python<'_>, p: &ParsedTriple) -> PyObject { start, end, atom_offset, - } => PyTuple::new(py, [*start, *end, *atom_offset as u64]), + } => PyTuple::new_bound(py, [*start, *end, *atom_offset as u64]), ParsedTriple::Pair { start, end, right_index, - } => PyTuple::new(py, [*start, *end, *right_index as u64]), + } => PyTuple::new_bound(py, [*start, *end, *right_index as u64]), }; tuple.into_py(py) } @@ -67,12 +67,16 @@ fn deserialize_as_tree( let mut cursor = io::Cursor::new(blob); let (r, tree_hashes) = parse_triples(&mut cursor, calculate_tree_hashes)?; let r = r.iter().map(|pt| tuple_for_parsed_triple(py, pt)).collect(); - let s = tree_hashes.map(|ths| ths.iter().map(|b| PyBytes::new(py, b).into()).collect()); + let s = tree_hashes.map(|ths| { + ths.iter() + .map(|b| PyBytes::new_bound(py, b).into()) + .collect() + }); Ok((r, s)) } #[pymodule] -fn clvm_rs(_py: Python, m: &PyModule) -> PyResult<()> { +fn clvm_rs(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(run_serialized_chia_program, m)?)?; m.add_function(wrap_pyfunction!(serialized_length, m)?)?; m.add_function(wrap_pyfunction!(deserialize_as_tree, m)?)?; diff --git a/wheel/src/lazy_node.rs b/wheel/src/lazy_node.rs index 0243369b..71eae760 100644 --- a/wheel/src/lazy_node.rs +++ b/wheel/src/lazy_node.rs @@ -13,9 +13,8 @@ pub struct LazyNode { impl ToPyObject for LazyNode { fn to_object(&self, py: Python<'_>) -> PyObject { - let node: &PyCell = PyCell::new(py, self.clone()).unwrap(); - let pa: &PyAny = node; - pa.to_object(py) + let node: Bound = Bound::new(py, self.clone()).unwrap(); + node.to_object(py) } } @@ -27,7 +26,7 @@ impl LazyNode { SExp::Pair(p1, p2) => { let r1 = Self::new(self.allocator.clone(), *p1); let r2 = Self::new(self.allocator.clone(), *p2); - let v: &PyTuple = PyTuple::new(py, &[r1, r2]); + let v = PyTuple::new_bound(py, &[r1, r2]); Ok(Some(v.into())) } _ => Ok(None), @@ -37,7 +36,9 @@ impl LazyNode { #[getter(atom)] pub fn atom(&self, py: Python) -> Option { match &self.allocator.sexp(self.node) { - SExp::Atom => Some(PyBytes::new(py, self.allocator.atom(self.node).as_ref()).into()), + SExp::Atom => { + Some(PyBytes::new_bound(py, self.allocator.atom(self.node).as_ref()).into()) + } _ => None, } }