# Changelog
+## v5.2.1
+
+### Notable Changes
+
+- Use static import map on test webpage instead of async dynamic import.
+- Reduce WebGL canvas size on test webpage to prevent crashing on iOS.
+
## v5.2.0
### Notable Changes
### Other Changes
- Refactor server to extract code into manageable helper functions, improve
-organization, and fix some minor issues.
+ organization, and fix some minor issues.
- Merge shared code in GPU implementation work calls and extract it into modular
-functions.
+ functions.
- Extract some basic shared code into utils file and bundle it.
- Simplify lib exports.
- Introduce new typings for server config and PoW results.
- Lower timeout duration when tool is busy.
- Allow difficulty of zero.
- Throw an error if work to be validated does not match the nonce returned by
-the compute result.
+ the compute result.
- Add max HTTP header size limit to launch script to protect server process.
- Check more generate calls in test script, and reduce run size of benchmark.
- Tweak error messaging.
- Save server logs by day instead of by execution.
- Display server process ID on every log entry instead of just once when
-starting server.
+ starting server.
- Adjust log timestamp formatting.
## v4.1.3
### Notable Changes
- Use SIGHUP to reload configuration values (except PORT which requires
-relaunching the server).
+ relaunching the server).
- Refactor CLI to spawn the server as a child process so that it can be assigned a
-port from the operating system dynamically, avoiding port collisions with other
-processes and subsequent failure, and communicate it to the CLI using IPC.
+ port from the operating system dynamically, avoiding port collisions with other
+ processes and subsequent failure, and communicate it to the CLI using IPC.
- Fix fast exit failing to clean up resources by handling SIGINT and SIGTERM.
## v4.1.2
### Notable Changes
- Load configuration from file (`$HOME/.nano-pow/config`) and use it to set
-execution options if relevant environment variables are not present.
+ execution options if relevant environment variables are not present.
## v4.1.1
### Notable Changes
- Change default port to 5040 to reduce collisions with other projects which
-commonly specify a default port of 3000.
+ commonly specify a default port of 3000.
- Improve formatting of environment variable documentation.
## v4.0.10
### Notable Changes
- Complete conversion from `threshold` terminology and parameters to `difficulty`
-to align with official Nano node specifications.
+ to align with official Nano node specifications.
- Update documentation.
- Remove deprecated functions from type definition file.
### Notable Changes
- Initialize upon first method execution instead of upon import in order to avoid
-conflicts with GPU.
+ conflicts with GPU.
- Fix file paths in server test.
## v4.0.5
### Notable Changes
- Use `npm prepare` script to ensure build artifacts are up-to-date before
-installing locally or publishing.
+ installing locally or publishing.
## v4.0.4
### Notable Changes
- Fix CLI file paths for older versions of Node that do not have
-`import.meta.dirname` available.
+ `import.meta.dirname` available.
## v4.0.3
### Notable Changes
- Import `node:crypto` module for older versions of Node which require it to be
-specified explicitly.
+ specified explicitly.
- Fix warning in shell script when no arguments are present.
- Log IP address instead of static <http://localhost> value from testing.
### Notable Changes
- Fix server file paths for older versions of Node that do not have
-`import.meta.dirname` available.
+ `import.meta.dirname` available.
## v4.0.1
### Notable Changes
- Update `nano-pow` command to call shell script which subsequently calls
-`server.js` if called with `nano-pow --server` or `cli.js` as usual if not.
+ `server.js` if called with `nano-pow --server` or `cli.js` as usual if not.
## v4.0.0
- Implement lazy initialization of both APIs.
- Parse CLI output with regular expression and try to print as JSON before falling
-back to text.
+ back to text.
- Fix CLI statements that were causing issues with older versions of node.
- Fix getter type.
#### Other Changes
- Indicate a more specific `threshold` by passing a full 16-character string to
-the new `work_` methods.
+ 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.
- Updated CLI documentation for new input/output features.
- Refactored WebGL draw shader to align with WebGPU compute shader on BLAKE2b
-initialization.
+ initialization.
- Rename file of test blockhashes since they are not seeds.
- Update README license section.
### Other Changes
- Fixed a bug in the compute shader where the final 64-bit addition missed a carry
-bit and resulted in a slightly different, though still valid, work value than
-expected, which only came to light when testing a custom max-value threshold
-(0xFFFFFFFF) well beyond Nano requirements.
+ bit and resulted in a slightly different, though still valid, work value than
+ expected, which only came to light when testing a custom max-value threshold
+ (0xFFFFFFFF) well beyond Nano requirements.
- Fixed a bug in the final hash digest and subsequent threshold comparison which
-used the original blake2b_IV[0] value instead of the value modified by the
-parameter block.
+ used the original blake2b_IV[0] value instead of the value modified by the
+ parameter block.
- Fixed types.d.ts parameter definitions.
- Delayed canvas setup in WebGL implementation to allow for a cleaner
-initialization.
+ initialization.
- Added more comprehensive documentation of BLAKE2b configuration and
-initialization in compute shader, for those who are interested in learning how
-it works.
+ initialization in compute shader, for those who are interested in learning how
+ it works.
- Add more logging when the debug option is used.
- Updated dependencies.
- Simplify the WebGL pixel-coordinate-based nonce variation.
- Unroll WebGL main G mix function loop for improved performance.
- Add input to WebGL draw shader to better differentiate between search and
-validate processes.
+ validate processes.
- Simplify WebGL vertex shader now that it is only required for drawing the
-fullscreen quad and not for pixel coordinates.
+ fullscreen quad and not for pixel coordinates.
- Maintain WebGL canvas between draw calls, unless level-of-effort has changed, to
-reduce overhead of executing a search.
+ reduce overhead of executing a search.
- Attempt to handle WebGL context loss, with improved reset function, by
-reinitializing class.
+ reinitializing class.
- Reduce promise stack buildup when waiting for WebGL query result.
- Fix WebGL color buffer clearing by using correct API function.
- Improve nonce seed generation in both WebGL and WebGPU by switching from
-`crypto.getRandomValues()` to insecure `Math.random()` which is justified by the
-fact that NanoPow generates proof-of-work, not keys.
+ `crypto.getRandomValues()` to insecure `Math.random()` which is justified by the
+ fact that NanoPow generates proof-of-work, not keys.
- Reduce garbage collection by reusing static variables.
- Add debug logging that obeys user-provided debug flag which is now stored as a
-static variable as well.
+ static variable as well.
- Add Typescript typings for new WebGL types.
- Fix minor issues with test page.
- Add benchmark results table.
- Expand the options available on the sample testing page.
- Fix a bug with the validate function where a valid but different nonce would be
-reported as a match to the input nonce.
+ reported as a match to the input nonce.
- Fix a bug with the truncated average benchmark calculation.
## v1.2.4
- Fix packaging bugs to eliminate npm errors about imports and types.
- Fix repo cloning so that `git clone https://codecow.com/nano-pow.git` works as
-expected (thanks to u/the_azarian for helping track this down).
+ expected (thanks to u/the_azarian for helping track this down).
## v1.0.0