Skip to content

Commit 4101d8f

Browse files
committed
Release 0.2.0
* Add challenge manager * Use sled for storage * Debug CLI commands See CHANGELOG for more details
1 parent 00848f9 commit 4101d8f

20 files changed

+2721
-612
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ result*
55
*.vkey
66
*.mnemonic
77
challenges.json
8-
state*
8+
/state*

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog for Shadow Harvester v0.2.0
2+
3+
This release marks a fundamental architectural shift, moving the miner from a fragile,
4+
synchronous model to a robust, multi-threaded, reactive system. The core focus was
5+
decoupling hashing from network latency, improving crash resilience,
6+
and transitioning to a modern database for state management.
7+
8+
## ⚠️ IMPORTANT: STATE MIGRATION REQUIRED
9+
10+
Since this release moves from file-based state (receipts, indices) to an embedded
11+
Sled database, **all users must run the migration tool once** to preserve their
12+
history and resume mnemonic mining correctly.
13+
14+
```bash
15+
shadow-harvester migrate-state --old-data-dir ./ --data-dir <your_sled_path>
16+
```
17+
18+
19+
* **Failure to run this command** will result in the miner starting over at index 0
20+
and ignoring any previously completed challenge progress.
21+
22+
## 🚀 Major Architectural Overhaul
23+
24+
* **Reactive, Multi-Threaded Core:** The application logic is refactored into a reactive, channel-based (mPSC) architecture. This cleanly separates responsibilities among dedicated worker threads: **Challenge Manager**, **State Worker**, and **Network Polling**.
25+
* **Sled Database Integration:** All critical state data (receipts, challenge data, and mnemonic progress) has been migrated from the legacy file-based system to a fast, crash-safe, embedded database (**Sled**).
26+
* **Asynchronous Submission Queue:** Hashing is decoupled from network I/O. Solutions are now written to a local disk queue, and a dedicated **State Worker** thread handles submission retries in the background, preventing API instability from stopping the mining process.
27+
28+
## 🛡️ Resilience and State Management
29+
30+
* **Crash Recovery Implemented:** Solutions found by the miner are saved using an **atomic, two-stage persistence** process (local file -> Sled queue). This ensures no valid nonce is lost if the miner crashes or loses power.
31+
* **Robust Mnemonic Resumption:** The logic for Mnemonic Sequential Mining now correctly recovers the last processed index by reading addresses and derivation paths from the Sled database, guaranteeing continuity.
32+
* **Server Stability:** The submitter thread now correctly identifies and retries transient **5xx Internal Server Errors** instead of treating them as fatal validation failures.
33+
* **Donation Tracking Removed:** All logic for submitting and tracking donation transactions was removed, simplifying the core architecture.
34+
35+
## 💻 New CLI Commands and Debugging Tools
36+
37+
All commands requiring state access are now nested under `challenge` or `wallet`, providing precise inspection capabilities.
38+
39+
### Challenge State Commands (`shadow-harvester challenge`)
40+
41+
| Command | Functionality |
42+
| :--- | :--- |
43+
| `challenge list` | Lists all unique Challenge IDs stored in the local database. |
44+
| `challenge info --id <ID>` | Dumps the full JSON details for a specific challenge configuration. |
45+
| `challenge details --id <ID>` | Outputs structured mining details (ROM Key, Difficulty) along with aggregated local counts of **completed solutions** and **pending submissions**. |
46+
| `challenge import --file <path>` | Imports a custom challenge JSON file into the Sled database for testing or custom mining. |
47+
| `challenge receipt-info` | Dumps the full JSON receipt stored for a specific `challenge_id` and `address`. |
48+
| `challenge pending-info` | Dumps the full JSON for a specific pending solution waiting in the submission queue. |
49+
50+
### Wallet State Commands (`shadow-harvester wallet`)
51+
52+
| Command | Functionality |
53+
| :--- | :--- |
54+
| `wallet list` | Lists unique wallet identifiers (`<Mnemonic Hash>:<Account Index>`) found in the database. |
55+
| `wallet addresses --wallet <hash:account>` | Lists all known Cardano addresses and their derivation indexes associated with that wallet identifier. |
56+
| `wallet list-challenges --address <addr>` | Lists all Challenge IDs for which the specified address has a successfully completed receipt. |

0 commit comments

Comments
 (0)