Chris Duncan [Fri, 27 Jun 2025 00:54:38 +0000 (17:54 -0700)]
Refactor BLAKE2b codegen.
Combine API-specific blake code generation files into one abstracted script.
Reset hashes between score benchmark runs so it doesn't pull from cache.
Chris Duncan [Sat, 21 Jun 2025 06:17:08 +0000 (23:17 -0700)]
Fix WASM in puppeteer.
The puppeteer browser instance loads NanoPow with a script and includes CSP. While it specifically uses WebGPU for performance, it was discovered that WASM would not load due to missing required CSP directives, so they have been added.
The reduced WASM iteration count has been reverted since it seems to be an issue with Firefox and not Chromium.
Adjust logging.
Chris Duncan [Fri, 20 Jun 2025 08:55:58 +0000 (01:55 -0700)]
Fix WASM workers.
Worker was removing listener when stopped but was then deaf to main thread, so restore listener after posting its message back.
Reduce WASM module iterations to get results more often from slower hardware.
Chris Duncan [Wed, 18 Jun 2025 20:21:44 +0000 (13:21 -0700)]
Unblock CPU loop.
CPU work_generate now returns a promise and iterates a limited loop before re-calling itself on the next animation frame. This unblocks the main thread and allows the environment to reload properly, i.e. refresh the browser tab.
Chris Duncan [Wed, 18 Jun 2025 14:29:42 +0000 (07:29 -0700)]
Move server execution into npm script.
This simplifies the bash script. It also allows the example systemd service to use a Type of "simple" and eliminates the PIDFile requirement. The console output is unnecessary when using systemd since the expectation is that logs go to the journal only.
Chris Duncan [Wed, 18 Jun 2025 14:29:42 +0000 (07:29 -0700)]
Move server execution into npm script.
This simplifies the bash script. It also allows the example systemd service to use a Type of "simple" and eliminates the PIDFile requirement. The console output is unnecessary when using systemd since the expectation is that logs go to the journal only.
Chris Duncan [Sat, 14 Jun 2025 18:41:48 +0000 (11:41 -0700)]
Add and update available APIs.
Add WASM and CPU implementations.
Add API options parameter.
Add scripts to generate shaders and AssemblyScript.
Add sample systemd service for server.
Add Logger and Queue utility classes.
Fix CLI and server IPC.
Add WorkErrorResponse type.
Improve type checking and config checking.
Move generate APIs into their own directory.
Chris Duncan [Tue, 6 May 2025 21:41:36 +0000 (14:41 -0700)]
Extract some basic shared code into utils file and bundle it. Simplify lib exports. Introduce new typings for server config and PoW results. Clean up CLI and fix some minor issues. Limit Node heap to improve CLI and server performance. Refactor server to extract code into manageable helper functions, improve organization, and fix some minor issues. Restrict difficulty to maximum of network difficulty to mitigate DoS attacks. Merge shared code in work calls in GPU implementation and extract it into modular functions. Implement work queue to better manage inbound requests. Fix nonce check in compute shader. Fix test page benchmark results from not being sorted properly. Update server test script.