Changelog
Unreleased
v0.2.0 (2026-09-12)
Improvements (26)
-
2026-09-05
- Core (Block, Blockchain & Merkle Tree): Hardened
Blockcaching and hash guard inhierachain/core/block.py(type-checkedstored_hash, cached event list), added deterministicevent_idgeneration (orjson+SHA-256evt-{16}) and Merkle-root verification in_is_block_linked_correctly/Blockchain.add_event()now returningstr(hierachain/core/blockchain.py), and fixedMerkleTree._build_treeodd-node handling to propagate unduplicated leaf instead of hashing duplicate (hierachain/core/merkle_tree.py). - Core (Logging & Error Handling): Narrowed broad
except ExceptiontoOSError/ArrowException/ValueError/TypeErrorinhierachain/core/parquet_log.pyandhierachain/error_mitigation/journal.py, added typedpa.Table | Noneannotation, and addedImportErrorfallback forkubernetesclient inhierachain/hierarchical/k8s_namespace_manager/operations.py. - Consensus (BFT & PoA/PoF & Ordering): Added strict
isinstance(str)guards forsignature/public_key/block_hashinhierachain/consensus/proof_of_federation._verify_block_quorumand removed insecureKeyPairfallback inhierachain/consensus/proof_of_authority.py; tightened BFT validation inhierachain/consensus/bft/helpers.py(strictnessearly-return and per-sequence digest/view quorum matching in_process_commit_quorum_logic); simplifiedhierachain/consensus/ordering/recovery.pytype handling (int(block_index_raw),dict|None). - Consensus & Hierarchical (Types & Schema): Replaced
TYPE_CHECKINGforward references with runtimeAnyacrosshierachain/consensus/bft/dispatcher.py|engine.py|view_change.pyandhierachain/hierarchical/main_chain/proofs.py|registry.py|rebalancer/split_ops.py|sub_chain/*.py; centralizedEVENT_SCHEMA(pa.schema) inhierachain/core/block.pyand reused it inhierachain/consensus/ordering/certifier.py,hierachain/error_mitigation/journal.py,hierachain/hierarchical/channel/ledger.py; enhancedBFTViewChangeManagerto emitprepared_proofs. - Hierarchical (Hierarchy Manager & SubChain): Enhanced
_shared_poolinhierachain/hierarchical/hierarchy_manager/base.pyto support dynamicmax_workers(spawns ephemeral pool when changed, else reuses global); replacedhash()with deterministicorjson+SHA-256evt-ID inhierachain/hierarchical/sub_chain/base.py; removed unused legacyhierachain/hierarchical/sub_chain.py. - Hierarchical (Rollback & Rebalancer): Hardened
hierachain/error_mitigation/rollback_manager.pywith component-aware_capture_storage_state, path-traversal guard viaos.path.realpathin_rollback_configuration, section-count logging anddata_hashintegrity check; cleanedhierachain/error_mitigation/validator_helpers.pyand narrowed imports; simplifiedhierachain/hierarchical/rebalancer/split_ops.pyimports. - API (Middleware, Server & WebSocket): Streamed payload limit via
request.stream()withbytes_readaccounting andrequest._receivereplay inhierachain/api/middleware.py; enforced trusted-proxy checkclient_ip in TRUSTED_PROXIESforX-Forwarded-Forand fixed rate-limit IP fallback; extracted CORS to_add_cors_middlewareinhierachain/api/server.pyand madeuvloopmandatory; simplifiedPingLoopRunnerinit inhierachain/api/websocket/manager.py. - API (Ledger, GraphQL, Explorer & Business): Centralized default field handling in
hierachain/api/storage/explorer_helpers.py; addedassertguards inhierachain/api/ledger/depds.pyand replaced recursive depth check with iterative stack (depth >10) inhierachain/api/ledger/schemas.py; adaptedhierachain/api/graphql/resolvers.py|types.pyforBlockchain.add_event()->strandis_cid_stringlogic; typedprivate_data_entry: dict[str,Any]inhierachain/api/business/private_data.py. - API (Admin Identity - Feature): Added optional
nonce/timestamp/chain_idfields toSecureEventRequest(hierachain/api/admin/schemas.py), enforcedchain_idmismatch (422) and 300s timestamp freshness, prefixed challenge withb"HRC_IDENTITY_CHALLENGE:"and restoredrequire_chain_accessdependency for/verify-identity(hierachain/api/admin/endpoints.py). - Security, Events, Database & Cleanup: Simplified
_sanitize_html_contexttore.sub(..., "[TEMPLATE_BLOCKED]")(hierachain/security/sanitization.py) and switched ZK mock verification toZKVerifier(mode="mock").verify(hierachain/security/zk_prover.py); tightenedBaseEvent.__eq__(other: object)(hierachain/domains/events/base_event.py); centralized DB schema init toinit_database_schemainhierachain/adapters/database/postgres_schema.py|sqlite_schema.pyand simplified adapters; removed 17 unused imports acrossapi/storage,consensus/ordering,core/utils,error_mitigation/*,risk_management/*.
- Core (Block, Blockchain & Merkle Tree): Hardened
-
2026-09-01
- Database (PostgreSQL): Introduced
PostgresAdapter(hierachain/adapters/database/postgres_adapter.py) extendingSQLBasewithpsycopg/psycopg2connection pooling (dictionary row access) andpostgres_schema.pydefining tables (chains,blocks,events,proofs,chain_state) with optimized composite indexes (chain_name+timestamp,entity_id+chain_name,block_hash) and full CRUD for blockchain data. - Config: Enhanced storage/database flexibility in
hierachain/config/settings.pyandhierachain/config/product_config_template.py— addedBLOCK_CREATION_MODE/BLOCK_MAX_WAIT_SECfor block creation control,PARQUET_ROLL_INTERVAL(monthly/daily/by_size_mb),POSTGRES_SYNC_MODE(realtime/batch_worker/disabled),SQL_RETENTION_DAYS; madeSTORAGE_BACKENDauto-detectpostgresfromDATABASE_URLwithsqlitefallback and unifiedDATABASE_URL/HRC_DATABASE_URLhandling; streamlined product template backends tosqlite,postgres,redis,memory,parquet_only. - Storage (Hierarchical & Ordering): Added dynamic adapter selection in
hierachain/consensus/ordering/storage.py(OrderingStorageHandler),hierachain/hierarchical/hierarchy_manager/base.py(_create_storage) andhierachain/hierarchical/sub_chain/base.py— selectsPostgresAdapterwhendb_urlstarts withpostgres:///postgresql://otherwiseSQLiteAdapter; refactoredSubChainDB path generation to always ensuredata/{safe_name}/journalexists with path-traversal guard. - Database (Query & Indexes): Optimized
hierachain/adapters/database/sqlite_schema.py(create_indexesnow uses fullCREATE INDEXstatements) and refactoredhierachain/adapters/database/base/sql_adapter.pyto use predefined reusable query templates (_QUERIES_WITH_CHAIN/_QUERIES_WITHOUT_CHAIN) with parameterized queries for chain-aware event filtering, and fixed block cleanup to delete viahash/block_hashinstead ofid/block_id.
- Database (PostgreSQL): Introduced
-
2026-08-31
- SDK: Replaced
assertstatements with explicitRuntimeErrorchecks in_get_sessionacrosshierachain/sdk/client.pyandhierachain/sdk/async_client.pyto prevent session validation from being skipped in optimized byte-code mode (-O). - Logging & Error Mitigation: Replaced bare
except Exception: passandcontinueblocks with explicitlogger.debug()messages inhierachain/core/parquet_log.py,hierachain/error_mitigation/journal.py, andhierachain/risk_management/audit_logger.pyfor file closing, unlinking, rotation recovery, and batch replaying, improving error visibility while maintaining fail-safe execution.
- SDK: Replaced
-
2026-08-29
- Journal: Migrated
TransactionJournal(hierachain/error_mitigation/journal.py) to Parquet storage (pyarrow.parquet) with 100MB file cap, auto rotationcurrent_{ns}.parquet, bounded async queue (10k) and thread-safeParquetWritermanagement, plus replay over multiple Parquet files with backward compat for.arrow/.log. - Audit: Added
ArrowAuditStorage(hierachain/risk_management/audit_logger.py) as default backend, persistingAuditEventvia Parquet with Arrow schema, 100MB rotation,AuditFilter-aware retrieval, and compat for*.jsonl. - Logging: Unified all
log/persistence to Parquet viahierachain/core/parquet_log.py(write_parquet_log,ParquetLogHandler), migratingconsensus_scaling,view_changes,error_classifications,restoration_events,scaling_events,network_alerts,resource_scaling,rollback_operations,quarantine_dump,risk_analyzer,mitigation_strategiesto*.parquetand switchingOrderingServicetonode_{id}_journal.parquet.
- Journal: Migrated
-
2026-08-27
- API: Adjusted authentication handling in
hierachain/api/server.py(addedRequestannotation toauth_dependency, unifiedverifierinitialization and extendedEXEMPT_PATHSwith/api/admin/verify-identity) and removed redundantrequire_chain_accessdependencies inhierachain/api/admin/endpoints.pyfor/verify-identityand/statusso health checks and identity verification work correctly whenHRC_ENV=product.
- API: Adjusted authentication handling in
-
2026-08-24
- API: Introduced
hierachain/api/context.pyfor decoupled, context-based P2P client runtime lifecycle management across API server initialization, shutdown, and network ping endpoints. - Hierarchical (Rebalancer): Centralized sub-chain utility functions into
hierachain/hierarchical/rebalancer/utils.pyand streamlined state migration during sub-chain splitting to migrate pending events and inherit entity World State snapshots without altering committed block history. - Domains: Streamlined domain event module structure in
hierachain/domains/events/, decoupling cross-module circular imports betweenDomainEventbase and concrete event definitions.
- API: Introduced
-
2026-08-23
- Network: Added timestamp drift validation (
max_drift, default 300s) toverify_messageinhierachain/network/message_cryptographic.pyto ensure freshness of received P2P messages and reject replayed packets with stale timestamps. - API (Rate Limiter): Optimized in-memory
RateLimiterinhierachain/api/middleware.pywith periodic batch expiration cleanup (_cleanup_expired), eliminating $O(N)$ dictionary rebuilds and lock contention on every request under high traffic load; added client IP extraction fromX-Forwarded-Forheader for proxy deployments. - Core & Hierarchical: Enhanced
finalize_blockinBlockchain(hierachain/core/blockchain.py) andMainChain(hierachain/hierarchical/main_chain/base.py) to preservepending_eventswhen block creation or validation fails, preventing event data loss; addedself.locksynchronization toMainChainblock finalization methods.
- Network: Added timestamp drift validation (
-
2026-08-15
- Dead Code Removal: Removed unused utility functions across hierarchical and domain modules (
hierachain/core/utils.py,consensus/proof_of_federation.py,domains/chains/domain_chain.py,domains/chains/metrics.py,domains/utils/cross_chain_validator.py,domains/utils/entity_tracer.py,hierarchical/multi_org.py): deletedgroup_events_by_entity,_is_block_valid,_extract_signature_from_block,_analyze_compliance_status,_calculate_performance_stats,_process_string_value,_process_bytes_value,_generate_recommendations, andcreate_multi_org_networkfor a leaner, more maintainable codebase.
- Dead Code Removal: Removed unused utility functions across hierarchical and domain modules (
Fix (15)
-
2026-08-31
- Security (Secret Manager): Sanitized exception logging templates in
_get_from_aws(hierachain/config/secret_manager.py) to eliminate false-positive credential disclosure warnings during static security audits.
- Security (Secret Manager): Sanitized exception logging templates in
-
2026-08-29
- Security (Sanitization): Fixed
_sanitize_html_context(hierachain/security/sanitization.py) to neutralize SSTI with[TEMPLATE_BLOCKED]instead of no-ophtml.escape, and tightened_sanitize_filename_contextwith allowlist^[a-zA-Z0-9_\-~.]+$and../.filtering to prevent path traversal.
- Security (Sanitization): Fixed
-
2026-08-27
- Security (Key Manager): Added
PYTEST_CURRENT_TEST/pytestguard ininitialize_default_keys(hierachain/security/key_manager.py) to prevent default API key creation in test environments whenHRC_ENV=productand allow safe initialization underpytest. - Hierarchical (Rebalancer): Handle both
callableandnon-callablepending events in_get_pending_events(hierachain/hierarchical/rebalancer/split_ops.py) by checkingcallable()and falling back to thepending_eventslist. - Consensus (BFT): Relaxed timestamp drift threshold from 30s to 120s in
verify_message_signature(hierachain/consensus/bft/helpers.py) to avoid drift failures when the suite runs long with a statically created message at import time. - Config (Env Manager): Added
HRC_ENV=test/PYTEST_CURRENT_TESTchecks ininit_env_config(hierachain/config/env_manager.py) to prevent creating.env.HRC.exampleand loading the product.envwhile runningpytest. - Cluster (Lockdown): Hardened
verify_signatureinhierachain/cluster/lockdown_types.pywith emptystrtype checks andtry/exceptaroundhmac.compare_digestto safely handle invalid signatures while maintaining backward compatibility with legacy 32-char truncated signatures.
- Security (Key Manager): Added
-
2026-08-24
- Consensus (Ordering): Added empty batch check (
if not self.current_batch: return False) tois_batch_readyinBlockBuilder(hierachain/consensus/ordering/block_builder.py) to prevent false-positive readiness checks and no-op block creation triggers during idle timeout periods. - Core (Merkle Tree): Added domain separation prefix (
0x01) to internal node hashing inMerkleTree._build_tree(hierachain/core/merkle_tree.py) to prevent node duplication and second-preimage collision risks. - API (Payload Limit): Enforced upload payload size limits (1MB) on streaming/chunked requests lacking
Content-Lengthinadd_payload_limit(hierachain/api/middleware.py).
- Consensus (Ordering): Added empty batch check (
-
2026-08-23
- Consensus (BFT): Enforced strict signature verification in
_validate_consensus_message(hierachain/consensus/bft/helpers.py), ensuring that incoming BFT messages (PRE-PREPARE,PREPARE,COMMIT) with invalid or missing signatures are always rejected (return False) across all strictness modes. - Hierarchical (Proof Verification): Added fallback chain scanning in
_verify_proof_in_main_chain(hierachain/hierarchical/main_chain/proofs.py) to search committed blocks when a proof submission is not yet reflected in the O(1)proof_index. - Cluster (Lockdown Protocol): Standardized
LockdownMessageHMAC-SHA256 signatures inhierachain/cluster/lockdown_types.pyto use the full 64-character hex digest (256-bit) while maintaining backward compatibility with legacy 32-character truncated signatures inverify_signature.
- Consensus (BFT): Enforced strict signature verification in
-
2026-08-14
- Security (ZK Mock Proof):
_generate_mock_proofinhierachain/security/zk_prover.pynow accepts asub_chain_nameparameter and includes it inpublic_inputs, fixing the SHA-256 commitment being computed withsub_chain_name=""while the verifier hashed with the real sub-chain name (causing every proof to be rejected whenENABLE_ZK_PROOFS=true)._verify_mock_proofreplaces the laxmock_proofprefix check with the standard_verify_mocklogic fromzk_verifier(commitment hash vspublic_inputs), rejecting fake proofs. - Hierarchical: Moved the genesis-only chain guard above
get_latest_block()in_submit_proof_for_sub_chain(hierachain/hierarchical/sub_chain/proof.py), preventing anIndexErroron an empty SubChain and returningFalseas intended.
- Security (ZK Mock Proof):
v0.1.0 (2026-08-10)
This major milestone release marks the consolidation of HieraChain's core library architecture (hierachain/). Key highlights include complete terminology standardization, dual-tier consensus refinement (PoA for Intra-Org SubChains and PoF for Inter-Org MainChain alliances), integration of high-performance libraries (orjson, uvloop), extensive dead code removal, and API router restructuring.
Improvements (52)
-
2026-07-27
- Consensus: Introduced
HRC_MAINCHAIN_CONSENSUSenv var with backward-compatibleHRC_CONSENSUS_TYPEalias.MainChain.__init__accepts optionalconsensus_typeparameter.SubChainnow defaults to PoA for intra-org domain events, configurable viaconfig["consensus_type"].
- Consensus: Introduced
-
2026-07-23
- Refactoring: Moved all inline/late imports (
os,sys,time,uuid,asyncio,warnings,httpx,pyarrow,cast) to module-level top-of-file across 14 source files, fully conforming to PEP 8 import ordering.
- Refactoring: Moved all inline/late imports (
-
2026-07-22
- API: Integrated
uvloopdependency and enabled high-performance async event loop support in API server. - Blockchain: Introduced
event_type_indexonBlockchainandto_event_listonBlockfor O(1) event type lookups. - Cache: Replaced standard list with
OrderedDictfor LRU/TTL access ordering and simplified thread cleanup lifecycle. - Security: Refactored cryptocurrency term validation with recursive structure traversal, replacing expensive JSON regex serialization.
- Hierarchical: Optimized
HierarchyManagerto use a shared thread pool executor context, reducing thread creation overhead during proof sync. - State: Resolved race condition in
WorldStateroot hash calculation by moving sorting and Merkle tree construction out of the lock. - Network: Optimized ZMQ transport replay buffer management with threshold-based cleanup (>1000 entries).
- Consensus: Lowered parallel signature verification batch threshold from 15 to 4 for earlier multi-threading acceleration.
- API: Integrated
-
2026-07-18
- Storage: Tuned IPFS connection pooling parameters (
max_keepalive_connections=50,max_connections=150) to accelerate concurrent block storage. - Core: Resolved critical indexing race conditions in block creation within lock constraints and aligned initial index references.
- Database: Optimized SQLite adapter by setting database connection timeout to 30.0 seconds to prevent write-lock exceptions under high parallel load.
- Storage: Tuned IPFS connection pooling parameters (
-
2026-07-17
- Performance: Replaced
jsonwithorjsonacross the entire codebase (security, risk_management, network, monitoring, privacy, config, CLI, API, and hierachain modules) for faster serialization/deserialization. - Core: Added optimized data payload recovery for blocks with direct
datacolumn parsing when available. - Security: Optimized signature verification with configurable thread pool (CPU count) and extracted
_get_verify_keyhelper for public key decoding.
- Performance: Replaced
-
2026-07-12
- Network: Fixed seed node public key decoding with special handling for
$$delimiter characters.
- Network: Fixed seed node public key decoding with special handling for
-
2026-07-09
- Risk Management: Improved database connection handling in audit logger.
- Policy: Fixed Null value evaluation in Arrow
StructArray.
-
2026-07-05
- Database: Enhanced SQL adapter with metadata and merkle root support.
- API: Renamed API version tags for clarity (
v1→ledger,v2→business,v3→admin); updated security testing scripts and health check endpoints accordingly.
-
2026-07-04
- API: Restructured API modules for better security and maintainability; uses background tasks for async security event recording.
- Monitoring: Implemented comprehensive performance monitoring module; added alert system with anomaly detection and notification.
- Risk Management: Implemented
DatabaseAuditStoragefor persistent audit logging. - Refactoring: Removed deadlock detector and related tests; removed
sql_backendreferences; reorganized version management.
-
2026-07-02
- Storage Migration: Replaced
SqlStorageBackendwithSQLiteAdapter; deleted legacy storage module. - Database: Added chain state table for quick state lookups; added blockchain data storage and retrieval functions.
- Storage Migration: Replaced
-
2026-07-01
- API Routing: Major refactoring of API routing structure and module names; optimized middleware and WebSocket manager.
- Domains: Refactored event extraction logic and transaction management; removed generic-level re-export shim.
-
2026-06-30
- Dead Code Removal: Removed unused modules across core (performance, parallel_engine), storage (
ChainModel), network (message encryption exception classes), error_mitigation, domains (entity reporting, compliance), consensus, API, and adapters. - State: Removed
apply_event_listfunction from world state. - Event Ledger: Reconstructed event data structure and storage logic.
- Dead Code Removal: Removed unused modules across core (performance, parallel_engine), storage (
-
2026-06-24
- Dependencies: Added
vulturefor dead code detection.
- Dependencies: Added
-
2026-06-23
- Hierarchical: Modularized
MainChain(proof + registry),SubChain(rehydration logic),Rebalancer(event extraction),HierarchyManager(cross-level sync init), K8s namespace manager; addedcompliance_checker. - Consensus: Improved signature extraction and verification logic.
- Monitoring/Alert: Modularized into separate packages with shared types.
- ERP: Modularized integration components for better maintainability.
- Security: Improved API key storage and caching management.
- Events: Moved domain event classes with factory functions; moved metrics and transaction manager to separate modules.
- Core: Improved event queries and type handling.
- Hierarchical: Modularized
-
2026-06-22
- BFT Consensus: Restructured into modular components (engine, dispatcher, view_change).
- Ordering: Restructured batch processing and validation logic.
- Cluster: Extracted node validation and authentication helpers.
- Redis: Restructured adapter into manager classes with delegate operations.
- Security: Extracted production security checks to helper function.
- API: Extracted chain block lookup and creation helpers.
- WebSocket: Added explicit
Nonetype annotations for optional parameters. - Schemas: Optimized payload depth validation to use stack traversal.
-
2026-06-21
- Performance: Replaced
jsonwithorjsonacross database layer for faster serialization. - Journal: Added asynchronous background writing for event logging.
- Security: Optimized batch signature verification and proof serialization.
- Performance: Replaced
-
2026-06-20
- Consensus: Optimized batch signature verification; delegated crypto term validation to core utility.
-
2026-06-19
- Domains: Reorganized package structure; migrated generic modules; removed
generic/layer. - Hierarchical: Implemented
HierarchyManagerfor chain coordination; restructured sub-chain proof handling. - Core: Improved block event processing and merkle tree handling.
- Consensus: Reorganized BFT consensus; updated PoA and PoF classes.
- Security: Removed deprecated certificate and backup modules; simplified imports.
- Storage: Removed memory storage and world state modules.
- State: Added
WorldStateclass for entity state management. - Error Mitigation: Removed deprecated rollback and recovery modules.
- Integration: Removed
ArrowClientand related types. - Network: Removed
NetworkClientSyncsynchronous wrapper. - Database: Added
RedisStorageAdapterfor Redis blockchain storage. - Config: Removed unused cache and parallel processing settings.
- CLI: Fixed import path for
DomainChain. - Version: Simplified version module; removed unused functions.
- Dependencies: Added
orjson 3.11.9.
- Domains: Reorganized package structure; migrated generic modules; removed
-
2026-06-17
- SDK: Restructured into sync and async clients with shared types and exceptions.
- Security: Modularized certificate and key backup management.
- Risk Management: Restructured and optimized modules.
-
2026-06-16
- Core Cache: Replaced monolithic
caching.pywith modularCacheandCacheManagercomponents. - BFT: Consolidated BFT helpers into single module.
- Cluster: Moved data types to separate modules (lockdown_types, cross_level_sync_types).
- Monitoring: Unified alert and performance types into shared module.
- Integration: Moved error and sync classes to types module.
- Hierarchical: Centralized shared types into new
types.pymodule. - Error Mitigation: Added comprehensive error mitigation modules (consensus_validator, resource_validator, network_recovery, auto_scaler, backup_recovery).
- Core Cache: Replaced monolithic
-
2026-06-15
- API Restructuring: Split monolithic
v1/endpoints.pyinto modular components; modularizedv2/endpoints.py; fixedv3import paths. - GraphQL: Restructured schema and resolvers for better organization.
- Database: Added base SQL adapter and integrated into
SQLiteAdapter. - Server: Modularized middleware and GraphQL handler; optimized server setup; modularized blockchain explorer into components.
- API Restructuring: Split monolithic
Breaking Changes (1)
- API Routing & Data Schemas: Restructured API routes into domain-specific namespaces (
/api/ledger,/api/business,/api/admin), updated payload key names fromtransaction_*toevent/details, and refactored SDK client namespaces.
v0.0.6 (2026-07-15)
This release focuses on security hardening of the logging subsystem, simplification of the core blockchain and hierarchical layers, and further consensus hardening with proper error handling.
Improvements (6)
- Secure Logging: Added regex-based redaction of sensitive keys and tokens in
hierachain/security/: sensitive values are replaced with'***'to prevent credential leakage. Introduced_SEVERITY_MAPfor consistent security event logging, replacing direct log level methods withlogger.log(), reducing duplication across all logging call sites. - Core Blockchain Refactoring: Added
_rebuild_event_indexesto reset and rebuild event indexes after block loading, ensuring index consistency across restarts. Changed hash mismatch from silent correction to raising an exception, so potential data corruption is no longer hidden. Replaced direct dictionary access withblock.to_event_list()for cleaner event filtering. - Consensus Hardening: Enhanced
_contains_forbidden_termswith regex word-boundary matching to eliminate false positives. Removed fallback random signature generation; signing now fails cleanly with an error message when the private key is missing.ProofOfFederationauto-generates key pairs for validators, exposespublic_keyproperty, addedblock_hashto consensus metadata._verify_block_quorumnow accepts optionalsigner_idto avoid redundant event re-scanning. - Hierarchical Layer Simplification: Removed temporary entity index mapping, local chain clear, event statistics reset in sub-chain rehydration. Removed redundant event addition to
Blockchain.pending_events. Streamlined_recover_pending_events_from_journalto count uncommitted events only, moving event reconstruction toOrderingRecovery. - Testing & Benchmark: Enhanced ZK Proof-of-Federation test with real keypair, real signatures, and pre-consensus block validation. Updated storage benchmark using
Blockclass fromhierachain.core, renamedevent_typetoevent. Added helper function forProofOfFederationinstantiation with signing key.
Fix (1)
- Logger Test Alignment: Updated test assertions to match new logger method signatures (
mock_info→mock_log,call_argsindexing adjusted).
v0.0.5 (2026-06-20)
This release focuses on core hierachain/ package improvements, including replacing ipfshttpclient with httpx for Kubo RPC, idempotent sub-chain creation, chain integrity hardening, block persistence, and safe edge-case handling.
Improvements (6)
- Kubo RPC Migration: Replaced
ipfshttpclientwithhttpxinhierachain/api/storage/ipfs_client.py, executing IPFS operations directly via Kubo HTTP RPC API. Added_parse_multiaddrhelper for host/port extraction from multiaddress strings. Refactored core operations (upload, download, pin, unpin, list_pins, stats) to usehttpx.ClientPOST requests. Removed_IPFSClientContextwrapper class. - Idempotent Sub-Chain Creation: API v1 (
hierachain/api/v1/endpoints.py) checks for existing sub-chain before creation, returns201 Createdwith"already_exists"audit trail for duplicates. Returns409 Conflictwhenmanager.add_sub_chainraisesValueErroron duplicate. - Chain Integrity Hardening: Added
_verify_chain_links()inhierachain/consensus/ordering/storage.pyto validateprevious_hashchain of blocks._block_from_dictraisesValueErroron computed hash mismatch instead of merely logging an error. - Event Enrichment & Block Persistence: Ordering service (
hierachain/consensus/ordering/service.py) injectsevent_idintoevent_datapayload before creating pending events. Recovery (recovery.py) prioritizes enrichedevent_dataover calculated fallback. Sub-chain finalize (hierachain/hierarchical/sub_chain.py) persists blocks via storage handler, ensuring rehydration retains consensus events. - Block Overwrite: In
hierachain/storage/sql_backend.py,save_blockqueries for existing blocks byindex/chain_name, deletes and replaces them instead of silently handlingUNIQUE constraintviolations. - Zero Children Safeguard: Rebalancer (
hierachain/hierarchical/rebalancer.py) safely returns0whennum_children <= 0, preventing modulo-by-zero errors.
Fix (1)
- Integrity Check Locking: Moved post-rehydration chain integrity validation outside the lock in
hierachain/hierarchical/sub_chain.py. Downgraded mismatch log from error to warning to account for pending consumer thread blocks.
v0.0.4 (2026-05-25)
This release focuses on Node Identity with Ed25519/Curve25519 keypairs, ZeroMQ CURVE encryption for P2P, API v3 secure event submission, Ed25519 signing for Proof of Federation, BFT timestamp validation against replay attacks, and comprehensive security hardening within hierachain/.
Improvements (4)
- Node Identity & P2P Networking: Introduced
NodeIdentityinhierachain/security/identity_loader.py, ZeroMQ CURVE encryption inNetworkClient,send_direct/broadcastmethods, ping-pong heartbeat. Propagated node identity throughHierarchyManager,DomainChain,OrderingService, and BFT consensus. - API v3 & Cryptographic Signatures: New
POST /api/v3/chains/{chain_name}/secure-eventsendpoint with Ed25519 signature verification, 1MB payload limit, and max depth 10. Addedsender/signaturefields to v1 event schemas with strict hex validation. - Consensus Hardening: Ed25519 signing for Proof of Federation (
_create_federation_signature,_verify_block_quorum), 30-second BFT timestamp drift check against replay attacks, block hash verification on reconstruction, configurableblock_intervalviaHRC_BLOCK_INTERVAL. - Security: Production ZK proof rejection (test environment bypass), HMAC constant-time comparison (
hmac.compare_digest),threading.RLockin LockdownProtocol, PBKDF2 increased to 310,000 iterations,AdvancedCachewith TTL/LRU forKeyManager.
Fix (2)
- Consensus & Storage: Fixed block signature verification and auto key generation in PoA, corrected default return value in BFT handler from
TruetoFalse, added 64-char SHA-256 proof_hash validation, chain integrity checks after deserialization, addedcreator_id/signaturecolumns to block DB model. - API & SDK: Updated SDK default base URL from 8000 to 2661, sub-chain name regex validation, thread-safe
RateLimiter, CID/nonce validation in IPFS client.
v0.0.3 (2026-05-02)
This release focuses on comprehensive type safety improvements across hierachain/, achieving full Mypy compliance, strict Ed25519 64-byte signature validation, JSON canonicalization for deterministic verification, HMAC-based lockdown protocol, payload limit middleware, and 24-hour timestamp validation.
Improvements (4)
- Full Mypy Compliance: Resolved static typing warnings across all modules: consensus, API, security, network, monitoring, error mitigation, storage, adapters, hierarchical, domains, core and cluster.
- Ed25519 Signature Validation: Enforced strict 64-byte length for Ed25519 signatures in
verify_signature_standaloneto prevent validation bypass. - JSON Canonicalization: Implemented robust
get_canonical_byteswith recursive dict sorting, Unicode NFC normalization, and consistent float formatting for deterministic signature verification. - Security: Added
PayloadLimitMiddlewarerejecting POST/PUT/PATCH over 1MB, 24h proof timestamp consistency validation, default API key prevention in production (RuntimeError), refactored HMAC lockdown protocol (hmac.newSHA256).
Fix (1)
- BFT & Validation: Limited BFT message log to 10,000 entries preventing unbounded memory growth, improved IPFS connection handling (
_ensure_connectedwith proper None checks), fixed bare except clauses, enforced\bword-boundary matching for cryptocurrency term validation.
v0.0.2 (2026-04-04)
This release focuses on enhanced security, system observability, and important stability improvements for the core hierachain/ package, addressing real-world issues discovered during testing and evaluation.
Improvements (5)
-
Unified Secret & Credential Management:
- Introduced unified
SecretManagerinconfigfor secure credential management with multiple backend support. - Prevented accidental secret leakage in logs by masking secret names and backend identifiers.
- Prevented automatic master key generation in production to require explicit key provisioning.
- Introduced unified
-
Security & Policy:
- Added persistent storage for brute force lockouts and proactive rejection of dangerous input patterns in policy engine.
- Enhanced directory creation checks to prevent path traversal attacks in SubChain SQLite database paths.
- Added dedicated security module for GraphQL endpoint with input validation and access control.
-
Observability & Monitoring:
- Integrated Prometheus metrics collection for real-time monitoring of API latency, block throughput, and consensus health.
- Added JSON logging support for better integration with log aggregation systems like ELK and Loki.
- Added simple alert methods and global instance manager for proactive event notification.
- Enhanced API rate limiting with Redis backend for distributed deployments.
-
Core & Hierarchical Chain Improvements:
- Implemented deadlock detection with timeout and recovery mechanisms in lock management.
- Escalated missing ZK proof severity to critical and integrated automatic alert triggering.
- Improved proof submission robustness and shutdown handling in hierarchical chains.
- Added input validation for
ChannelLedger.add_eventto prevent malformed events.
-
Developer Tools & CLI:
- Added dedicated CLI commands for key generation, backup, and recovery (
python -m hierachain key ...). - Added endpoint to fetch specific blocks by index or hash for targeted audit.
- Updated SDK client for full multi-chain API v3 support.
- Synchronized block schema with event schema for consistent data structure.
- Added dedicated CLI commands for key generation, backup, and recovery (
Fix (2)
-
Consensus & Ordering Stability:
- Resolved critical race condition in block commit and pending event handling in
OrderingService. - Ensured lockdown and resume operations are atomic to prevent inconsistent state during maintenance.
- Prevented silent data loss during transaction journal recovery with proper validation.
- Improved state recovery logic with config validation and modularized recovery from transaction journal.
- Resolved critical race condition in block commit and pending event handling in
-
Core & Hierarchical Chain:
- Fixed race condition in hierarchical chain management and added graceful shutdown procedures.
v0.0.1 (2026-03-22)
This release marks the completion of HieraChain's initial architectural direction, focusing on consolidating core components into a unified prototype framework.
Improvements (4)
- IPFS Storage Integration: Support for off-chain data storage with AES-256-GCM encryption and CID identifiers across all API interfaces (REST, GraphQL, WebSocket).
-
Performance & Scalability Optimization:
- Parallel block processing in
OrderingService. - Caching for certificate and permission validation.
- Worker pool optimization (75% CPU) and multi-threading support for SQLite.
- Parallel block processing in
-
Developer Tools: Launched
BlockchainExplorerdashboard and detailed technical documentation system. -
Security & Integrity:
- Merkle Root support in block header and storage.
- Ensured hash consistency and thread-safety for core components.
- Standardized security logging with
SecureLogger.
Fix (1)
-
Stability & QA:
- Fixed Chain Rehydration bug for correct state restoration after restart.