mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
chains/rust/zkvm had sixteen modules and nothing to hold them: no crate root, no seam to the node, no VM and no evaluator, so nothing in it had ever been built or run. It has those now. vm.rs is the chain — the genesis fold that leaves a new chain one fold in rather than at the zero root, the one admission predicate that assembly and verification both ask, the single verification pass in the reference's order, and an acceptance that stages the block record, every nullifier it spends, every output it creates and the advanced root through one view and commits them together. host.rs re-exports the node's own seam rather than restating it. Where the two compared halves of a verdict divide is stated over the rules, in Error::before_the_chain, because this chain has one verification pass and no separate syntactic method to read. The port agreed with Go on all 137 Z vectors on its first run, and its own suite is 160 tests. chains/rust/fhevm answered every F vector already and disagreed with Go on seven, all in the F_JSON group. Its JSON decoder was stricter than encoding/json in four ways: it refused a null payload where Go reads the zero struct and lets the rule the zero payload breaks name itself, refused a stray closing brace or bracket after a complete value where Decoder.More reports no further element, folded member names by ASCII case where Go folds by unicode.SimpleFold — U+017F onto S and U+212A onto K — and refused a base64 word broken across a line that encoding/base64 reads straight through. It also resolved two members naming one field by preferring the exact match, where Go resolves each key on its own and writes the later one, which is a rule about document order and needs a map that keeps it. All four are fixed and each has a test naming the rule rather than the vector. make chains now runs 725 vectors through Go, Rust and C++ with all three answering all six chains, and every compared field agrees. Co-authored-by: Hanzo Dev <[email protected]>
26 lines
1.2 KiB
Rust
26 lines
1.2 KiB
Rust
// SPDX-License-Identifier: BSD-3-Clause-Eco
|
|
// Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved.
|
|
|
|
//! Re-emit the loader path `libluxcrypto` was resolved at.
|
|
//!
|
|
//! This crate links that library only through the node: `lux-node` holds an
|
|
//! ML-DSA identity and an ML-KEM session, and both come from `libluxcrypto` by
|
|
//! way of `lux-pq`. `cargo:rustc-link-arg` reaches only the binaries of the
|
|
//! crate that emitted it, so the rpath `lux-node` set for its own binaries does
|
|
//! not reach this crate's test binaries — and without this they link and then
|
|
//! cannot load.
|
|
//!
|
|
//! `links` metadata does reach here. `DEP_LUXPQ_LIB_DIR` is `lux-pq` passing on
|
|
//! what the ABI crate resolved, so the directory is found exactly once, down
|
|
//! there, and repeated here rather than searched for a second time. Nothing is
|
|
//! emitted when the variable is absent: the library may already be on the
|
|
//! system loader path, and inventing a directory would only be a second place
|
|
//! to look.
|
|
|
|
fn main() {
|
|
if let Some(dir) = std::env::var_os("DEP_LUXPQ_LIB_DIR") {
|
|
println!("cargo:rustc-link-arg=-Wl,-rpath,{}", dir.to_string_lossy());
|
|
}
|
|
println!("cargo:rerun-if-env-changed=DEP_LUXPQ_LIB_DIR");
|
|
}
|