Cargo.lock,sdk/python: port python bindings to pyo3 version 0.26

This commit is contained in:
oars
2025-10-20 16:15:20 +03:00
parent 9e5a163cb3
commit 99199786f7
7 changed files with 30 additions and 29 deletions

42
Cargo.lock generated
View File

@@ -1433,7 +1433,7 @@ dependencies = [
"regalloc2",
"rustc-hash 1.1.0",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
]
[[package]]
@@ -1478,7 +1478,7 @@ dependencies = [
"cranelift-codegen",
"log",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
]
[[package]]
@@ -5328,11 +5328,10 @@ dependencies = [
[[package]]
name = "pyo3"
version = "0.22.6"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
dependencies = [
"cfg-if",
"indoc",
"libc",
"memoffset",
@@ -5346,19 +5345,18 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
version = "0.22.6"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
dependencies = [
"once_cell",
"target-lexicon",
"target-lexicon 0.13.3",
]
[[package]]
name = "pyo3-ffi"
version = "0.22.6"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
dependencies = [
"libc",
"pyo3-build-config",
@@ -5366,9 +5364,9 @@ dependencies = [
[[package]]
name = "pyo3-macros"
version = "0.22.6"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
@@ -5378,9 +5376,9 @@ dependencies = [
[[package]]
name = "pyo3-macros-backend"
version = "0.22.6"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -6713,6 +6711,12 @@ version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "target-lexicon"
version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
[[package]]
name = "taud"
version = "0.5.0"
@@ -8461,7 +8465,7 @@ dependencies = [
"serde-wasm-bindgen",
"shared-buffer",
"tar",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"tracing",
"wasm-bindgen",
@@ -8498,7 +8502,7 @@ dependencies = [
"self_cell",
"shared-buffer",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"wasmer-types",
"wasmer-vm",
@@ -8521,7 +8525,7 @@ dependencies = [
"more-asserts",
"rayon",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
"tracing",
"wasmer-compiler",
"wasmer-types",
@@ -8583,7 +8587,7 @@ dependencies = [
"more-asserts",
"rkyv",
"sha2",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"xxhash-rust",
]

View File

@@ -19,7 +19,7 @@ darkfi-sdk = {path = "../"}
halo2_proofs = {version = "0.3.1", features = ["circuit-params", "dev-graph", "sanity-checks"]}
halo2_gadgets = {version = "0.3.1", features = ["circuit-params"]}
plotters = "0.3.7"
pyo3 = {version = "0.22.6", features = ["gil-refs"]}
pyo3 = "0.26.0"
rand = "0.8.5"
[lints]

View File

@@ -68,7 +68,7 @@ pub fn pedersen_commitment_base(value: &Bound<Fp>, blind: &Bound<Fq>) -> Ep {
/// Wrapper function for creating this Python module.
pub(crate) fn create_module(py: Python<'_>) -> PyResult<Bound<PyModule>> {
let submod = PyModule::new_bound(py, "crypto")?;
let submod = PyModule::new(py, "crypto")?;
submod.add_function(wrap_pyfunction!(poseidon_hash, &submod)?)?;
submod.add_function(wrap_pyfunction!(pedersen_commitment_u64, &submod)?)?;
submod.add_function(wrap_pyfunction!(pedersen_commitment_base, &submod)?)?;

View File

@@ -29,9 +29,6 @@ mod crypto;
mod zkas;
#[pyo3::prelude::pymodule]
// We allow unexpected configs here since `pyo3::py_run!` macro
// uses `#[cfg(feature = "gil-refs")]`.
#[allow(unexpected_cfgs)]
fn darkfi_sdk(
py: pyo3::Python<'_>,
m: &pyo3::Bound<'_, pyo3::prelude::PyModule>,

View File

@@ -58,7 +58,7 @@ impl MerkleTree {
/// Wrapper function for creating this Python module.
pub(crate) fn create_module(py: pyo3::Python<'_>) -> PyResult<Bound<PyModule>> {
let submod = PyModule::new_bound(py, "merkle")?;
let submod = PyModule::new(py, "merkle")?;
submod.add_class::<MerkleTree>()?;
Ok(submod)
}

View File

@@ -295,7 +295,7 @@ pub fn fp_mod_fv(x: &Bound<Fp>) -> Fq {
}
pub fn create_module(py: pyo3::Python<'_>) -> PyResult<Bound<PyModule>> {
let submod = PyModule::new_bound(py, "pasta")?;
let submod = PyModule::new(py, "pasta")?;
submod.add_class::<Fp>()?;
submod.add_class::<Fq>()?;

View File

@@ -185,8 +185,8 @@ impl ZkCircuit {
}
fn opvalues(&self) -> Vec<(DebugOpValue, Vec<Fp>)> {
let opvalue_binding = self.0.tracer.opvalues.borrow();
let opvalues = opvalue_binding.as_ref().unwrap();
let opvalue_guard = self.0.tracer.opvalues.lock().unwrap();
let opvalues = opvalue_guard.as_ref().unwrap();
let mut result = Vec::new();
for opvalue in opvalues {
match opvalue {
@@ -355,7 +355,7 @@ impl MockProver {
}
pub fn create_module(py: Python<'_>) -> PyResult<Bound<PyModule>> {
let submod = PyModule::new_bound(py, "zkas")?;
let submod = PyModule::new(py, "zkas")?;
submod.add_class::<ZkBinary>()?;
submod.add_class::<ZkCircuit>()?;