Skip to content

feat: add automated backup verification script (bounty #755)#633

Merged
Scottcjn merged 3 commits intoScottcjn:mainfrom
chenxizhu04050020-bit:feat/backup-verification-issue-755
Mar 7, 2026
Merged

feat: add automated backup verification script (bounty #755)#633
Scottcjn merged 3 commits intoScottcjn:mainfrom
chenxizhu04050020-bit:feat/backup-verification-issue-755

Conversation

@chenxizhu04050020-bit
Copy link
Copy Markdown
Contributor

Summary

Implements automated backup verification for RustChain SQLite backups (bounty #755).

Added

  • tools/verify_backup.py
    • Finds latest backup from configurable directory/pattern
    • Copies backup to temporary location (non-destructive)
    • Runs PRAGMA integrity_check
    • Verifies required tables exist and contain data:
      • balances
      • miner_attest_recent
      • headers
      • ledger
      • epoch_rewards
    • Checks positive balances exist (amount > 0)
    • Compares backup/live row counts with tolerance
    • Verifies backup epoch drift is not more than 1 epoch
    • Exit code: 0 pass, 1 fail
  • tests/test_verify_backup.py
    • pass path
    • fail path when backup epoch is too old

Usage

python tools/verify_backup.py \
  --backup-dir /root/rustchain/backups \
  --pattern 'rustchain_v2*.db*' \
  --live-db /root/rustchain/rustchain_v2.db

Test Result

  • pytest -q tests/test_verify_backup.py2 passed

Related bounty: Scottcjn/rustchain-bounties#755

@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) tests Test suite changes labels Mar 7, 2026
@github-actions github-actions bot added the size/L PR: 201-500 lines label Mar 7, 2026
@chenxizhu04050020-bit
Copy link
Copy Markdown
Contributor Author

Quick implementation notes for reviewers:\n\n- Added tools/verify_backup.py (non-destructive backup verifier)\n- Added tests/test_verify_backup.py (pass/fail coverage)\n- Included SPDX header in new files\n- Verified locally: pytest -q tests/test_verify_backup.py → 2 passed\n\nIf you want tighter drift thresholds or different backup filename patterns, I can adjust quickly.

@Scottcjn
Copy link
Copy Markdown
Owner

Scottcjn commented Mar 7, 2026

@chenxizhu04050020-bit — Your backup verification + faucet implementation is genuinely good code. The GitHub account age tiering on the faucet, the test suite, the create_app() factory pattern — this is how production Python should look.

We want to pay you 35 RTC for this work (10 for backup verification + 25 for the faucet). But first:

  1. Follow @Scottcjn
  2. Star Rustchain + bottube
  3. Tell us your preferred wallet name (any name, e.g. "chenxizhu")

You also have a Whisper transcription PR on bottube (#286) — that's another 25 RTC waiting for you.

Total pending: 60 RTC once you follow. That's real money in our ecosystem. Welcome to the community.

— Elyan Labs

@Scottcjn
Copy link
Copy Markdown
Owner

Scottcjn commented Mar 7, 2026

Star Bounty -- Half Payment Processed!

Hey @chenxizhu04050020-bit! Thanks for starring and following!

Star Payment: 2.75 RTC sent (half of 5.50 RTC) -- wallet chenxizhu04050020-bit (pending #682)

You've starred 2 of 3 flagship repos -- just missing one:

Once you star beacon-skill, reply here and I'll release the other 2.75 RTC!

Also still have 35 RTC pending for this backup+faucet PR and 25 RTC for your Whisper PR on BoTTube -- just need you to follow up so we can merge!

Campaign: 2,713 / 5,000 stars -- every star counts!

@Scottcjn Scottcjn merged commit eda9e4f into Scottcjn:main Mar 7, 2026
3 checks passed
@Scottcjn
Copy link
Copy Markdown
Owner

Scottcjn commented Mar 7, 2026

Merged and Paid — @chenxizhu04050020-bit

Excellent work. This covers both bounties:

25 RTC paid to wallet .

Your Whisper transcription PR on bottube was also merged earlier. Keep it up!

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 size/L PR: 201-500 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants