mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
chains/schema/qchain.zap says what a Q block and a Q transaction are — the same offsets the chain stated in Rust, and the same ones the Go chain writes. zapgen turns that into the accessors, so the block and the two transaction shapes are no longer spelled out twice. The runtime goes with them. chains/rust/zap holds one emitted copy for every chain in this directory, so the reader a chain calls is the reader the Go and C++ chains call; quantumvm's own 896-line copy is gone, and xvm's byte- identical twin will follow. What is left in wire.rs is what a Q block MEANS: the transaction set a length list partitions, the bound on how much a peer can make this node allocate, and canonical-or-nothing — re-serializing what was decoded and refusing anything that does not come back the same bytes. The bytes did not move. The two Go-captured golden wires still match, and tests/corpus_bytes.rs now writes back every Q block in the shared corpus and compares it to the hex the Go chain generated: 12 blocks, byte for byte. 110 unit tests, the corpus differential and the byte test all pass. One verdict moved and it moved tighter. A reader that knows an element is four bytes wide now refuses a declared count no buffer that size could hold, so a forged length list is refused where it is read instead of at the allocation behind it. The allocation bound is still there and still catches the counts that fit the run but not the blob; the test now names both.
63 lines
2.7 KiB
TOML
63 lines
2.7 KiB
TOML
# SPDX-License-Identifier: BSD-3-Clause-Eco
|
|
|
|
[package]
|
|
name = "lux-quantumvm"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "The Lux Q-Chain in Rust: ML-DSA transaction stamps, the Quasar finality bridge, ZAP on the wire"
|
|
license = "BSD-3-Clause-Eco"
|
|
repository = "https://github.com/luxfi/node2"
|
|
publish = false
|
|
|
|
[dependencies]
|
|
# The ZAP runtime, emitted by zapgen into `chains/rust/zap` — one copy for
|
|
# every chain here, so a reader a chain calls is the reader the Go and C++
|
|
# chains call. A path dependency because it is generated in this tree from
|
|
# `chains/schema`, and a version between them would be a way to disagree
|
|
# about what a byte means.
|
|
lux-zap = { path = "../zap" }
|
|
|
|
# The host. `vm::Vm` and `vm::Block` are the node's OWN trait definitions, not a
|
|
# copy of them. A chain that restated the seam would compile against a shape the
|
|
# node never sees, and would keep compiling on the day the node changed a
|
|
# method. A path dependency because `lux-node` is not published.
|
|
lux-node = { path = "../../../../../lux-rs/node" }
|
|
|
|
# `Id` — `lux_consensus::finality::Id`, `[u8; 32]`. Named from the crate the
|
|
# host names it from, so a block this chain builds is named the way the node
|
|
# that certifies it names it, with nothing in between to translate.
|
|
lux-consensus = "1.23.0"
|
|
|
|
# ML-DSA-65 (FIPS 204): the per-validator identity signature this chain stamps
|
|
# transactions and round digests with. One implementation, the same
|
|
# `libluxcrypto` the Go node signs under — a second ML-DSA would be a second
|
|
# set of keys nobody else can check.
|
|
#
|
|
# Naming it here also hands this crate the `links` metadata that says where that
|
|
# library was resolved, which is what lets the test binaries load.
|
|
lux-pq = { path = "../../../../../lux-rs/sdk/lux-pq" }
|
|
|
|
# The validator signature the Quasar bridge collects and aggregates. Same curve
|
|
# and same domain tag as the Go committee's — a second BLS is a second network.
|
|
blst = "0.3"
|
|
|
|
# A block id is `sha256(bytes)` and a transaction id is `sha256(preimage)`; the
|
|
# quantum stamp folds under SHA-512. A second implementation of either would be
|
|
# a second answer to "which block".
|
|
sha2 = "0.10"
|
|
|
|
# The one boundary where a chain answers a caller in a shape it did not choose.
|
|
# A hand-written parser at a boundary is a vulnerability with a schedule.
|
|
serde_json = "1"
|
|
|
|
# The operating system's own randomness, for a key's nonce and a stamp's noise.
|
|
# One call to the kernel, no userspace pool to reseed and no fallback path that
|
|
# could quietly produce something predictable.
|
|
getrandom = "0.2"
|
|
|
|
[dev-dependencies]
|
|
# The differential corpus is JSON and its wires are hex, because that is how the
|
|
# Go generator prints them.
|
|
hex = "0.4"
|
|
serde = { version = "1", features = ["derive"] }
|