fix(arch_cross_validation): flat fingerprints lose all features and are scored as spoofed#7976
Open
Vyacheslav-Tomashevskiy wants to merge 1 commit into
Conversation
…core as spoofed
extract_all_features() has an explicit branch for the flat fingerprint
layout (no "checks" wrapper): it collects the known check keys straight
off the fingerprint. But the loop that follows reads each check with
check_value.get("data", {}), and a flat check IS the payload - it has no
"data" key. Every flat check therefore resolves to {} and the feature
map comes back empty, so the flat branch is silently dead.
Consequence: an identical, legitimate G4 fingerprint scores 1.0 in the
wrapped form but 0.69 in the flat form - just under the 0.70
ARCH_VALIDATION_SCORE_THRESHOLD in fleet_immune_system - and is reported
as "SUSPICIOUS: significant arch mismatch", dropping the miner to the
"modern" bucket and its vintage bonus.
Fix mirrors the X.get("data", X) fallback that extract_simd_features,
extract_clock_features, extract_cache_features and extract_thermal_features
all already use. Spoof-detection tests are unaffected (a spoofed
fingerprint still scores low).
Contributor
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Owner
|
Genuine fix for flat-fingerprint false-spoofing. Held on one confirmation: can you point to a production miner client that actually emits the flat (unwrapped) fingerprint shape this handles? If a real client sends it, this is High-value and pays immediately; want to confirm it's not a test-only shape first. — Sophia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
extract_all_features()innode/arch_cross_validation.pyhas an explicit branch for the flat fingerprint layout (nocheckswrapper) — it collects the known check keys straight off the fingerprint:But the loop that follows reads each check with
check_value.get("data", {})— and a flat check is the payload; it has no"data"key. So every flat check resolves to{}, the feature map comes back empty, and that flat branch is silently dead code.The four sibling helpers (
extract_simd_features,extract_clock_features,extract_cache_features,extract_thermal_features) all already handle both shapes withX.get("data", X)— this one place doesn't.Impact
An identical, legitimate G4 fingerprint scores differently depending only on its shape:
>= 0.70thresholdchecks+data)SUSPICIOUS: significant arch mismatch0.69 lands just under
ARCH_VALIDATION_SCORE_THRESHOLD = 0.70infleet_immune_system.py, so the decision actually flips:passed=False→validated_bucket = "modern"→ the vintage miner loses the arch bonus it earned. Real hardware gets treated as a spoofer.Scope, stated honestly:
run_and_store_arch_validation()is reached viafleet_immune_system, whose own docstring says it "must be called from the attestation submission flow" — so as of this commit the hook isn't yet wired into the node's submit path. This is a latent correctness bug in the validation library, not live reward loss today. I'm not inflating it beyond that.Fix
One line — use the same
X.get("data", X)fallback the sibling extractors use, so a flat check falls back to itself instead of emptying the branch.Verification
node/test_arch_cross_validation.py— addedtest_g4_flat_fingerprint_not_flagged, asserting the flat form scores>= 0.8and equals the wrapped score.AssertionError: flat G4 fingerprint falsely flagged: 0.69test_arch_cross_validation.pysuite green — includingtest_g4_x86_spoofing, confirming spoof detection is not weakened (a spoofed fingerprint still scores low).tests/test_bucket_spoof_fix.py(the dependent bucket/spoof suite): 6 passed.Verified against
upstream/main@96660f06.RTC:
RTCd1554f0f35576faf01d386a6be1c947f560dd0b7