mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
Q is the post-quantum lane of the parallel-witness finality model (LP-020), and it was unported in both non-Go runtimes. This is the port, against the node's own seam: `lux_node::vm` is named, never restated, and an id is `lux_consensus::finality::Id`, so a block this chain builds is named the way the node that certifies it names it. Two signatures live here and they are not the same thing. A transaction stamp is one validator's ML-DSA-65 signature over one transaction, bound to the moment it was made, and it rides beside the transaction on the wire. A round witness is a quorum of the committee signing one block, and it is deliberately NOT a field of the block: the block id is the hash of the block's own bytes, so a signature inside it would give two honest nodes two ids for one block. The wire is canonical or nothing. Parse re-encodes what it decoded and refuses anything that does not come back byte-identical, because a ZAP message declares its own size and its own root offset — padding after the content, a relocated root and a root pointed at the header all decode to the same block under different names. The chain is on a disk, not in a map. `Store::commit` takes the whole batch, so the block, its height index entry and the tip pointer move together or not at all; `store::Log` extends that across a crash, dropping a torn tail whole. A read that FAILED is reported as a failure rather than as an empty chain, which is what keeps one transient error from committing genesis over a live tip. Q-Chain sells no blockspace: `issue_tx` refuses every amount (LP-0130 §6), and the chain advances only through consensus-internal aggregation. Held to the reference, not to itself. `tests/vectors/q_reference.json` is five vectors whose every byte came out of the Go chain — its encoder's wires and its parser's verdicts, ids included — and `src/wire.rs` asserts the Go encoder's own bytes for a preimage and an unsigned envelope as constants. `src/bin/conformance.rs` answers the cross-language corpus in the runner's own format; over the four Q vectors, Go and Rust agree on every compared field, including this chain's genesis id. 118 tests, no stubs. Two places are narrower than Go and say so rather than faking: ML-DSA-44 and -87 cannot be signed under here because libluxcrypto exposes only -65 (asking is an error, never a silent downgrade), and batch verification is CPU-parallel because the accelerator's ML-DSA kernel is reachable from Go only. `/bin/` in .gitignore is anchored to the repo root: unanchored it also swallowed `chains/rust/*/src/bin/`, which is where the differential's Rust evaluators live.
82 lines
4.4 KiB
JSON
82 lines
4.4 KiB
JSON
[
|
|
{
|
|
"id": "Q_BASE_TX",
|
|
"chain": "Q",
|
|
"name": "QuantumVM Base Transaction",
|
|
"description": "The signature preimage: what a Q-Chain transaction IS, and what its id is the hash of",
|
|
"category": "tx_wire",
|
|
"wire_hex": "5a415000020000001000000043000000e8030000000000006400000000000000080000001b0000007175616e74756d2d696e737472756374696f6e2d7061796c6f6164",
|
|
"expected_action": "verify",
|
|
"is_l1_fork_gate": false,
|
|
"go_expectation": {
|
|
"valid": true,
|
|
"tx_type": "QuantumBaseTx",
|
|
"status": "ACCEPTED",
|
|
"tx_id": "26DCaQ56VyQfmWEpZKmYXjzMGVZrCYSs7XFQvV7DQuYbc2v8tz",
|
|
"tx_id_hex": "8f86dca5f8117440ff0a3ebe24b3a5810811a990ef5369822a9838707d7a3873"
|
|
}
|
|
},
|
|
{
|
|
"id": "Q_TX_ENVELOPE",
|
|
"chain": "Q",
|
|
"name": "QuantumVM Transaction Envelope",
|
|
"description": "The preimage plus the ML-DSA signature over it — what rides in a block",
|
|
"category": "tx_wire",
|
|
"wire_hex": "5a4150000200000010000000830000003000000043000000000000000000000000001a3deb03b2a10000000000000000000000000000000000000000000000005a415000020000001000000043000000e8030000000000006400000000000000080000001b0000007175616e74756d2d696e737472756374696f6e2d7061796c6f6164",
|
|
"expected_action": "verify_envelope",
|
|
"is_l1_fork_gate": false,
|
|
"go_expectation": {
|
|
"valid": true,
|
|
"tx_type": "QuantumBaseTx",
|
|
"status": "ACCEPTED",
|
|
"tx_id": "26DCaQ56VyQfmWEpZKmYXjzMGVZrCYSs7XFQvV7DQuYbc2v8tz",
|
|
"tx_id_hex": "8f86dca5f8117440ff0a3ebe24b3a5810811a990ef5369822a9838707d7a3873"
|
|
}
|
|
},
|
|
{
|
|
"id": "Q_BLOCK",
|
|
"chain": "Q",
|
|
"name": "QuantumVM Canonical Block",
|
|
"description": "A block over one transaction, encoded as the Go chain encodes one",
|
|
"category": "block_wire",
|
|
"wire_hex": "5a4150000200000018000000030100008300000000000000e803000000000000010000000000000001010101010101010101010101010101010101010101010101010101010101011e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e0100000000000000a0ffffff0100000008000000830000005a4150000200000010000000830000003000000043000000000000000000000000001a3deb03b2a10000000000000000000000000000000000000000000000005a415000020000001000000043000000e8030000000000006400000000000000080000001b0000007175616e74756d2d696e737472756374696f6e2d7061796c6f6164",
|
|
"expected_action": "block_accept",
|
|
"is_l1_fork_gate": false,
|
|
"go_expectation": {
|
|
"valid": true,
|
|
"status": "ACCEPTED",
|
|
"block_id": "2thq7BJZUJF3PQMQgMmeFoELS7xnSPFvGBvDr3DbWNN4e9eivL",
|
|
"block_id_hex": "f918a3f093723ed8619cfa0f63324525c907d05e13435e430d7cbbe103da382d"
|
|
}
|
|
},
|
|
{
|
|
"id": "Q_BLOCK_PADDED",
|
|
"chain": "Q",
|
|
"name": "QuantumVM Block With Padding",
|
|
"description": "The same block with a byte past its content and the declared size grown to cover it — one block under two ids",
|
|
"category": "block_wire",
|
|
"wire_hex": "5a4150000200000018000000040100008300000000000000e803000000000000010000000000000001010101010101010101010101010101010101010101010101010101010101011e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e0100000000000000a0ffffff0100000008000000830000005a4150000200000010000000830000003000000043000000000000000000000000001a3deb03b2a10000000000000000000000000000000000000000000000005a415000020000001000000043000000e8030000000000006400000000000000080000001b0000007175616e74756d2d696e737472756374696f6e2d7061796c6f616400",
|
|
"expected_action": "block_reject",
|
|
"is_l1_fork_gate": false,
|
|
"go_expectation": {
|
|
"valid": false,
|
|
"status": "REJECTED",
|
|
"reason": "quantumvm: block wire is not the canonical encoding of its content"
|
|
}
|
|
},
|
|
{
|
|
"id": "Q_BLOCK_BODY_IN_BLOB",
|
|
"chain": "Q",
|
|
"name": "QuantumVM Block Carrying A Preimage",
|
|
"description": "A block whose transaction blob holds the signature preimage where the envelope belongs",
|
|
"category": "block_wire",
|
|
"wire_hex": "5a4150000200000018000000c30000004300000000000000e803000000000000010000000000000001010101010101010101010101010101010101010101010101010101010101011e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e0100000000000000a0ffffff0100000008000000430000005a415000020000001000000043000000e8030000000000006400000000000000080000001b0000007175616e74756d2d696e737472756374696f6e2d7061796c6f6164",
|
|
"expected_action": "block_reject",
|
|
"is_l1_fork_gate": false,
|
|
"go_expectation": {
|
|
"valid": false,
|
|
"status": "REJECTED",
|
|
"reason": "quantumvm: transaction 0: zap: buffer too small"
|
|
}
|
|
}
|
|
] |