nano-rspow-python 0.17.2__tar.gz → 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/Cargo.lock +6 -6
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/Cargo.toml +1 -1
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/PKG-INFO +1 -1
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/README.md +6 -1
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/benches/pow_benchmark.rs +15 -3
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/cpu.rs +27 -13
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/lib.rs +3 -3
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/src/lib.rs +1 -3
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/README.md +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/Cargo.toml +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/difficulty.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/opencl_backend/mod.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/opencl_backend/pow.cl +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/thresholds.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/types.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_backend/mod.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_backend/pow.wgsl +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_shared.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/Cargo.toml +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/README.md +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/build.rs +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/nano_rspow.pyi +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/tests/test_pow.py +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/nano-rspow-python/uv.lock +0 -0
- {nano_rspow_python-0.17.2 → nano_rspow_python-0.18.0}/pyproject.toml +0 -0
|
@@ -757,7 +757,7 @@ dependencies = [
|
|
|
757
757
|
|
|
758
758
|
[[package]]
|
|
759
759
|
name = "nano-rspow"
|
|
760
|
-
version = "0.
|
|
760
|
+
version = "0.18.0"
|
|
761
761
|
dependencies = [
|
|
762
762
|
"blake2b_simd",
|
|
763
763
|
"bytemuck",
|
|
@@ -773,7 +773,7 @@ dependencies = [
|
|
|
773
773
|
|
|
774
774
|
[[package]]
|
|
775
775
|
name = "nano-rspow-cli"
|
|
776
|
-
version = "0.
|
|
776
|
+
version = "0.18.0"
|
|
777
777
|
dependencies = [
|
|
778
778
|
"clap",
|
|
779
779
|
"hex",
|
|
@@ -785,14 +785,14 @@ dependencies = [
|
|
|
785
785
|
|
|
786
786
|
[[package]]
|
|
787
787
|
name = "nano-rspow-ffi"
|
|
788
|
-
version = "0.
|
|
788
|
+
version = "0.18.0"
|
|
789
789
|
dependencies = [
|
|
790
790
|
"nano-rspow",
|
|
791
791
|
]
|
|
792
792
|
|
|
793
793
|
[[package]]
|
|
794
794
|
name = "nano-rspow-node"
|
|
795
|
-
version = "0.
|
|
795
|
+
version = "0.18.0"
|
|
796
796
|
dependencies = [
|
|
797
797
|
"hex",
|
|
798
798
|
"nano-rspow",
|
|
@@ -804,7 +804,7 @@ dependencies = [
|
|
|
804
804
|
|
|
805
805
|
[[package]]
|
|
806
806
|
name = "nano-rspow-python"
|
|
807
|
-
version = "0.
|
|
807
|
+
version = "0.18.0"
|
|
808
808
|
dependencies = [
|
|
809
809
|
"hex",
|
|
810
810
|
"nano-rspow",
|
|
@@ -813,7 +813,7 @@ dependencies = [
|
|
|
813
813
|
|
|
814
814
|
[[package]]
|
|
815
815
|
name = "nano-rspow-web"
|
|
816
|
-
version = "0.
|
|
816
|
+
version = "0.18.0"
|
|
817
817
|
dependencies = [
|
|
818
818
|
"bytemuck",
|
|
819
819
|
"getrandom",
|
|
@@ -28,6 +28,11 @@ for the network requirements.
|
|
|
28
28
|
## ⚡ Quick Start
|
|
29
29
|
|
|
30
30
|
### 1. Standalone CLI
|
|
31
|
+
The native release workflow produces CLI archives for macOS and Linux
|
|
32
|
+
(arm64/amd64), and Windows (amd64), with SHA-256 checksums. See the
|
|
33
|
+
[native release guide](scripts/release/README.md) for artifact names and the
|
|
34
|
+
Go module distribution process.
|
|
35
|
+
|
|
31
36
|
Install from crates.io (requires a Rust toolchain):
|
|
32
37
|
```bash
|
|
33
38
|
cargo install nano-rspow-cli
|
|
@@ -91,7 +96,7 @@ Below is the directory mapping for each target, along with their primary release
|
|
|
91
96
|
| **Rust (Core)** | [crate API documentation](nano-rspow/src/lib.rs) | [GitHub Releases](https://github.com/CasualSecurityInc/nano-rspow/releases) |
|
|
92
97
|
| **Node.js & TS** | [nano-rspow-node README](https://github.com/CasualSecurityInc/nano-rspow/blob/HEAD/nano-rspow-node/README.md) | [Public NPM package](https://www.npmjs.com/package/nano-rspow-node) |
|
|
93
98
|
| **Python** | [nano-rspow-python README](nano-rspow-python/README.md) | [PyPI (pip)](https://pypi.org/project/nano-rspow-python/) |
|
|
94
|
-
| **Go** | [nano-rspow-go README](nano-rspow-go/README.md) | Go module
|
|
99
|
+
| **Go** | [nano-rspow-go README](nano-rspow-go/README.md) | Versioned Go module with native libraries |
|
|
95
100
|
| **Web (WASM / WebGPU)** | [nano-rspow-web/README.md](nano-rspow-web/README.md) | [Public NPM package](https://www.npmjs.com/package/nano-rspow-web) + [🎛️ Demo](https://csi.ninzin.net/nano-rspow/) |
|
|
96
101
|
| **CLI Tool** | [nano-rspow-cli README](nano-rspow-cli/README.md) | The only full-featured `nano-rspow` executable: [crates.io](https://crates.io/crates/nano-rspow-cli) · [GitHub Releases](https://github.com/CasualSecurityInc/nano-rspow/releases) |
|
|
97
102
|
|
|
@@ -41,7 +41,11 @@ fn bench_cpu_generation(c: &mut Criterion) {
|
|
|
41
41
|
// Only dev threshold: higher tiers take 1-2 s per sample.
|
|
42
42
|
group.bench_function("dev", |b| {
|
|
43
43
|
let generator = nano_rspow::WorkGenerator::cpu();
|
|
44
|
-
b.iter(||
|
|
44
|
+
b.iter(|| {
|
|
45
|
+
generator
|
|
46
|
+
.generate(&BENCH_HASH, thresholds::testing::DEV)
|
|
47
|
+
.unwrap()
|
|
48
|
+
});
|
|
45
49
|
});
|
|
46
50
|
|
|
47
51
|
group.finish();
|
|
@@ -65,7 +69,11 @@ fn bench_gpu_generation(c: &mut Criterion) {
|
|
|
65
69
|
group.throughput(Throughput::Elements(1));
|
|
66
70
|
|
|
67
71
|
group.bench_function("dev", |b| {
|
|
68
|
-
b.iter(||
|
|
72
|
+
b.iter(|| {
|
|
73
|
+
generator
|
|
74
|
+
.generate(&BENCH_HASH, thresholds::testing::DEV)
|
|
75
|
+
.unwrap()
|
|
76
|
+
});
|
|
69
77
|
});
|
|
70
78
|
|
|
71
79
|
group.bench_function("receive", |b| {
|
|
@@ -88,7 +96,11 @@ fn bench_gpu_generation(c: &mut Criterion) {
|
|
|
88
96
|
group.sampling_mode(SamplingMode::Flat);
|
|
89
97
|
|
|
90
98
|
group.bench_function("legacy_epoch1", |b| {
|
|
91
|
-
b.iter(||
|
|
99
|
+
b.iter(|| {
|
|
100
|
+
generator
|
|
101
|
+
.generate(&BENCH_HASH, thresholds::legacy::EPOCH1)
|
|
102
|
+
.unwrap()
|
|
103
|
+
});
|
|
92
104
|
});
|
|
93
105
|
|
|
94
106
|
group.bench_function("send", |b| {
|
|
@@ -106,7 +106,13 @@ impl CpuBackend {
|
|
|
106
106
|
|
|
107
107
|
match cmd {
|
|
108
108
|
WorkCommand::Stop => return,
|
|
109
|
-
WorkCommand::Search {
|
|
109
|
+
WorkCommand::Search {
|
|
110
|
+
hash,
|
|
111
|
+
threshold,
|
|
112
|
+
done,
|
|
113
|
+
cancel,
|
|
114
|
+
result_tx,
|
|
115
|
+
} => {
|
|
110
116
|
const BATCH: usize = 256;
|
|
111
117
|
|
|
112
118
|
loop {
|
|
@@ -242,7 +248,9 @@ mod tests {
|
|
|
242
248
|
let hash = [0u8; 32];
|
|
243
249
|
let backend = CpuBackend::new();
|
|
244
250
|
let cancel = CancelToken::new();
|
|
245
|
-
let nonce = backend
|
|
251
|
+
let nonce = backend
|
|
252
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
253
|
+
.unwrap();
|
|
246
254
|
let diff = difficulty::compute(&hash, nonce);
|
|
247
255
|
assert!(
|
|
248
256
|
diff >= thresholds::testing::DEV,
|
|
@@ -275,7 +283,9 @@ mod tests {
|
|
|
275
283
|
|
|
276
284
|
let backend = CpuBackend::new();
|
|
277
285
|
let cancel = CancelToken::new();
|
|
278
|
-
let nonce = backend
|
|
286
|
+
let nonce = backend
|
|
287
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
288
|
+
.unwrap();
|
|
279
289
|
let diff = difficulty::compute(&hash, nonce);
|
|
280
290
|
assert!(diff >= thresholds::testing::DEV);
|
|
281
291
|
}
|
|
@@ -288,7 +298,9 @@ mod tests {
|
|
|
288
298
|
|
|
289
299
|
// Multiple calls on the same backend should all produce valid work
|
|
290
300
|
for _ in 0..5 {
|
|
291
|
-
let nonce = backend
|
|
301
|
+
let nonce = backend
|
|
302
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
303
|
+
.unwrap();
|
|
292
304
|
let diff = difficulty::compute(&hash, nonce);
|
|
293
305
|
assert!(
|
|
294
306
|
diff >= thresholds::testing::DEV,
|
|
@@ -312,9 +324,7 @@ mod tests {
|
|
|
312
324
|
.map(|_| {
|
|
313
325
|
let backend = Arc::clone(&backend);
|
|
314
326
|
let cancel = cancel.clone();
|
|
315
|
-
thread::spawn(move ||
|
|
316
|
-
backend.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
317
|
-
})
|
|
327
|
+
thread::spawn(move || backend.generate(&hash, thresholds::testing::DEV, &cancel))
|
|
318
328
|
})
|
|
319
329
|
.collect();
|
|
320
330
|
|
|
@@ -344,9 +354,7 @@ mod tests {
|
|
|
344
354
|
let cancel = CancelToken::new();
|
|
345
355
|
|
|
346
356
|
let cancel_clone = cancel.clone();
|
|
347
|
-
let handle = thread::spawn(move ||
|
|
348
|
-
backend.generate(&hash, u64::MAX, &cancel_clone)
|
|
349
|
-
});
|
|
357
|
+
let handle = thread::spawn(move || backend.generate(&hash, u64::MAX, &cancel_clone));
|
|
350
358
|
|
|
351
359
|
thread::sleep(std::time::Duration::from_millis(100));
|
|
352
360
|
cancel.cancel();
|
|
@@ -365,9 +373,15 @@ mod tests {
|
|
|
365
373
|
let backend = CpuBackend::new();
|
|
366
374
|
let cancel = CancelToken::new();
|
|
367
375
|
|
|
368
|
-
let nonce1 = backend
|
|
369
|
-
|
|
370
|
-
|
|
376
|
+
let nonce1 = backend
|
|
377
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
378
|
+
.unwrap();
|
|
379
|
+
let nonce2 = backend
|
|
380
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
381
|
+
.unwrap();
|
|
382
|
+
let nonce3 = backend
|
|
383
|
+
.generate(&hash, thresholds::testing::DEV, &cancel)
|
|
384
|
+
.unwrap();
|
|
371
385
|
|
|
372
386
|
// Three nonces from a seeded RNG with 2^64 space should all be distinct.
|
|
373
387
|
assert_ne!(nonce1, nonce2, "same nonce on consecutive generate calls");
|
|
@@ -210,17 +210,17 @@ pub fn recommend_local_pow() -> bool {
|
|
|
210
210
|
hashes += 1;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
|
|
214
214
|
let elapsed_secs = start.elapsed().as_secs_f64();
|
|
215
215
|
let hashes_per_sec = hashes as f64 / elapsed_secs;
|
|
216
|
-
|
|
216
|
+
|
|
217
217
|
#[cfg(not(target_arch = "wasm32"))]
|
|
218
218
|
let core_count = rayon::current_num_threads() as f64;
|
|
219
219
|
#[cfg(target_arch = "wasm32")]
|
|
220
220
|
let core_count = 1.0;
|
|
221
221
|
|
|
222
222
|
let estimated_total_hps = hashes_per_sec * core_count;
|
|
223
|
-
|
|
223
|
+
|
|
224
224
|
// Target: ~15 MH/s minimum for reasonable current send-threshold speed.
|
|
225
225
|
estimated_total_hps >= 15_000_000.0
|
|
226
226
|
};
|
|
@@ -298,9 +298,7 @@ fn parse_cli_request(line: &str) -> Result<(String, [u8; 32], u64), String> {
|
|
|
298
298
|
let hash = parse_hash(&hash_text).map_err(|error| error.to_string())?;
|
|
299
299
|
let threshold = if let Some(threshold_text) = parts.get(1).map(|part| part.trim()) {
|
|
300
300
|
if !threshold_text.starts_with("0x") {
|
|
301
|
-
return Err(format!(
|
|
302
|
-
"threshold {threshold_text:?} must start with 0x"
|
|
303
|
-
));
|
|
301
|
+
return Err(format!("threshold {threshold_text:?} must start with 0x"));
|
|
304
302
|
}
|
|
305
303
|
u64::from_str_radix(&threshold_text[2..], 16)
|
|
306
304
|
.map_err(|error| format!("invalid threshold {threshold_text:?}: {error}"))?
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|