Hash through nano::blake2b instead of the BLAKE2b C API (#5331) * Pin vote, block, work and key digests to known values The vote hash and full hash, the block full hash, the work value and deterministic keys had no tests with fixed expected values. Each new test checks a digest computed outside the node, with integer inputs whose bytes all differ, so hashing them in another byte order fails. * Add a typed C++ wrapper for BLAKE2b nano::blake2b<Size> fixes the digest size at compile time, takes bytes, text and integers in an explicit byte order, returns the digest by value, as an integer or in place, and wipes its state on request. Its tests check the RFC 7693 example and digests computed outside the node. * Hash through nano::blake2b instead of the BLAKE2b C API Blocks, votes, work, account checksums, deterministic keys and endpoint hashes now go through the wrapper. Integers that were hashed in host byte order through casts and a union now state their order, the little-endian one every supported platform used already, so no digest changes. uint256_union gains a constructor from its 32 bytes, the three account checksum copies become one, and config.cpp drops an include it did not use. * Remove the fuzzer stub from the work value work_thresholds::value was defined twice under #ifndef NANO_FUZZER_TEST, the fuzzer variant accepting any work. It now always computes the hash. The message fuzzer, the only target that meets a work check, parses with zero work thresholds instead, and nano::is_fuzzer_build () joins the build predicates in config.hpp for code that needs the distinction later. * Compute work attempts through work_thresholds::value work_pool::loop hashed each attempt with its own copy of the work value. It now calls work_thresholds::value, so a fuzzer build, where that accepts any work, takes the first attempt instead of hashing.
__________
Type: commit
Hash: 66b65a4f2fb515da60dcd74b6720370efaae5da8
Created: today
__________
gr0v1ty/nano-node:66b65a4f2fb515da60dcd74b6720370efaae5da8
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 89 s | -96.0 s | GitHub job logs | Show |
| 5n4pr_conf_10k_change | PASS | 94 s | -158.0 s | GitHub job logs | Show |
| 5n4pr_conf_change_dependant | PASS | 103 s | -3.0 s | GitHub job logs | - |
| 5n4pr_conf_change_independant | PASS | 623 s | 515.0 s | GitHub job logs | - |
| 5n4pr_conf_send_dependant | PASS | 377 s | 268.0 s | GitHub job logs | - |
| 5n4pr_conf_send_independant | PASS | 107 s | -5.0 s | GitHub job logs | - |
| 5n4pr_rocks_10k_bintree | PASS | 95 s | -93.0 s | GitHub job logs | - |
| 5n4pr_rocks_10k_change | PASS | 122 s | -146.0 s | GitHub job logs | - |