zexus 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/__init__.py +7 -0
  4. package/src/zexus/__init__.py +1 -1
  5. package/src/zexus/__pycache__/__init__.cpython-312.pyc +0 -0
  6. package/src/zexus/__pycache__/capability_system.cpython-312.pyc +0 -0
  7. package/src/zexus/__pycache__/debug_sanitizer.cpython-312.pyc +0 -0
  8. package/src/zexus/__pycache__/environment.cpython-312.pyc +0 -0
  9. package/src/zexus/__pycache__/error_reporter.cpython-312.pyc +0 -0
  10. package/src/zexus/__pycache__/input_validation.cpython-312.pyc +0 -0
  11. package/src/zexus/__pycache__/lexer.cpython-312.pyc +0 -0
  12. package/src/zexus/__pycache__/module_cache.cpython-312.pyc +0 -0
  13. package/src/zexus/__pycache__/module_manager.cpython-312.pyc +0 -0
  14. package/src/zexus/__pycache__/object.cpython-312.pyc +0 -0
  15. package/src/zexus/__pycache__/security.cpython-312.pyc +0 -0
  16. package/src/zexus/__pycache__/security_enforcement.cpython-312.pyc +0 -0
  17. package/src/zexus/__pycache__/syntax_validator.cpython-312.pyc +0 -0
  18. package/src/zexus/__pycache__/zexus_ast.cpython-312.pyc +0 -0
  19. package/src/zexus/__pycache__/zexus_token.cpython-312.pyc +0 -0
  20. package/src/zexus/access_control_system/__pycache__/__init__.cpython-312.pyc +0 -0
  21. package/src/zexus/access_control_system/__pycache__/access_control.cpython-312.pyc +0 -0
  22. package/src/zexus/advanced_types.py +17 -2
  23. package/src/zexus/blockchain/__init__.py +411 -0
  24. package/src/zexus/blockchain/accelerator.py +1160 -0
  25. package/src/zexus/blockchain/chain.py +660 -0
  26. package/src/zexus/blockchain/consensus.py +821 -0
  27. package/src/zexus/blockchain/contract_vm.py +1019 -0
  28. package/src/zexus/blockchain/crypto.py +79 -14
  29. package/src/zexus/blockchain/events.py +526 -0
  30. package/src/zexus/blockchain/loadtest.py +721 -0
  31. package/src/zexus/blockchain/monitoring.py +350 -0
  32. package/src/zexus/blockchain/mpt.py +716 -0
  33. package/src/zexus/blockchain/multichain.py +951 -0
  34. package/src/zexus/blockchain/multiprocess_executor.py +338 -0
  35. package/src/zexus/blockchain/network.py +886 -0
  36. package/src/zexus/blockchain/node.py +666 -0
  37. package/src/zexus/blockchain/rpc.py +1203 -0
  38. package/src/zexus/blockchain/rust_bridge.py +421 -0
  39. package/src/zexus/blockchain/storage.py +423 -0
  40. package/src/zexus/blockchain/tokens.py +750 -0
  41. package/src/zexus/blockchain/upgradeable.py +1004 -0
  42. package/src/zexus/blockchain/verification.py +1602 -0
  43. package/src/zexus/blockchain/wallet.py +621 -0
  44. package/src/zexus/cli/__pycache__/main.cpython-312.pyc +0 -0
  45. package/src/zexus/cli/main.py +300 -20
  46. package/src/zexus/cli/zpm.py +1 -1
  47. package/src/zexus/compiler/__pycache__/bytecode.cpython-312.pyc +0 -0
  48. package/src/zexus/compiler/__pycache__/lexer.cpython-312.pyc +0 -0
  49. package/src/zexus/compiler/__pycache__/parser.cpython-312.pyc +0 -0
  50. package/src/zexus/compiler/__pycache__/semantic.cpython-312.pyc +0 -0
  51. package/src/zexus/compiler/__pycache__/zexus_ast.cpython-312.pyc +0 -0
  52. package/src/zexus/compiler/lexer.py +10 -5
  53. package/src/zexus/concurrency_system.py +79 -0
  54. package/src/zexus/config.py +54 -0
  55. package/src/zexus/crypto_bridge.py +244 -8
  56. package/src/zexus/dap/__init__.py +10 -0
  57. package/src/zexus/dap/__main__.py +4 -0
  58. package/src/zexus/dap/dap_server.py +391 -0
  59. package/src/zexus/dap/debug_engine.py +298 -0
  60. package/src/zexus/environment.py +10 -1
  61. package/src/zexus/evaluator/__pycache__/bytecode_compiler.cpython-312.pyc +0 -0
  62. package/src/zexus/evaluator/__pycache__/core.cpython-312.pyc +0 -0
  63. package/src/zexus/evaluator/__pycache__/expressions.cpython-312.pyc +0 -0
  64. package/src/zexus/evaluator/__pycache__/functions.cpython-312.pyc +0 -0
  65. package/src/zexus/evaluator/__pycache__/resource_limiter.cpython-312.pyc +0 -0
  66. package/src/zexus/evaluator/__pycache__/statements.cpython-312.pyc +0 -0
  67. package/src/zexus/evaluator/__pycache__/unified_execution.cpython-312.pyc +0 -0
  68. package/src/zexus/evaluator/__pycache__/utils.cpython-312.pyc +0 -0
  69. package/src/zexus/evaluator/bytecode_compiler.py +441 -37
  70. package/src/zexus/evaluator/core.py +560 -49
  71. package/src/zexus/evaluator/expressions.py +122 -49
  72. package/src/zexus/evaluator/functions.py +417 -16
  73. package/src/zexus/evaluator/statements.py +521 -118
  74. package/src/zexus/evaluator/unified_execution.py +573 -72
  75. package/src/zexus/evaluator/utils.py +14 -2
  76. package/src/zexus/event_loop.py +186 -0
  77. package/src/zexus/lexer.py +742 -486
  78. package/src/zexus/lsp/__init__.py +1 -1
  79. package/src/zexus/lsp/definition_provider.py +163 -9
  80. package/src/zexus/lsp/server.py +22 -8
  81. package/src/zexus/lsp/symbol_provider.py +182 -9
  82. package/src/zexus/module_cache.py +237 -9
  83. package/src/zexus/object.py +64 -6
  84. package/src/zexus/parser/__pycache__/parser.cpython-312.pyc +0 -0
  85. package/src/zexus/parser/__pycache__/strategy_context.cpython-312.pyc +0 -0
  86. package/src/zexus/parser/__pycache__/strategy_structural.cpython-312.pyc +0 -0
  87. package/src/zexus/parser/parser.py +786 -285
  88. package/src/zexus/parser/strategy_context.py +407 -66
  89. package/src/zexus/parser/strategy_structural.py +117 -19
  90. package/src/zexus/persistence.py +15 -1
  91. package/src/zexus/renderer/__init__.py +15 -0
  92. package/src/zexus/renderer/__pycache__/__init__.cpython-312.pyc +0 -0
  93. package/src/zexus/renderer/__pycache__/backend.cpython-312.pyc +0 -0
  94. package/src/zexus/renderer/__pycache__/canvas.cpython-312.pyc +0 -0
  95. package/src/zexus/renderer/__pycache__/color_system.cpython-312.pyc +0 -0
  96. package/src/zexus/renderer/__pycache__/layout.cpython-312.pyc +0 -0
  97. package/src/zexus/renderer/__pycache__/main_renderer.cpython-312.pyc +0 -0
  98. package/src/zexus/renderer/__pycache__/painter.cpython-312.pyc +0 -0
  99. package/src/zexus/renderer/tk_backend.py +208 -0
  100. package/src/zexus/renderer/web_backend.py +260 -0
  101. package/src/zexus/runtime/__pycache__/__init__.cpython-312.pyc +0 -0
  102. package/src/zexus/runtime/__pycache__/async_runtime.cpython-312.pyc +0 -0
  103. package/src/zexus/runtime/__pycache__/load_manager.cpython-312.pyc +0 -0
  104. package/src/zexus/runtime/file_flags.py +137 -0
  105. package/src/zexus/safety/__pycache__/__init__.cpython-312.pyc +0 -0
  106. package/src/zexus/safety/__pycache__/memory_safety.cpython-312.pyc +0 -0
  107. package/src/zexus/security.py +424 -34
  108. package/src/zexus/stdlib/fs.py +23 -18
  109. package/src/zexus/stdlib/http.py +289 -186
  110. package/src/zexus/stdlib/sockets.py +207 -163
  111. package/src/zexus/stdlib/websockets.py +282 -0
  112. package/src/zexus/stdlib_integration.py +369 -2
  113. package/src/zexus/strategy_recovery.py +6 -3
  114. package/src/zexus/type_checker.py +423 -0
  115. package/src/zexus/virtual_filesystem.py +189 -2
  116. package/src/zexus/vm/__init__.py +113 -3
  117. package/src/zexus/vm/__pycache__/async_optimizer.cpython-312.pyc +0 -0
  118. package/src/zexus/vm/__pycache__/bytecode.cpython-312.pyc +0 -0
  119. package/src/zexus/vm/__pycache__/bytecode_converter.cpython-312.pyc +0 -0
  120. package/src/zexus/vm/__pycache__/cache.cpython-312.pyc +0 -0
  121. package/src/zexus/vm/__pycache__/compiler.cpython-312.pyc +0 -0
  122. package/src/zexus/vm/__pycache__/gas_metering.cpython-312.pyc +0 -0
  123. package/src/zexus/vm/__pycache__/jit.cpython-312.pyc +0 -0
  124. package/src/zexus/vm/__pycache__/parallel_vm.cpython-312.pyc +0 -0
  125. package/src/zexus/vm/__pycache__/vm.cpython-312.pyc +0 -0
  126. package/src/zexus/vm/async_optimizer.py +14 -1
  127. package/src/zexus/vm/binary_bytecode.py +659 -0
  128. package/src/zexus/vm/bytecode.py +28 -1
  129. package/src/zexus/vm/bytecode_converter.py +26 -12
  130. package/src/zexus/vm/cabi.c +1985 -0
  131. package/src/zexus/vm/cabi.cpython-312-x86_64-linux-gnu.so +0 -0
  132. package/src/zexus/vm/cabi.h +127 -0
  133. package/src/zexus/vm/cache.py +557 -17
  134. package/src/zexus/vm/compiler.py +703 -5
  135. package/src/zexus/vm/fastops.c +15743 -0
  136. package/src/zexus/vm/fastops.cpython-312-x86_64-linux-gnu.so +0 -0
  137. package/src/zexus/vm/fastops.pyx +288 -0
  138. package/src/zexus/vm/gas_metering.py +50 -9
  139. package/src/zexus/vm/jit.py +83 -2
  140. package/src/zexus/vm/native_jit_backend.py +1816 -0
  141. package/src/zexus/vm/native_runtime.cpp +1388 -0
  142. package/src/zexus/vm/native_runtime.cpython-312-x86_64-linux-gnu.so +0 -0
  143. package/src/zexus/vm/optimizer.py +161 -11
  144. package/src/zexus/vm/parallel_vm.py +118 -42
  145. package/src/zexus/vm/peephole_optimizer.py +82 -4
  146. package/src/zexus/vm/profiler.py +38 -18
  147. package/src/zexus/vm/register_allocator.py +16 -5
  148. package/src/zexus/vm/register_vm.py +8 -5
  149. package/src/zexus/vm/vm.py +3411 -573
  150. package/src/zexus/vm/wasm_compiler.py +658 -0
  151. package/src/zexus/zexus_ast.py +63 -11
  152. package/src/zexus/zexus_token.py +13 -5
  153. package/src/zexus/zpm/installer.py +55 -15
  154. package/src/zexus/zpm/package_manager.py +1 -1
  155. package/src/zexus/zpm/registry.py +257 -28
  156. package/src/zexus.egg-info/PKG-INFO +7 -4
  157. package/src/zexus.egg-info/SOURCES.txt +116 -9
  158. package/src/zexus.egg-info/entry_points.txt +1 -0
  159. package/src/zexus.egg-info/requires.txt +4 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.7.1-FF6B35?style=for-the-badge)
5
+ ![Zexus Logo](https://img.shields.io/badge/Zexus-v1.7.2-FF6B35?style=for-the-badge)
6
6
  [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
7
7
  [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=for-the-badge&logo=python)](https://python.org)
8
8
  [![GitHub](https://img.shields.io/badge/GitHub-Zaidux/zexus--interpreter-181717?style=for-the-badge&logo=github)](https://github.com/Zaidux/zexus-interpreter)
@@ -67,9 +67,9 @@ Zexus is a next-generation, general-purpose programming language designed for se
67
67
 
68
68
  ---
69
69
 
70
- ## 🎉 What's New in v1.7.1
70
+ ## 🎉 What's New in v1.7.2
71
71
 
72
- ### Latest Features (v1.7.1)
72
+ ### Latest Features (v1.7.2)
73
73
 
74
74
  ✅ **FIND Keyword** - Declarative project search that resolves exact module paths with scope filtering and smart suggestions
75
75
  ✅ **LOAD Keyword & Manager** - Provider-aware configuration loader with built-in ENV, JSON, and YAML support plus caching
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zexus",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "A modern, security-first programming language with blockchain support",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,7 @@
1
+ """Project `src` package.
2
+
3
+ This file exists to support tests/imports that use the form
4
+ `src.zexus...` while preserving the standard `zexus...` import style.
5
+
6
+ The actual application code lives under `src/zexus/`.
7
+ """
@@ -4,7 +4,7 @@ Zexus Programming Language
4
4
  A declarative, intent-based programming language for modern applications.
5
5
  """
6
6
 
7
- __version__ = "1.7.1"
7
+ __version__ = "1.7.2"
8
8
  __author__ = "Ziver Labs"
9
9
  __email__ = "ziverofficial567@gmail.com"
10
10
 
@@ -32,10 +32,25 @@ class TypeParameter:
32
32
  return self.name == other.name
33
33
 
34
34
  def satisfies_bounds(self, type_spec: 'TypeSpec') -> bool:
35
- """Check if type satisfies bounds."""
35
+ """Check if type satisfies bounds.
36
+
37
+ Verifies that type_spec is compatible with all upper bounds
38
+ defined on this type parameter.
39
+ """
36
40
  if not self.bounds:
37
41
  return True
38
- # Simplified - would need full subtype checking
42
+ for bound in self.bounds:
43
+ # If both are AdvancedTypeSpec, use structural compatibility
44
+ if hasattr(type_spec, 'is_assignable_to') and hasattr(bound, 'is_assignable_to'):
45
+ if not type_spec.is_assignable_to(bound):
46
+ return False
47
+ # If both have base_type, compare base types
48
+ elif hasattr(type_spec, 'base_type') and hasattr(bound, 'base_type'):
49
+ if type_spec.base_type != bound.base_type:
50
+ return False
51
+ # String-based comparison fallback
52
+ elif str(type_spec) != str(bound):
53
+ return False
39
54
  return True
40
55
 
41
56
 
@@ -9,6 +9,10 @@ Features:
9
9
  - Gas tracking and execution limits
10
10
  - Cryptographic primitives (hashing, signatures)
11
11
  - Smart contract execution environment
12
+ - Real blockchain: chain, blocks, mempool
13
+ - P2P networking with peer discovery
14
+ - Pluggable consensus (PoW, PoA, PoS)
15
+ - Full node with mining and sync
12
16
  """
13
17
 
14
18
  from .ledger import Ledger, LedgerManager, get_ledger_manager
@@ -19,6 +23,170 @@ from .transaction import (
19
23
  )
20
24
  from .crypto import CryptoPlugin, register_crypto_builtins
21
25
 
26
+ # Real blockchain infrastructure
27
+ from .chain import (
28
+ Block, BlockHeader, Transaction as ChainTransaction,
29
+ TransactionReceipt, Chain, Mempool
30
+ )
31
+ from .storage import (
32
+ StorageBackend, SQLiteBackend, LevelDBBackend, RocksDBBackend,
33
+ MemoryBackend, get_storage_backend, register_backend,
34
+ )
35
+ from .network import P2PNetwork, Message, MessageType, PeerInfo, PeerReputationManager
36
+ from .consensus import (
37
+ ConsensusEngine, ProofOfWork, ProofOfAuthority, ProofOfStake,
38
+ BFTConsensus, BFTMessage, BFTPhase, BFTRoundState,
39
+ create_consensus
40
+ )
41
+ from .node import BlockchainNode, NodeConfig
42
+
43
+ # JSON-RPC server (optional — requires aiohttp)
44
+ try:
45
+ from .rpc import RPCServer, RPCError, RPCErrorCode, RPCMethodRegistry
46
+ _RPC_AVAILABLE = True
47
+ except ImportError:
48
+ _RPC_AVAILABLE = False
49
+
50
+ # Contract VM bridge (connects VM opcodes to real chain state)
51
+ try:
52
+ from .contract_vm import ContractVM, ContractExecutionReceipt, ContractStateAdapter
53
+ _CONTRACT_VM_AVAILABLE = True
54
+ except ImportError:
55
+ _CONTRACT_VM_AVAILABLE = False
56
+
57
+ # Multichain / cross-chain bridge infrastructure
58
+ try:
59
+ from .multichain import (
60
+ ChainRouter,
61
+ BridgeRelay,
62
+ BridgeContract,
63
+ CrossChainMessage,
64
+ MerkleProofEngine,
65
+ MessageStatus,
66
+ )
67
+ _MULTICHAIN_AVAILABLE = True
68
+ except ImportError:
69
+ _MULTICHAIN_AVAILABLE = False
70
+
71
+ # Event indexing & log filtering
72
+ try:
73
+ from .events import EventIndex, EventLog, LogFilter, BloomFilter
74
+ _EVENTS_AVAILABLE = True
75
+ except ImportError:
76
+ _EVENTS_AVAILABLE = False
77
+
78
+ # Merkle Patricia Trie
79
+ try:
80
+ from .mpt import MerklePatriciaTrie, StateTrie, TrieNode, NodeType
81
+ _MPT_AVAILABLE = True
82
+ except ImportError:
83
+ _MPT_AVAILABLE = False
84
+
85
+ # HD Wallet & Keystore
86
+ try:
87
+ from .wallet import (
88
+ HDWallet, Account, Keystore, ExtendedKey,
89
+ generate_mnemonic, validate_mnemonic, mnemonic_to_seed,
90
+ )
91
+ _WALLET_AVAILABLE = True
92
+ except ImportError:
93
+ _WALLET_AVAILABLE = False
94
+
95
+ # Token Standards (ZX-20, ZX-721, ZX-1155)
96
+ try:
97
+ from .tokens import (
98
+ ZX20Token, ZX20Interface,
99
+ ZX721Token, ZX721Interface,
100
+ ZX1155Token, ZX1155Interface,
101
+ TokenEvent, TransferEvent, ApprovalEvent,
102
+ TransferSingleEvent, TransferBatchEvent, ApprovalForAllEvent,
103
+ )
104
+ _TOKENS_AVAILABLE = True
105
+ except ImportError:
106
+ _TOKENS_AVAILABLE = False
107
+
108
+ # Upgradeable Contracts & Chain Governance
109
+ try:
110
+ from .upgradeable import (
111
+ ProxyContract,
112
+ ImplementationRecord,
113
+ UpgradeManager,
114
+ ChainUpgradeGovernance,
115
+ ChainUpgradeProposal,
116
+ ProposalStatus,
117
+ ProposalType,
118
+ UpgradeEvent,
119
+ UpgradeEventType,
120
+ )
121
+ _UPGRADEABLE_AVAILABLE = True
122
+ except ImportError:
123
+ _UPGRADEABLE_AVAILABLE = False
124
+
125
+ # Formal Verification Engine
126
+ try:
127
+ from .verification import (
128
+ FormalVerifier,
129
+ VerificationLevel,
130
+ VerificationReport,
131
+ VerificationFinding,
132
+ Severity,
133
+ FindingCategory,
134
+ StructuralVerifier,
135
+ InvariantVerifier,
136
+ PropertyVerifier,
137
+ TaintAnalyzer,
138
+ AnnotationParser,
139
+ Invariant,
140
+ ContractProperty,
141
+ )
142
+ _VERIFICATION_AVAILABLE = True
143
+ except ImportError:
144
+ _VERIFICATION_AVAILABLE = False
145
+
146
+ # Execution Accelerator
147
+ try:
148
+ from .accelerator import (
149
+ ExecutionAccelerator,
150
+ AOTCompiler,
151
+ InlineCache,
152
+ NumericFastPath,
153
+ WASMCache,
154
+ BatchExecutor,
155
+ TxBatchResult,
156
+ CompiledAction,
157
+ )
158
+ _ACCELERATOR_AVAILABLE = True
159
+ except ImportError:
160
+ _ACCELERATOR_AVAILABLE = False
161
+
162
+ # Production monitoring
163
+ try:
164
+ from .monitoring import NodeMetrics, MetricsServer
165
+ _MONITORING_AVAILABLE = True
166
+ except ImportError:
167
+ _MONITORING_AVAILABLE = False
168
+
169
+ # Rust native execution core
170
+ try:
171
+ from .rust_bridge import RustCoreBridge, rust_core_available
172
+ _RUST_CORE_AVAILABLE = rust_core_available()
173
+ except ImportError:
174
+ _RUST_CORE_AVAILABLE = False
175
+
176
+ # Multiprocess executor (GIL-free parallelism)
177
+ try:
178
+ from .multiprocess_executor import MultiProcessBatchExecutor, MPBatchResult
179
+ _MULTIPROCESS_AVAILABLE = True
180
+ except ImportError:
181
+ _MULTIPROCESS_AVAILABLE = False
182
+
183
+ # Load testing framework
184
+ try:
185
+ from .loadtest import LoadTestRunner, LoadProfile, LoadTestReport, quick_benchmark
186
+ _LOADTEST_AVAILABLE = True
187
+ except ImportError:
188
+ _LOADTEST_AVAILABLE = False
189
+
22
190
  __all__ = [
23
191
  # Ledger
24
192
  'Ledger',
@@ -37,4 +205,247 @@ __all__ = [
37
205
  # Crypto
38
206
  'CryptoPlugin',
39
207
  'register_crypto_builtins',
208
+
209
+ # Chain & Blocks
210
+ 'Block',
211
+ 'BlockHeader',
212
+ 'ChainTransaction',
213
+ 'TransactionReceipt',
214
+ 'Chain',
215
+ 'Mempool',
216
+
217
+ # Storage Backends
218
+ 'StorageBackend',
219
+ 'SQLiteBackend',
220
+ 'LevelDBBackend',
221
+ 'RocksDBBackend',
222
+ 'MemoryBackend',
223
+ 'get_storage_backend',
224
+ 'register_backend',
225
+
226
+ # P2P Network
227
+ 'P2PNetwork',
228
+ 'Message',
229
+ 'MessageType',
230
+ 'PeerInfo',
231
+
232
+ # Consensus
233
+ 'ConsensusEngine',
234
+ 'ProofOfWork',
235
+ 'ProofOfAuthority',
236
+ 'ProofOfStake',
237
+ 'BFTConsensus',
238
+ 'BFTMessage',
239
+ 'BFTPhase',
240
+ 'BFTRoundState',
241
+ 'create_consensus',
242
+
243
+ # Node
244
+ 'BlockchainNode',
245
+ 'NodeConfig',
246
+
247
+ # RPC Server
248
+ 'RPCServer',
249
+ 'RPCError',
250
+ 'RPCErrorCode',
251
+ 'RPCMethodRegistry',
252
+
253
+ # Contract VM
254
+ 'ContractVM',
255
+ 'ContractExecutionReceipt',
256
+ 'ContractStateAdapter',
257
+
258
+ # Multichain / Bridge
259
+ 'ChainRouter',
260
+ 'BridgeRelay',
261
+ 'BridgeContract',
262
+ 'CrossChainMessage',
263
+ 'MerkleProofEngine',
264
+ 'MessageStatus',
265
+
266
+ # Event Indexing
267
+ 'EventIndex',
268
+ 'EventLog',
269
+ 'LogFilter',
270
+ 'BloomFilter',
271
+
272
+ # Merkle Patricia Trie
273
+ 'MerklePatriciaTrie',
274
+ 'StateTrie',
275
+ 'TrieNode',
276
+ 'NodeType',
277
+
278
+ # HD Wallet & Keystore
279
+ 'HDWallet',
280
+ 'Account',
281
+ 'Keystore',
282
+ 'ExtendedKey',
283
+ 'generate_mnemonic',
284
+ 'validate_mnemonic',
285
+ 'mnemonic_to_seed',
286
+
287
+ # Token Standards
288
+ 'ZX20Token',
289
+ 'ZX20Interface',
290
+ 'ZX721Token',
291
+ 'ZX721Interface',
292
+ 'ZX1155Token',
293
+ 'ZX1155Interface',
294
+ 'TokenEvent',
295
+ 'TransferEvent',
296
+ 'ApprovalEvent',
297
+ 'TransferSingleEvent',
298
+ 'TransferBatchEvent',
299
+ 'ApprovalForAllEvent',
300
+
301
+ # Upgradeable Contracts & Chain Governance
302
+ 'ProxyContract',
303
+ 'ImplementationRecord',
304
+ 'UpgradeManager',
305
+ 'ChainUpgradeGovernance',
306
+ 'ChainUpgradeProposal',
307
+ 'ProposalStatus',
308
+ 'ProposalType',
309
+ 'UpgradeEvent',
310
+ 'UpgradeEventType',
311
+
312
+ # Formal Verification
313
+ 'FormalVerifier',
314
+ 'VerificationLevel',
315
+ 'VerificationReport',
316
+ 'VerificationFinding',
317
+ 'Severity',
318
+ 'FindingCategory',
319
+ 'StructuralVerifier',
320
+ 'InvariantVerifier',
321
+ 'PropertyVerifier',
322
+ 'TaintAnalyzer',
323
+ 'AnnotationParser',
324
+ 'Invariant',
325
+ 'ContractProperty',
326
+
327
+ # Execution Accelerator
328
+ 'ExecutionAccelerator',
329
+ 'AOTCompiler',
330
+ 'InlineCache',
331
+ 'NumericFastPath',
332
+ 'WASMCache',
333
+ 'BatchExecutor',
334
+ 'TxBatchResult',
335
+ 'CompiledAction',
336
+
337
+ # Production Monitoring
338
+ 'NodeMetrics',
339
+ 'MetricsServer',
340
+
341
+ # Rust Native Execution Core
342
+ 'RustCoreBridge',
343
+ 'rust_core_available',
344
+
345
+ # Multiprocess Executor
346
+ 'MultiProcessBatchExecutor',
347
+ 'MPBatchResult',
348
+
349
+ # Load Testing
350
+ 'LoadTestRunner',
351
+ 'LoadProfile',
352
+ 'LoadTestReport',
353
+ 'quick_benchmark',
354
+
355
+ # Dependency audit
356
+ 'check_dependencies',
40
357
  ]
358
+
359
+
360
+ # ── Dependency audit helper ──────────────────────────────────────────
361
+
362
+ import warnings as _warnings
363
+
364
+
365
+ def check_dependencies(verbose: bool = True) -> dict:
366
+ """Check optional blockchain dependencies and emit warnings.
367
+
368
+ Returns a dict mapping component names to their availability status.
369
+ When *verbose* is ``True`` (the default), a user-friendly summary is
370
+ printed and ``warnings.warn()`` is called for any missing component.
371
+
372
+ Usage::
373
+
374
+ from zexus.blockchain import check_dependencies
375
+ deps = check_dependencies()
376
+ """
377
+ status: dict = {}
378
+
379
+ # Rust native core
380
+ status["rust_core"] = _RUST_CORE_AVAILABLE
381
+ if not _RUST_CORE_AVAILABLE and verbose:
382
+ _warnings.warn(
383
+ "Rust execution core not compiled — throughput capped at "
384
+ "~500 TPS (Python GIL bound). Build it for 1800+ TPS:\n"
385
+ " cd rust_core/ && pip install maturin && maturin develop --release",
386
+ stacklevel=2,
387
+ )
388
+
389
+ # LevelDB
390
+ try:
391
+ import plyvel # noqa: F401
392
+ status["leveldb"] = True
393
+ except ImportError:
394
+ status["leveldb"] = False
395
+ if verbose:
396
+ _warnings.warn(
397
+ "plyvel not installed — LevelDBBackend unavailable. "
398
+ "Install: pip install plyvel (requires libleveldb-dev)",
399
+ stacklevel=2,
400
+ )
401
+
402
+ # RocksDB
403
+ try:
404
+ import rocksdb # noqa: F401 # type: ignore[import-untyped]
405
+ status["rocksdb"] = True
406
+ except ImportError:
407
+ status["rocksdb"] = False
408
+ if verbose:
409
+ _warnings.warn(
410
+ "python-rocksdb not installed — RocksDBBackend unavailable. "
411
+ "Install: pip install python-rocksdb (requires librocksdb-dev)",
412
+ stacklevel=2,
413
+ )
414
+
415
+ # aiohttp (for RPC server)
416
+ try:
417
+ import aiohttp # noqa: F401
418
+ status["aiohttp"] = True
419
+ except ImportError:
420
+ status["aiohttp"] = False
421
+ if verbose:
422
+ _warnings.warn(
423
+ "aiohttp not installed — RPCServer unavailable. "
424
+ "Install: pip install aiohttp",
425
+ stacklevel=2,
426
+ )
427
+
428
+ # Prometheus client (for monitoring)
429
+ try:
430
+ import prometheus_client # noqa: F401
431
+ status["prometheus"] = True
432
+ except ImportError:
433
+ status["prometheus"] = False
434
+ if verbose:
435
+ _warnings.warn(
436
+ "prometheus_client not installed — Prometheus metrics export "
437
+ "unavailable. Install: pip install prometheus-client",
438
+ stacklevel=2,
439
+ )
440
+
441
+ if verbose:
442
+ installed = [k for k, v in status.items() if v]
443
+ missing = [k for k, v in status.items() if not v]
444
+ print(f"Zexus Blockchain dependencies: "
445
+ f"{len(installed)} available, {len(missing)} missing")
446
+ if missing:
447
+ print(f" Missing: {', '.join(missing)}")
448
+ if installed:
449
+ print(f" Available: {', '.join(installed)}")
450
+
451
+ return status