Skip to content

Changelog

Unreleased

Breaking Changes (60)
  • 2026-10-18

    • API (Queued Secure Event Acknowledgement): add_secure_event (hierachain/api/admin/endpoints.py) stamps event/timestamp, retains the signed content in event_data["signature_content"] before journaling, returns SecureEventResponse(status="queued") with the ordering event ID in event_hash and the acknowledgement time in timestamp, and maps OrderingBackpressureError to HTTP 503 ({message, event_id, journaled}) plus ValueError to 422; SecureEventResponse (hierachain/api/admin/schemas.py) now describes status as queued with asynchronous block commitment — responses no longer report "committed", so clients that awaited a committed status must treat the acknowledgement as queued and await block commitment.
  • 2026-10-15

    • Packaging (Drop Python 3.10 Support): requires-python in pyproject.toml rises from >=3.10 to >=3.11 with the 3.10 classifier removed; Ruff target-version moves to py311, Black drops py310, Mypy python_version moves to 3.11, the CI compatibility matrix in .github/workflows/test.yml covers 3.11–3.14, and uv.lock is regenerated — environments still on Python 3.10 must upgrade to 3.11+ before installing this checkout.
  • 2026-10-06

    • Config & Core (Remove Unused Cache Metadata): Remove Settings.ADVANCED_CACHING_ENABLED, BLOCK_CACHE_SIZE, EVENT_CACHE_SIZE, ENTITY_CACHE_SIZE, BLOCK_CACHE_POLICY, EVENT_CACHE_POLICY, ENTITY_CACHE_POLICY, ENTITY_TTL, and hierachain.core.cache.DEFAULT_CACHE_CONFIG. Direct imports/accesses must migrate to actual cache-instance or service configuration; these names had no runtime consumers. AdvancedCache, KeyManager caches, and Ordering's block_cache_size retain their behavior. BFT node-count validation now receives node IDs directly without generating wrapper classes; quorum validation is unchanged.
    • Error Mitigation (Advisory Logs): Capacity log events become consensus_capacity_recommendation (both payload and wrapper) and resource_capacity_recommendation; update filters for auto_scaling_triggered, consensus_scaling, and resource_scaling_triggered. Remove the fictitious key_rotation_scheduled event and next_rotation deadline. Public methods, legacy configuration, Parquet paths, BFT quorum checks, and retained-key AES-256-GCM behavior remain unchanged; provisioning and rotation belong to the host application.
    • Consensus (Ordering Processor Consolidation): Remove OrderingExecutor (hierachain/consensus/ordering/processor.py) and fold process_batch()/process_single_event() into OrderingProcessor; __init__ takes a typed OrderingService and reads event_pool/pending_events/metrics/certifier/block_builder/storage_handler/should_stop/config live off service instead of caching attribute copies, with -> None annotations on lifecycle methods. Direct imports of OrderingExecutor and access to processor.event_pool/processor.should_stop/processor.executor (and sibling cached attributes) must migrate to processor.service.* or process_batch/process_single_event on the processor; certification/batch/replay flow (process_replayed_event() with allow_stale_timestamp) is unchanged.
  • 2026-10-05

    • Consensus & Config (PoA Interval Opt-in, No Implicit Delay): ProofOfAuthority.__init__ (hierachain/consensus/proof_of_authority.py) defaults block_interval from 10.0 to 0.0 (None = 0.0), rejects non-finite/negative values with ValueError, and _check_block_timing() only enforces explicitly configured spacing while still rejecting decreasing timestamps; Settings.BLOCK_INTERVAL (hierachain/config/settings.py) changes the HRC_BLOCK_INTERVAL default from "10.0" to "0.0" — previously forced a 10s spacing delay unless overridden.
    • Channel (Durable Append-only Ledger Stream): ChannelLedger (hierachain/hierarchical/channel/ledger.py) replaces the _persist callback with bind_storage() requiring append_channel_record/load_channel_records, appends typed event/block records guarded by expected_sequence plus registry revision, adds refresh()/_replay_record() with trusted-key block validation rolling back only newly applied records, and shares _validate_block()/_validate_pending_event() between restore() and replay; Channel (hierachain/hierarchical/channel/channel.py) refreshes the ledger inside _registry_operation, records stats via _record_event_statistics() skipping events without submitter_org, and drops manual rollback in add_event()/finalize_block() — previously persisted via opaque callback with full-state rollback.
    • Hierarchy (Split Recovery/Registry & Versioned Ledger Seeds): HierarchyManager (hierachain/hierarchical/hierarchy_manager/base.py) delegates main-chain replay/sub-chain restore to new hierarchy_manager/recovery.py and snapshot persist/restore/apply to new hierarchy_manager/registry.py, stops embedding channel-ledger snapshots in the registry state, persists channel ledgers atomically with the registry revision via _channel_ledger_version seeds written through append_channel_record/load_channel_records (bound ledgers restart at sequence 1), validates the full snapshot before mutating coordinator objects, and migrates legacy snapshots in place with 3-attempt retry — previously stored monolithic snapshots with embedded ledger data.
    • Database (Channel Ledger Tables & Atomic Registry+Ledger Write): new ChannelLedgerSQLStorage mixin plus create_channel_ledger_tables() (hierachain/adapters/database/channel_ledger_sql.py) gives SQLBase (SQLite/PostgreSQL) append_channel_record/load_channel_records with registry-revision and ledger-sequence guards (channel_ledger_heads/channel_ledger_records tables created in postgres_schema.py/sqlite_schema.py); save_hierarchy_registry() accepts channel_ledgers and commits registry plus ledger seeding in one transaction (commit moved out of _execute_save_hierarchy_registry, Postgres placeholder/lock/BEGIN IMMEDIATE overrides); RedisStorageAdapter (hierachain/adapters/database/redis_adapter.py) adds WATCH/MULTI ledger seeding/conditional append/suffix reads and fixes load_hierarchy_registry key handling — previously had no channel-ledger storage and committed registry alone.
  • 2026-10-04

    • Serialization (Strict stdlib JSON, No orjson): new hierachain/serialization.py (dumps_json/loads_json/dumps_canonical_json) replaces orjson across ~40 modules (hierachain/adapters/database/base/sql_adapter.py, hierachain/adapters/database/postgres_adapter.py, hierachain/adapters/database/redis_adapter.py, hierachain/core/block.py, hierachain/core/blockchain.py, hierachain/core/merkle_tree.py, hierachain/network/zmq_transport.py, hierachain/network/message_cryptographic.py, hierachain/security/*, hierachain/api/**/*, hierachain/sdk/client.py, hierachain/sdk/async_client.py, hierachain/consensus/ordering/utils.py, hierachain/error_mitigation/*, hierachain/monitoring/*, hierachain/risk_management/types.py, hierachain/config/*, hierachain/cli/key.py) with compact (",", ":") encoding, allow_nan=False, integer preservation, and NaN/Infinity rejection; RedisEventManager raises RedisStorageError on malformed/missing event records instead of returning [], and SQLite _execute_delete_chain now deletes proofs rows alongside events/blocks/chains — previously serialized via orjson, tolerated non-finite floats, silently skipped bad Redis records, and left proofs behind.
    • Core (Cache MutableMapping & Key Coercion): AdvancedCache (hierachain/core/cache.py) now implements collections.abc.MutableMapping[str, Any] instead of subclassing dict, drops keys() -> list[str] in favor of __iter__, coerces every key via str(key) in get/set/delete/contains/__getitem__, distinguishes stored None from missing via a sentinel in __getitem__, and only evicts when evict_key is not None — previously behaved as a dict with uncoerced keys, conflated None values with misses, and skipped falsy eviction keys.
    • Hierarchy (Durable Channel Ledger & Signed Registration Rebuild): Channel.__init__ (hierachain/hierarchical/channel/channel.py) accepts node_identity/trusted_public_keys and builds a signed ChannelLedger(node_identity, trusted_public_keys, channel_id); ChannelLedger (hierachain/hierarchical/channel/ledger.py) adds snapshot()/restore() with full signature/sequence/channel_id validation, threading.RLock, _save() fail-closed persistence with rollback on add_event/finalize_block, deepcopy isolation plus channel_id/timestamp stamping, and Channel.restore_statistics(); HierarchyManager (hierachain/hierarchical/hierarchy_manager/base.py) lazily acquires transaction_manager (raising RuntimeError when closed), adds close(), and rebuilds registered_sub_chains/sub_chain_metadata/authorities from signed sub_chain_registration MainChain events with finite-timestamp, metadata-shape, and domain-conflict checks — previously accepted unsigned/unchecked ledgers and re-appended registrations on every restart.
    • Consensus (Canonical Digest & Strict Quorum Pipeline): hash_request (hierachain/consensus/bft/types.py, hierachain/consensus/bft/helpers.py) uses dumps_canonical_json with new _request_digest_is_valid(); BFTConsensus/BFTConsensusEngine (hierachain/consensus/bft/consensus.py, hierachain/consensus/bft/engine.py) deepcopy operations/messages, block new proposals while pending_apply_events is non-empty, reject duplicate PRE_PREPARE sequences, record the local PREPARE vote before broadcast via record_local_prepare_vote(), enforce in-order commit (seq == committed_sequence + 1, buffering futures, draining after recovery), and persist/apply via _build_consensus_event with retry; OrderingService (hierachain/consensus/ordering/service.py) adds stable ID generation for cross-tier checks — previously hashed str(operation), allowed overlapping proposals/out-of-order commits, and mutated shared messages.
    • Domain & Sync (Transactional Projections & Canonical Lockdown Signatures): BaseChain (hierachain/domains/chains/base_chain.py) serializes register_entity/operation handlers under lock, gates on _domain_projection_healthy, persists initial_data_json (canonical bytes) for restart rebuild_domain_state() with event_id-then-content dedup and domain_projection_errors, tracks custom vs default handlers, and isolates payloads via deepcopy/snapshot cloning in CrossChainValidator (hierachain/domains/utils/cross_chain_validator.py); DomainChain/TxManager (hierachain/domains/chains/domain_chain.py, hierachain/domains/chains/tx_manager.py) replay projections from the accepted log; CrossLevelSyncManager (hierachain/cluster/cross_level_sync.py) adds RLock plus _operation batch context with active-operation tracking, and LockdownMessageGuard/lockdown_types.py bounds admission with replay tracking while signatures move to strict JSON helpers — previously mutated shared state without locks, lost initial data on rebuild, and signed via orjson, invalidating old signatures.
    • API (Enforced Auth, Permissions & 501 Stubs): strict JSON helpers replace orjson in hierachain/api/* (hierachain/api/ledger/blocks.py, hierachain/api/ledger/chains.py, hierachain/api/ledger/events.py, hierachain/api/ledger/schemas.py, hierachain/api/graphql/resolvers.py, hierachain/api/graphql/types.py, hierachain/api/storage/*, hierachain/api/websocket/*); graphql_handler.py adds async execution with permission checks and context auth, websocket/endpoints.py enforces subscription auth, business/contracts.py/business/private_data.py return HTTP 501 for unimplemented contract/private-data execution, ledger endpoints apply stricter query-parameter validation, and depds.py/server.py add hierarchy-manager closure/lifecycle helpers — previously allowed unauthenticated GraphQL/WS paths, silently stubbed unimplemented endpoints, and accepted loose query params.
    • CLI & Config (Unified Node Config & Master-Key Removal): load_chains_from_file replaced by load_node_config(ctx, config) (hierachain/cli/store.py, hierachain/cli/__init__.py) with YAML/JSON support, settings.CLI_CONFIG_FILE default changed from chains.json to data/config.yaml, and create/list_chains/add_event/show_events/init_node (hierachain/cli/chain.py, hierachain/cli/event.py, hierachain/cli/node.py) apply stricter validation plus durable get_hierarchy_manager(); Settings (hierachain/config/settings.py) removes MASTER_KEY_SOURCE/MASTER_KEY_FILE (HRC_MASTER_KEY_SOURCE/HRC_MASTER_KEY_FILE now raise ValueError), loads dotenv via HRC_ENV_FILE at import, centralizes parsing in _first_nonblank_environment_value()/_environment_csv() (HRC_NODE_ID/NODE_ID, HRC_P2P_PORT/NODE_PORT, HRC_PEERS/PEERS, HRC_REDIS_HOST/REDIS_HOST, HRC_REDIS_PORT/REDIS_PORT), and drops master_key from diagnostics — previously accepted legacy chain files, defaulted to chains.json, and silently ignored unsupported key sources.
    • Journal, Network, Audit & ERP (Fail-closed Strictness): TransactionJournal (hierachain/error_mitigation/journal.py) walks directories via pinned descriptors rejecting symlinks (O_NOFOLLOW, 0600/0700), holds POSIX fcntl write exclusivity, serializes via strict helpers, extends the journal envelope with fields/details, and rolls back failed writes; DataValidator (hierachain/error_mitigation/data_validator.py) tightens schema compatibility; SecureConnectionManager (hierachain/network/secure_connection.py) adds timestamp/nonce replay protection with strict certificate/org/signing-key alignment and rejects stale/unsolicited handshake acks; ArrowAuditStorage (hierachain/risk_management/audit_logger.py, hierachain/risk_management/__init__.py) adds AuditReadResult/AuditIntegrityStatus, normalizes stored events, and raises instead of silently failing with enhanced legacy handling; ERP (hierachain/integration/enterprise.py, hierachain/integration/erp/base.py, hierachain/integration/erp/change_detector.py, hierachain/integration/erp/mapping.py) deepcopy-isolates profiles/metadata, validates config/key_fields/detect_changes, and enforces simulation mode for synthetic fixtures — previously allowed symlinked paths, concurrent writers, stale handshakes, silent audit drops, and mutated shared ERP profiles.
  • 2026-10-03

    • Database (Registry Revision Guard): SQLBase.save_hierarchy_registry() / RedisStorageAdapter.save_hierarchy_registry() (hierachain/adapters/database/base/sql_adapter.py, hierachain/adapters/database/postgres_adapter.py, hierachain/adapters/database/redis_adapter.py) now require state["_revision"] to be a new str distinct from expected_revision (SQL conditional INSERT/UPDATE on the stored _revision, Redis WATCH/MULTI compare, Postgres %s dialect override) and reject missing/unchanged revisions — previously accepted any snapshot and overwrote unconditionally.
    • Hierarchy (Optimistic Concurrency & Admin Enforcement): _persist_hierarchy_registry() (hierachain/hierarchical/hierarchy_manager/base.py) stamps a uuid4 _revision and rejects stale saves via expected_revision, get_organization()/get_channel()/_restore_hierarchy_registry() refresh from persisted state (raising on missing/invalid snapshots), and new _apply_hierarchy_registry()/_mutate_registry() retry with rollback; _build_channel_orgs() (hierachain/hierarchical/hierarchy_manager/organization.py) now takes a registered dict instead of the manager, and register_organization_member(..., actor_user_id) raises PermissionError via shared _is_organization_admin() for non-admins — previously overwrote newer state and allowed any caller.
    • Channel (Live Refresh & ACTIVE Gate): Channel (hierachain/hierarchical/channel/channel.py) serializes registry operations via _registry_operation RLock with live _refresh_registry() before each call (org add/remove, private-collection creation, event query/info, policy update, suspend/resume), and submit_event() returns False when status != ACTIVE before role resolution — previously served stale membership and accepted events on non-active channels.
    • Ordering (Backpressure, Timeout & Gap Detection): OrderingService (hierachain/consensus/ordering/service.py) validates enqueue_timeout (0 < timeout <= 60, default 1.0) raising ValueError otherwise, reserves queue capacity before the journal write via _enqueue_event() raising OrderingBackpressureError(event_id, journaled) (hierachain/consensus/ordering/types.py) when full/inactive, and OrderingStorageHandler._load_from_db() (hierachain/consensus/ordering/storage.py) loads via get_blocks_from_index() raising ValueError on index gaps — previously queued unconditionally and stopped silently at the first missing block.
    • API (Backpressure 503 & Admin 403): add_event (hierachain/api/ledger/events.py) maps OrderingBackpressureError to HTTP 503 with {message, event_id, journaled} for client retry; register_organization_member (hierachain/api/business/organizations.py) reuses shared _is_organization_admin() and maps manager PermissionError to 403 while forwarding actor_user_id — previously backpressured events surfaced as generic errors with duplicated inline admin checks.
    • Core (Block Event Snapshot): Block.to_event_list() (hierachain/core/block.py) converts the verified Arrow table on every call returning an independent snapshot, dropping _cached_events memoization and __slots__ entry (plus _block_from_dict cleanup in hierachain/consensus/ordering/storage.py) — previously returned a shared mutable cached list that could drift from underlying events.
  • 2026-10-01

    • Error Mitigation (Retained Keys & Strict Validators): EncryptionValidator (hierachain/error_mitigation/encryption_validator.py) now resolves a caller-managed 32-byte key by key_id via key_resolver (no ephemeral os.urandom fallback) with AAD-bound AES-256-GCM (algorithm/key_id/timestamp), adds decrypt_data() with bytes/tag-IV length/algorithm/finite-timestamp checks, and masks failures behind generic SecurityError; _run_single_custom_validator (hierachain/error_mitigation/data_validator.py) enforces (bool, str) return and promotes validator failures/exceptions from warning to add_error with field name — previously passing validations now fail.
    • ERP (Fail-closed Transformers): EventTranslator (hierachain/integration/erp/mapping.py) shares the caller's MappingEngine (hierachain/integration/erp/base.py) so registered transformers apply consistently, and unknown transformer names raise MappingError instead of silently returning the input value.
    • Cluster (Quarantine Signature Payload): QuarantineReport.compute_signature (hierachain/cluster/lockdown_types.py) signs the full orjson sorted-keys payload instead of node_id:timestamp:last_block_index, from_dict() validates msg_type/lockdown_type and rejects non-finite timestamps before signing, and verify_signature() returns False on missing/invalid signatures instead of raising — previously issued signatures no longer verify.
    • Config (AWS Secret JSON Field): _get_from_aws/SecretManager._get_aws (hierachain/config/secret_manager.py) parse SecretString as a JSON object via orjson and return the validated string field named by key, requiring HRC_AWS_SECRET_NAME as the SecretId instead of falling back to key — non-JSON secrets, non-string fields, and missing secret names now return None.
  • 2026-09-30

    • Domain (Strict Resource Allocation): BaseChain.add_domain_event (hierachain/domains/chains/base_chain.py) now rejects events for unregistered entities and invalid resource transitions via _can_apply_resource_allocation() (event type must equal resource_{allocation_type}, membership checks for assigned/reserved/released/transferred including target_entity_id existence); ResourceAllocationEvent.is_valid (hierachain/domains/events/custom_events.py) requires non-empty target_entity_id distinct from entity_id for transferred — previously accepted events now return False.
    • Validator (Strict Proof Fields): ProofValidator._validate_single_proof (hierachain/domains/utils/cross_chain_validator.py) requires sub_chain_name/proof_hash to be non-empty str and timestamp to be a positive non-bool int/float, recording missing_proof_fields with an inconsistent_proofs increment instead of silently skipping field-less proofs.
  • 2026-09-29

    • Core & Hierarchical (Strict Event Validation): Blockchain.add_event (hierachain/core/blockchain.py) and SubChain.add_event (hierachain/hierarchical/sub_chain/base.py) now enforce validate_event_structure() (plus dict type check in SubChain) and raise ValueError on invalid structure; ledger add_event (hierachain/api/ledger/events.py) maps it to HTTP 422 instead of accepting malformed events.
    • API (Fail-closed Redis Rate Limiting): RedisRateLimiter moved to (hierachain/adapters/database/redis_rate_limiter.py) with check()/RateLimiterBackendError; add_rate_limit (hierachain/api/middleware.py) runs Redis checks via asyncio.to_thread and returns 503 when the backend is unavailable instead of the previous fail-open allow, and reuses the checked remaining quota for headers.
    • API (GraphQL Bounded Limits): resolvers (hierachain/api/graphql/resolvers.py) cap results via _bounded_limit()/MAX_QUERY_RESULTS=100 with limit=None meaning 100, clamped from_index/to_index/start+limit slicing, and early exit on limit=0 — larger requested limits now return at most 100 items.
    • Network (Strict Replay & Nonce Checks): _is_valid_replay (hierachain/network/zmq_transport.py) requires nonce to be str with 1..128 chars, finite numeric timestamp within replay_tolerance, and rejects when the 1000-entry replay buffer stays full after expiry pruning instead of silently evicting.
  • 2026-09-28

    • Core & Security (Mandatory Trusted Block Signatures): Blockchain.__init__/add_block/is_valid_new_block/is_chain_valid (hierachain/core/blockchain.py) now resolve the signer via require_block_identity() and verify against trusted_public_keys with _sign_block()/sign_block(); BlockVerifier (hierachain/security/verify/block_verifier.py) requires strict_mode=True and unconditionally rejects unsigned/malformed signatures, verifying only against caller-supplied trusted keys; load_trusted_block_keys()/require_block_identity() (hierachain/security/identity_loader.py) require HRC_BLOCK_TRUSTED_KEYS_FILE (new Settings.BLOCK_TRUSTED_KEYS_FILE) with an Ed25519 hex map and node-key alignment; initialize_default_keys() (hierachain/security/key_manager.py) now blocks defaults whenever Settings().env == "production".
    • Consensus & Ordering (Signed Blocks, Quorum & ZK): creator_id added to block construction with finalization-position checks in verify_quorum_signatures (hierachain/consensus/base_consensus.py, hierachain/consensus/proof_of_federation.py); ZK proofs are validated during verification, rejecting missing/invalid proofs when required and checking consensus_finalization structure/order/hash; BlockManager signs on creation and storage rejects unsigned/untrusted blocks with reconcile_journal_event() dedup on replay (hierachain/consensus/ordering/block_manager.py, hierachain/consensus/ordering/service.py, hierachain/consensus/ordering/storage.py).
    • Hierarchical Main/Sub-Chain (Durable Proofs & Signing): replaced in-memory proof counts with durable storage plus _refresh_durable_proofs()/proof_sequence/_durable_block_events (hierachain/hierarchical/main_chain/base.py, hierachain/hierarchical/main_chain/proofs.py, hierachain/hierarchical/main_chain/registry.py); SubChain proof submission enforces durable storage, rejects duplicates, adds ZK-proof metadata validation, and signs finalization with trusted keys per consensus type (hierachain/hierarchical/sub_chain/base.py, hierachain/hierarchical/sub_chain/block.py, hierachain/hierarchical/sub_chain/proof.py).
    • Hierarchical Registry (Durable Hierarchy & Stricter Validation): _persist_hierarchy_registry()/_restore_hierarchy_registry() with locking (hierachain/hierarchical/hierarchy_manager/base.py); restoration supports placeholder sub-chains with dynamic replacement; organization/channel registries enforce stricter member checks (hierachain/hierarchical/hierarchy_manager/organization.py, hierachain/hierarchical/hierarchy_manager/validation.py).
    • Channel (Signatures, Endorsement & Roles): block finalization verifies signatures against trusted keys, endorsement evaluation supports configurable eligible org sets, policy/org/status updates gain rollback, and submit_event/registry persistence require member-role validation (hierachain/hierarchical/channel/channel.py, hierachain/hierarchical/channel/ledger.py, hierachain/hierarchical/channel/policy.py, hierachain/hierarchical/channel/types.py).
    • Cluster (Cross-level Sync Without Copy): proof submission no longer merges history or copies cross-chain blocks (hierachain/cluster/cross_level_sync.py); anchors persist via _persist_proof_anchor() with durable verification under storage locks.
    • Audit (Schema & Hash Change): AuditEvent gains affected_entities with SQLite migration, JSON optional-field handling, and calculate_hash() over the full sorted dict (hierachain/risk_management/types.py, hierachain/risk_management/audit_logger.py) — stored digests change; new PostgresAuditManifest (hierachain/adapters/database/audit_manifest.py) with verify_integrity() and stricter persistence validation.
    • Config (Strict Env & Backend): Settings.env (hierachain/config/settings.py) raises ValueError on unknown HRC_ENV/ENV values (only production/prod/product, dev, test aliases), STORAGE_BACKEND allowlists memory/redis/sqlite/postgres/postgresql via _configured_database_url() (DATABASE_URL/HRC_DATABASE_URL), adds BLOCK_TRUSTED_KEYS_FILE, and ProductionSettings.AUTH_ENABLED is unconditionally True with HRC_AUTH_ENABLED=true enforced; get_settings() routes only on normalized production/test.
    • API/CLI/Business (Prod Auth & HierarchyManager): server lifespan requires require_block_identity() plus explicit DATABASE_URL/HRC_DATABASE_URL for production Postgres, mandates HRC_API_KEYS_FILE via _load_production_key_manager() (≥32-char keys, permissions, active key), replaces ENV with env, and tightens CORS/logging to production (hierachain/api/server.py, hierachain/api/graphql_handler.py); business channels/organizations move off in-memory _channels/_organizations to HierarchyManager with stricter validation and member-role schemas (hierachain/api/business/channels.py, hierachain/api/business/organizations.py, hierachain/api/business/schemas.py, hierachain/api/business/state.py); ledger proof submission delegates to HierarchyManager (hierachain/api/ledger/proofs.py); CLI submit_proof rejects registry submissions (durable authenticated API required) and verify enforces trusted-key chain validation (hierachain/cli/chain.py, hierachain/cli/verify.py).
  • 2026-09-27

    • Storage (IPFS Encryption Key): create_ipfs_client_from_env() (hierachain/api/storage/ipfs_client.py) now requires HRC_IPFS_ENCRYPTION_KEY to be exactly 64 hexadecimal characters (32 bytes) and raises IPFSError otherwise — it no longer falls back to generating an ephemeral key with a warning, so deployments without a stable key fail fast at startup instead of producing undecryptable payloads.
  • 2026-09-26

    • Config (Journal Sync): Removed Settings.JOURNAL_FSYNC / HRC_JOURNAL_FSYNC (hierachain/config/settings.py); TransactionJournal (hierachain/error_mitigation/journal.py) dropped the background writer queue/thread and always writes synchronously with os.fsync.
    • Core (Merkle Payload): Unified event payload serialization into serialize_event_payload() (hierachain/core/merkle_tree.py) reused by hierachain/core/block.py; Merkle leaves now include the data field (previously excluded), so leaves/roots/hashes change for identical events.
    • Database (Fail-hard Reads & Event Envelope): SQLBase.get_block_by_index/get_latest_block/get_event_by_id (hierachain/adapters/database/base/sql_adapter.py) now propagate database errors instead of returning None; PostgresAdapter._execute_save_block (hierachain/adapters/database/postgres_adapter.py) persists the full event envelope (orjson.dumps(event)) with submitted_by/sender_id fallback, and fetchers decode via the shared _create_event_from_row/_decode_jsonb.
    • Hierarchical (Storage Fail-fast): HierarchyManager._create_storage() (hierachain/hierarchical/hierarchy_manager/base.py) no longer falls back to SQLite when PostgreSQL is configured but unavailable — it raises RuntimeError instead; __init__/add_sub_chain now persist metadata and restore via list_chains(), raising on failure.
  • 2026-09-24

    • Core (Parquet Logs): write_parquet_log() now writes immutable segments of up to 1,024 records under <path>.segments; read_parquet_log() reads the segments and legacy single-file logs. Consumers that read <path> directly must switch to the helper.
  • 2026-09-22

    • Error Mitigation (Validators): Removed APIValidator (including the "api" entry of the create_validator factory and forbidden-term Arrow/legacy validation) from hierachain/error_mitigation/validator.py and package exports (hierachain/error_mitigation/__init__.py); corrected the ConsensusValidator import path to hierachain/error_mitigation/consensus_validator.py in hierachain/consensus/bft/helpers.py.
    • Monitoring: Removed the alert_manager global singleton instance and export from hierachain/monitoring/__init__.py (the AlertManager/PerformanceMonitor classes remain available).
    • Config (Storage Backend): Changed the default storage backend from sqlite to postgres in hierachain/config/settings.py (DEFAULT_STORAGE_BACKEND, default DATABASE_URL now postgresql://hiera:hiera@localhost:5432/hierachain, HRC_DATABASE_URL support with explicit sqlite:// handling) and hierachain/config/product_config_template.py (HRC_STORAGE_BACKEND=postgres with per-node DATABASE_URL/HRC_DATABASE_URL); ProductionSettings.DEFAULT_STORAGE_BACKEND switched from redis to postgres.
  • 2026-09-21

    • Monitoring: Removed PrometheusMetrics and singleton metrics from hierachain/monitoring/metrics.py (file deleted), removing Prometheus metrics collection utilities.
    • Risk Management: Removed RotatingAuditStorage from hierachain/risk_management/audit_logger.py and package exports (hierachain/risk_management/__init__.py).
  • 2026-09-20

    • Core (Cache): Removed BlockchainCacheManager, CacheInvalidator, EntityEventFetcher, and CachePerformanceTracker from hierachain/core/cache_manager.py (file deleted).
    • Error Mitigation (Recovery & Rollback): Removed RollbackManager and associated types (RollbackType, RollbackStatus, StateSnapshot, RollbackOperation), recovery engines (NetworkRecoveryEngine, ConsensusRecoveryEngine, BackupRecoveryEngine, AutoScaler), and RecoveryError from hierachain/error_mitigation/.
    • Risk Management: Removed RiskAnalyzer, MitigationManager, MitigationStrategies, and related risk/mitigation types (RiskAssessment, RiskSeverity, RiskCategory, MitigationAction, MitigationResult, MitigationStatus) from hierachain/risk_management/, keeping only audit logging primitives.
    • Monitoring: Removed PerformanceMetrics, MetricType, and PerformanceSnapshot from hierachain/monitoring/performance_metrics.py (file deleted).
    • Cluster: Removed ClusterManager, ClusterLockdownManager, ClusterState, and quorum-based lockdown coordination from hierachain/cluster/ (cluster_manager.py and lockdown_protocol.py deleted).
  • 2026-09-19

    • Hierarchical & Config: Removed deprecated packages k8s_namespace_manager, proof_aggregation, and rebalancer from hierachain/hierarchical/ (K8sNamespaceManager, ProofAggregator, SubChainRebalancer) along with related configuration settings (K8S_*, PROOF_*, REBALANCE_*) in hierachain/config/settings.py.
  • 2026-09-18

    • Cluster: Removed StateSyncManager (hierachain/cluster/state_sync_manager.py) and associated exports from hierachain/cluster/__init__.py.
Improvements (59)
  • 2026-10-24

    • Hierarchy (Persistent Organization-to-SubChain Grants): HierarchyManager (hierachain/hierarchical/hierarchy_manager/base.py) replaces the no-op assign_organization_to_chain() with a persisted chain_access map keyed by chain then organization, written through _mutate_registry() with a default of read/write when permissions is omitted and ValueError for empty, non-list, or unknown permissions, and adds revoke_organization_from_chain(), get_chain_access() (deep-copied grants, None for an unmanaged chain), and can_access_chain() which matches the caller's organization membership, stored identity, and role against read/write/proofs while letting unmanaged chains pass; the hierarchy registry (hierachain/hierarchical/hierarchy_manager/registry.py) persists chain_access under the existing revision retries and validates chain names, registered organizations, and permission values on restore, with legacy snapshots missing the field loading as unmanaged — previously assignments returned False and granted nothing.
    • API (Per-Chain Access Enforcement & Grant Management): new require_chain_read/require_chain_write/require_chain_proof dependencies (hierachain/api/ledger/access.py) combine the existing API-key resource checks with can_access_chain() and raise HTTP 403 on denial, replacing the coarse guards for blocks, chain statistics/creation, events, proofs, and /api/admin/chains/{chain_name}/secure-events; list_chains and cross-chain entity traces (hierachain/api/ledger/chains.py, hierachain/api/ledger/entities.py) omit unreadable SubChains; GraphQL resolvers (hierachain/api/graphql/resolvers.py) raise PermissionError for block, event, status, and add-event access and filter allChains; new GET/PUT/DELETE /api/ledger/chains/{chain_name}/organizations (hierachain/api/ledger/chain_access.py) list, replace, and revoke organization grants behind chains:manage, returning 422 for invalid permission lists and 404 for unknown chains/organizations/assignments; WebSocket subscriptions and broadcast fan-out (hierachain/api/websocket/endpoints.py, hierachain/api/websocket/manager.py, hierachain/api/websocket/registry.py) reject unauthorized chains at connect time, close with code 1008, re-check grants on resubscribe and before every send (including wildcard and event-type streams), and scope get_stats to readable chains — previously any API key holding a resource scope could read, write, or stream every SubChain. Grants remain independent (write does not imply read) and chains without assignments keep the previous coarse-scope behavior.
  • 2026-10-22

    • Dependencies (PyArrow & aiohttp Floors): pyproject.toml raises pyarrow from >=24.0.0 to >=25.0.0 and aiohttp from >=3.14.3 to >=3.14.5, with uv.lock regenerated — installs pinned below these floors must upgrade, and the compute-API fixes below follow the PyArrow 25 surface.
  • 2026-10-15

    • Database & Ordering (Durable Redis Ledger Backend): new RedisLedgerAdapter (hierachain/adapters/database/redis_ledger.py, exported from hierachain/adapters/database/__init__.py) extends RedisStorageAdapter with an append-only signed-block ledger keyed by SHA-256 chain_name, atomic WATCH/MULTI save_block() with creator_id/signature/merkle_root validation, index-sequence plus previous_hash link plus no-expire guards with idempotent same-position retry, strict sequence-checked get_blocks_from_index()/get_block_by_index()/get_latest_block()/list_block_chain_names() raising RedisStorageError on empty/corrupt/incomplete history, ledger-scan get_entity_events()/get_events_by_type()/get_event_by_id() (ordered status) and get_chain_statistics(), durability-gated store_chain()/save_hierarchy_registry()/append_channel_record()/store_proof() via require_durable_storage() (appendonly=yes, appendfsync=always, no-appendfsync-on-rewrite=no, maxmemory-policy=noeviction, aof-load-truncated=no, healthy AOF, primary role) and a pruning refusal in cleanup_old_data(); OrderingStorageHandler (hierachain/consensus/ordering/storage.py) selects it when storage_backend == "redis" (preserving PostgreSQL/SQLite selection), HierarchyManager._create_storage() (hierachain/hierarchical/hierarchy_manager/base.py) returns it for the redis backend instead of raising, and SubChain (hierachain/hierarchical/sub_chain/base.py) forwards storage_backend into the ordering config — previously the redis backend raised RuntimeError in the hierarchy manager and ordering ignored the Redis selection.
  • 2026-10-07

    • Core (Sequence Merkle Input): MerkleTree.__init__ (hierachain/core/merkle_tree.py) widens data_list from list[str | dict] to collections.abc.Sequence[str | dict] and annotates -> None, accepting tuples and other read-only sequences without copying — previously required a concrete list.
  • 2026-10-06

    • Monitoring (Lazy Submodule Loading): hierachain/monitoring/__init__.py defers alert_system/performance_monitor imports behind a PEP 562 __getattr__ so each module loads only when AlertManager/PerformanceMonitor is first requested; __all__ and public names are unchanged. AlertManager default-rule/notifier setup becomes methods with rule matching folded into check_metric(), keeping evaluation in one place — previously both submodules imported eagerly at package import time.
    • Error Mitigation (Unified Resource Checks): ResourceValidator (hierachain/error_mitigation/resource_validator.py) consolidates _check_cpu_usage()/_check_memory_usage()/_check_disk_usage() into a single CPU/memory/disk loop with identical violation strings and advisory-only resource_capacity_recommendation emission (auto_scale opt-in, disk excluded), dropping the unused cast import — previously three duplicated private helpers.
  • 2026-10-05

    • Core (Bounded Event Paging): new select_event_page() (hierachain/core/event_query.py) pages by (block_index, event_index) cursor, filters Arrow columns in batches, stops decoding once limit is hit, and falls back to plain lists for external chains; Blockchain (hierachain/core/blockchain.py) records event_index in _index_block_events sharing one cached entry between entity_event_index and the new _event_query_type_index, adds get_event_page() picking the narrowest entity/type index under lock with time-range/cursor delegation, and resets the new index in _rebuild_event_indexes().
    • API (GraphQL Cursor Pagination): resolve_events (hierachain/api/graphql/resolvers.py) delegates filtering to Blockchain.get_event_page/select_event_page (replacing _filter_event*/_get_events_from_chain), adds _decode_event_cursor()/_encode_event_cursor() opaque versioned chain-scoped base64url cursor of (block_index, event_index) with size/shape/value validation, and exposes a new after argument (hierachain/api/graphql/schema.py) plus per-event cursor field (hierachain/api/graphql/types.py).
    • Consensus (Incremental Journal ID Index): new JournalEventLookup (hierachain/consensus/ordering/journal_lookup.py) incrementally tracks ID/channel/content-SHA256 commitments under lock rejecting conflicting ID bindings with ValueError; OrderingService (hierachain/consensus/ordering/service.py) consults the index for unknown event IDs instead of rescanning the journal, recovering full payloads from disk only for journal-only hits with per-occurrence validation.
    • Journal (Synced File-state Tracking): TransactionJournal (hierachain/error_mitigation/journal.py) adds _file_write_state() (st_dev, st_ino, st_size, st_mtime_ns, st_ctime_ns) plus _synced_file_state updated after every successful fsync in append/rollback/flush, skips redundant fsync in read_since() when state is unchanged, and fail-closes (ValueError) when the active file was replaced ((st_dev, st_ino) mismatch) — previously fsynced unconditionally on every tail read without replacement detection.
  • 2026-10-04

    • Parquet (Snapshot Publish & Directory fsync): write_parquet_log() (hierachain/core/parquet_log.py) now publishes every append as a complete Parquet snapshot (pq.write_table to temp file, file fsync, atomic os.replace, directory fsync via _sync_directory()), keeps only the bounded active segment in _writers, seals the segment on any publish failure so later appends cannot overwrite uncertain data, and serializes data via dumps_json; read_parquet_log() takes a consistent snapshot under lock; removed atexit finalizer and persistent ParquetWriter state.
    • Hierarchy (Lazy Coordinator & Graceful Close): HierarchyManager (hierachain/hierarchical/hierarchy_manager/base.py) defers CrossChainTransactionManager creation until first use (skipping the 2PC writer for registry/channel-only workers while still recovering existing decisions under the journal lease), scopes bootstrap/restore in ExitStack, and adds close() releasing storage, coordinator journal, and sub-chain orderers without opening new resources; SubChain proof paths (hierachain/hierarchical/sub_chain/proof.py, hierachain/hierarchical/main_chain/proofs.py) add detailed pending/submission-schedule reasons with atomic state updates and safe rollbacks.
    • Consensus (Ordered Commit Drain & Stable IDs): BFTConsensusEngine (hierachain/consensus/bft/engine.py) extracts record_local_prepare_vote()/_record_message() helpers, dedups commit votes via _add_to_votes, and drains buffered future quorums after each successful apply; OrderingService (hierachain/consensus/ordering/service.py) retries failed chain applications and generates stable event IDs for cross-tier consistency checks.
    • Domain (Projection Health & Rebuild): BaseChain (hierachain/domains/chains/base_chain.py) exposes domain_projection_healthy/domain_projection_errors plus rebuild_domain_state() replaying committed blocks and pending events with deterministic handler projections, and differentiates default vs custom event handlers via _default_event_handler_methods.
    • Cluster (Batched Sync & Bounded Lockdown Admission): CrossLevelSyncManager (hierachain/cluster/cross_level_sync.py) serializes sync_to_mainchain/sync_from_mainchain/resolve_sync_conflict in _operation batches with active-operation tracking and aggregated status; new LockdownMessageGuard bounds message admission with replay tracking and authentication.
    • API & Server (Async GraphQL & Lifecycle Helpers): graphql_handler.py (hierachain/api/graphql_handler.py) supports async execution with request context; api/__init__.py/api/server.py centralize strict JSON error envelopes and hierarchy-manager shutdown; api/middleware.py aligns payload-limit handling with the new serializers.
    • Security (Brute-force Failure Tracking & Lean MSP): SQLite/Redis auth stores (hierachain/adapters/database/auth_state.py) add an indexed auth_failures table, windowed get_failure_count(), record_failure() failure/lockout creation, and an atomic Redis Lua increment/lockout script with consistent failure deletion; MSP (hierachain/security/msp.py) removes the certificate-verification cache for simpler, consistent verification.
    • ERP, Scheduler & State (Backoff, Validation & Docs): SyncScheduler (hierachain/integration/erp/scheduler.py) switches to exponential retry backoff with timer-based task management and change_detected logic; MappingEngine/ChangeDetector (hierachain/integration/erp/base.py, hierachain/integration/erp/change_detector.py, hierachain/integration/erp/mapping.py, hierachain/integration/enterprise.py) validate config/key_fields/detect_changes including deeply nested keys; WorldState (hierachain/state/world_state.py) clarifies Merkle-root usage and projection-rebuild requirements.
  • 2026-10-03

    • Journal (Cursor-based Tail Reads): new TransactionJournal.read_since(cursor) (hierachain/error_mitigation/journal.py) flushes/fsyncs the active journal, spans rotated files via (st_ino, offset) cursor, reads legacy Parquet only on the initial scan, and fails closed (ValueError/RuntimeError) on missing/truncated cursors or a missing active file.
    • Domains & Hierarchical (Incremental 2PC Recovery): DomainChain._load_transaction_event_markers() (hierachain/domains/chains/domain_chain.py) and CrossChainTransactionManager._read_latest_records() (hierachain/hierarchical/transaction_manager.py) consume only new frames via read_since() with _transaction_journal_cursor/_journal_cursor plus _durable_records cache under lock, falling back to full replay() when the cursor API is missing.
    • Sub-chain (Bootstrap Retention & Index Reuse): SubChain (hierachain/hierarchical/sub_chain/base.py) constructs ordering with retain_bootstrap=True; _rehydrate_chain_from_ordering_service()/_apply_rehydrated_blocks() (hierachain/hierarchical/sub_chain/ordering.py) prefer one-shot take_bootstrap_blocks() then get_blocks_from_db(start_index=0) and rebuild indexes via Blockchain._rebuild_event_indexes(), removing _update_event_statistics().
    • Database (Single-statement Block Range): new SQLBase.get_blocks_from_index() (hierachain/adapters/database/base/sql_adapter.py, Postgres %s placeholder in hierachain/adapters/database/postgres_adapter.py) loads headers plus ordered events in one JOIN (ORDER BY chain_name, index, event id) grouped per block; ordered event payloads from get_event_by_id now include chain_name.
    • Ordering (Bootstrap Snapshot & Bounded Certification): OrderingService.take_bootstrap_blocks() (hierachain/consensus/ordering/service.py, appended in hierachain/consensus/ordering/block_manager.py) transfers the verified startup snapshot once when retain_bootstrap=True; EventCertifier(max_history=10000) (hierachain/consensus/ordering/certifier.py) LRU-bounds certified_events with lock-protected access; get_event_status short-circuits durable ordered via get_event_by_id.
    • Core (Eager TTL Cache Cleanup): AdvancedCache (hierachain/core/cache.py) drops the per-instance daemon TTL cleanup thread/_cleanup_stop, running eager cleanup_ttl() under a single lock on set eviction plus get_stats()/get_keys()/__len__().
  • 2026-10-02

    • Consensus (Ordering Finalizer & Startup Integrity): OrderingService (hierachain/consensus/ordering/service.py) accepts an optional block_finalizer(block, previous_block) hook and validates the persisted chain (get_blocks_from_db(0) tail-hash versus latest) before journal replay, raising on incomplete/damaged history; wait_for_active() accepts timeout=None for indefinite recovery waits with monotonic deadlines plus should_stop/thread-liveness checks; OrderingBlockManager.commit_block (hierachain/consensus/ordering/block_manager.py) aborts when the service is stopping, assigns creator_id under the index lock, delegates consensus to the finalizer, and re-checks shutdown before signing.
    • Hierarchical (Sub-chain Ordered-Block Finalization): new SubChain._finalize_ordered_block() (hierachain/hierarchical/sub_chain/base.py) completes consensus before the orderer signs and persists (timing-aware delay interruptible via _shutdown_event, creator_id preserved across finalization, validate_block rejection raised as ValueError); SubChain uses a threading.RLock for block processing, waits indefinitely for ordering recovery (wait_for_active(timeout=None) so journal backlogs finish instead of restarting), drains shutdown via finalize_sub_chain_block(), and passes the finalizer into OrderingService.
    • Hierarchical (Sub-chain Block Application): _process_and_finalize_single_block() (hierachain/hierarchical/sub_chain/block.py) now applies already-finalized ordering blocks unchanged (no index/hash recalculation, consensus re-finalization, or re-signing), parking the orderer in MAINTENANCE with a stop signal when add_block fails; _finalize_sub_chain_block_for_chain() serializes dequeue plus apply under block_processing_lock to preserve FIFO order; _reset_ordering_service_state() was removed (hierachain/hierarchical/sub_chain/ordering.py) with rehydration relying on chain sync instead of rewriting block_history/blocks_created.
    • Hierarchical (Recovery Resource Management): HierarchyManager.__init__/_restore_sub_chains() (hierachain/hierarchical/hierarchy_manager/base.py) scope bootstrap and sub-chain restoration in ExitStack (journal/storage/per-chain shutdown callbacks, pop_all() only on success) replacing manual try/except cleanup.
  • 2026-09-30

    • Database (Chain Name Listing): new SQLBase.list_block_chain_names() (hierachain/adapters/database/base/sql_adapter.py) returning ordered DISTINCT chain_name from blocks with fail-hard error propagation for CLI verification.
    • State (Immutable Snapshots): WorldState.get_entity_state()/get_all_states() (hierachain/state/world_state.py) now return deepcopy snapshots (plus deepcopy of last_details on updates) so callers cannot mutate internal state.
    • Audit (Sealed Reads & Retention): ArrowAuditStorage (hierachain/risk_management/audit_logger.py) centralizes _seal_active_file(), fixes limit=0/None handling in retrieve_events, counts via Parquet metadata/bounded 4096-row batches in get_event_count(), and adds cleanup_old_events() deleting only fully-expired Parquet archives; DatabaseAuditStorage._filter_sql() unifies event_type/severity/source_component/user_id/time_range predicates for retrieval and count.
    • CLI (Key Files & Multi-backend Verify): hierachain/cli/key.py writes new keys with O_EXCL 0600, reads JSON or two-line hex via _read_key_file(), and fully masks the private key on show; hierachain/cli/verify.py adds _open_backend() for postgres/postgresql/sqlite URLs plus path backends over SQLBase, tracks events_unsigned separately (unsigned allowed, incomplete signatures invalid, sender_public_key fallback, to_event_list()), and fails the audit on invalid events as well as blocks.
    • Domain (Resource Lifecycle): BaseChain (hierachain/domains/chains/base_chain.py) handles resource_released/resource_reserved/resource_transferred with allocated_resources/reserved_resources lifecycle (reserve, release from either list, move on reserved→assigned, transfer between entities), registers entities only after add_event succeeds, and returns False on handler errors instead of swallowing them.
  • 2026-09-29

    • Database (Shared Auth State Stores): new SQLiteRevocationStore/SQLiteLockoutStore (file-shared, 0600, digest-hashed keys) and RedisRevocationStore/RedisLockoutStore plus RedisRateLimiter (hierachain/adapters/database/auth_state.py, hierachain/adapters/database/redis_rate_limiter.py); hierachain/adapters/database/__init__.py switched to lazy __getattr__ imports.
    • Config (Auth State Backends): new HRC_AUTH_STATE_REDIS_URL (Settings.AUTH_STATE_REDIS_URL) and HRC_API_KEY_REVOCATIONS_DB (Settings.API_KEY_REVOCATIONS_DB), with get_auth_config() selecting redis/sqlite/file lockout backend (hierachain/config/settings.py).
    • Security & API (Shared Revocation & Async Checks): KeyManager accepts revocation_store and checks it in is_revoked() (hierachain/security/key_manager.py); BruteForceProtector delegates to shared SQLite/Redis lockout stores (hierachain/security/brute_force_protector.py); APIKeyVerifier offloads brute-force/revocation/is_valid checks via asyncio.to_thread and checks revocation before validity (hierachain/security/verify/api_key_verifier.py); production server wires RedisRevocationStore/SQLiteRevocationStore into KeyManager (hierachain/api/server.py).
    • Hierarchical & Core (Metadata Sanitation): MainChain.register_sub_chain sanitizes once via sanitize_metadata_for_main_chain() for both registry and authority metadata (hierachain/hierarchical/main_chain/base.py); sanitize_metadata_for_main_chain gains recursive _sanitize_summary_value() (nested dict/list pruning, >5-key dict / >10-item list omitted) and new omitted fields internal_data/complete_log/detailed_data, with stricter list validation (hierachain/core/utils.py).
    • SDK (Thread-safe Circuit Breaker & Responses): CircuitBreaker (hierachain/sdk/types.py) gains locking with single in-flight HALF_OPEN probe (acquire_request()/release_probe(), probe-aware record_success()/record_failure()); sync/async clients handle HEAD/GET/OPTIONS and HTTPStatus.NO_CONTENT empty bodies with retryable vs non-retryable error split (hierachain/sdk/client.py, hierachain/sdk/async_client.py).
    • Network (Peer Management & Health): NetworkClient tracks public_key/_last_activity, PEER_TIMEOUT=60.0 with _refresh_peer_health(), preserves keys on re-register, and adds unregister_peer() with socket cleanup; ZmqNode.register_peer() resets changed sockets and unregister_peer() discards pending messages (hierachain/network/network_client.py, hierachain/network/zmq_transport.py).
  • 2026-09-28

    • Database (Hierarchy Registry & Audit Manifest): save/load hierarchy registry across PostgreSQL/SQLite/Redis adapters, new PostgresAuditManifest for audit digests, streamlined event filtering/metadata handling, SQLite synchronous=FULL durability, and stricter chain-state integrity (hierachain/adapters/database/__init__.py, hierachain/adapters/database/audit_manifest.py, hierachain/adapters/database/base/sql_adapter.py, hierachain/adapters/database/postgres_adapter.py, hierachain/adapters/database/redis_adapter.py, hierachain/adapters/database/sqlite_adapter.py).
    • Hierarchical (Durable 2PC Journal): persistent phase journal with _journal_record()/_load_journal(), structured prepare/commit/rollback, participant validation, and retry for unresolved decisions (hierachain/hierarchical/transaction_manager.py, hierachain/hierarchical/private_data.py, hierachain/hierarchical/types.py).
    • Domains (Committed Transaction Recovery): committed_transactions tracking with _tx_commit_lock, marker load/reconcile, and post-COMMIT recovery for idempotent acknowledgments (hierachain/domains/chains/domain_chain.py, hierachain/domains/chains/tx_manager.py).
    • API (Channel Event Submission): new POST /channels/{channel_id}/organizations/{org_id}/events with authentication and validation (hierachain/api/ledger/events.py).
    • Journal (File Listing): streamlined _get_journal_files() ordering/dedup without redundant sorting (hierachain/error_mitigation/journal.py).
  • 2026-09-27

    • Storage (IPFS Async & Auto-pin): upload_to_ipfs_background()/download_from_ipfs() (hierachain/api/storage/endpoint_helpers.py) now offload blocking IPFS calls via asyncio.to_thread to avoid stalling the event loop; IPFSClient upload (hierachain/api/storage/ipfs_client.py) passes auto-pin as an add query parameter instead of a follow-up pin() call.
  • 2026-09-26

    • API (Readiness): Added GET /api/ledger/ready (hierachain/api/ledger/health.py) reporting ready only when every sub-chain ordering service is ACTIVE (503 otherwise); exempted in hierachain/api/server.py; thread-safe lazy get_hierarchy_manager() returning 503 while recovery is not ready (hierachain/api/ledger/depds.py); sub-chain creation forwards manager.node_identity (hierachain/api/ledger/chains.py).
    • Consensus (Ordering Genesis & Replay): OrderingService accepts an optional genesis_block (hierachain/consensus/ordering/service.py) persisted when the database is empty; EventCertifier.validate()/OrderingExecutor.process_single_event() accept allow_stale_timestamp with strict finite numeric timestamp checks (hierachain/consensus/ordering/certifier.py, hierachain/consensus/ordering/processor.py); replayed journal events flow through process_replayed_event() (hierachain/consensus/ordering/recovery.py, hierachain/consensus/ordering/processor.py).
    • Database (Chain Listing & SQLite Memory): Added list_chains() across SQLBase/RedisChainManager/RedisStorageAdapter (hierachain/adapters/database/base/sql_adapter.py, hierachain/adapters/database/redis_adapter.py); SQLiteAdapter (hierachain/adapters/database/sqlite_adapter.py) supports shared-cache :memory: via a keeper connection; SQLBase._create_event_from_row returns the enriched envelope directly when columns match; RedisChainManager.store_chain omits None domain_type.
  • 2026-09-24

    • API (Server Auth): Widened auth_dependency (hierachain/api/server.py) from Request to HTTPConnection with a verifier is None guard, and exposed the verifier as fast_app.state.auth_verifier for shared access.
    • Security (API Key Verifier): Made APIKeyVerifier (hierachain/security/verify/api_key_verifier.py) HTTPConnection-compatible (_extract_client_ip/__call__/_extract_api_key); added centralized KeyManager.get_permissions() (hierachain/security/key_manager.py) with the verified auth context now carrying top-level permissions (ResourcePermissionChecker falls back to app_details); _get_active_verifier(connection) resolves the verifier from application state.
  • 2026-09-23

    • Database (PostgreSQL Adapter): Batched event inserts in _execute_save_block (hierachain/adapters/database/postgres_adapter.py) via a single cursor.executemany() over collected event_rows instead of per-event cursor.execute(), reducing round-trips when persisting multi-event blocks.
    • Consensus (Ordering Service): Simplified OrderingService startup (hierachain/consensus/ordering/service.py) by removing the duplicate _recover_pending_events_from_journal() count-and-log pass and delegating journal replay entirely to the processor (recover_state_async()); extracted the shared _start_processing_thread() helper reused by __init__ and start().
  • 2026-09-22

    • Journal (Error Mitigation & Ordering): Migrated TransactionJournal (hierachain/error_mitigation/journal.py) from ParquetWriter to append-only Arrow IPC framing (length-prefixed RecordBatch streams via _serialize_arrow_batch, os.fsync durability, multi-row batch replay with legacy stream fallback); renamed the default active log current.parquet to current.arrow (rotation files *_*.parquet to *_*.arrow, likewise node_{id}_journal.parquet to .arrow for OrderingService in hierachain/consensus/ordering/service.py) while preserving replay of legacy Parquet files (active legacy file auto-renamed to *_legacy_*.parquet via the _is_parquet_file guard).
    • Hierarchical (SubChain Proof & Events): Streamlined SubChain.add_event() (hierachain/hierarchical/sub_chain/base.py) to return the authoritative event_id from ordering_service.receive_event() instead of a synthetic orjson+SHA-256 digest (dropping the hashlib/orjson imports); switched should_submit_proof() to block-index tracking via the new last_proof_block_index (updated in hierachain/hierarchical/sub_chain/proof.py) instead of pending-event checks; hardened _process_and_finalize_single_block (hierachain/hierarchical/sub_chain/block.py) to log persistence failures at error level and return False without appending the block in memory.
    • Database (PostgreSQL Adapter): Hardened PostgresAdapter (hierachain/adapters/database/postgres_adapter.py) with connect_timeout: 3 on pool initialization, dynamic orjson parsing of raw event data in _execute_fetch_block_events, self-contained _execute_save_block requiring chain_name (auto-inserts a missing chains row, accepts metadata/merkle_root fallback), and graceful block fetchers returning hydrated block dicts with optional chain_name (_execute_get_block_by_index/_execute_get_latest_block converted to instance methods).
    • Hierarchical (Storage Fallback): Made HierarchyManager._create_storage() (hierachain/hierarchical/hierarchy_manager/base.py) resilient by probing PostgreSQL (SELECT 1 FROM chains LIMIT 0) and falling back to SQLiteAdapter with a warning when PostgreSQL is unavailable.
  • 2026-09-18

    • Consensus (Ordering Service): Added capacity bounding for event_pool using Settings.EVENT_POOL_MAX_SIZE in hierachain/consensus/ordering/service.py to prevent unbounded memory growth, and added maintenance mode check in submit_event to wait for active status (wait_for_active()) and reject event submissions when not active.
    • API (Ledger Events): Updated /api/ledger/events (hierachain/api/ledger/events.py) in add_event to return the authoritative event_id directly from sub_chain.add_event(event) instead of generating a synthetic positional identifier.
Fix (33)
  • 2026-10-22

    • Network (Transport Release & Explicit MSP Checks): ZmqNode.start() (hierachain/network/zmq_transport.py) now calls stop() and chains the original error with raise ... from e when socket setup fails, NetworkClient.start() (hierachain/network/network_client.py) runs stop() on failure, and stop() no longer returns early when _is_running is false — a failed start can be retried without leaking sockets. validate_msp_from_message() (hierachain/network/secure_connection.py) replaces the all(...) generator with explicit str/non-empty checks per handshake field so every missing field reports its own rejection reason.
    • Adapter (Runtime Edge Cases): PostgresAuditManifest.__init__ (hierachain/adapters/database/audit_manifest.py) accepts a None fetchone() row; PostgresAdapter (hierachain/adapters/database/postgres_adapter.py) loads the psycopg2 fallback via import_module, makes _execute_store_proof() static with submitted_at/created_at defaulting to time.time(), and the SQLite _execute_update_state() return type widens to bool | None (hierachain/adapters/database/base/sql_adapter.py); ChannelLedgerSQLStorage (hierachain/adapters/database/channel_ledger_sql.py) declares _get_connection() under TYPE_CHECKING, and RedisLedgerAdapter.get_latest_block() (hierachain/adapters/database/redis_ledger.py) filters empty tips before max() and returns None when no chain has blocks.
    • API (GraphQL Filtering & Type Hardening): resolve_events (hierachain/api/graphql/resolvers.py) forwards entity_id/event_type/from_timestamp/to_timestamp/limit/after explicitly to select_event_page() for non-Blockchain chains, _to_event_type() assigns EventType fields after construction so details_metadata no longer hits an invalid constructor keyword, and _required_graphql_permissions() (hierachain/api/graphql_handler.py) detects fragments with isinstance(..., FragmentDefinitionNode) instead of the raw definition.kind string; GraphQL fields in hierachain/api/graphql/types.py are annotated with cast() (with EventType.resolve_events() allowed to return None), and the WebSocket chain_name parameter (hierachain/api/websocket/endpoints.py) is typed str with the same "all" default.
    • Consensus (Journal Requeue & Rule Naming): OrderingService.receive_event() (hierachain/consensus/ordering/service.py) raises ValueError when a journal hit has no record before requeueing, and _find_stable_event() rejects non-dict stored payloads with the same ValueError instead of an AttributeError; _run_custom_rules() (hierachain/consensus/ordering/certifier.py) names rules lacking __name__ via type(rule).__name__ so callable objects no longer abort certification, and BFTConsensus (hierachain/consensus/bft/consensus.py) hashes self.current_request directly.
    • Hierarchical & Cluster (Durable Recovery Guards): _restore_main_chain() (hierachain/hierarchical/hierarchy_manager/recovery.py) raises RuntimeError when durable storage is unavailable and casts the registration timestamp before float(); ChannelLedger._replay_record() (hierachain/hierarchical/channel/ledger.py) rejects non-dict snapshot/event/block payloads through the existing validation and RuntimeError paths; _durable_block_events() (hierachain/hierarchical/main_chain/proofs.py) and _verify_anchor_exists() (hierachain/cluster/cross_level_sync.py) treat a missing proof_storage explicitly as unavailable so strict and non-strict paths return documented results instead of relying on getattr(None, ...).
    • Core & Error Mitigation (PyArrow 25 Compute API): _iter_block_rows() (hierachain/core/event_query.py) builds the entity/timestamp mask with pc.call_function("and"/"equal"/"greater_equal"/"less_equal"/"indices_nonzero"), and _check_forbidden_terms_in_array() (hierachain/error_mitigation/validator_helpers.py) lowercases and matches via pc.call_function with pc.MatchSubstringOptions(term); _open_safe_file() (hierachain/error_mitigation/journal.py) narrows mode to Literal["rb", "ab", "wb", "r+b"], and AdvancedCache.get() (hierachain/core/cache.py) accepts any key object before str() coercion.
    • Domains (Event Marker & Validator Narrowing): _rebuild_domain_state() (hierachain/domains/chains/base_chain.py) skips replayed events whose event type is not a str before dispatch, recover_committed_transaction()/commit_transaction() (hierachain/domains/chains/domain_chain.py) return False when _transaction_event_markers is None instead of indexing it, and ProofValidator._validate_single_proof() (hierachain/domains/utils/cross_chain_validator.py) casts the already-validated sub_chain_name/proof_hash before lookups.
    • SDK & Security (Timeout & API Key Source): HieraChainAsyncClient (hierachain/sdk/async_client.py) wraps config.timeout in aiohttp.ClientTimeout(total=...), and HieraChainClient (hierachain/sdk/client.py) raises HieraChainAPIError when the response carries no HTTP status code; APIKeyVerifier._extract_api_key() (hierachain/security/verify/api_key_verifier.py) resolves the source explicitly — query_params for APIKeyQuery, headers otherwise — and calls check_api_key() on that mapping instead of invoking the FastAPI dependency with the connection, while KeyManager.storage (hierachain/security/key_manager.py) is annotated Any.
    • Monitoring & CLI (Typed Alert Stats & Command Registration): AlertManager.stats (hierachain/monitoring/alert_system.py) is typed with a _AlertStatistics TypedDict, so counter updates drop the per-access cast() calls, and hierachain/cli/__init__.py registers commands without the redundant cast(Command, ...) wrappers.
  • 2026-10-18

    • API (Ledger Sender Identity & Default Nonce Validation): _build_event_data (hierachain/api/ledger/events.py) now also writes sender alongside submitted_by so ordering can read the signing identity from either field, and EventRequest.details_nonce (hierachain/api/ledger/schemas.py) sets validate_default=True so the None default is validated too — previously the default nonce bypassed hex/length validation and the stored event omitted sender.
    • Ordering (Canonical Signature Recheck & Shutdown Drain): _extract_verification_items (hierachain/consensus/ordering/processor.py) skips events carrying signature_content (already verified by the certifier during live processing and replay), verifies legacy signatures with 0x-stripped hex sender/signature, and polls event_pool at most every 0.1s while keeping batch_timeout; new _verify_canonical_event() (hierachain/consensus/ordering/utils.py) rebinds the ordered business fields (entity_id, event_type, event, timestamp) to the original signed signature_content and rejects altered or extra fields via SignatureVerifier().verify_event_signature(), while verify_event_signature() runs the canonical branch for such envelopes instead of the legacy payload path; OrderingService.stop() (hierachain/consensus/ordering/service.py) joins the processing thread without the 5-second timeout so in-flight work finishes before storage and the journal are closed — previously canonical secure events were re-verified only as legacy payloads, altered or extra fields escaped the binding checks, and shutdown could close storage under an active batch.
  • 2026-10-07

    • Ordering (Committed-event Latency Accounting): OrderingStorageHandler.save_block() (hierachain/consensus/ordering/storage.py) consumes processed_events timing entries only for event_ids in the persisted block, retaining timings for events still pending in another batch, and types trusted_public_keys as dict[str, bytes] with the same configured/file-backed fallback — previously cleared the whole timing map on every commit.
    • Storage (IPFS Availability Check): IPFSClient.is_available() (hierachain/api/storage/ipfs_client.py) probes /api/v0/files/stat with arg=/ipfs/<cid> instead of the removed /api/v0/object/stat?arg=<cid>, returning False on unsuccessful responses or connection failures — previously called the unsupported endpoint.
  • 2026-10-04

    • Parquet (Seal-on-error & No Silent Overwrite): write_parquet_log() (hierachain/core/parquet_log.py) seals the active segment when directory/file fsync or publish fails and unlinks the temp file, so a failed append can never be silently overwritten by a later one.
    • Journal & Monitoring (Rollback & Strict Types): failed journal writes roll back envelope mutations preserving integrity (hierachain/error_mitigation/journal.py); ErrorClassifier (hierachain/error_mitigation/error_classifier.py) and monitoring types (hierachain/monitoring/alert_system.py, hierachain/monitoring/performance_monitor.py, hierachain/monitoring/types.py) adopt strict JSON helpers with corrected alert payload types instead of lossy orjson coercions.
  • 2026-10-03

    • Ordering (Serialized Commits & Lockdown): share a single service._commit_lock RLock across OrderingBlockManager/OrderingMaintenance/OrderingProcessor (hierachain/consensus/ordering/block_manager.py, hierachain/consensus/ordering/maintenance.py, hierachain/consensus/ordering/processor.py, hierachain/consensus/ordering/service.py); in-flight commits retry via OrderingPausedError keeping the cut batch intact, LOCKDOWN/SHUTDOWN/ERROR are no longer clobbered by MAINTENANCE, collection pauses in LOCKDOWN, shutdown wakes capacity-blocked producers, and rejected events are removed from the pending map.
    • Hierarchy (In-place Registry Refresh): _apply_hierarchy_registry() refreshes orgs/channels in place preserving Channel object references and events_by_org counts while closing removed channels, and _mutate_registry() retries registry mutations 3x with rollback (hierachain/hierarchical/hierarchy_manager/base.py).
    • Channel (Serialized Registry Access): _registry_operation decorator (hierachain/hierarchical/channel/channel.py) serializes org add/remove, private-collection creation, event query, channel/org info, policy update, and suspend/resume under the shared registry RLock with live refresh.
    • API (Centralized Org Admin Check): register_organization_member (hierachain/api/business/organizations.py) reuses shared _is_organization_admin() (hierachain/hierarchical/hierarchy_manager/organization.py) replacing duplicated inline role/identity checks.
  • 2026-10-02

    • Hierarchical (Journal Load Cleanup): CrossChainTransactionManager.__init__ (hierachain/hierarchical/transaction_manager.py) closes the internally created journal when _load_journal() raises (caller-supplied journals are left to the caller) instead of leaking the handle.
    • Core (Sender Validation): validate_event_structure() (hierachain/core/utils.py) excludes the signed-envelope sender public-key field from business-content cryptocurrency-term scanning and validates sender separately, keeping envelope keys out of content checks.
    • API (Hierarchy Recovery Concurrency): get_hierarchy_manager() (hierachain/api/ledger/depds.py) uses non-blocking lock acquisition (503 "in progress" when another thread is recovering) with a 5-second monotonic retry backoff bounding recovery attempts during request storms instead of blocking concurrent requests.
  • 2026-10-01

    • ERP (Scheduler Deadlock): SyncScheduler.get_all_tasks (hierachain/integration/erp/scheduler.py) builds statuses via detached _task_status() snapshots under a single lock instead of calling get_status() per task, fixing a nested-lock deadlock when listing tasks.
  • 2026-09-28

    • Network (Production Env Check): SecureConnectionManager (hierachain/network/secure_connection.py) checks settings.env == "production" instead of the stale "product", restoring insecure-P2P warnings.
  • 2026-09-27

    • Storage (CID Resolution): resolve_cid_field() (hierachain/api/storage/endpoint_helpers.py) now re-raises CID resolution failures instead of silently returning the original unresolved data, preventing downstream consumers from operating on un-resolved payloads.
  • 2026-09-26

    • Journal (Framing & Replay): Added _JOURNAL_MAX_FRAME_SIZE/_JOURNAL_DATA_MARKER envelope preserving data versus extra fields, partial-write loops, torn-tail truncation repair on open, leading-magic PAR1 detection, and fail-hard replay raising ValueError on corrupt/truncated frames instead of skipping (hierachain/error_mitigation/journal.py).
    • Consensus (Ordering Fail-closed): OrderingBlockManager.commit_block/processor loop/executor (hierachain/consensus/ordering/block_manager.py, hierachain/consensus/ordering/processor.py) set MAINTENANCE and re-raise; recovery forces block creation (force=True) and raises RuntimeError on null/corrupt entries; _block_from_dict (hierachain/consensus/ordering/storage.py) verifies the Merkle root before the hash with strict data is None termination.
    • Hierarchical (Recovery Validation): SubChain init (hierachain/hierarchical/sub_chain/base.py) fails fast on wait_for_active() timeout with ordering shutdown and delegates genesis persistence to OrderingService; _process_and_finalize_single_block (hierachain/hierarchical/sub_chain/block.py) validates via is_valid_new_block; rehydration (hierachain/hierarchical/sub_chain/ordering.py) raises ValueError on integrity/queue conflicts and discards already-rehydrated queued blocks.
  • 2026-09-25

    • Journal (Error Mitigation): Made TransactionJournal.log_event() (hierachain/error_mitigation/journal.py) fail-closed for async writes by waiting on the per-event Future completed by the background writer instead of acknowledging on enqueue; the queue-full path still falls back to a synchronous write.
    • Consensus (Ordering Recovery): Set OrderingStatus.MAINTENANCE at the start of _initialize_service (hierachain/consensus/ordering/processor.py) so the service never exposes ACTIVE during replay, and made OrderingRecovery (hierachain/consensus/ordering/recovery.py) raise RuntimeError on journal error entries instead of silently skipping them.
  • 2026-09-24

    • Database (PostgreSQL Adapter): Hardened _execute_save_block (hierachain/adapters/database/postgres_adapter.py) to delete stale events rows for the overwritten (chain_name, index) before inserting, and to upsert blocks via ON CONFLICT (chain_name, "index") DO UPDATE instead of ON CONFLICT (hash) DO NOTHING, keeping block overwrites consistent with their events.
    • Consensus (Ordering Service & Storage): Made submit_event (hierachain/consensus/ordering/service.py) raise RuntimeError when journal.log_event() fails instead of silently queueing an unpersisted event, and made OrderingStorageHandler.save_block (hierachain/consensus/ordering/storage.py) raise on storage-adapter rejection with idempotent block_history/last_block updates (replace on same index, append only when advancing).
  • 2026-09-23

    • API (Admin Secure Event): Fixed add_secure_event (hierachain/api/admin/endpoints.py) to call request.model_dump(exclude_unset=True) so unset optional fields (nonce/timestamp/chain_id) are no longer forwarded as None when adding chain events.

v0.2.0 (2026-09-12)

Improvements (26)
  • 2026-09-05

    • Core (Block, Blockchain & Merkle Tree): Hardened Block caching and hash guard in hierachain/core/block.py (type-checked stored_hash, cached event list), added deterministic event_id generation (orjson+SHA-256 evt-{16}) and Merkle-root verification in _is_block_linked_correctly/Blockchain.add_event() now returning str (hierachain/core/blockchain.py), and fixed MerkleTree._build_tree odd-node handling to propagate unduplicated leaf instead of hashing duplicate (hierachain/core/merkle_tree.py).
    • Core (Logging & Error Handling): Narrowed broad except Exception to OSError/ArrowException/ValueError/TypeError in hierachain/core/parquet_log.py and hierachain/error_mitigation/journal.py, added typed pa.Table | None annotation, and added ImportError fallback for kubernetes client in hierachain/hierarchical/k8s_namespace_manager/operations.py.
    • Consensus (BFT & PoA/PoF & Ordering): Added strict isinstance(str) guards for signature/public_key/block_hash in hierachain/consensus/proof_of_federation._verify_block_quorum and removed insecure KeyPair fallback in hierachain/consensus/proof_of_authority.py; tightened BFT validation in hierachain/consensus/bft/helpers.py (strictness early-return and per-sequence digest/view quorum matching in _process_commit_quorum_logic); simplified hierachain/consensus/ordering/recovery.py type handling (int(block_index_raw), dict|None).
    • Consensus & Hierarchical (Types & Schema): Replaced TYPE_CHECKING forward references with runtime Any across hierachain/consensus/bft/dispatcher.py|engine.py|view_change.py and hierachain/hierarchical/main_chain/proofs.py|registry.py|rebalancer/split_ops.py|sub_chain/*.py; centralized EVENT_SCHEMA (pa.schema) in hierachain/core/block.py and reused it in hierachain/consensus/ordering/certifier.py, hierachain/error_mitigation/journal.py, hierachain/hierarchical/channel/ledger.py; enhanced BFTViewChangeManager to emit prepared_proofs.
    • Hierarchical (Hierarchy Manager & SubChain): Enhanced _shared_pool in hierachain/hierarchical/hierarchy_manager/base.py to support dynamic max_workers (spawns ephemeral pool when changed, else reuses global); replaced hash() with deterministic orjson+SHA-256 evt- ID in hierachain/hierarchical/sub_chain/base.py; removed unused legacy hierachain/hierarchical/sub_chain.py.
    • Hierarchical (Rollback & Rebalancer): Hardened hierachain/error_mitigation/rollback_manager.py with component-aware _capture_storage_state, path-traversal guard via os.path.realpath in _rollback_configuration, section-count logging and data_hash integrity check; cleaned hierachain/error_mitigation/validator_helpers.py and narrowed imports; simplified hierachain/hierarchical/rebalancer/split_ops.py imports.
    • API (Middleware, Server & WebSocket): Streamed payload limit via request.stream() with bytes_read accounting and request._receive replay in hierachain/api/middleware.py; enforced trusted-proxy check client_ip in TRUSTED_PROXIES for X-Forwarded-For and fixed rate-limit IP fallback; extracted CORS to _add_cors_middleware in hierachain/api/server.py and made uvloop mandatory; simplified PingLoopRunner init in hierachain/api/websocket/manager.py.
    • API (Ledger, GraphQL, Explorer & Business): Centralized default field handling in hierachain/api/storage/explorer_helpers.py; added assert guards in hierachain/api/ledger/depds.py and replaced recursive depth check with iterative stack (depth >10) in hierachain/api/ledger/schemas.py; adapted hierachain/api/graphql/resolvers.py|types.py for Blockchain.add_event()->str and is_cid_string logic; typed private_data_entry: dict[str,Any] in hierachain/api/business/private_data.py.
    • API (Admin Identity - Feature): Added optional nonce/timestamp/chain_id fields to SecureEventRequest (hierachain/api/admin/schemas.py), enforced chain_id mismatch (422) and 300s timestamp freshness, prefixed challenge with b"HRC_IDENTITY_CHALLENGE:" and restored require_chain_access dependency for /verify-identity (hierachain/api/admin/endpoints.py).
    • Security, Events, Database & Cleanup: Simplified _sanitize_html_context to re.sub(..., "[TEMPLATE_BLOCKED]") (hierachain/security/sanitization.py) and switched ZK mock verification to ZKVerifier(mode="mock").verify (hierachain/security/zk_prover.py); tightened BaseEvent.__eq__(other: object) (hierachain/domains/events/base_event.py); centralized DB schema init to init_database_schema in hierachain/adapters/database/postgres_schema.py|sqlite_schema.py and simplified adapters; removed 17 unused imports across api/storage, consensus/ordering, core/utils, error_mitigation/*, risk_management/*.
  • 2026-09-01

    • Database (PostgreSQL): Introduced PostgresAdapter (hierachain/adapters/database/postgres_adapter.py) extending SQLBase with psycopg/psycopg2 connection pooling (dictionary row access) and postgres_schema.py defining 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.py and hierachain/config/product_config_template.py — added BLOCK_CREATION_MODE/BLOCK_MAX_WAIT_SEC for block creation control, PARQUET_ROLL_INTERVAL (monthly/daily/by_size_mb), POSTGRES_SYNC_MODE (realtime/batch_worker/disabled), SQL_RETENTION_DAYS; made STORAGE_BACKEND auto-detect postgres from DATABASE_URL with sqlite fallback and unified DATABASE_URL/HRC_DATABASE_URL handling; streamlined product template backends to sqlite, 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) and hierachain/hierarchical/sub_chain/base.py — selects PostgresAdapter when db_url starts with postgres:///postgresql:// otherwise SQLiteAdapter; refactored SubChain DB path generation to always ensure data/{safe_name}/journal exists with path-traversal guard.
    • Database (Query & Indexes): Optimized hierachain/adapters/database/sqlite_schema.py (create_indexes now uses full CREATE INDEX statements) and refactored hierachain/adapters/database/base/sql_adapter.py to 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 via hash/block_hash instead of id/block_id.
  • 2026-08-31

    • SDK: Replaced assert statements with explicit RuntimeError checks in _get_session across hierachain/sdk/client.py and hierachain/sdk/async_client.py to prevent session validation from being skipped in optimized byte-code mode (-O).
    • Logging & Error Mitigation: Replaced bare except Exception: pass and continue blocks with explicit logger.debug() messages in hierachain/core/parquet_log.py, hierachain/error_mitigation/journal.py, and hierachain/risk_management/audit_logger.py for file closing, unlinking, rotation recovery, and batch replaying, improving error visibility while maintaining fail-safe execution.
  • 2026-08-29

    • Journal: Migrated TransactionJournal (hierachain/error_mitigation/journal.py) to Parquet storage (pyarrow.parquet) with 100MB file cap, auto rotation current_{ns}.parquet, bounded async queue (10k) and thread-safe ParquetWriter management, plus replay over multiple Parquet files with backward compat for .arrow/.log.
    • Audit: Added ArrowAuditStorage (hierachain/risk_management/audit_logger.py) as default backend, persisting AuditEvent via Parquet with Arrow schema, 100MB rotation, AuditFilter-aware retrieval, and compat for *.jsonl.
    • Logging: Unified all log/ persistence to Parquet via hierachain/core/parquet_log.py (write_parquet_log, ParquetLogHandler), migrating consensus_scaling, view_changes, error_classifications, restoration_events, scaling_events, network_alerts, resource_scaling, rollback_operations, quarantine_dump, risk_analyzer, mitigation_strategies to *.parquet and switching OrderingService to node_{id}_journal.parquet.
  • 2026-08-27

    • API: Adjusted authentication handling in hierachain/api/server.py (added Request annotation to auth_dependency, unified verifier initialization and extended EXEMPT_PATHS with /api/admin/verify-identity) and removed redundant require_chain_access dependencies in hierachain/api/admin/endpoints.py for /verify-identity and /status so health checks and identity verification work correctly when HRC_ENV=product.
  • 2026-08-24

    • API: Introduced hierachain/api/context.py for 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.py and 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 between DomainEvent base and concrete event definitions.
  • 2026-08-23

    • Network: Added timestamp drift validation (max_drift, default 300s) to verify_message in hierachain/network/message_cryptographic.py to ensure freshness of received P2P messages and reject replayed packets with stale timestamps.
    • API (Rate Limiter): Optimized in-memory RateLimiter in hierachain/api/middleware.py with 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 from X-Forwarded-For header for proxy deployments.
    • Core & Hierarchical: Enhanced finalize_block in Blockchain (hierachain/core/blockchain.py) and MainChain (hierachain/hierarchical/main_chain/base.py) to preserve pending_events when block creation or validation fails, preventing event data loss; added self.lock synchronization to MainChain block finalization methods.
  • 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): deleted group_events_by_entity, _is_block_valid, _extract_signature_from_block, _analyze_compliance_status, _calculate_performance_stats, _process_string_value, _process_bytes_value, _generate_recommendations, and create_multi_org_network for a leaner, more maintainable codebase.
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.
  • 2026-08-29

    • Security (Sanitization): Fixed _sanitize_html_context (hierachain/security/sanitization.py) to neutralize SSTI with [TEMPLATE_BLOCKED] instead of no-op html.escape, and tightened _sanitize_filename_context with allowlist ^[a-zA-Z0-9_\-~.]+$ and ../. filtering to prevent path traversal.
  • 2026-08-27

    • Security (Key Manager): Added PYTEST_CURRENT_TEST/pytest guard in initialize_default_keys (hierachain/security/key_manager.py) to prevent default API key creation in test environments when HRC_ENV=product and allow safe initialization under pytest.
    • Hierarchical (Rebalancer): Handle both callable and non-callable pending events in _get_pending_events (hierachain/hierarchical/rebalancer/split_ops.py) by checking callable() and falling back to the pending_events list.
    • 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_TEST checks in init_env_config (hierachain/config/env_manager.py) to prevent creating .env.HRC.example and loading the product .env while running pytest.
    • Cluster (Lockdown): Hardened verify_signature in hierachain/cluster/lockdown_types.py with empty str type checks and try/except around hmac.compare_digest to safely handle invalid signatures while maintaining backward compatibility with legacy 32-char truncated signatures.
  • 2026-08-24

    • Consensus (Ordering): Added empty batch check (if not self.current_batch: return False) to is_batch_ready in BlockBuilder (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 in MerkleTree._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-Length in add_payload_limit (hierachain/api/middleware.py).
  • 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 LockdownMessage HMAC-SHA256 signatures in hierachain/cluster/lockdown_types.py to use the full 64-character hex digest (256-bit) while maintaining backward compatibility with legacy 32-character truncated signatures in verify_signature.
  • 2026-08-14

    • Security (ZK Mock Proof): _generate_mock_proof in hierachain/security/zk_prover.py now accepts a sub_chain_name parameter and includes it in public_inputs, fixing the SHA-256 commitment being computed with sub_chain_name="" while the verifier hashed with the real sub-chain name (causing every proof to be rejected when ENABLE_ZK_PROOFS=true). _verify_mock_proof replaces the lax mock_proof prefix check with the standard _verify_mock logic from zk_verifier (commitment hash vs public_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 an IndexError on an empty SubChain and returning False as intended.

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_CONSENSUS env var with backward-compatible HRC_CONSENSUS_TYPE alias. MainChain.__init__ accepts optional consensus_type parameter. SubChain now defaults to PoA for intra-org domain events, configurable via config["consensus_type"].
  • 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.
  • 2026-07-22

    • API: Integrated uvloop dependency and enabled high-performance async event loop support in API server.
    • Blockchain: Introduced event_type_index on Blockchain and to_event_list on Block for O(1) event type lookups.
    • Cache: Replaced standard list with OrderedDict for 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 HierarchyManager to use a shared thread pool executor context, reducing thread creation overhead during proof sync.
    • State: Resolved race condition in WorldState root 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.
  • 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.
  • 2026-07-17

    • Performance: Replaced json with orjson across 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 data column parsing when available.
    • Security: Optimized signature verification with configurable thread pool (CPU count) and extracted _get_verify_key helper for public key decoding.
  • 2026-07-12

    • Network: Fixed seed node public key decoding with special handling for $$ delimiter characters.
  • 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 DatabaseAuditStorage for persistent audit logging.
    • Refactoring: Removed deadlock detector and related tests; removed sql_backend references; reorganized version management.
  • 2026-07-02

    • Storage Migration: Replaced SqlStorageBackend with SQLiteAdapter; deleted legacy storage module.
    • Database: Added chain state table for quick state lookups; added blockchain data storage and retrieval functions.
  • 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_list function from world state.
    • Event Ledger: Reconstructed event data structure and storage logic.
  • 2026-06-24

    • Dependencies: Added vulture for dead code detection.
  • 2026-06-23

    • Hierarchical: Modularized MainChain (proof + registry), SubChain (rehydration logic), Rebalancer (event extraction), HierarchyManager (cross-level sync init), K8s namespace manager; added compliance_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.
  • 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 None type annotations for optional parameters.
    • Schemas: Optimized payload depth validation to use stack traversal.
  • 2026-06-21

    • Performance: Replaced json with orjson across database layer for faster serialization.
    • Journal: Added asynchronous background writing for event logging.
    • Security: Optimized batch signature verification and proof serialization.
  • 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 HierarchyManager for 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 WorldState class for entity state management.
    • Error Mitigation: Removed deprecated rollback and recovery modules.
    • Integration: Removed ArrowClient and related types.
    • Network: Removed NetworkClientSync synchronous wrapper.
    • Database: Added RedisStorageAdapter for 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.
  • 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.py with modular Cache and CacheManager components.
    • 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.py module.
    • Error Mitigation: Added comprehensive error mitigation modules (consensus_validator, resource_validator, network_recovery, auto_scaler, backup_recovery).
  • 2026-06-15

    • API Restructuring: Split monolithic v1/endpoints.py into modular components; modularized v2/endpoints.py; fixed v3 import 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.
Breaking Changes (1)
  • API Routing & Data Schemas: Restructured API routes into domain-specific namespaces (/api/ledger, /api/business, /api/admin), updated payload key names from transaction_* to event / 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_MAP for consistent security event logging, replacing direct log level methods with logger.log(), reducing duplication across all logging call sites.
  • Core Blockchain Refactoring: Added _rebuild_event_indexes to 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 with block.to_event_list() for cleaner event filtering.
  • Consensus Hardening: Enhanced _contains_forbidden_terms with 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. ProofOfFederation auto-generates key pairs for validators, exposes public_key property, added block_hash to consensus metadata. _verify_block_quorum now accepts optional signer_id to 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_journal to count uncommitted events only, moving event reconstruction to OrderingRecovery.
  • Testing & Benchmark: Enhanced ZK Proof-of-Federation test with real keypair, real signatures, and pre-consensus block validation. Updated storage benchmark using Block class from hierachain.core, renamed event_type to event. Added helper function for ProofOfFederation instantiation with signing key.
Fix (1)
  • Logger Test Alignment: Updated test assertions to match new logger method signatures (mock_info → mock_log, call_args indexing 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 ipfshttpclient with httpx in hierachain/api/storage/ipfs_client.py, executing IPFS operations directly via Kubo HTTP RPC API. Added _parse_multiaddr helper for host/port extraction from multiaddress strings. Refactored core operations (upload, download, pin, unpin, list_pins, stats) to use httpx.Client POST requests. Removed _IPFSClientContext wrapper class.
  • Idempotent Sub-Chain Creation: API v1 (hierachain/api/v1/endpoints.py) checks for existing sub-chain before creation, returns 201 Created with "already_exists" audit trail for duplicates. Returns 409 Conflict when manager.add_sub_chain raises ValueError on duplicate.
  • Chain Integrity Hardening: Added _verify_chain_links() in hierachain/consensus/ordering/storage.py to validate previous_hash chain of blocks. _block_from_dict raises ValueError on computed hash mismatch instead of merely logging an error.
  • Event Enrichment & Block Persistence: Ordering service (hierachain/consensus/ordering/service.py) injects event_id into event_data payload before creating pending events. Recovery (recovery.py) prioritizes enriched event_data over 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_block queries for existing blocks by index/chain_name, deletes and replaces them instead of silently handling UNIQUE constraint violations.
  • Zero Children Safeguard: Rebalancer (hierachain/hierarchical/rebalancer.py) safely returns 0 when num_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 NodeIdentity in hierachain/security/identity_loader.py, ZeroMQ CURVE encryption in NetworkClient, send_direct/broadcast methods, ping-pong heartbeat. Propagated node identity through HierarchyManager, DomainChain, OrderingService, and BFT consensus.
  • API v3 & Cryptographic Signatures: New POST /api/v3/chains/{chain_name}/secure-events endpoint with Ed25519 signature verification, 1MB payload limit, and max depth 10. Added sender/signature fields 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, configurable block_interval via HRC_BLOCK_INTERVAL.
  • Security: Production ZK proof rejection (test environment bypass), HMAC constant-time comparison (hmac.compare_digest), threading.RLock in LockdownProtocol, PBKDF2 increased to 310,000 iterations, AdvancedCache with TTL/LRU for KeyManager.
Fix (2)
  • Consensus & Storage: Fixed block signature verification and auto key generation in PoA, corrected default return value in BFT handler from True to False, added 64-char SHA-256 proof_hash validation, chain integrity checks after deserialization, added creator_id/signature columns 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_standalone to prevent validation bypass.
  • JSON Canonicalization: Implemented robust get_canonical_bytes with recursive dict sorting, Unicode NFC normalization, and consistent float formatting for deterministic signature verification.
  • Security: Added PayloadLimitMiddleware rejecting POST/PUT/PATCH over 1MB, 24h proof timestamp consistency validation, default API key prevention in production (RuntimeError), refactored HMAC lockdown protocol (hmac.new SHA256).
Fix (1)
  • BFT & Validation: Limited BFT message log to 10,000 entries preventing unbounded memory growth, improved IPFS connection handling (_ensure_connected with proper None checks), fixed bare except clauses, enforced \b word-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 SecretManager in config for 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.
  • 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_event to 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.
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.
  • 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.
  • Developer Tools: Launched BlockchainExplorer dashboard 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.