Files
zeekay 67a78e4f63 chains/rust/xvm: run this chain inside the node, and test that it does
The chain satisfied a seam nothing held. Now `lux-rs/node` holds it:
`tests/node.rs` registers the X-Chain in the node's own `Rpc`, serves it on a
real socket and gets `xvm.getBlockchainID` and `xvm.issueTx` back through
`/v1/bc/X`; puts it behind `plugin::Server` and drives build, verify, accept
and get across the sealed post-quantum link from a `plugin::Client`; refuses a
node that pinned another genesis; and reads a block's two roots out through
`Engine::position`, which is the statement a validator signs.

Nothing there is a stand-in. The only thing this crate supplies is the chain.

A block and the thing consensus certifies are now one value: `host::Block` is
implemented on `block::Block` rather than on a wrapper around it, so there is
nothing to unwrap at the boundary and nothing to keep in step.

`build.rs` repeats the loader path `lux-pq` already resolved, because a
link-arg reaches only the emitting crate's own binaries and the test binaries
here run the node.
2026-09-04 18:48:15 -07:00

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 — `tests/node.rs` runs the node, and
//! without this it links 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");
}