Verify BM1362 capture through shared miner work path
next-build / build (push) Canceled after 0s

This commit is contained in:
2026-10-15 05:50:00 -06:00
parent f011557cd5
commit 59249d44d3
2 changed files with 38 additions and 1 deletions
+3 -1
View File
@@ -67,7 +67,9 @@ boot or a production board adapter.
The same strict pool fixture reconstructs one BM1362 job with an empty
extranonce2 and independently verifies its captured share before returning
ACCEPT. This extends the host pool path to a second chip family; physical
chain initialization and stock firmware remain unverified.
chain initialization and stock firmware remain unverified. A separate Rust
integration test feeds the pinned BM1362 header and 11-byte report through
the mining controller's work encoder, report decoder, and proof check.
The core also validates a supplied Litecoin Scrypt header using the fixed
N=1024, r=1, p=1 algorithm. Its output matches Litecoin's
[published block 29255 proof-of-work vector](https://github.com/litecoin-project/litecoin/wiki/Scrypt-proof-of-work)
+35
View File
@@ -124,6 +124,41 @@ fn captured_nonce_passes_a_started_miner() {
);
}
#[test]
fn real_bm1362_capture_uses_shared_bm13xx_work_and_report_frames() {
// SDK capture bm1362-real-nonces.txt: one real-silicon pool-accepted share.
// This checks host framing and proof only; board initialization is separate.
let header_hex = concat!(
"00000020fc3ab8d43021f45eb662389d0f791f657dbf75a5cb93670b57b6c22503b4213a",
"0503969b7384e1215aace8cfc65dae22d8493ad48fec0b7ac3b0ad7b4e7fb0c5",
"c0012e6a8f06021700000000"
);
let mut header = [0_u8; 80];
for (byte, pair) in header.iter_mut().zip(header_hex.as_bytes().chunks_exact(2)) {
*byte = u8::from_str_radix(std::str::from_utf8(pair).unwrap(), 16).unwrap();
}
let report = [
0xaa, 0x55, 0x33, 0x25, 0x0b, 0x63, 0x00, 0x18, 0x67, 0x6b, 0x95,
];
let mut backend = FakeBackend {
temperatures: vec![50_000; 3],
report: Some(report),
..Default::default()
};
{
let mut miner = Bm1366Miner::new(&mut backend, 0, 0, 0, 100, 80_000).unwrap();
miner.start().unwrap();
miner.submit(header, diff_one(), 0x18).unwrap();
let share = miner.poll().unwrap().unwrap();
assert_eq!(share.nonce, 0x630b_2533);
assert_eq!(share.work_id, 0x18);
assert_eq!(share.rolled_version, 0x2ced_6000);
miner.stop().unwrap();
}
assert!(!backend.powered);
assert_eq!(&backend.sent[10..14], &header[72..76]);
}
#[test]
fn hot_or_missing_sensor_stops_power() {
let mut hot = FakeBackend {