nano-rspow-python 0.17.1__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.
Files changed (25) hide show
  1. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/Cargo.lock +6 -6
  2. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/Cargo.toml +1 -1
  3. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/PKG-INFO +1 -1
  4. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/README.md +32 -3
  5. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/benches/pow_benchmark.rs +15 -3
  6. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/cpu.rs +27 -13
  7. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/lib.rs +3 -3
  8. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/src/lib.rs +1 -3
  9. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/README.md +0 -0
  10. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/Cargo.toml +0 -0
  11. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/difficulty.rs +0 -0
  12. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/opencl_backend/mod.rs +0 -0
  13. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/opencl_backend/pow.cl +0 -0
  14. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/thresholds.rs +0 -0
  15. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/types.rs +0 -0
  16. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_backend/mod.rs +0 -0
  17. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_backend/pow.wgsl +0 -0
  18. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow/src/wgpu_shared.rs +0 -0
  19. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/Cargo.toml +0 -0
  20. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/README.md +0 -0
  21. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/build.rs +0 -0
  22. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/nano_rspow.pyi +0 -0
  23. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/tests/test_pow.py +0 -0
  24. {nano_rspow_python-0.17.1 → nano_rspow_python-0.18.0}/nano-rspow-python/uv.lock +0 -0
  25. {nano_rspow_python-0.17.1 → 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.17.1"
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.17.1"
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.17.1"
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.17.1"
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.17.1"
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.17.1"
816
+ version = "0.18.0"
817
817
  dependencies = [
818
818
  "bytemuck",
819
819
  "getrandom",
@@ -3,7 +3,7 @@ members = ["nano-rspow", "nano-rspow-python"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "0.17.1"
6
+ version = "0.18.0"
7
7
  edition = "2024"
8
8
  license = "MIT"
9
9
  repository = "https://github.com/CasualSecurityInc/nano-rspow"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nano-rspow-python
3
- Version: 0.17.1
3
+ Version: 0.18.0
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: Programming Language :: Python :: 3.9
@@ -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
@@ -52,10 +57,34 @@ See the [nano-rspow-node README](https://github.com/CasualSecurityInc/nano-rspow
52
57
 
53
58
  ### 3. Interactive Web Dashboard
54
59
  Build and open the self-contained browser dashboard. It tests WebGPU and a Web Worker CPU fallback:
60
+
61
+ ```bash
62
+ make web-prereqs # once, after cloning: wasm32 target, wasm-bindgen, npm deps
63
+ make web-demo # build the dashboard and open it
64
+ ```
65
+
66
+ `make web-prereqs` adds the `wasm32-unknown-unknown` Rust target, checks for the
67
+ `wasm-bindgen` CLI and explains how to install it if absent, and installs the npm
68
+ dependencies. It is safe to re-run. After that:
69
+
55
70
  ```bash
56
- cargo benchmark-web
71
+ make web-demo-check # is the built page present, complete and up to date?
72
+ make web-clean # discard the generated dashboard
57
73
  ```
58
74
 
75
+ The dashboard is written to `nano-rspow-web/browser-demo/index.html` as a single
76
+ self-contained file — the WebAssembly, the wasm-bindgen glue and the WGSL shader
77
+ are all inlined, so it runs straight from disk. It is **generated, not
78
+ committed**, so a stale copy can never be opened by mistake; `make web-demo-check`
79
+ tells you if the copy on disk is missing or older than the crate.
80
+
81
+ There is also a head-to-head dashboard that compares this package against
82
+ `nano-pow`, the `nano-rspow-node` addon and the Rust CLI work peer. It needs the
83
+ native addon, so it is a separate target: `make web-compare-run` serves it on
84
+ <http://localhost:8080/>. See the
85
+ [nano-rspow-web README](https://github.com/CasualSecurityInc/nano-rspow/blob/HEAD/nano-rspow-web/README.md)
86
+ for the full set of options.
87
+
59
88
  ---
60
89
 
61
90
  ## 📦 Documentation & Release Channels
@@ -67,7 +96,7 @@ Below is the directory mapping for each target, along with their primary release
67
96
  | **Rust (Core)** | [crate API documentation](nano-rspow/src/lib.rs) | [GitHub Releases](https://github.com/CasualSecurityInc/nano-rspow/releases) |
68
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) |
69
98
  | **Python** | [nano-rspow-python README](nano-rspow-python/README.md) | [PyPI (pip)](https://pypi.org/project/nano-rspow-python/) |
70
- | **Go** | [nano-rspow-go README](nano-rspow-go/README.md) | Go module source checkout |
99
+ | **Go** | [nano-rspow-go README](nano-rspow-go/README.md) | Versioned Go module with native libraries |
71
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/) |
72
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) |
73
102
 
@@ -86,7 +115,7 @@ This monorepo is organized into specialized workspaces to deliver native perform
86
115
  ├── nano-rspow-go/ # Go module and nano-rspow-go streaming CLI
87
116
  ├── nano-rspow-node/ # High-performance Node.js & TypeScript native bindings (N-API)
88
117
  ├── nano-rspow-python/ # Native PyO3 bindings for Python environments
89
- └── nano-rspow-web/ # Web/WASM target crate & self-contained HTML benchmarking dashboard
118
+ └── nano-rspow-web/ # Web/WASM target crate & the two HTML benchmarking dashboards
90
119
  ```
91
120
 
92
121
  ---
@@ -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(|| generator.generate(&BENCH_HASH, thresholds::testing::DEV).unwrap());
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(|| generator.generate(&BENCH_HASH, thresholds::testing::DEV).unwrap());
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(|| generator.generate(&BENCH_HASH, thresholds::legacy::EPOCH1).unwrap());
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 { hash, threshold, done, cancel, result_tx } => {
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.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
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.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
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.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
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.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
369
- let nonce2 = backend.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
370
- let nonce3 = backend.generate(&hash, thresholds::testing::DEV, &cancel).unwrap();
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}"))?