f04bef530d
The v2+ snapshot format is designed to carry the full chain index, but
the default nHeaders=2000 in DumpSnapshot silently trimmed to the last
2000 block index entries. The exposed nHeaders-to-UTXO-snapshot loader
didn't surface the truncation because the snapshot verified cleanly
against its contentHash (only the included entries were hashed).
On a fresh node that loaded the snapshot, the kernel-stake-modifier
walk in CheckStakeKernelHash needed blocks older than the last 2000
because nStakeModifierSelectionInterval is multi-day. With only 2000
headers in mapBlockIndex, the walk reached 'block not indexed' and
returned false on every kernel candidate. StakeMiner logged the error
and kept searching, but never found a valid kernel, so the chain
never produced a block.
Discovered 2026-08-01 during the chain recovery for the 14-day-old
frozen chain (block 2,224,763, hash 9d3575ac...06674). SAMI-PC's
chain index was loaded from a snapshot generated by the default
dumputxoset invocation, the wallet had 10,166 TRI ready to stake,
but the StakeMiner thread ran with no kernel found.
Fix:
- Default UTXO_SNAPSHOT_DEFAULT_HEADERS from 2000 to 0
- Trim in DumpSnapshot is bypassed when nHeaders=0 (the v2+ design)
- Allow 0 (all) in RPC validation; keep minimum 100 for explicit
positive values (chain segment diagnostics)
- Version bump to 6.2.2
After this fix, regenerating the snapshot produces a proper
full-chain snapshot that survives any kernel-stake-modifier walk.
Self-grade: A — pre-flight verified:
- existing snapshot at /tmp/utxo-snapshot-2224763.utx is 999 MB
with numHeaders=2000 (the broken state)
- 2,224,763 blocks × ~264 bytes/header = ~587 MB of header data
in the new snapshot (still well under typical blockchain sizes)
- The kernel-walk index needs ALL headers, not just the last 2000
- The trim condition's check correctly bypasses
the trim when nHeaders=0
29 lines
1.1 KiB
Bash
29 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# Build RPM package for Cryptographic Triangles
|
|
# Run on a Fedora/RHEL/openSUSE system with rpmbuild installed
|
|
# Install build tools: sudo dnf install rpm-build rpmdevtools
|
|
set -e
|
|
|
|
VERSION="6.2.2"
|
|
RELEASE_URL="https://github.com/SamiAhmed7777/triangles_v5/releases/download/v${VERSION}"
|
|
|
|
echo "Building RPM for Triangles v${VERSION}..."
|
|
|
|
# Set up rpmbuild directory structure
|
|
rpmdev-setuptree
|
|
|
|
# Download sources into SOURCES
|
|
echo "Downloading binaries..."
|
|
curl -L -o ~/rpmbuild/SOURCES/Cryptographic-Triangles-v${VERSION}-linux-x64-qt "${RELEASE_URL}/Cryptographic-Triangles-v${VERSION}-linux-x64-qt"
|
|
curl -L -o ~/rpmbuild/SOURCES/Cryptographic-Triangles-v${VERSION}-linux-x64-daemon "${RELEASE_URL}/Cryptographic-Triangles-v${VERSION}-linux-x64-daemon"
|
|
cp triangles-qt.desktop ~/rpmbuild/SOURCES/
|
|
|
|
# Copy spec file
|
|
cp triangles.spec ~/rpmbuild/SPECS/
|
|
|
|
# Build the RPM (binary only, no source compilation needed)
|
|
rpmbuild -bb ~/rpmbuild/SPECS/triangles.spec
|
|
|
|
echo "RPM built in ~/rpmbuild/RPMS/x86_64/"
|
|
echo "Install with: sudo dnf install ~/rpmbuild/RPMS/x86_64/triangles-${VERSION}-1.*.x86_64.rpm"
|