-
Notifications
You must be signed in to change notification settings - Fork 646
Description
π Bug description
When using the --in option to load addresses from a file, keyfinder fails with the error:
[Info] Error: invalid argument
This happens consistently when the input file contains more than 16 Bitcoin addresses, even if all of them are valid and previously tested individually.
π Root Cause
After inspecting the source code, we found the following line in CudaHashLookup.cu:
#define MAX_TARGETS_CONSTANT_MEM 16And later:
if (targets.size() <= MAX_TARGETS_CONSTANT_MEM) {
return setTargetConstantMemory(targets);
} else {
return setTargetBloomFilter(targets);
}The logic is supposed to switch to a bloom filter automatically when more than 16 targets are provided. However, this transition silently fails and returns invalid argument.
β Reproduction steps
-
Create a file named
addresses.txtwith 17 valid Base58 Bitcoin addresses. -
Run:
keyfinder --in addresses.txt
-
Observe the error:
[Info] Error: invalid argument -
Reduce the file to 16 addresses β it works fine.
π‘ Expected behavior
keyfindershould properly fall back to bloom filter mode.- If any error occurs in that transition, it should print a clear message or fallback safely.
- Ideally, it should log something like:
[Warning] Input exceeds 16 constant memory targets; switching to bloom filter.
π§ͺ Environment
- OS: Linux (Ubuntu 22.04)
- CUDA version: 12.0
- GPU: NVIDIA RTX 2000 Ada
- Build: Compiled from latest
masterusingmake BUILD_CUDA=1
π οΈ Workaround
By adding logging to the bloom filter logic, I verified that it does work correctly if the allocation and transfer succeed. After recompiling with minor logging fixes, it correctly loaded and processed over 100,000 addresses using the bloom filter mechanism.
β€οΈ Suggestion
I can submit a PR to improve the error messaging and add a note in the README for this hidden limitation.
Let me know if that would be welcome.