Fault-tolerance & Integrity
This page previously described security/resource_guard.py and security/integrity.py, which do not exist in hierachain/. Fault tolerance in the codebase is distributed instead.
Resource protection (actual)
- Rate and payload limits live in
hierachain/api/middleware.py(add_rate_limit,add_payload_limitwithHRC_RATE_LIMIT,HRC_RATE_LIMIT_RPM,HRC_RATE_LIMIT_BACKEND,HRC_TRUSTED_PROXIES; payload is checked viarequest.stream()with a 1MB limit). - Event pool and RAM guards are
HRC_EVENT_POOL_MAX_SIZE(10k) andHRC_RAM_CRITICAL_THRESHOLD(95%), checked in ordering and storage paths. - There is no
ResourceGuardMiddleware. The 70%/90% threshold table and the load shedding inmonitoring/performance_monitor.pydescribed earlier were fabricated. Use app middleware together with reverse proxy limits.
Integrity checks (actual)
There is no startup signature scan in security/integrity.py. The actual integrity mechanisms are:
- Merkle and chain links in
hierachain/core/block.pyandcore/merkle_tree.py(domain-separated0x01prefix) andconsensus/ordering/storage.py:_verify_chain_links()(previous_hashchain). - Proof verification in
hierachain/hierarchical/main_chain/proofs.py:_verify_proof_in_main_chain(fallback chain scan) andsecurity/verify/block_verifier.py. - Rollback integrity in
hierachain/error_mitigation/rollback_manager.py:_verify_rollback_integrity(data_hashcheck) with a path traversal guard.
graph LR
A[Block finalize] --> B[previous_hash check]
B --> C[Merkle root verify]
C --> D[Proof verify on MainChain]
D --> E[Rollback data_hash if needed]