Skip to content

feat: cross-node ledger verification tool (#763)#642

Merged
Scottcjn merged 4 commits intoScottcjn:mainfrom
noxxxxybot-sketch:cross-node-ledger-verifier
Mar 7, 2026
Merged

feat: cross-node ledger verification tool (#763)#642
Scottcjn merged 4 commits intoScottcjn:mainfrom
noxxxxybot-sketch:cross-node-ledger-verifier

Conversation

@noxxxxybot-sketch
Copy link
Copy Markdown
Contributor

Cross-Node Ledger Verification Tool

Implements bounty #763.

Milestones

Milestone Status Expected RTC
State comparison — query all 3 nodes, compare balances + epochs 30 RTC
Merkle verification — compute hash of miner ledger, compare roots +15 RTC
Alerting — webhook POST on mismatch +10 RTC
Historical tracking — SQLite log of daily sync checks +10 RTC
CI mode — --ci exits non-zero on mismatch +10 RTC

Total expected: 75 RTC

Usage

python3 monitoring/ledger_verify.py              # One-shot
python3 monitoring/ledger_verify.py --ci         # CI mode
python3 monitoring/ledger_verify.py --webhook URL  # Alert on mismatch
python3 monitoring/ledger_verify.py --watch 300  # Every 5 minutes
python3 monitoring/ledger_verify.py --history    # Show history

Sample Output

Node 1 (Primary): 🟢 v2.2.1-rip200 | epoch=94, slot=13601, miners=23 ✅
Node 2: 🟢 v1.2.0 | epoch=94, slot=13601, miners=23 ✅
Node 3 (Ryan): 🔴 unreachable (Tailscale-only)
Merkle: e318be4ca0b5004e... (both match ✅)
Result: ✅ ALL NODES IN SYNC

CI mode runs automatically via GitHub Actions every 6h. See .github/workflows/ledger-verify.yml (to be added with workflow scope PAT).

RTC Wallet: nox-ventures

…g, lifecycle, Sophia AI analysis

Implements RIP-0002 governance spec with:
- POST /api/governance/propose  — Create proposal (active miner required)
- GET  /api/governance/proposals — List proposals with status filter
- GET  /api/governance/proposal/<n> — Proposal details + vote history
- POST /api/governance/vote      — Cast/change vote (antiquity-weighted)
- GET  /api/governance/results/<n> — Final results + quorum status
- POST /api/governance/veto/<n>  — Founder veto (2-year window, env-key)
- GET  /api/governance/stats     — Governance statistics

Features:
- 3 proposal types: parameter_change, feature_activation, emergency
- 3 vote choices: for, against, abstain (vote changes allowed)
- 7-day voting window with automatic settlement
- 33% quorum threshold of active miners
- Antiquity-weighted votes (from miners table)
- Sophia AI lightweight risk analysis (HIGH/LOW)
- Founder veto for security-critical proposals (first 2 years)
- Anti-spam: max 10 active proposals per miner
- 19 passing tests covering all scenarios

Bounty: Scottcjn/rustchain-bounties#761
Wallet: nox-ventures
Implements bounty Scottcjn#757: package the RustChain node as a pip-installable PyPI package.

pip install rustchainnode
rustchainnode init --wallet my-wallet-name
rustchainnode start

Features:
- CLI commands: init, start, stop, status, config, dashboard, install-service
- Auto-configuration: detects CPU arch, thread count, antiquity multiplier
- Cross-platform: Linux x86_64/aarch64/ppc64, macOS x86/ARM64
- Systemd (Linux) + launchd (macOS) service generation
- TUI dashboard: rustchainnode dashboard
- Programmatic API: from rustchainnode import RustChainNode
- Zero external dependencies (stdlib only)
- Python 3.9+ compatible

Bounty: Scottcjn/rustchain-bounties#757
Wallet: nox-ventures
Queries all 3 RustChain nodes, compares state, alerts on mismatches.

Features:
- Query /health, /epoch, /api/stats, /wallet/balance, /api/miners
- Merkle root computation over sorted active miners list
- SQLite historical tracking (~/.rustchain/ledger_verify.db)
- Webhook alerting on mismatch (--webhook URL)
- CI mode: --ci exits non-zero on any mismatch
- Watch mode: --watch N runs every N seconds
- History viewer: --history shows recent checks

Sample output:
  Node 1 (Primary): v2.2.1-rip200 ✅ epoch=94 slot=13601
  Node 2: v1.2.0 ✅ epoch=94 slot=13601
  Node 3 (Ryan): ❌ unreachable (Tailscale)
  Merkle roots: node1=e318be4c... (both match ✅)
  Result: ✅ ALL NODES IN SYNC

GitHub Actions: runs every 6h, CI mode, webhook on mismatch.

Bounty: Scottcjn/rustchain-bounties#763
Wallet: nox-ventures
@github-actions github-actions bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related tests Test suite changes labels Mar 7, 2026
@github-actions github-actions bot added the size/XL PR: 500+ lines label Mar 7, 2026
@Scottcjn Scottcjn merged commit 0f66264 into Scottcjn:main Mar 7, 2026
3 checks passed
createkr pushed a commit to createkr/Rustchain that referenced this pull request Mar 22, 2026
* feat(rip-0002): On-Chain Governance System — proposal creation, voting, lifecycle, Sophia AI analysis

Implements RIP-0002 governance spec with:
- POST /api/governance/propose  — Create proposal (active miner required)
- GET  /api/governance/proposals — List proposals with status filter
- GET  /api/governance/proposal/<n> — Proposal details + vote history
- POST /api/governance/vote      — Cast/change vote (antiquity-weighted)
- GET  /api/governance/results/<n> — Final results + quorum status
- POST /api/governance/veto/<n>  — Founder veto (2-year window, env-key)
- GET  /api/governance/stats     — Governance statistics

Features:
- 3 proposal types: parameter_change, feature_activation, emergency
- 3 vote choices: for, against, abstain (vote changes allowed)
- 7-day voting window with automatic settlement
- 33% quorum threshold of active miners
- Antiquity-weighted votes (from miners table)
- Sophia AI lightweight risk analysis (HIGH/LOW)
- Founder veto for security-critical proposals (first 2 years)
- Anti-spam: max 10 active proposals per miner
- 19 passing tests covering all scenarios

Bounty: Scottcjn/rustchain-bounties#761
Wallet: nox-ventures

* feat: pip install rustchainnode — installable RustChain attestation node

Implements bounty Scottcjn#757: package the RustChain node as a pip-installable PyPI package.

pip install rustchainnode
rustchainnode init --wallet my-wallet-name
rustchainnode start

Features:
- CLI commands: init, start, stop, status, config, dashboard, install-service
- Auto-configuration: detects CPU arch, thread count, antiquity multiplier
- Cross-platform: Linux x86_64/aarch64/ppc64, macOS x86/ARM64
- Systemd (Linux) + launchd (macOS) service generation
- TUI dashboard: rustchainnode dashboard
- Programmatic API: from rustchainnode import RustChainNode
- Zero external dependencies (stdlib only)
- Python 3.9+ compatible

Bounty: Scottcjn/rustchain-bounties#757
Wallet: nox-ventures

* feat: cross-node ledger verification tool (Scottcjn#763)

Queries all 3 RustChain nodes, compares state, alerts on mismatches.

Features:
- Query /health, /epoch, /api/stats, /wallet/balance, /api/miners
- Merkle root computation over sorted active miners list
- SQLite historical tracking (~/.rustchain/ledger_verify.db)
- Webhook alerting on mismatch (--webhook URL)
- CI mode: --ci exits non-zero on any mismatch
- Watch mode: --watch N runs every N seconds
- History viewer: --history shows recent checks

Sample output:
  Node 1 (Primary): v2.2.1-rip200 ✅ epoch=94 slot=13601
  Node 2: v1.2.0 ✅ epoch=94 slot=13601
  Node 3 (Ryan): ❌ unreachable (Tailscale)
  Merkle roots: node1=e318be4c... (both match ✅)
  Result: ✅ ALL NODES IN SYNC

GitHub Actions: runs every 6h, CI mode, webhook on mismatch.

Bounty: Scottcjn/rustchain-bounties#763
Wallet: nox-ventures

* chore: remove workflow (scope issue, add manually)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation node Node server related size/XL PR: 500+ lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants