Changelog
Unreleased
Breaking Changes (60)
-
2026-10-18
- API (Queued Secure Event Acknowledgement):
add_secure_event(hierachain/api/admin/endpoints.py) stampsevent/timestamp, retains the signed content inevent_data["signature_content"]before journaling, returnsSecureEventResponse(status="queued")with the ordering event ID inevent_hashand the acknowledgement time intimestamp, and mapsOrderingBackpressureErrorto HTTP 503 ({message, event_id, journaled}) plusValueErrorto 422;SecureEventResponse(hierachain/api/admin/schemas.py) now describesstatusasqueuedwith 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.
- API (Queued Secure Event Acknowledgement):
-
2026-10-15
- Packaging (Drop Python 3.10 Support):
requires-pythoninpyproject.tomlrises from>=3.10to>=3.11with the3.10classifier removed; Rufftarget-versionmoves topy311, Black dropspy310, Mypypython_versionmoves to3.11, the CI compatibility matrix in.github/workflows/test.ymlcovers3.11–3.14, anduv.lockis regenerated — environments still on Python 3.10 must upgrade to 3.11+ before installing this checkout.
- Packaging (Drop Python 3.10 Support):
-
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, andhierachain.core.cache.DEFAULT_CACHE_CONFIG. Direct imports/accesses must migrate to actual cache-instance or service configuration; these names had no runtime consumers.AdvancedCache,KeyManagercaches, and Ordering'sblock_cache_sizeretain 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) andresource_capacity_recommendation; update filters forauto_scaling_triggered,consensus_scaling, andresource_scaling_triggered. Remove the fictitiouskey_rotation_scheduledevent andnext_rotationdeadline. 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 foldprocess_batch()/process_single_event()intoOrderingProcessor;__init__takes a typedOrderingServiceand readsevent_pool/pending_events/metrics/certifier/block_builder/storage_handler/should_stop/configlive offserviceinstead of caching attribute copies, with-> Noneannotations on lifecycle methods. Direct imports ofOrderingExecutorand access toprocessor.event_pool/processor.should_stop/processor.executor(and sibling cached attributes) must migrate toprocessor.service.*orprocess_batch/process_single_eventon the processor; certification/batch/replay flow (process_replayed_event()withallow_stale_timestamp) is unchanged.
- Config & Core (Remove Unused Cache Metadata): Remove
-
2026-10-05
- Consensus & Config (PoA Interval Opt-in, No Implicit Delay):
ProofOfAuthority.__init__(hierachain/consensus/proof_of_authority.py) defaultsblock_intervalfrom10.0to0.0(None=0.0), rejects non-finite/negative values withValueError, and_check_block_timing()only enforces explicitly configured spacing while still rejecting decreasing timestamps;Settings.BLOCK_INTERVAL(hierachain/config/settings.py) changes theHRC_BLOCK_INTERVALdefault 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_persistcallback withbind_storage()requiringappend_channel_record/load_channel_records, appends typedevent/blockrecords guarded byexpected_sequenceplus registryrevision, addsrefresh()/_replay_record()with trusted-key block validation rolling back only newly applied records, and shares_validate_block()/_validate_pending_event()betweenrestore()and replay;Channel(hierachain/hierarchical/channel/channel.py) refreshes the ledger inside_registry_operation, records stats via_record_event_statistics()skipping events withoutsubmitter_org, and drops manual rollback inadd_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 newhierarchy_manager/recovery.pyand snapshot persist/restore/apply to newhierarchy_manager/registry.py, stops embedding channel-ledger snapshots in the registry state, persists channel ledgers atomically with the registryrevisionvia_channel_ledger_versionseeds written throughappend_channel_record/load_channel_records(bound ledgers restart at sequence1), 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
ChannelLedgerSQLStoragemixin pluscreate_channel_ledger_tables()(hierachain/adapters/database/channel_ledger_sql.py) givesSQLBase(SQLite/PostgreSQL)append_channel_record/load_channel_recordswith registry-revision and ledger-sequence guards (channel_ledger_heads/channel_ledger_recordstables created inpostgres_schema.py/sqlite_schema.py);save_hierarchy_registry()acceptschannel_ledgersand commits registry plus ledger seeding in one transaction (commit moved out of_execute_save_hierarchy_registry, Postgres placeholder/lock/BEGIN IMMEDIATEoverrides);RedisStorageAdapter(hierachain/adapters/database/redis_adapter.py) adds WATCH/MULTI ledger seeding/conditional append/suffix reads and fixesload_hierarchy_registrykey handling — previously had no channel-ledger storage and committed registry alone.
- Consensus & Config (PoA Interval Opt-in, No Implicit Delay):
-
2026-10-04
- Serialization (Strict stdlib JSON, No orjson): new
hierachain/serialization.py(dumps_json/loads_json/dumps_canonical_json) replacesorjsonacross ~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, andNaN/Infinityrejection;RedisEventManagerraisesRedisStorageErroron malformed/missing event records instead of returning[], and SQLite_execute_delete_chainnow deletesproofsrows alongsideevents/blocks/chains— previously serialized viaorjson, tolerated non-finite floats, silently skipped bad Redis records, and left proofs behind. - Core (Cache MutableMapping & Key Coercion):
AdvancedCache(hierachain/core/cache.py) now implementscollections.abc.MutableMapping[str, Any]instead of subclassingdict, dropskeys() -> list[str]in favor of__iter__, coerces every key viastr(key)inget/set/delete/contains/__getitem__, distinguishes storedNonefrom missing via a sentinel in__getitem__, and only evicts whenevict_key is not None— previously behaved as adictwith uncoerced keys, conflatedNonevalues with misses, and skipped falsy eviction keys. - Hierarchy (Durable Channel Ledger & Signed Registration Rebuild):
Channel.__init__(hierachain/hierarchical/channel/channel.py) acceptsnode_identity/trusted_public_keysand builds a signedChannelLedger(node_identity, trusted_public_keys, channel_id);ChannelLedger(hierachain/hierarchical/channel/ledger.py) addssnapshot()/restore()with full signature/sequence/channel_idvalidation,threading.RLock,_save()fail-closed persistence with rollback onadd_event/finalize_block,deepcopyisolation pluschannel_id/timestampstamping, andChannel.restore_statistics();HierarchyManager(hierachain/hierarchical/hierarchy_manager/base.py) lazily acquirestransaction_manager(raisingRuntimeErrorwhen closed), addsclose(), and rebuildsregistered_sub_chains/sub_chain_metadata/authorities from signedsub_chain_registrationMainChain 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) usesdumps_canonical_jsonwith new_request_digest_is_valid();BFTConsensus/BFTConsensusEngine(hierachain/consensus/bft/consensus.py,hierachain/consensus/bft/engine.py)deepcopyoperations/messages, block new proposals whilepending_apply_eventsis non-empty, reject duplicatePRE_PREPAREsequences, record the localPREPAREvote before broadcast viarecord_local_prepare_vote(), enforce in-order commit (seq == committed_sequence + 1, buffering futures, draining after recovery), and persist/apply via_build_consensus_eventwith retry;OrderingService(hierachain/consensus/ordering/service.py) adds stable ID generation for cross-tier checks — previously hashedstr(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) serializesregister_entity/operation handlers under lock, gates on_domain_projection_healthy, persistsinitial_data_json(canonical bytes) for restartrebuild_domain_state()withevent_id-then-content dedup anddomain_projection_errors, tracks custom vs default handlers, and isolates payloads viadeepcopy/snapshot cloning inCrossChainValidator(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) addsRLockplus_operationbatch context with active-operation tracking, andLockdownMessageGuard/lockdown_types.pybounds admission with replay tracking while signatures move to strict JSON helpers — previously mutated shared state without locks, lost initial data on rebuild, and signed viaorjson, invalidating old signatures. - API (Enforced Auth, Permissions & 501 Stubs): strict JSON helpers replace
orjsoninhierachain/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.pyadds async execution with permission checks and context auth,websocket/endpoints.pyenforces subscription auth,business/contracts.py/business/private_data.pyreturn HTTP 501 for unimplemented contract/private-data execution, ledger endpoints apply stricter query-parameter validation, anddepds.py/server.pyadd 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_filereplaced byload_node_config(ctx, config)(hierachain/cli/store.py,hierachain/cli/__init__.py) with YAML/JSON support,settings.CLI_CONFIG_FILEdefault changed fromchains.jsontodata/config.yaml, andcreate/list_chains/add_event/show_events/init_node(hierachain/cli/chain.py,hierachain/cli/event.py,hierachain/cli/node.py) apply stricter validation plus durableget_hierarchy_manager();Settings(hierachain/config/settings.py) removesMASTER_KEY_SOURCE/MASTER_KEY_FILE(HRC_MASTER_KEY_SOURCE/HRC_MASTER_KEY_FILEnow raiseValueError), loads dotenv viaHRC_ENV_FILEat 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 dropsmaster_keyfrom diagnostics — previously accepted legacy chain files, defaulted tochains.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 POSIXfcntlwrite exclusivity, serializes via strict helpers, extends the journal envelope withfields/details, and rolls back failed writes;DataValidator(hierachain/error_mitigation/data_validator.py) tightens schema compatibility;SecureConnectionManager(hierachain/network/secure_connection.py) addstimestamp/noncereplay 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) addsAuditReadResult/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, validatesconfig/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.
- Serialization (Strict stdlib JSON, No orjson): new
-
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 requirestate["_revision"]to be a newstrdistinct fromexpected_revision(SQL conditional INSERT/UPDATE on the stored_revision, Redis WATCH/MULTI compare, Postgres%sdialect 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 auuid4_revisionand rejects stale saves viaexpected_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 aregistereddict instead of the manager, andregister_organization_member(..., actor_user_id)raisesPermissionErrorvia 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_operationRLock with live_refresh_registry()before each call (org add/remove, private-collection creation, event query/info, policy update, suspend/resume), andsubmit_event()returnsFalsewhenstatus != ACTIVEbefore role resolution — previously served stale membership and accepted events on non-active channels. - Ordering (Backpressure, Timeout & Gap Detection):
OrderingService(hierachain/consensus/ordering/service.py) validatesenqueue_timeout(0 < timeout <= 60, default1.0) raisingValueErrorotherwise, reserves queue capacity before the journal write via_enqueue_event()raisingOrderingBackpressureError(event_id, journaled)(hierachain/consensus/ordering/types.py) when full/inactive, andOrderingStorageHandler._load_from_db()(hierachain/consensus/ordering/storage.py) loads viaget_blocks_from_index()raisingValueErroron 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) mapsOrderingBackpressureErrorto 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 managerPermissionErrorto 403 while forwardingactor_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_eventsmemoization and__slots__entry (plus_block_from_dictcleanup inhierachain/consensus/ordering/storage.py) — previously returned a shared mutable cached list that could drift from underlying events.
- Database (Registry Revision Guard):
-
2026-10-01
- Error Mitigation (Retained Keys & Strict Validators):
EncryptionValidator(hierachain/error_mitigation/encryption_validator.py) now resolves a caller-managed 32-byte key bykey_idviakey_resolver(no ephemeralos.urandomfallback) with AAD-bound AES-256-GCM (algorithm/key_id/timestamp), addsdecrypt_data()with bytes/tag-IV length/algorithm/finite-timestamp checks, and masks failures behind genericSecurityError;_run_single_custom_validator(hierachain/error_mitigation/data_validator.py) enforces(bool, str)return and promotes validator failures/exceptions from warning toadd_errorwith field name — previously passing validations now fail. - ERP (Fail-closed Transformers):
EventTranslator(hierachain/integration/erp/mapping.py) shares the caller'sMappingEngine(hierachain/integration/erp/base.py) so registered transformers apply consistently, and unknowntransformernames raiseMappingErrorinstead of silently returning the input value. - Cluster (Quarantine Signature Payload):
QuarantineReport.compute_signature(hierachain/cluster/lockdown_types.py) signs the fullorjsonsorted-keys payload instead ofnode_id:timestamp:last_block_index,from_dict()validatesmsg_type/lockdown_typeand rejects non-finite timestamps before signing, andverify_signature()returnsFalseon 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) parseSecretStringas a JSON object viaorjsonand return the validated string field named bykey, requiringHRC_AWS_SECRET_NAMEas theSecretIdinstead of falling back tokey— non-JSON secrets, non-string fields, and missing secret names now returnNone.
- Error Mitigation (Retained Keys & Strict Validators):
-
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 equalresource_{allocation_type}, membership checks forassigned/reserved/released/transferredincludingtarget_entity_idexistence);ResourceAllocationEvent.is_valid(hierachain/domains/events/custom_events.py) requires non-emptytarget_entity_iddistinct fromentity_idfortransferred— previously accepted events now returnFalse. - Validator (Strict Proof Fields):
ProofValidator._validate_single_proof(hierachain/domains/utils/cross_chain_validator.py) requiressub_chain_name/proof_hashto be non-emptystrandtimestampto be a positive non-boolint/float, recordingmissing_proof_fieldswith aninconsistent_proofsincrement instead of silently skipping field-less proofs.
- Domain (Strict Resource Allocation):
-
2026-09-29
- Core & Hierarchical (Strict Event Validation):
Blockchain.add_event(hierachain/core/blockchain.py) andSubChain.add_event(hierachain/hierarchical/sub_chain/base.py) now enforcevalidate_event_structure()(plusdicttype check inSubChain) and raiseValueErroron invalid structure; ledgeradd_event(hierachain/api/ledger/events.py) maps it to HTTP 422 instead of accepting malformed events. - API (Fail-closed Redis Rate Limiting):
RedisRateLimitermoved to (hierachain/adapters/database/redis_rate_limiter.py) withcheck()/RateLimiterBackendError;add_rate_limit(hierachain/api/middleware.py) runs Redis checks viaasyncio.to_threadand returns 503 when the backend is unavailable instead of the previous fail-open allow, and reuses the checkedremainingquota for headers. - API (GraphQL Bounded Limits): resolvers (
hierachain/api/graphql/resolvers.py) cap results via_bounded_limit()/MAX_QUERY_RESULTS=100withlimit=Nonemeaning 100, clampedfrom_index/to_index/start+limitslicing, and early exit onlimit=0— larger requested limits now return at most 100 items. - Network (Strict Replay & Nonce Checks):
_is_valid_replay(hierachain/network/zmq_transport.py) requiresnonceto bestrwith1..128chars, finite numeric timestamp withinreplay_tolerance, and rejects when the1000-entry replay buffer stays full after expiry pruning instead of silently evicting.
- Core & Hierarchical (Strict Event Validation):
-
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 viarequire_block_identity()and verify againsttrusted_public_keyswith_sign_block()/sign_block();BlockVerifier(hierachain/security/verify/block_verifier.py) requiresstrict_mode=Trueand unconditionally rejects unsigned/malformed signatures, verifying only against caller-supplied trusted keys;load_trusted_block_keys()/require_block_identity()(hierachain/security/identity_loader.py) requireHRC_BLOCK_TRUSTED_KEYS_FILE(newSettings.BLOCK_TRUSTED_KEYS_FILE) with an Ed25519 hex map and node-key alignment;initialize_default_keys()(hierachain/security/key_manager.py) now blocks defaults wheneverSettings().env == "production". - Consensus & Ordering (Signed Blocks, Quorum & ZK):
creator_idadded to block construction with finalization-position checks inverify_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 checkingconsensus_finalizationstructure/order/hash;BlockManagersigns on creation and storage rejects unsigned/untrusted blocks withreconcile_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);SubChainproof 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):
AuditEventgainsaffected_entitieswith SQLite migration, JSON optional-field handling, andcalculate_hash()over the full sorted dict (hierachain/risk_management/types.py,hierachain/risk_management/audit_logger.py) — stored digests change; newPostgresAuditManifest(hierachain/adapters/database/audit_manifest.py) withverify_integrity()and stricter persistence validation. - Config (Strict Env & Backend):
Settings.env(hierachain/config/settings.py) raisesValueErroron unknownHRC_ENV/ENVvalues (onlyproduction/prod/product,dev,testaliases),STORAGE_BACKENDallowlistsmemory/redis/sqlite/postgres/postgresqlvia_configured_database_url()(DATABASE_URL/HRC_DATABASE_URL), addsBLOCK_TRUSTED_KEYS_FILE, andProductionSettings.AUTH_ENABLEDis unconditionallyTruewithHRC_AUTH_ENABLED=trueenforced;get_settings()routes only on normalizedproduction/test. - API/CLI/Business (Prod Auth & HierarchyManager): server lifespan requires
require_block_identity()plus explicitDATABASE_URL/HRC_DATABASE_URLfor production Postgres, mandatesHRC_API_KEYS_FILEvia_load_production_key_manager()(≥32-char keys,permissions, active key), replacesENVwithenv, and tightens CORS/logging toproduction(hierachain/api/server.py,hierachain/api/graphql_handler.py); business channels/organizations move off in-memory_channels/_organizationstoHierarchyManagerwith 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 toHierarchyManager(hierachain/api/ledger/proofs.py); CLIsubmit_proofrejects registry submissions (durable authenticated API required) andverifyenforces trusted-key chain validation (hierachain/cli/chain.py,hierachain/cli/verify.py).
- Core & Security (Mandatory Trusted Block Signatures):
-
2026-09-27
- Storage (IPFS Encryption Key):
create_ipfs_client_from_env()(hierachain/api/storage/ipfs_client.py) now requiresHRC_IPFS_ENCRYPTION_KEYto be exactly 64 hexadecimal characters (32 bytes) and raisesIPFSErrorotherwise — 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.
- Storage (IPFS Encryption Key):
-
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 withos.fsync. - Core (Merkle Payload): Unified event payload serialization into
serialize_event_payload()(hierachain/core/merkle_tree.py) reused byhierachain/core/block.py; Merkle leaves now include thedatafield (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 returningNone;PostgresAdapter._execute_save_block(hierachain/adapters/database/postgres_adapter.py) persists the full event envelope (orjson.dumps(event)) withsubmitted_by/sender_idfallback, 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 raisesRuntimeErrorinstead;__init__/add_sub_chainnow persist metadata and restore vialist_chains(), raising on failure.
- Config (Journal Sync): Removed
-
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.
- Core (Parquet Logs):
-
2026-09-22
- Error Mitigation (Validators): Removed
APIValidator(including the"api"entry of thecreate_validatorfactory and forbidden-term Arrow/legacy validation) fromhierachain/error_mitigation/validator.pyand package exports (hierachain/error_mitigation/__init__.py); corrected theConsensusValidatorimport path tohierachain/error_mitigation/consensus_validator.pyinhierachain/consensus/bft/helpers.py. - Monitoring: Removed the
alert_managerglobal singleton instance and export fromhierachain/monitoring/__init__.py(theAlertManager/PerformanceMonitorclasses remain available). - Config (Storage Backend): Changed the default storage backend from
sqlitetopostgresinhierachain/config/settings.py(DEFAULT_STORAGE_BACKEND, defaultDATABASE_URLnowpostgresql://hiera:hiera@localhost:5432/hierachain,HRC_DATABASE_URLsupport with explicitsqlite://handling) andhierachain/config/product_config_template.py(HRC_STORAGE_BACKEND=postgreswith per-nodeDATABASE_URL/HRC_DATABASE_URL);ProductionSettings.DEFAULT_STORAGE_BACKENDswitched fromredistopostgres.
- Error Mitigation (Validators): Removed
-
2026-09-21
- Monitoring: Removed
PrometheusMetricsand singletonmetricsfromhierachain/monitoring/metrics.py(file deleted), removing Prometheus metrics collection utilities. - Risk Management: Removed
RotatingAuditStoragefromhierachain/risk_management/audit_logger.pyand package exports (hierachain/risk_management/__init__.py).
- Monitoring: Removed
-
2026-09-20
- Core (Cache): Removed
BlockchainCacheManager,CacheInvalidator,EntityEventFetcher, andCachePerformanceTrackerfromhierachain/core/cache_manager.py(file deleted). - Error Mitigation (Recovery & Rollback): Removed
RollbackManagerand associated types (RollbackType,RollbackStatus,StateSnapshot,RollbackOperation), recovery engines (NetworkRecoveryEngine,ConsensusRecoveryEngine,BackupRecoveryEngine,AutoScaler), andRecoveryErrorfromhierachain/error_mitigation/. - Risk Management: Removed
RiskAnalyzer,MitigationManager,MitigationStrategies, and related risk/mitigation types (RiskAssessment,RiskSeverity,RiskCategory,MitigationAction,MitigationResult,MitigationStatus) fromhierachain/risk_management/, keeping only audit logging primitives. - Monitoring: Removed
PerformanceMetrics,MetricType, andPerformanceSnapshotfromhierachain/monitoring/performance_metrics.py(file deleted). - Cluster: Removed
ClusterManager,ClusterLockdownManager,ClusterState, and quorum-based lockdown coordination fromhierachain/cluster/(cluster_manager.pyandlockdown_protocol.pydeleted).
- Core (Cache): Removed
-
2026-09-19
- Hierarchical & Config: Removed deprecated packages
k8s_namespace_manager,proof_aggregation, andrebalancerfromhierachain/hierarchical/(K8sNamespaceManager,ProofAggregator,SubChainRebalancer) along with related configuration settings (K8S_*,PROOF_*,REBALANCE_*) inhierachain/config/settings.py.
- Hierarchical & Config: Removed deprecated packages
-
2026-09-18
- Cluster: Removed
StateSyncManager(hierachain/cluster/state_sync_manager.py) and associated exports fromhierachain/cluster/__init__.py.
- Cluster: Removed
Improvements (59)
-
2026-10-24
- Hierarchy (Persistent Organization-to-SubChain Grants):
HierarchyManager(hierachain/hierarchical/hierarchy_manager/base.py) replaces the no-opassign_organization_to_chain()with a persistedchain_accessmap keyed by chain then organization, written through_mutate_registry()with a default ofread/writewhenpermissionsis omitted andValueErrorfor empty, non-list, or unknown permissions, and addsrevoke_organization_from_chain(),get_chain_access()(deep-copied grants,Nonefor an unmanaged chain), andcan_access_chain()which matches the caller's organization membership, stored identity, and role againstread/write/proofswhile letting unmanaged chains pass; the hierarchy registry (hierachain/hierarchical/hierarchy_manager/registry.py) persistschain_accessunder 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 returnedFalseand granted nothing. - API (Per-Chain Access Enforcement & Grant Management): new
require_chain_read/require_chain_write/require_chain_proofdependencies (hierachain/api/ledger/access.py) combine the existing API-key resource checks withcan_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_chainsand cross-chain entity traces (hierachain/api/ledger/chains.py,hierachain/api/ledger/entities.py) omit unreadable SubChains; GraphQL resolvers (hierachain/api/graphql/resolvers.py) raisePermissionErrorfor block, event, status, and add-event access and filterallChains; newGET/PUT/DELETE /api/ledger/chains/{chain_name}/organizations(hierachain/api/ledger/chain_access.py) list, replace, and revoke organization grants behindchains: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 code1008, re-check grants on resubscribe and before every send (including wildcard and event-type streams), and scopeget_statsto readable chains — previously any API key holding a resource scope could read, write, or stream every SubChain. Grants remain independent (writedoes not implyread) and chains without assignments keep the previous coarse-scope behavior.
- Hierarchy (Persistent Organization-to-SubChain Grants):
-
2026-10-22
- Dependencies (PyArrow & aiohttp Floors):
pyproject.tomlraisespyarrowfrom>=24.0.0to>=25.0.0andaiohttpfrom>=3.14.3to>=3.14.5, withuv.lockregenerated — installs pinned below these floors must upgrade, and the compute-API fixes below follow the PyArrow 25 surface.
- Dependencies (PyArrow & aiohttp Floors):
-
2026-10-15
- Database & Ordering (Durable Redis Ledger Backend): new
RedisLedgerAdapter(hierachain/adapters/database/redis_ledger.py, exported fromhierachain/adapters/database/__init__.py) extendsRedisStorageAdapterwith an append-only signed-block ledger keyed by SHA-256chain_name, atomic WATCH/MULTIsave_block()withcreator_id/signature/merkle_rootvalidation, index-sequence plusprevious_hashlink plus no-expire guards with idempotent same-position retry, strict sequence-checkedget_blocks_from_index()/get_block_by_index()/get_latest_block()/list_block_chain_names()raisingRedisStorageErroron empty/corrupt/incomplete history, ledger-scanget_entity_events()/get_events_by_type()/get_event_by_id()(orderedstatus) andget_chain_statistics(), durability-gatedstore_chain()/save_hierarchy_registry()/append_channel_record()/store_proof()viarequire_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 incleanup_old_data();OrderingStorageHandler(hierachain/consensus/ordering/storage.py) selects it whenstorage_backend == "redis"(preserving PostgreSQL/SQLite selection),HierarchyManager._create_storage()(hierachain/hierarchical/hierarchy_manager/base.py) returns it for theredisbackend instead of raising, andSubChain(hierachain/hierarchical/sub_chain/base.py) forwardsstorage_backendinto the ordering config — previously theredisbackend raisedRuntimeErrorin the hierarchy manager and ordering ignored the Redis selection.
- Database & Ordering (Durable Redis Ledger Backend): new
-
2026-10-07
- Core (Sequence Merkle Input):
MerkleTree.__init__(hierachain/core/merkle_tree.py) widensdata_listfromlist[str | dict]tocollections.abc.Sequence[str | dict]and annotates-> None, accepting tuples and other read-only sequences without copying — previously required a concretelist.
- Core (Sequence Merkle Input):
-
2026-10-06
- Monitoring (Lazy Submodule Loading):
hierachain/monitoring/__init__.pydefersalert_system/performance_monitorimports behind a PEP 562__getattr__so each module loads only whenAlertManager/PerformanceMonitoris first requested;__all__and public names are unchanged.AlertManagerdefault-rule/notifier setup becomes methods with rule matching folded intocheck_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-onlyresource_capacity_recommendationemission (auto_scaleopt-in, disk excluded), dropping the unusedcastimport — previously three duplicated private helpers.
- Monitoring (Lazy Submodule Loading):
-
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 oncelimitis hit, and falls back to plain lists for external chains;Blockchain(hierachain/core/blockchain.py) recordsevent_indexin_index_block_eventssharing one cached entry betweenentity_event_indexand the new_event_query_type_index, addsget_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 toBlockchain.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 newafterargument (hierachain/api/graphql/schema.py) plus per-eventcursorfield (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 withValueError;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_stateupdated after every successfulfsyncin append/rollback/flush, skips redundantfsyncinread_since()when state is unchanged, and fail-closes (ValueError) when the active file was replaced ((st_dev, st_ino)mismatch) — previouslyfsynced unconditionally on every tail read without replacement detection.
- Core (Bounded Event Paging): new
-
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_tableto temp file, filefsync, atomicos.replace, directoryfsyncvia_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 serializesdataviadumps_json;read_parquet_log()takes a consistent snapshot under lock; removedatexitfinalizer and persistentParquetWriterstate. - Hierarchy (Lazy Coordinator & Graceful Close):
HierarchyManager(hierachain/hierarchical/hierarchy_manager/base.py) defersCrossChainTransactionManagercreation until first use (skipping the 2PC writer for registry/channel-only workers while still recovering existing decisions under the journal lease), scopes bootstrap/restore inExitStack, and addsclose()releasing storage, coordinator journal, and sub-chain orderers without opening new resources;SubChainproof 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) extractsrecord_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) exposesdomain_projection_healthy/domain_projection_errorsplusrebuild_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) serializessync_to_mainchain/sync_from_mainchain/resolve_sync_conflictin_operationbatches with active-operation tracking and aggregated status; newLockdownMessageGuardbounds 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.pycentralize strict JSON error envelopes and hierarchy-manager shutdown;api/middleware.pyaligns payload-limit handling with the new serializers. - Security (Brute-force Failure Tracking & Lean MSP):
SQLite/Redisauth stores (hierachain/adapters/database/auth_state.py) add an indexedauth_failurestable, windowedget_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 andchange_detectedlogic;MappingEngine/ChangeDetector(hierachain/integration/erp/base.py,hierachain/integration/erp/change_detector.py,hierachain/integration/erp/mapping.py,hierachain/integration/enterprise.py) validateconfig/key_fields/detect_changesincluding deeply nested keys;WorldState(hierachain/state/world_state.py) clarifies Merkle-root usage and projection-rebuild requirements.
- Parquet (Snapshot Publish & Directory fsync):
-
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) andCrossChainTransactionManager._read_latest_records()(hierachain/hierarchical/transaction_manager.py) consume only new frames viaread_since()with_transaction_journal_cursor/_journal_cursorplus_durable_recordscache under lock, falling back to fullreplay()when the cursor API is missing. - Sub-chain (Bootstrap Retention & Index Reuse):
SubChain(hierachain/hierarchical/sub_chain/base.py) constructs ordering withretain_bootstrap=True;_rehydrate_chain_from_ordering_service()/_apply_rehydrated_blocks()(hierachain/hierarchical/sub_chain/ordering.py) prefer one-shottake_bootstrap_blocks()thenget_blocks_from_db(start_index=0)and rebuild indexes viaBlockchain._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%splaceholder inhierachain/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 fromget_event_by_idnow includechain_name. - Ordering (Bootstrap Snapshot & Bounded Certification):
OrderingService.take_bootstrap_blocks()(hierachain/consensus/ordering/service.py, appended inhierachain/consensus/ordering/block_manager.py) transfers the verified startup snapshot once whenretain_bootstrap=True;EventCertifier(max_history=10000)(hierachain/consensus/ordering/certifier.py) LRU-boundscertified_eventswith lock-protected access;get_event_statusshort-circuits durableorderedviaget_event_by_id. - Core (Eager TTL Cache Cleanup):
AdvancedCache(hierachain/core/cache.py) drops the per-instance daemon TTL cleanup thread/_cleanup_stop, running eagercleanup_ttl()under a single lock onseteviction plusget_stats()/get_keys()/__len__().
- Journal (Cursor-based Tail Reads): new
-
2026-10-02
- Consensus (Ordering Finalizer & Startup Integrity):
OrderingService(hierachain/consensus/ordering/service.py) accepts an optionalblock_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()acceptstimeout=Nonefor indefinite recovery waits with monotonic deadlines plusshould_stop/thread-liveness checks;OrderingBlockManager.commit_block(hierachain/consensus/ordering/block_manager.py) aborts when the service is stopping, assignscreator_idunder 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_idpreserved across finalization,validate_blockrejection raised asValueError);SubChainuses athreading.RLockfor block processing, waits indefinitely for ordering recovery (wait_for_active(timeout=None)so journal backlogs finish instead of restarting), drains shutdown viafinalize_sub_chain_block(), and passes the finalizer intoOrderingService. - 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 inMAINTENANCEwith a stop signal whenadd_blockfails;_finalize_sub_chain_block_for_chain()serializes dequeue plus apply underblock_processing_lockto preserve FIFO order;_reset_ordering_service_state()was removed (hierachain/hierarchical/sub_chain/ordering.py) with rehydration relying on chain sync instead of rewritingblock_history/blocks_created. - Hierarchical (Recovery Resource Management):
HierarchyManager.__init__/_restore_sub_chains()(hierachain/hierarchical/hierarchy_manager/base.py) scope bootstrap and sub-chain restoration inExitStack(journal/storage/per-chainshutdowncallbacks,pop_all()only on success) replacing manual try/except cleanup.
- Consensus (Ordering Finalizer & Startup Integrity):
-
2026-09-30
- Database (Chain Name Listing): new
SQLBase.list_block_chain_names()(hierachain/adapters/database/base/sql_adapter.py) returning orderedDISTINCT chain_namefromblockswith fail-hard error propagation for CLI verification. - State (Immutable Snapshots):
WorldState.get_entity_state()/get_all_states()(hierachain/state/world_state.py) now returndeepcopysnapshots (plusdeepcopyoflast_detailson updates) so callers cannot mutate internal state. - Audit (Sealed Reads & Retention):
ArrowAuditStorage(hierachain/risk_management/audit_logger.py) centralizes_seal_active_file(), fixeslimit=0/Nonehandling inretrieve_events, counts via Parquet metadata/bounded4096-row batches inget_event_count(), and addscleanup_old_events()deleting only fully-expired Parquet archives;DatabaseAuditStorage._filter_sql()unifiesevent_type/severity/source_component/user_id/time_rangepredicates for retrieval and count. - CLI (Key Files & Multi-backend Verify):
hierachain/cli/key.pywrites new keys withO_EXCL0600, reads JSON or two-line hex via_read_key_file(), and fully masks the private key onshow;hierachain/cli/verify.pyadds_open_backend()forpostgres/postgresql/sqliteURLs plus path backends overSQLBase, tracksevents_unsignedseparately (unsigned allowed, incomplete signatures invalid,sender_public_keyfallback,to_event_list()), and fails the audit on invalid events as well as blocks. - Domain (Resource Lifecycle):
BaseChain(hierachain/domains/chains/base_chain.py) handlesresource_released/resource_reserved/resource_transferredwithallocated_resources/reserved_resourceslifecycle (reserve, release from either list, move onreserved→assigned, transfer between entities), registers entities only afteradd_eventsucceeds, and returnsFalseon handler errors instead of swallowing them.
- Database (Chain Name Listing): new
-
2026-09-29
- Database (Shared Auth State Stores): new
SQLiteRevocationStore/SQLiteLockoutStore(file-shared,0600, digest-hashed keys) andRedisRevocationStore/RedisLockoutStoreplusRedisRateLimiter(hierachain/adapters/database/auth_state.py,hierachain/adapters/database/redis_rate_limiter.py);hierachain/adapters/database/__init__.pyswitched to lazy__getattr__imports. - Config (Auth State Backends): new
HRC_AUTH_STATE_REDIS_URL(Settings.AUTH_STATE_REDIS_URL) andHRC_API_KEY_REVOCATIONS_DB(Settings.API_KEY_REVOCATIONS_DB), withget_auth_config()selectingredis/sqlite/filelockout backend (hierachain/config/settings.py). - Security & API (Shared Revocation & Async Checks):
KeyManageracceptsrevocation_storeand checks it inis_revoked()(hierachain/security/key_manager.py);BruteForceProtectordelegates to shared SQLite/Redis lockout stores (hierachain/security/brute_force_protector.py);APIKeyVerifieroffloads brute-force/revocation/is_validchecks viaasyncio.to_threadand checks revocation before validity (hierachain/security/verify/api_key_verifier.py); production server wiresRedisRevocationStore/SQLiteRevocationStoreintoKeyManager(hierachain/api/server.py). - Hierarchical & Core (Metadata Sanitation):
MainChain.register_sub_chainsanitizes once viasanitize_metadata_for_main_chain()for both registry and authority metadata (hierachain/hierarchical/main_chain/base.py);sanitize_metadata_for_main_chaingains recursive_sanitize_summary_value()(nested dict/list pruning,>5-key dict />10-item list omitted) and new omitted fieldsinternal_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-flightHALF_OPENprobe (acquire_request()/release_probe(), probe-awarerecord_success()/record_failure()); sync/async clients handleHEAD/GET/OPTIONSandHTTPStatus.NO_CONTENTempty bodies with retryable vs non-retryable error split (hierachain/sdk/client.py,hierachain/sdk/async_client.py). - Network (Peer Management & Health):
NetworkClienttrackspublic_key/_last_activity,PEER_TIMEOUT=60.0with_refresh_peer_health(), preserves keys on re-register, and addsunregister_peer()with socket cleanup;ZmqNode.register_peer()resets changed sockets andunregister_peer()discards pending messages (hierachain/network/network_client.py,hierachain/network/zmq_transport.py).
- Database (Shared Auth State Stores): new
-
2026-09-28
- Database (Hierarchy Registry & Audit Manifest): save/load hierarchy registry across PostgreSQL/SQLite/Redis adapters, new
PostgresAuditManifestfor audit digests, streamlined event filtering/metadata handling, SQLitesynchronous=FULLdurability, 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_transactionstracking 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}/eventswith 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).
- Database (Hierarchy Registry & Audit Manifest): save/load hierarchy registry across PostgreSQL/SQLite/Redis adapters, new
-
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 viaasyncio.to_threadto avoid stalling the event loop;IPFSClientupload (hierachain/api/storage/ipfs_client.py) passes auto-pin as anaddquery parameter instead of a follow-uppin()call.
- Storage (IPFS Async & Auto-pin):
-
2026-09-26
- API (Readiness): Added
GET /api/ledger/ready(hierachain/api/ledger/health.py) reportingreadyonly when every sub-chain ordering service isACTIVE(503 otherwise); exempted inhierachain/api/server.py; thread-safe lazyget_hierarchy_manager()returning 503 while recovery is not ready (hierachain/api/ledger/depds.py); sub-chain creation forwardsmanager.node_identity(hierachain/api/ledger/chains.py). - Consensus (Ordering Genesis & Replay):
OrderingServiceaccepts an optionalgenesis_block(hierachain/consensus/ordering/service.py) persisted when the database is empty;EventCertifier.validate()/OrderingExecutor.process_single_event()acceptallow_stale_timestampwith strict finite numeric timestamp checks (hierachain/consensus/ordering/certifier.py,hierachain/consensus/ordering/processor.py); replayed journal events flow throughprocess_replayed_event()(hierachain/consensus/ordering/recovery.py,hierachain/consensus/ordering/processor.py). - Database (Chain Listing & SQLite Memory): Added
list_chains()acrossSQLBase/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_rowreturns the enriched envelope directly when columns match;RedisChainManager.store_chainomitsNonedomain_type.
- API (Readiness): Added
-
2026-09-24
- API (Server Auth): Widened
auth_dependency(hierachain/api/server.py) fromRequesttoHTTPConnectionwith averifier is Noneguard, and exposed the verifier asfast_app.state.auth_verifierfor 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 centralizedKeyManager.get_permissions()(hierachain/security/key_manager.py) with the verified auth context now carrying top-levelpermissions(ResourcePermissionCheckerfalls back toapp_details);_get_active_verifier(connection)resolves the verifier from application state.
- API (Server Auth): Widened
-
2026-09-23
- Database (PostgreSQL Adapter): Batched event inserts in
_execute_save_block(hierachain/adapters/database/postgres_adapter.py) via a singlecursor.executemany()over collectedevent_rowsinstead of per-eventcursor.execute(), reducing round-trips when persisting multi-event blocks. - Consensus (Ordering Service): Simplified
OrderingServicestartup (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__andstart().
- Database (PostgreSQL Adapter): Batched event inserts in
-
2026-09-22
- Journal (Error Mitigation & Ordering): Migrated
TransactionJournal(hierachain/error_mitigation/journal.py) fromParquetWriterto append-only Arrow IPC framing (length-prefixedRecordBatchstreams via_serialize_arrow_batch,os.fsyncdurability, multi-row batch replay with legacy stream fallback); renamed the default active logcurrent.parquettocurrent.arrow(rotation files*_*.parquetto*_*.arrow, likewisenode_{id}_journal.parquetto.arrowforOrderingServiceinhierachain/consensus/ordering/service.py) while preserving replay of legacy Parquet files (active legacy file auto-renamed to*_legacy_*.parquetvia the_is_parquet_fileguard). - Hierarchical (SubChain Proof & Events): Streamlined
SubChain.add_event()(hierachain/hierarchical/sub_chain/base.py) to return the authoritativeevent_idfromordering_service.receive_event()instead of a syntheticorjson+SHA-256 digest (dropping thehashlib/orjsonimports); switchedshould_submit_proof()to block-index tracking via the newlast_proof_block_index(updated inhierachain/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 aterrorlevel and returnFalsewithout appending the block in memory. - Database (PostgreSQL Adapter): Hardened
PostgresAdapter(hierachain/adapters/database/postgres_adapter.py) withconnect_timeout: 3on pool initialization, dynamicorjsonparsing of raw eventdatain_execute_fetch_block_events, self-contained_execute_save_blockrequiringchain_name(auto-inserts a missingchainsrow, acceptsmetadata/merkle_rootfallback), and graceful block fetchers returning hydrated block dicts with optionalchain_name(_execute_get_block_by_index/_execute_get_latest_blockconverted 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 toSQLiteAdapterwith a warning when PostgreSQL is unavailable.
- Journal (Error Mitigation & Ordering): Migrated
-
2026-09-18
- Consensus (Ordering Service): Added capacity bounding for
event_poolusingSettings.EVENT_POOL_MAX_SIZEinhierachain/consensus/ordering/service.pyto prevent unbounded memory growth, and added maintenance mode check insubmit_eventto 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) inadd_eventto return the authoritativeevent_iddirectly fromsub_chain.add_event(event)instead of generating a synthetic positional identifier.
- Consensus (Ordering Service): Added capacity bounding for
Fix (33)
-
2026-10-22
- Network (Transport Release & Explicit MSP Checks):
ZmqNode.start()(hierachain/network/zmq_transport.py) now callsstop()and chains the original error withraise ... from ewhen socket setup fails,NetworkClient.start()(hierachain/network/network_client.py) runsstop()on failure, andstop()no longer returns early when_is_runningis false — a failed start can be retried without leaking sockets.validate_msp_from_message()(hierachain/network/secure_connection.py) replaces theall(...)generator with explicitstr/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 aNonefetchone()row;PostgresAdapter(hierachain/adapters/database/postgres_adapter.py) loads thepsycopg2fallback viaimport_module, makes_execute_store_proof()static withsubmitted_at/created_atdefaulting totime.time(), and the SQLite_execute_update_state()return type widens tobool | None(hierachain/adapters/database/base/sql_adapter.py);ChannelLedgerSQLStorage(hierachain/adapters/database/channel_ledger_sql.py) declares_get_connection()underTYPE_CHECKING, andRedisLedgerAdapter.get_latest_block()(hierachain/adapters/database/redis_ledger.py) filters empty tips beforemax()and returnsNonewhen no chain has blocks. - API (GraphQL Filtering & Type Hardening):
resolve_events(hierachain/api/graphql/resolvers.py) forwardsentity_id/event_type/from_timestamp/to_timestamp/limit/afterexplicitly toselect_event_page()for non-Blockchainchains,_to_event_type()assignsEventTypefields after construction sodetails_metadatano longer hits an invalid constructor keyword, and_required_graphql_permissions()(hierachain/api/graphql_handler.py) detects fragments withisinstance(..., FragmentDefinitionNode)instead of the rawdefinition.kindstring; GraphQL fields inhierachain/api/graphql/types.pyare annotated withcast()(withEventType.resolve_events()allowed to returnNone), and the WebSocketchain_nameparameter (hierachain/api/websocket/endpoints.py) is typedstrwith the same"all"default. - Consensus (Journal Requeue & Rule Naming):
OrderingService.receive_event()(hierachain/consensus/ordering/service.py) raisesValueErrorwhen ajournalhit has no record before requeueing, and_find_stable_event()rejects non-dict stored payloads with the sameValueErrorinstead of anAttributeError;_run_custom_rules()(hierachain/consensus/ordering/certifier.py) names rules lacking__name__viatype(rule).__name__so callable objects no longer abort certification, andBFTConsensus(hierachain/consensus/bft/consensus.py) hashesself.current_requestdirectly. - Hierarchical & Cluster (Durable Recovery Guards):
_restore_main_chain()(hierachain/hierarchical/hierarchy_manager/recovery.py) raisesRuntimeErrorwhen durable storage is unavailable and casts the registration timestamp beforefloat();ChannelLedger._replay_record()(hierachain/hierarchical/channel/ledger.py) rejects non-dict snapshot/event/block payloads through the existing validation andRuntimeErrorpaths;_durable_block_events()(hierachain/hierarchical/main_chain/proofs.py) and_verify_anchor_exists()(hierachain/cluster/cross_level_sync.py) treat a missingproof_storageexplicitly as unavailable so strict and non-strict paths return documented results instead of relying ongetattr(None, ...). - Core & Error Mitigation (PyArrow 25 Compute API):
_iter_block_rows()(hierachain/core/event_query.py) builds the entity/timestamp mask withpc.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 viapc.call_functionwithpc.MatchSubstringOptions(term);_open_safe_file()(hierachain/error_mitigation/journal.py) narrowsmodetoLiteral["rb", "ab", "wb", "r+b"], andAdvancedCache.get()(hierachain/core/cache.py) accepts any key object beforestr()coercion. - Domains (Event Marker & Validator Narrowing):
_rebuild_domain_state()(hierachain/domains/chains/base_chain.py) skips replayed events whoseeventtype is not astrbefore dispatch,recover_committed_transaction()/commit_transaction()(hierachain/domains/chains/domain_chain.py) returnFalsewhen_transaction_event_markersisNoneinstead of indexing it, andProofValidator._validate_single_proof()(hierachain/domains/utils/cross_chain_validator.py) casts the already-validatedsub_chain_name/proof_hashbefore lookups. - SDK & Security (Timeout & API Key Source):
HieraChainAsyncClient(hierachain/sdk/async_client.py) wrapsconfig.timeoutinaiohttp.ClientTimeout(total=...), andHieraChainClient(hierachain/sdk/client.py) raisesHieraChainAPIErrorwhen the response carries no HTTP status code;APIKeyVerifier._extract_api_key()(hierachain/security/verify/api_key_verifier.py) resolves the source explicitly —query_paramsforAPIKeyQuery, headers otherwise — and callscheck_api_key()on that mapping instead of invoking the FastAPI dependency with the connection, whileKeyManager.storage(hierachain/security/key_manager.py) is annotatedAny. - Monitoring & CLI (Typed Alert Stats & Command Registration):
AlertManager.stats(hierachain/monitoring/alert_system.py) is typed with a_AlertStatisticsTypedDict, so counter updates drop the per-accesscast()calls, andhierachain/cli/__init__.pyregisters commands without the redundantcast(Command, ...)wrappers.
- Network (Transport Release & Explicit MSP Checks):
-
2026-10-18
- API (Ledger Sender Identity & Default Nonce Validation):
_build_event_data(hierachain/api/ledger/events.py) now also writessenderalongsidesubmitted_byso ordering can read the signing identity from either field, andEventRequest.details_nonce(hierachain/api/ledger/schemas.py) setsvalidate_default=Trueso theNonedefault is validated too — previously the default nonce bypassed hex/length validation and the stored event omittedsender. - Ordering (Canonical Signature Recheck & Shutdown Drain):
_extract_verification_items(hierachain/consensus/ordering/processor.py) skips events carryingsignature_content(already verified by the certifier during live processing and replay), verifies legacy signatures with0x-stripped hex sender/signature, and pollsevent_poolat most every0.1swhile keepingbatch_timeout; new_verify_canonical_event()(hierachain/consensus/ordering/utils.py) rebinds the ordered business fields (entity_id,event_type,event,timestamp) to the original signedsignature_contentand rejects altered or extra fields viaSignatureVerifier().verify_event_signature(), whileverify_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.
- API (Ledger Sender Identity & Default Nonce Validation):
-
2026-10-07
- Ordering (Committed-event Latency Accounting):
OrderingStorageHandler.save_block()(hierachain/consensus/ordering/storage.py) consumesprocessed_eventstiming entries only forevent_ids in the persisted block, retaining timings for events still pending in another batch, and typestrusted_public_keysasdict[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/statwitharg=/ipfs/<cid>instead of the removed/api/v0/object/stat?arg=<cid>, returningFalseon unsuccessful responses or connection failures — previously called the unsupported endpoint.
- Ordering (Committed-event Latency Accounting):
-
2026-10-04
- Parquet (Seal-on-error & No Silent Overwrite):
write_parquet_log()(hierachain/core/parquet_log.py) seals the active segment when directory/filefsyncor 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 lossyorjsoncoercions.
- Parquet (Seal-on-error & No Silent Overwrite):
-
2026-10-03
- Ordering (Serialized Commits & Lockdown): share a single
service._commit_lockRLock acrossOrderingBlockManager/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 viaOrderingPausedErrorkeeping the cut batch intact,LOCKDOWN/SHUTDOWN/ERRORare no longer clobbered byMAINTENANCE, collection pauses inLOCKDOWN, 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 preservingChannelobject references andevents_by_orgcounts while closing removed channels, and_mutate_registry()retries registry mutations 3x with rollback (hierachain/hierarchical/hierarchy_manager/base.py). - Channel (Serialized Registry Access):
_registry_operationdecorator (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.
- Ordering (Serialized Commits & Lockdown): share a single
-
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-envelopesenderpublic-key field from business-content cryptocurrency-term scanning and validatessenderseparately, 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.
- Hierarchical (Journal Load Cleanup):
-
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 callingget_status()per task, fixing a nested-lock deadlock when listing tasks.
- ERP (Scheduler Deadlock):
-
2026-09-28
- Network (Production Env Check):
SecureConnectionManager(hierachain/network/secure_connection.py) checkssettings.env == "production"instead of the stale"product", restoring insecure-P2P warnings.
- Network (Production Env Check):
-
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.
- Storage (CID Resolution):
-
2026-09-26
- Journal (Framing & Replay): Added
_JOURNAL_MAX_FRAME_SIZE/_JOURNAL_DATA_MARKERenvelope preservingdataversusextrafields, partial-write loops, torn-tail truncation repair on open, leading-magicPAR1detection, and fail-hard replay raisingValueErroron 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) setMAINTENANCEand re-raise; recovery forces block creation (force=True) and raisesRuntimeErroron null/corrupt entries;_block_from_dict(hierachain/consensus/ordering/storage.py) verifies the Merkle root before the hash with strictdata is Nonetermination. - Hierarchical (Recovery Validation):
SubChaininit (hierachain/hierarchical/sub_chain/base.py) fails fast onwait_for_active()timeout with ordering shutdown and delegates genesis persistence toOrderingService;_process_and_finalize_single_block(hierachain/hierarchical/sub_chain/block.py) validates viais_valid_new_block; rehydration (hierachain/hierarchical/sub_chain/ordering.py) raisesValueErroron integrity/queue conflicts and discards already-rehydrated queued blocks.
- Journal (Framing & Replay): Added
-
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-eventFuturecompleted 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.MAINTENANCEat the start of_initialize_service(hierachain/consensus/ordering/processor.py) so the service never exposesACTIVEduring replay, and madeOrderingRecovery(hierachain/consensus/ordering/recovery.py) raiseRuntimeErroron journalerrorentries instead of silently skipping them.
- Journal (Error Mitigation): Made
-
2026-09-24
- Database (PostgreSQL Adapter): Hardened
_execute_save_block(hierachain/adapters/database/postgres_adapter.py) to delete staleeventsrows for the overwritten(chain_name, index)before inserting, and to upsert blocks viaON CONFLICT (chain_name, "index") DO UPDATEinstead ofON CONFLICT (hash) DO NOTHING, keeping block overwrites consistent with their events. - Consensus (Ordering Service & Storage): Made
submit_event(hierachain/consensus/ordering/service.py) raiseRuntimeErrorwhenjournal.log_event()fails instead of silently queueing an unpersisted event, and madeOrderingStorageHandler.save_block(hierachain/consensus/ordering/storage.py) raise on storage-adapter rejection with idempotentblock_history/last_blockupdates (replace on same index, append only when advancing).
- Database (PostgreSQL Adapter): Hardened
-
2026-09-23
- API (Admin Secure Event): Fixed
add_secure_event(hierachain/api/admin/endpoints.py) to callrequest.model_dump(exclude_unset=True)so unset optional fields (nonce/timestamp/chain_id) are no longer forwarded asNonewhen adding chain events.
- API (Admin Secure Event): Fixed
v0.2.0 (2026-09-12)
Improvements (26)
-
2026-09-05
- Core (Block, Blockchain & Merkle Tree): Hardened
Blockcaching and hash guard inhierachain/core/block.py(type-checkedstored_hash, cached event list), added deterministicevent_idgeneration (orjson+SHA-256evt-{16}) and Merkle-root verification in_is_block_linked_correctly/Blockchain.add_event()now returningstr(hierachain/core/blockchain.py), and fixedMerkleTree._build_treeodd-node handling to propagate unduplicated leaf instead of hashing duplicate (hierachain/core/merkle_tree.py). - Core (Logging & Error Handling): Narrowed broad
except ExceptiontoOSError/ArrowException/ValueError/TypeErrorinhierachain/core/parquet_log.pyandhierachain/error_mitigation/journal.py, added typedpa.Table | Noneannotation, and addedImportErrorfallback forkubernetesclient inhierachain/hierarchical/k8s_namespace_manager/operations.py. - Consensus (BFT & PoA/PoF & Ordering): Added strict
isinstance(str)guards forsignature/public_key/block_hashinhierachain/consensus/proof_of_federation._verify_block_quorumand removed insecureKeyPairfallback inhierachain/consensus/proof_of_authority.py; tightened BFT validation inhierachain/consensus/bft/helpers.py(strictnessearly-return and per-sequence digest/view quorum matching in_process_commit_quorum_logic); simplifiedhierachain/consensus/ordering/recovery.pytype handling (int(block_index_raw),dict|None). - Consensus & Hierarchical (Types & Schema): Replaced
TYPE_CHECKINGforward references with runtimeAnyacrosshierachain/consensus/bft/dispatcher.py|engine.py|view_change.pyandhierachain/hierarchical/main_chain/proofs.py|registry.py|rebalancer/split_ops.py|sub_chain/*.py; centralizedEVENT_SCHEMA(pa.schema) inhierachain/core/block.pyand reused it inhierachain/consensus/ordering/certifier.py,hierachain/error_mitigation/journal.py,hierachain/hierarchical/channel/ledger.py; enhancedBFTViewChangeManagerto emitprepared_proofs. - Hierarchical (Hierarchy Manager & SubChain): Enhanced
_shared_poolinhierachain/hierarchical/hierarchy_manager/base.pyto support dynamicmax_workers(spawns ephemeral pool when changed, else reuses global); replacedhash()with deterministicorjson+SHA-256evt-ID inhierachain/hierarchical/sub_chain/base.py; removed unused legacyhierachain/hierarchical/sub_chain.py. - Hierarchical (Rollback & Rebalancer): Hardened
hierachain/error_mitigation/rollback_manager.pywith component-aware_capture_storage_state, path-traversal guard viaos.path.realpathin_rollback_configuration, section-count logging anddata_hashintegrity check; cleanedhierachain/error_mitigation/validator_helpers.pyand narrowed imports; simplifiedhierachain/hierarchical/rebalancer/split_ops.pyimports. - API (Middleware, Server & WebSocket): Streamed payload limit via
request.stream()withbytes_readaccounting andrequest._receivereplay inhierachain/api/middleware.py; enforced trusted-proxy checkclient_ip in TRUSTED_PROXIESforX-Forwarded-Forand fixed rate-limit IP fallback; extracted CORS to_add_cors_middlewareinhierachain/api/server.pyand madeuvloopmandatory; simplifiedPingLoopRunnerinit inhierachain/api/websocket/manager.py. - API (Ledger, GraphQL, Explorer & Business): Centralized default field handling in
hierachain/api/storage/explorer_helpers.py; addedassertguards inhierachain/api/ledger/depds.pyand replaced recursive depth check with iterative stack (depth >10) inhierachain/api/ledger/schemas.py; adaptedhierachain/api/graphql/resolvers.py|types.pyforBlockchain.add_event()->strandis_cid_stringlogic; typedprivate_data_entry: dict[str,Any]inhierachain/api/business/private_data.py. - API (Admin Identity - Feature): Added optional
nonce/timestamp/chain_idfields toSecureEventRequest(hierachain/api/admin/schemas.py), enforcedchain_idmismatch (422) and 300s timestamp freshness, prefixed challenge withb"HRC_IDENTITY_CHALLENGE:"and restoredrequire_chain_accessdependency for/verify-identity(hierachain/api/admin/endpoints.py). - Security, Events, Database & Cleanup: Simplified
_sanitize_html_contexttore.sub(..., "[TEMPLATE_BLOCKED]")(hierachain/security/sanitization.py) and switched ZK mock verification toZKVerifier(mode="mock").verify(hierachain/security/zk_prover.py); tightenedBaseEvent.__eq__(other: object)(hierachain/domains/events/base_event.py); centralized DB schema init toinit_database_schemainhierachain/adapters/database/postgres_schema.py|sqlite_schema.pyand simplified adapters; removed 17 unused imports acrossapi/storage,consensus/ordering,core/utils,error_mitigation/*,risk_management/*.
- Core (Block, Blockchain & Merkle Tree): Hardened
-
2026-09-01
- Database (PostgreSQL): Introduced
PostgresAdapter(hierachain/adapters/database/postgres_adapter.py) extendingSQLBasewithpsycopg/psycopg2connection pooling (dictionary row access) andpostgres_schema.pydefining tables (chains,blocks,events,proofs,chain_state) with optimized composite indexes (chain_name+timestamp,entity_id+chain_name,block_hash) and full CRUD for blockchain data. - Config: Enhanced storage/database flexibility in
hierachain/config/settings.pyandhierachain/config/product_config_template.py— addedBLOCK_CREATION_MODE/BLOCK_MAX_WAIT_SECfor block creation control,PARQUET_ROLL_INTERVAL(monthly/daily/by_size_mb),POSTGRES_SYNC_MODE(realtime/batch_worker/disabled),SQL_RETENTION_DAYS; madeSTORAGE_BACKENDauto-detectpostgresfromDATABASE_URLwithsqlitefallback and unifiedDATABASE_URL/HRC_DATABASE_URLhandling; streamlined product template backends tosqlite,postgres,redis,memory,parquet_only. - Storage (Hierarchical & Ordering): Added dynamic adapter selection in
hierachain/consensus/ordering/storage.py(OrderingStorageHandler),hierachain/hierarchical/hierarchy_manager/base.py(_create_storage) andhierachain/hierarchical/sub_chain/base.py— selectsPostgresAdapterwhendb_urlstarts withpostgres:///postgresql://otherwiseSQLiteAdapter; refactoredSubChainDB path generation to always ensuredata/{safe_name}/journalexists with path-traversal guard. - Database (Query & Indexes): Optimized
hierachain/adapters/database/sqlite_schema.py(create_indexesnow uses fullCREATE INDEXstatements) and refactoredhierachain/adapters/database/base/sql_adapter.pyto use predefined reusable query templates (_QUERIES_WITH_CHAIN/_QUERIES_WITHOUT_CHAIN) with parameterized queries for chain-aware event filtering, and fixed block cleanup to delete viahash/block_hashinstead ofid/block_id.
- Database (PostgreSQL): Introduced
-
2026-08-31
- SDK: Replaced
assertstatements with explicitRuntimeErrorchecks in_get_sessionacrosshierachain/sdk/client.pyandhierachain/sdk/async_client.pyto prevent session validation from being skipped in optimized byte-code mode (-O). - Logging & Error Mitigation: Replaced bare
except Exception: passandcontinueblocks with explicitlogger.debug()messages inhierachain/core/parquet_log.py,hierachain/error_mitigation/journal.py, andhierachain/risk_management/audit_logger.pyfor file closing, unlinking, rotation recovery, and batch replaying, improving error visibility while maintaining fail-safe execution.
- SDK: Replaced
-
2026-08-29
- Journal: Migrated
TransactionJournal(hierachain/error_mitigation/journal.py) to Parquet storage (pyarrow.parquet) with 100MB file cap, auto rotationcurrent_{ns}.parquet, bounded async queue (10k) and thread-safeParquetWritermanagement, plus replay over multiple Parquet files with backward compat for.arrow/.log. - Audit: Added
ArrowAuditStorage(hierachain/risk_management/audit_logger.py) as default backend, persistingAuditEventvia Parquet with Arrow schema, 100MB rotation,AuditFilter-aware retrieval, and compat for*.jsonl. - Logging: Unified all
log/persistence to Parquet viahierachain/core/parquet_log.py(write_parquet_log,ParquetLogHandler), migratingconsensus_scaling,view_changes,error_classifications,restoration_events,scaling_events,network_alerts,resource_scaling,rollback_operations,quarantine_dump,risk_analyzer,mitigation_strategiesto*.parquetand switchingOrderingServicetonode_{id}_journal.parquet.
- Journal: Migrated
-
2026-08-27
- API: Adjusted authentication handling in
hierachain/api/server.py(addedRequestannotation toauth_dependency, unifiedverifierinitialization and extendedEXEMPT_PATHSwith/api/admin/verify-identity) and removed redundantrequire_chain_accessdependencies inhierachain/api/admin/endpoints.pyfor/verify-identityand/statusso health checks and identity verification work correctly whenHRC_ENV=product.
- API: Adjusted authentication handling in
-
2026-08-24
- API: Introduced
hierachain/api/context.pyfor decoupled, context-based P2P client runtime lifecycle management across API server initialization, shutdown, and network ping endpoints. - Hierarchical (Rebalancer): Centralized sub-chain utility functions into
hierachain/hierarchical/rebalancer/utils.pyand streamlined state migration during sub-chain splitting to migrate pending events and inherit entity World State snapshots without altering committed block history. - Domains: Streamlined domain event module structure in
hierachain/domains/events/, decoupling cross-module circular imports betweenDomainEventbase and concrete event definitions.
- API: Introduced
-
2026-08-23
- Network: Added timestamp drift validation (
max_drift, default 300s) toverify_messageinhierachain/network/message_cryptographic.pyto ensure freshness of received P2P messages and reject replayed packets with stale timestamps. - API (Rate Limiter): Optimized in-memory
RateLimiterinhierachain/api/middleware.pywith periodic batch expiration cleanup (_cleanup_expired), eliminating $O(N)$ dictionary rebuilds and lock contention on every request under high traffic load; added client IP extraction fromX-Forwarded-Forheader for proxy deployments. - Core & Hierarchical: Enhanced
finalize_blockinBlockchain(hierachain/core/blockchain.py) andMainChain(hierachain/hierarchical/main_chain/base.py) to preservepending_eventswhen block creation or validation fails, preventing event data loss; addedself.locksynchronization toMainChainblock finalization methods.
- Network: Added timestamp drift validation (
-
2026-08-15
- Dead Code Removal: Removed unused utility functions across hierarchical and domain modules (
hierachain/core/utils.py,consensus/proof_of_federation.py,domains/chains/domain_chain.py,domains/chains/metrics.py,domains/utils/cross_chain_validator.py,domains/utils/entity_tracer.py,hierarchical/multi_org.py): deletedgroup_events_by_entity,_is_block_valid,_extract_signature_from_block,_analyze_compliance_status,_calculate_performance_stats,_process_string_value,_process_bytes_value,_generate_recommendations, andcreate_multi_org_networkfor a leaner, more maintainable codebase.
- Dead Code Removal: Removed unused utility functions across hierarchical and domain modules (
Fix (15)
-
2026-08-31
- Security (Secret Manager): Sanitized exception logging templates in
_get_from_aws(hierachain/config/secret_manager.py) to eliminate false-positive credential disclosure warnings during static security audits.
- Security (Secret Manager): Sanitized exception logging templates in
-
2026-08-29
- Security (Sanitization): Fixed
_sanitize_html_context(hierachain/security/sanitization.py) to neutralize SSTI with[TEMPLATE_BLOCKED]instead of no-ophtml.escape, and tightened_sanitize_filename_contextwith allowlist^[a-zA-Z0-9_\-~.]+$and../.filtering to prevent path traversal.
- Security (Sanitization): Fixed
-
2026-08-27
- Security (Key Manager): Added
PYTEST_CURRENT_TEST/pytestguard ininitialize_default_keys(hierachain/security/key_manager.py) to prevent default API key creation in test environments whenHRC_ENV=productand allow safe initialization underpytest. - Hierarchical (Rebalancer): Handle both
callableandnon-callablepending events in_get_pending_events(hierachain/hierarchical/rebalancer/split_ops.py) by checkingcallable()and falling back to thepending_eventslist. - Consensus (BFT): Relaxed timestamp drift threshold from 30s to 120s in
verify_message_signature(hierachain/consensus/bft/helpers.py) to avoid drift failures when the suite runs long with a statically created message at import time. - Config (Env Manager): Added
HRC_ENV=test/PYTEST_CURRENT_TESTchecks ininit_env_config(hierachain/config/env_manager.py) to prevent creating.env.HRC.exampleand loading the product.envwhile runningpytest. - Cluster (Lockdown): Hardened
verify_signatureinhierachain/cluster/lockdown_types.pywith emptystrtype checks andtry/exceptaroundhmac.compare_digestto safely handle invalid signatures while maintaining backward compatibility with legacy 32-char truncated signatures.
- Security (Key Manager): Added
-
2026-08-24
- Consensus (Ordering): Added empty batch check (
if not self.current_batch: return False) tois_batch_readyinBlockBuilder(hierachain/consensus/ordering/block_builder.py) to prevent false-positive readiness checks and no-op block creation triggers during idle timeout periods. - Core (Merkle Tree): Added domain separation prefix (
0x01) to internal node hashing inMerkleTree._build_tree(hierachain/core/merkle_tree.py) to prevent node duplication and second-preimage collision risks. - API (Payload Limit): Enforced upload payload size limits (1MB) on streaming/chunked requests lacking
Content-Lengthinadd_payload_limit(hierachain/api/middleware.py).
- Consensus (Ordering): Added empty batch check (
-
2026-08-23
- Consensus (BFT): Enforced strict signature verification in
_validate_consensus_message(hierachain/consensus/bft/helpers.py), ensuring that incoming BFT messages (PRE-PREPARE,PREPARE,COMMIT) with invalid or missing signatures are always rejected (return False) across all strictness modes. - Hierarchical (Proof Verification): Added fallback chain scanning in
_verify_proof_in_main_chain(hierachain/hierarchical/main_chain/proofs.py) to search committed blocks when a proof submission is not yet reflected in the O(1)proof_index. - Cluster (Lockdown Protocol): Standardized
LockdownMessageHMAC-SHA256 signatures inhierachain/cluster/lockdown_types.pyto use the full 64-character hex digest (256-bit) while maintaining backward compatibility with legacy 32-character truncated signatures inverify_signature.
- Consensus (BFT): Enforced strict signature verification in
-
2026-08-14
- Security (ZK Mock Proof):
_generate_mock_proofinhierachain/security/zk_prover.pynow accepts asub_chain_nameparameter and includes it inpublic_inputs, fixing the SHA-256 commitment being computed withsub_chain_name=""while the verifier hashed with the real sub-chain name (causing every proof to be rejected whenENABLE_ZK_PROOFS=true)._verify_mock_proofreplaces the laxmock_proofprefix check with the standard_verify_mocklogic fromzk_verifier(commitment hash vspublic_inputs), rejecting fake proofs. - Hierarchical: Moved the genesis-only chain guard above
get_latest_block()in_submit_proof_for_sub_chain(hierachain/hierarchical/sub_chain/proof.py), preventing anIndexErroron an empty SubChain and returningFalseas intended.
- Security (ZK Mock Proof):
v0.1.0 (2026-08-10)
This major milestone release marks the consolidation of HieraChain's core library architecture (hierachain/). Key highlights include complete terminology standardization, dual-tier consensus refinement (PoA for Intra-Org SubChains and PoF for Inter-Org MainChain alliances), integration of high-performance libraries (orjson, uvloop), extensive dead code removal, and API router restructuring.
Improvements (52)
-
2026-07-27
- Consensus: Introduced
HRC_MAINCHAIN_CONSENSUSenv var with backward-compatibleHRC_CONSENSUS_TYPEalias.MainChain.__init__accepts optionalconsensus_typeparameter.SubChainnow defaults to PoA for intra-org domain events, configurable viaconfig["consensus_type"].
- Consensus: Introduced
-
2026-07-23
- Refactoring: Moved all inline/late imports (
os,sys,time,uuid,asyncio,warnings,httpx,pyarrow,cast) to module-level top-of-file across 14 source files, fully conforming to PEP 8 import ordering.
- Refactoring: Moved all inline/late imports (
-
2026-07-22
- API: Integrated
uvloopdependency and enabled high-performance async event loop support in API server. - Blockchain: Introduced
event_type_indexonBlockchainandto_event_listonBlockfor O(1) event type lookups. - Cache: Replaced standard list with
OrderedDictfor LRU/TTL access ordering and simplified thread cleanup lifecycle. - Security: Refactored cryptocurrency term validation with recursive structure traversal, replacing expensive JSON regex serialization.
- Hierarchical: Optimized
HierarchyManagerto use a shared thread pool executor context, reducing thread creation overhead during proof sync. - State: Resolved race condition in
WorldStateroot hash calculation by moving sorting and Merkle tree construction out of the lock. - Network: Optimized ZMQ transport replay buffer management with threshold-based cleanup (>1000 entries).
- Consensus: Lowered parallel signature verification batch threshold from 15 to 4 for earlier multi-threading acceleration.
- API: Integrated
-
2026-07-18
- Storage: Tuned IPFS connection pooling parameters (
max_keepalive_connections=50,max_connections=150) to accelerate concurrent block storage. - Core: Resolved critical indexing race conditions in block creation within lock constraints and aligned initial index references.
- Database: Optimized SQLite adapter by setting database connection timeout to 30.0 seconds to prevent write-lock exceptions under high parallel load.
- Storage: Tuned IPFS connection pooling parameters (
-
2026-07-17
- Performance: Replaced
jsonwithorjsonacross the entire codebase (security, risk_management, network, monitoring, privacy, config, CLI, API, and hierachain modules) for faster serialization/deserialization. - Core: Added optimized data payload recovery for blocks with direct
datacolumn parsing when available. - Security: Optimized signature verification with configurable thread pool (CPU count) and extracted
_get_verify_keyhelper for public key decoding.
- Performance: Replaced
-
2026-07-12
- Network: Fixed seed node public key decoding with special handling for
$$delimiter characters.
- Network: Fixed seed node public key decoding with special handling for
-
2026-07-09
- Risk Management: Improved database connection handling in audit logger.
- Policy: Fixed Null value evaluation in Arrow
StructArray.
-
2026-07-05
- Database: Enhanced SQL adapter with metadata and merkle root support.
- API: Renamed API version tags for clarity (
v1→ledger,v2→business,v3→admin); updated security testing scripts and health check endpoints accordingly.
-
2026-07-04
- API: Restructured API modules for better security and maintainability; uses background tasks for async security event recording.
- Monitoring: Implemented comprehensive performance monitoring module; added alert system with anomaly detection and notification.
- Risk Management: Implemented
DatabaseAuditStoragefor persistent audit logging. - Refactoring: Removed deadlock detector and related tests; removed
sql_backendreferences; reorganized version management.
-
2026-07-02
- Storage Migration: Replaced
SqlStorageBackendwithSQLiteAdapter; deleted legacy storage module. - Database: Added chain state table for quick state lookups; added blockchain data storage and retrieval functions.
- Storage Migration: Replaced
-
2026-07-01
- API Routing: Major refactoring of API routing structure and module names; optimized middleware and WebSocket manager.
- Domains: Refactored event extraction logic and transaction management; removed generic-level re-export shim.
-
2026-06-30
- Dead Code Removal: Removed unused modules across core (performance, parallel_engine), storage (
ChainModel), network (message encryption exception classes), error_mitigation, domains (entity reporting, compliance), consensus, API, and adapters. - State: Removed
apply_event_listfunction from world state. - Event Ledger: Reconstructed event data structure and storage logic.
- Dead Code Removal: Removed unused modules across core (performance, parallel_engine), storage (
-
2026-06-24
- Dependencies: Added
vulturefor dead code detection.
- Dependencies: Added
-
2026-06-23
- Hierarchical: Modularized
MainChain(proof + registry),SubChain(rehydration logic),Rebalancer(event extraction),HierarchyManager(cross-level sync init), K8s namespace manager; addedcompliance_checker. - Consensus: Improved signature extraction and verification logic.
- Monitoring/Alert: Modularized into separate packages with shared types.
- ERP: Modularized integration components for better maintainability.
- Security: Improved API key storage and caching management.
- Events: Moved domain event classes with factory functions; moved metrics and transaction manager to separate modules.
- Core: Improved event queries and type handling.
- Hierarchical: Modularized
-
2026-06-22
- BFT Consensus: Restructured into modular components (engine, dispatcher, view_change).
- Ordering: Restructured batch processing and validation logic.
- Cluster: Extracted node validation and authentication helpers.
- Redis: Restructured adapter into manager classes with delegate operations.
- Security: Extracted production security checks to helper function.
- API: Extracted chain block lookup and creation helpers.
- WebSocket: Added explicit
Nonetype annotations for optional parameters. - Schemas: Optimized payload depth validation to use stack traversal.
-
2026-06-21
- Performance: Replaced
jsonwithorjsonacross database layer for faster serialization. - Journal: Added asynchronous background writing for event logging.
- Security: Optimized batch signature verification and proof serialization.
- Performance: Replaced
-
2026-06-20
- Consensus: Optimized batch signature verification; delegated crypto term validation to core utility.
-
2026-06-19
- Domains: Reorganized package structure; migrated generic modules; removed
generic/layer. - Hierarchical: Implemented
HierarchyManagerfor chain coordination; restructured sub-chain proof handling. - Core: Improved block event processing and merkle tree handling.
- Consensus: Reorganized BFT consensus; updated PoA and PoF classes.
- Security: Removed deprecated certificate and backup modules; simplified imports.
- Storage: Removed memory storage and world state modules.
- State: Added
WorldStateclass for entity state management. - Error Mitigation: Removed deprecated rollback and recovery modules.
- Integration: Removed
ArrowClientand related types. - Network: Removed
NetworkClientSyncsynchronous wrapper. - Database: Added
RedisStorageAdapterfor Redis blockchain storage. - Config: Removed unused cache and parallel processing settings.
- CLI: Fixed import path for
DomainChain. - Version: Simplified version module; removed unused functions.
- Dependencies: Added
orjson 3.11.9.
- Domains: Reorganized package structure; migrated generic modules; removed
-
2026-06-17
- SDK: Restructured into sync and async clients with shared types and exceptions.
- Security: Modularized certificate and key backup management.
- Risk Management: Restructured and optimized modules.
-
2026-06-16
- Core Cache: Replaced monolithic
caching.pywith modularCacheandCacheManagercomponents. - BFT: Consolidated BFT helpers into single module.
- Cluster: Moved data types to separate modules (lockdown_types, cross_level_sync_types).
- Monitoring: Unified alert and performance types into shared module.
- Integration: Moved error and sync classes to types module.
- Hierarchical: Centralized shared types into new
types.pymodule. - Error Mitigation: Added comprehensive error mitigation modules (consensus_validator, resource_validator, network_recovery, auto_scaler, backup_recovery).
- Core Cache: Replaced monolithic
-
2026-06-15
- API Restructuring: Split monolithic
v1/endpoints.pyinto modular components; modularizedv2/endpoints.py; fixedv3import paths. - GraphQL: Restructured schema and resolvers for better organization.
- Database: Added base SQL adapter and integrated into
SQLiteAdapter. - Server: Modularized middleware and GraphQL handler; optimized server setup; modularized blockchain explorer into components.
- API Restructuring: Split monolithic
Breaking Changes (1)
- API Routing & Data Schemas: Restructured API routes into domain-specific namespaces (
/api/ledger,/api/business,/api/admin), updated payload key names fromtransaction_*toevent/details, and refactored SDK client namespaces.
v0.0.6 (2026-07-15)
This release focuses on security hardening of the logging subsystem, simplification of the core blockchain and hierarchical layers, and further consensus hardening with proper error handling.
Improvements (6)
- Secure Logging: Added regex-based redaction of sensitive keys and tokens in
hierachain/security/: sensitive values are replaced with'***'to prevent credential leakage. Introduced_SEVERITY_MAPfor consistent security event logging, replacing direct log level methods withlogger.log(), reducing duplication across all logging call sites. - Core Blockchain Refactoring: Added
_rebuild_event_indexesto reset and rebuild event indexes after block loading, ensuring index consistency across restarts. Changed hash mismatch from silent correction to raising an exception, so potential data corruption is no longer hidden. Replaced direct dictionary access withblock.to_event_list()for cleaner event filtering. - Consensus Hardening: Enhanced
_contains_forbidden_termswith regex word-boundary matching to eliminate false positives. Removed fallback random signature generation; signing now fails cleanly with an error message when the private key is missing.ProofOfFederationauto-generates key pairs for validators, exposespublic_keyproperty, addedblock_hashto consensus metadata._verify_block_quorumnow accepts optionalsigner_idto avoid redundant event re-scanning. - Hierarchical Layer Simplification: Removed temporary entity index mapping, local chain clear, event statistics reset in sub-chain rehydration. Removed redundant event addition to
Blockchain.pending_events. Streamlined_recover_pending_events_from_journalto count uncommitted events only, moving event reconstruction toOrderingRecovery. - Testing & Benchmark: Enhanced ZK Proof-of-Federation test with real keypair, real signatures, and pre-consensus block validation. Updated storage benchmark using
Blockclass fromhierachain.core, renamedevent_typetoevent. Added helper function forProofOfFederationinstantiation with signing key.
Fix (1)
- Logger Test Alignment: Updated test assertions to match new logger method signatures (
mock_info→mock_log,call_argsindexing adjusted).
v0.0.5 (2026-06-20)
This release focuses on core hierachain/ package improvements, including replacing ipfshttpclient with httpx for Kubo RPC, idempotent sub-chain creation, chain integrity hardening, block persistence, and safe edge-case handling.
Improvements (6)
- Kubo RPC Migration: Replaced
ipfshttpclientwithhttpxinhierachain/api/storage/ipfs_client.py, executing IPFS operations directly via Kubo HTTP RPC API. Added_parse_multiaddrhelper for host/port extraction from multiaddress strings. Refactored core operations (upload, download, pin, unpin, list_pins, stats) to usehttpx.ClientPOST requests. Removed_IPFSClientContextwrapper class. - Idempotent Sub-Chain Creation: API v1 (
hierachain/api/v1/endpoints.py) checks for existing sub-chain before creation, returns201 Createdwith"already_exists"audit trail for duplicates. Returns409 Conflictwhenmanager.add_sub_chainraisesValueErroron duplicate. - Chain Integrity Hardening: Added
_verify_chain_links()inhierachain/consensus/ordering/storage.pyto validateprevious_hashchain of blocks._block_from_dictraisesValueErroron computed hash mismatch instead of merely logging an error. - Event Enrichment & Block Persistence: Ordering service (
hierachain/consensus/ordering/service.py) injectsevent_idintoevent_datapayload before creating pending events. Recovery (recovery.py) prioritizes enrichedevent_dataover calculated fallback. Sub-chain finalize (hierachain/hierarchical/sub_chain.py) persists blocks via storage handler, ensuring rehydration retains consensus events. - Block Overwrite: In
hierachain/storage/sql_backend.py,save_blockqueries for existing blocks byindex/chain_name, deletes and replaces them instead of silently handlingUNIQUE constraintviolations. - Zero Children Safeguard: Rebalancer (
hierachain/hierarchical/rebalancer.py) safely returns0whennum_children <= 0, preventing modulo-by-zero errors.
Fix (1)
- Integrity Check Locking: Moved post-rehydration chain integrity validation outside the lock in
hierachain/hierarchical/sub_chain.py. Downgraded mismatch log from error to warning to account for pending consumer thread blocks.
v0.0.4 (2026-05-25)
This release focuses on Node Identity with Ed25519/Curve25519 keypairs, ZeroMQ CURVE encryption for P2P, API v3 secure event submission, Ed25519 signing for Proof of Federation, BFT timestamp validation against replay attacks, and comprehensive security hardening within hierachain/.
Improvements (4)
- Node Identity & P2P Networking: Introduced
NodeIdentityinhierachain/security/identity_loader.py, ZeroMQ CURVE encryption inNetworkClient,send_direct/broadcastmethods, ping-pong heartbeat. Propagated node identity throughHierarchyManager,DomainChain,OrderingService, and BFT consensus. - API v3 & Cryptographic Signatures: New
POST /api/v3/chains/{chain_name}/secure-eventsendpoint with Ed25519 signature verification, 1MB payload limit, and max depth 10. Addedsender/signaturefields to v1 event schemas with strict hex validation. - Consensus Hardening: Ed25519 signing for Proof of Federation (
_create_federation_signature,_verify_block_quorum), 30-second BFT timestamp drift check against replay attacks, block hash verification on reconstruction, configurableblock_intervalviaHRC_BLOCK_INTERVAL. - Security: Production ZK proof rejection (test environment bypass), HMAC constant-time comparison (
hmac.compare_digest),threading.RLockin LockdownProtocol, PBKDF2 increased to 310,000 iterations,AdvancedCachewith TTL/LRU forKeyManager.
Fix (2)
- Consensus & Storage: Fixed block signature verification and auto key generation in PoA, corrected default return value in BFT handler from
TruetoFalse, added 64-char SHA-256 proof_hash validation, chain integrity checks after deserialization, addedcreator_id/signaturecolumns to block DB model. - API & SDK: Updated SDK default base URL from 8000 to 2661, sub-chain name regex validation, thread-safe
RateLimiter, CID/nonce validation in IPFS client.
v0.0.3 (2026-05-02)
This release focuses on comprehensive type safety improvements across hierachain/, achieving full Mypy compliance, strict Ed25519 64-byte signature validation, JSON canonicalization for deterministic verification, HMAC-based lockdown protocol, payload limit middleware, and 24-hour timestamp validation.
Improvements (4)
- Full Mypy Compliance: Resolved static typing warnings across all modules: consensus, API, security, network, monitoring, error mitigation, storage, adapters, hierarchical, domains, core and cluster.
- Ed25519 Signature Validation: Enforced strict 64-byte length for Ed25519 signatures in
verify_signature_standaloneto prevent validation bypass. - JSON Canonicalization: Implemented robust
get_canonical_byteswith recursive dict sorting, Unicode NFC normalization, and consistent float formatting for deterministic signature verification. - Security: Added
PayloadLimitMiddlewarerejecting POST/PUT/PATCH over 1MB, 24h proof timestamp consistency validation, default API key prevention in production (RuntimeError), refactored HMAC lockdown protocol (hmac.newSHA256).
Fix (1)
- BFT & Validation: Limited BFT message log to 10,000 entries preventing unbounded memory growth, improved IPFS connection handling (
_ensure_connectedwith proper None checks), fixed bare except clauses, enforced\bword-boundary matching for cryptocurrency term validation.
v0.0.2 (2026-04-04)
This release focuses on enhanced security, system observability, and important stability improvements for the core hierachain/ package, addressing real-world issues discovered during testing and evaluation.
Improvements (5)
-
Unified Secret & Credential Management:
- Introduced unified
SecretManagerinconfigfor secure credential management with multiple backend support. - Prevented accidental secret leakage in logs by masking secret names and backend identifiers.
- Prevented automatic master key generation in production to require explicit key provisioning.
- Introduced unified
-
Security & Policy:
- Added persistent storage for brute force lockouts and proactive rejection of dangerous input patterns in policy engine.
- Enhanced directory creation checks to prevent path traversal attacks in SubChain SQLite database paths.
- Added dedicated security module for GraphQL endpoint with input validation and access control.
-
Observability & Monitoring:
- Integrated Prometheus metrics collection for real-time monitoring of API latency, block throughput, and consensus health.
- Added JSON logging support for better integration with log aggregation systems like ELK and Loki.
- Added simple alert methods and global instance manager for proactive event notification.
- Enhanced API rate limiting with Redis backend for distributed deployments.
-
Core & Hierarchical Chain Improvements:
- Implemented deadlock detection with timeout and recovery mechanisms in lock management.
- Escalated missing ZK proof severity to critical and integrated automatic alert triggering.
- Improved proof submission robustness and shutdown handling in hierarchical chains.
- Added input validation for
ChannelLedger.add_eventto prevent malformed events.
-
Developer Tools & CLI:
- Added dedicated CLI commands for key generation, backup, and recovery (
python -m hierachain key ...). - Added endpoint to fetch specific blocks by index or hash for targeted audit.
- Updated SDK client for full multi-chain API v3 support.
- Synchronized block schema with event schema for consistent data structure.
- Added dedicated CLI commands for key generation, backup, and recovery (
Fix (2)
-
Consensus & Ordering Stability:
- Resolved critical race condition in block commit and pending event handling in
OrderingService. - Ensured lockdown and resume operations are atomic to prevent inconsistent state during maintenance.
- Prevented silent data loss during transaction journal recovery with proper validation.
- Improved state recovery logic with config validation and modularized recovery from transaction journal.
- Resolved critical race condition in block commit and pending event handling in
-
Core & Hierarchical Chain:
- Fixed race condition in hierarchical chain management and added graceful shutdown procedures.
v0.0.1 (2026-03-22)
This release marks the completion of HieraChain's initial architectural direction, focusing on consolidating core components into a unified prototype framework.
Improvements (4)
- IPFS Storage Integration: Support for off-chain data storage with AES-256-GCM encryption and CID identifiers across all API interfaces (REST, GraphQL, WebSocket).
-
Performance & Scalability Optimization:
- Parallel block processing in
OrderingService. - Caching for certificate and permission validation.
- Worker pool optimization (75% CPU) and multi-threading support for SQLite.
- Parallel block processing in
-
Developer Tools: Launched
BlockchainExplorerdashboard and detailed technical documentation system. -
Security & Integrity:
- Merkle Root support in block header and storage.
- Ensured hash consistency and thread-safety for core components.
- Standardized security logging with
SecureLogger.
Fix (1)
-
Stability & QA:
- Fixed Chain Rehydration bug for correct state restoration after restart.