Chris Duncan [Mon, 14 Apr 2025 15:27:45 +0000 (08:27 -0700)]
Use SIGHUP to reload config except PORT which requires relaunching the server. Refactor CLI to spawn server as child process and get port from OS dynamically using IPC. Fix fast exit by handling SIGINT and SIGTERM ourselves.
Chris Duncan [Sun, 13 Apr 2025 04:59:01 +0000 (21:59 -0700)]
Print server error if it does not launch, typically due to puppeteer issue. Reset on error reading from GPU instead of trying an infinite dispatch loop. Reduce interval for checking that GPU is not busy to half a second. Reset initialization flag when resetting NanoPowGpu. Fix abort call on timeout in cli. Extend CLI abort timeout to a full minute to accomodate low-power devices. Fix whitespace for inline help.
Chris Duncan [Sat, 12 Apr 2025 05:13:42 +0000 (22:13 -0700)]
Simplify GPU compute by reverting to vec2 and implementing G function since performance difference is almost nonexistent and the real benefit comes from native u64 types which do not yet exist in WGSL. Increase workgroup size to best value 96 found during testing on RTX 3070. Create --benchmark CLI argument. Store seed and blockhash in fast shared workgroup memory. Add benchmark convenience npm script. Fix documentation in inline help and manual page. Fix CLI default port collision with server default port. Change timestamp on server log files. Test concurrent curl requests to server. Fix action listed in server response error message. Update puppeteer and test page HTML with blank favicon to prevent unnecessary load.
Chris Duncan [Thu, 27 Mar 2025 21:03:44 +0000 (14:03 -0700)]
Overhaul server to consolidate work methods into one function. Overhaul CLI to spin up server and request work instead of using its own puppeteer instance since testing found the server overhead to be negligible in comparison to puppeteer. Remove size getter from GL. Fix types and related imports. Add more environment variables to control server behavior. Add tests to server test script. Update package configuration files.
Chris Duncan [Wed, 26 Mar 2025 15:04:11 +0000 (08:04 -0700)]
Ignore all arguments when starting server and use envvars instead. Read NANO_POW_EFFORT from environment when starting server. Update test script to use port 3001 to test custom value. Pass NanoPowOptions object into puppeteer evaluate calls. Update README to use destructuring assignment for output clarity and to use new method names. Add more command line guidance to README. Fix default effort used by server to match the actual implementation and fix README accordingly. Add --server documentation to manual. Fix threshold/difficulty ranges throughout documentation and remove mention of u32 threshold workaround from README. Whitespace.
Chris Duncan [Fri, 21 Mar 2025 16:40:23 +0000 (09:40 -0700)]
Implement server.
Add executable start a Node server, accept POST requests in same JSON format as Nano node specs, and process similarly to CLI using puppeteer. Remove migration compatibility layer introduced in v3.2.0. Extract help text to separate documentation file. Write basic test script to check server. Refactor threshold to expect 64-bit values only. Fix Typescript types.
Chris Duncan [Thu, 20 Mar 2025 21:56:55 +0000 (14:56 -0700)]
Set up for v4
Add two new methods which align with Nano node RPC actions. Return more data from hash result. Indicate a more specific `threshold` by passing a full 16-character string to the new `work_` methods. Changed `NanoPowGl.size` property to return total pixel count. Add typings for request and response objects consumed by new `work_` methods. Add more tests for receive threshold edge cases. Improve build process. Expand documentation.
Chris Duncan [Sun, 16 Mar 2025 06:22:33 +0000 (23:22 -0700)]
Reorganize source directory structure.
Put documentation and test files into top-level folders. Divide PoW modules by API instead of by file type. Update file paths accordingly. Replace a duplicate sample blockhash.
Chris Duncan [Sat, 15 Mar 2025 19:22:11 +0000 (12:22 -0700)]
Updated cli to accept input from stdin like redirects and pipes. Add JSON output option to cli. Updated documentation for new cli features. Refactor gl draw shader to align with gpu compute shader on blake2b initialization. Update README license section. Rename file of test blockhashes since they are not work seeds.
Chris Duncan [Thu, 13 Mar 2025 16:31:26 +0000 (09:31 -0700)]
At just 2.8 KiB, the Terms page is the most lightweight chrome:// URL, so use it for CLI instead of chrome://newtab which is over 25 times larger at 74.0 KiB.
Chris Duncan [Thu, 13 Mar 2025 15:29:40 +0000 (08:29 -0700)]
Fix incorrect final digest XOR in threshold comparison to properly use initialized state instead of using default state without the necessary parameter block.
Chris Duncan [Thu, 13 Mar 2025 15:28:30 +0000 (08:28 -0700)]
Flip compute shader UBO property order to be consistent with GL draw shader and to allow properties to be added later without messing up alignment too much.
Chris Duncan [Thu, 13 Mar 2025 01:34:01 +0000 (18:34 -0700)]
Merge cli into main
Create command line tool using puppeteer that can be executed when
installed globally.
Write man page for cli.
Fix subtle bug in final XOR line of compute shader only observed when
using max threshold value.
Added test cases to check for max threshold bug in the future.
Reorganize compute shader v initialization to improve clarity.
Add more debugging output when flag is enabled.
Delay GL canvas initialization to allow it to fail gracefully in
unsupported environments.
Fix JSdoc comments.
Add bug report email to README.
Update dependencies.
Chris Duncan [Wed, 12 Mar 2025 21:09:52 +0000 (14:09 -0700)]
Fix subtle but important carry bit bug that allowed valid nonces to be generated that were technically incorrect but close enough to the correct value that it wasn't caught until now.
Chris Duncan [Tue, 11 Mar 2025 18:03:56 +0000 (11:03 -0700)]
Apply fix for WebGPU not loading in about:blank page but also rejecting HTML content overwrites in trusted chrome:// pages. Switch from complete overwrite of content to script injection.
Chris Duncan [Sun, 9 Mar 2025 09:20:49 +0000 (01:20 -0800)]
Use file contents injected directly into HTML string to load NanoPow into puppeteer browser page instance. Add flags marked by Chrome dev team. WebGPU still does not seem to work; this is using WebGL, but it is at least working.