You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes: Scottcjn/rustchain-bounties#554
Problem (liu971227-sys / Rustchain#551):
classify_miner_bucket() trusted raw client-reported device_arch with no
cross-validation. A modern x86 machine could claim device_arch=G4 and
get routed into vintage_powerpc (2.5× multiplier) instead of modern (1.0×).
Changes to fleet_immune_system.py:
1. Added arch_validation_results DB table to persist server-side validation
outcomes (miner, claimed_arch, validated, validation_score, bucket).
2. Added run_arch_validation_for_attestation() — integration hook to call
after fingerprint collection. Uses arch_cross_validation.validate_arch_
consistency() and stores result in DB. Score < 0.70 → 'modern' bucket.
3. Added store_arch_validation_result() and get_validated_bucket() helpers.
4. Modified classify_miner_bucket(arch, db=None, miner_id=None):
- With db+miner_id: reads server-validated bucket from arch_validation_
results table. No DB record or failed validation → 'modern' (safe default).
- Without db/miner_id: legacy raw-arch lookup (backwards compatible).
5. Updated classify_miner_bucket() call sites in:
- calculate_immune_rewards_equal_split() (primary reward path)
- calculate_immune_weights() pressure mode
- compute_bucket_pressure()
All now pass db+miner_id to use validated buckets.
New file tests/test_bucket_spoof_fix.py (6 tests, all passing):
1. Intel Xeon + G4 claim → rejected, lands in 'modern' bucket
2. Real G4 fingerprint + G4 claim → accepted, vintage_powerpc bucket
3. Modern x86 faking AltiVec (has_sse=True) → rejected
4. Unvalidated miner (no record) → defaults to 'modern' (no bonus)
5. Legacy classify_miner_bucket(arch) still works unchanged
6. store/retrieve validation result round-trip
GitHub: @B1tor
RTC Wallet: RTC2fe3c33c77666ff76a1cd0999fd4466ee81250ff
Co-authored-by: B1tor <b1tor@users.noreply.github.com>
0 commit comments