Commit 20d04cc
fix: v25.2 — unify TX-sig verifier (apply<->gossip) + permanent attacker-PK blacklist
- block_pipeline TX-sig verifier now delegates to the canonical
verify_dilithium_tx_signature_async helper used by gossip/RPC paths,
via parallel join_all on SIGVERIFY_RUNTIME. The previous inline
hex-decode path only understood the user-wallet format
(hex 3309-byte sig, hex 1952-byte PK) and hard-rejected every
node-signed system TX (HeartbeatCommitment, PingCommitment,
PingCommitmentWithSampling, LightNodeEligibilityBitmap) whose
signature is the dilithium_sig_<id>_<b64> wrapper and whose
dilithium_public_key field carries the node_id string (PK resolved
via CONSENSUS_PK_REGISTRY). First inclusion in the commitment
window of any epoch (last 50 blocks) caused every receiver to
HARD REJECT the block, freezing the testnet at h=14350.
- consensus_crypto: replace the partial SPOOFER_PK_OFFENSES
log-suppression with a permanent attacker-PK blacklist keyed by
SHA3-256 fingerprint of the attacker's Dilithium3 public key.
First Tier-2 PK mismatch is conclusive proof of impersonation in
an immutable registry, so the key is banned on first sighting.
Fast-path drop runs at the top of verify_with_real_dilithium,
before the registry lock and ML-DSA-65 open call. Bounded memory
(12k entries, lazy LRU eviction). Mirrored to RocksDB metadata CF
with prefix attacker_pk_bl/<fp>, replayed at boot before the QUIC
listener opens. Single [CRIT][SECURITY] log per first sighting,
silent thereafter.
- unified_p2p: BlacklistReason::PkImpersonation variant (hard,
not subject to reputation recovery — attacker key structurally
fails Tier-2 verify forever). Public API on SimplifiedP2P:
is_pk_blacklisted, report_pk_impersonation, clear_attacker_pk,
clear_attacker_pk_blacklist_all, attacker_pk_blacklist_len.
- storage: save/load_attacker_pk_entry on PersistentStorage and
Storage wrappers (metadata CF, length-prefixed self-describing
record format).
- node boot: load_all_attacker_pk_entries -> seed -> install
persist callback that resolves storage via try_get_storage at
every call, runs before any verify path is reachable.
- Light = mobile-only API client (ZERO chain storage,
max_storage_bytes=0). v3.18 Full tier fully removed. All stale
references in code, comments and docs cleaned up. Backward-compat
parser keeps "full" -> NodeType::Super for legacy strings.
- 2-tier log format throughout: [INFO|WARN|ERR|CRIT][TAG].
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6a3792e commit 20d04cc
23 files changed
Lines changed: 1215 additions & 367 deletions
File tree
- core
- qnet-consensus/src
- qnet-sharding/src
- qnet-state/src
- development
- qnet-integration/src
- bin
- qnet-mobile-sdk
- docs
- documentation
- technical
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
944 | 946 | | |
945 | | - | |
946 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
947 | 952 | | |
948 | 953 | | |
949 | 954 | | |
| |||
963 | 968 | | |
964 | 969 | | |
965 | 970 | | |
966 | | - | |
967 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
968 | 975 | | |
969 | 976 | | |
970 | 977 | | |
| |||
1096 | 1103 | | |
1097 | 1104 | | |
1098 | 1105 | | |
1099 | | - | |
| 1106 | + | |
| 1107 | + | |
1100 | 1108 | | |
1101 | 1109 | | |
1102 | 1110 | | |
| |||
1863 | 1871 | | |
1864 | 1872 | | |
1865 | 1873 | | |
1866 | | - | |
1867 | | - | |
1868 | | - | |
1869 | | - | |
1870 | | - | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
1871 | 1880 | | |
1872 | 1881 | | |
1873 | 1882 | | |
| |||
2415 | 2424 | | |
2416 | 2425 | | |
2417 | 2426 | | |
2418 | | - | |
| 2427 | + | |
2419 | 2428 | | |
2420 | | - | |
2421 | | - | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
2422 | 2435 | | |
2423 | 2436 | | |
2424 | 2437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
606 | | - | |
607 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
608 | 609 | | |
609 | 610 | | |
610 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments