feat: local PoW via nano-rspow with remote fallback#2
Draft
cbrunnkvist wants to merge 3 commits into
Draft
Conversation
Integrate nano-rspow as the default PoW backend for Nano blocks, replacing the previous 100% remote RPC approach. - Add nano-rspow (CPU via rayon) behind 'local-pow' feature (default on) - PoW mode defaults to 'auto': local first, remote RPC fallback - NANO_POW_MODE env var: 'auto' (default), 'local', 'remote' - NANO_WORK_URL continues to provide additional remote endpoints - Remove hardcoded FALLBACK_WORK_URL (rpc.nano.to) - Downstream can opt out with --no-default-features
- Remove hardcoded SEND_DIFFICULTY/RECEIVE_DIFFICULTY hex constants - Re-export EPOCH2_SEND/EPOCH2_RECEIVE from nano_rspow::thresholds (with fallback consts when local-pow feature is disabled) - work_generate now accepts u64 threshold, converts to hex for RPC - Rename NANO_POW_MODE to NANO_WORK_MODE to align with NANO_WORK_URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NANO_WORK_MODEenv:auto(default),local,remoteNANO_WORK_URLsupplies additional remote endpointsnano_rspow::thresholds(no duplication)local-pow(default on), opt out with--no-default-featuresFiles
ows/crates/ows-lib/Cargo.toml— addnano-rspowdep +local-powfeatureows/crates/ows-lib/src/nano_rpc.rs— rewritework_generate, removeFALLBACK_WORK_URLows/crates/ows-lib/src/ops.rs— usenano_rpc::EPOCH2_SEND/RECEIVEthresholds