CashStratum 1.2.1 is a security and reliability release for the 1.2 line. It tightens how shares and difficulty are accounted for, keeps every transaction in very large BCH block templates, and fixes two operator-facing issues. We recommend that all 1.2.0 operators upgrade.
⛏️ Already finding blocks
The reference deployment, blocksniper.ai, moved to 1.2.1 on release day and mined two BCH mainnet blocks on this build within hours:
In both blocks the solo miner was paid on-chain, directly in the coinbase, to their own CashAddr. No pool custody and no payout run were involved.
🔒 Security hardening
| Area |
Before |
Now |
| Difficulty requests |
mining.suggest_difficulty and rental defaults could exceed maxdiff; password parsing accepted partial numbers and an embedded diff= |
Requests are clamped to the configured range and password difficulty tokens must be complete numbers |
| Hashrate accounting |
Rejected SV2 submissions and repeated stale SV1 submissions could count toward rate estimates |
Only eligible shares earn rate credit. Block detection and accepted latency-grace work are unchanged |
| Share logs |
Writing by filename could truncate a log that was open for append |
Writes go through the append stream, and write/close failures are checked |
| Client framing |
Parsing past a newline could accept a malformed frame or dispatch one request twice |
Exactly one complete frame is parsed at a time. EOF is handled, and the buffer is kept if a resize fails |
| Proxy merkle branches |
Hex encoding was not fully validated |
Encoding is validated and branches share the common capacity |
| Payout scripts |
Startup and remote-user address conversion results went unchecked |
An empty payout script is refused instead of producing work that pays nothing |
Each change and the original finding it addresses are listed in docs/security-hardening.md.
🧱 Large BCH templates
Templates above 65,535 transactions used to be truncated silently. Merkle construction is now heap-backed with 32-level branches across the template and proxy paths. A malformed template is rejected rather than replaced with empty work. A new C test, test/merklebranch, compares reconstructed branches against independently computed trees at 65,535, 65,536 and 300,000 transactions.
🐛 Fixes
- Chain detection fails closed. An RPC failure or an unknown chain no longer drops the pool onto mainnet. It retries until the node reports a supported chain.
- Block notifications recover on their own. Notification mode adds a five-second RPC tip-polling backstop, bounded ZMQ polling and recovery from failed sockets.
disableproxy on a parent proxy now takes effect. Before, only the parent socket closed. Its subproxies kept serving and new ones kept being recruited, so miners never moved. A disabled parent now takes its subproxies down and stops recruiting, and the active proxy switches over in the same second.
monitor.sh and clean-old-blocks.sh find your install. They used to guess the install directory from $HOME, which broke installs under /opt/cashstratum and runs as another user. They now resolve from the script's own location, following symlinks, and use the first candidate that holds a pool log. CASHSTRATUM_DIR and CKPOOL_DIR still take precedence.
✅ Verification
- BCH regtest gate: 89/89 assertions. These include real payout blocks and difficulty rejection and clamping.
- C unit tests pass on a clean Ubuntu build with SV2 enabled.
- New regressions under
testing/ cover connector framing, difficulty policy, network-prefix selection, notification recovery, remote payout registration and share accounting.
⬆️ Upgrading
# from a checkout
git fetch --tags && git checkout v1.2.1
./autogen.sh && ./configure && make
# or with the solo installer
sudo scripts/install-cashstratum-solo.sh --ref v1.2.1
Behaviour to be aware of after upgrading:
- A miner that asks for a difficulty above
maxdiff is clamped to maxdiff.
- A password difficulty token that is not a complete number (for example
d=500x) is ignored rather than partially parsed.
- If the node cannot report its chain at startup, the pool waits and retries instead of assuming mainnet.
- The home-directory monitor shortcut written by
post-install.sh is now a symlink to the installed script.
No configuration changes are required.
Full details: CHANGELOG.md · Install guide: docs/installation.md · Requires an existing, synced Bitcoin Cash Node.