How commune-ai/subspace works
Main Components
a) Core Node Architecture:
• Runtime Environment (from /runtime)
• Network Layer (from node/src/service)
• Consensus Layer (referenced in README)
• RPC Interface (from node/src/rpc)
b) Pallet System:
• Subspace Pallet (core functionality)
• Governance Pallet
• Offworker Pallet
• Subnet Emission Pallet
• Faucet Pallet
c) External Interfaces:
• EVM Compatibility Layer (indicated by precompiles)
• RPC Endpoints
• P2P Network Interface
Component Relationships
• Data flow between pallets
• Communication paths between node components
• External interaction points
Specific Implementation Details
Create subsections for key features:
a) Consensus Mechanism:
• Interaction between node/src/service and pallets/subspace
• Subnet consensus components from pallets/subnet_emission
b) Network Layer:
• P2P communication
• Peer discovery
• Module advertising system
c) State Management:
• Runtime storage
• Chain state handling
• State transitions
Detailed Component Breakdown
For each major component, include:
a) Runtime (/runtime):
• Precompiles
• State transitions
• Block execution
b) Pallets:
• Subspace: Network management, staking, subnet handling
• Governance: DAO functionality, proposals, voting
• Offworker: Process management, profitability calculations
• Subnet Emission: Distribution, consensus, pricing
c) Node Services:
• Manual sealing
• Decryption services
• ETH compatibility layer
Additional Elements
Supporting components:
• Testing framework
• Benchmarking system
• Chain specification handling
• RPC interfaces
Notes
Annotations for:
• Key configuration points
• Scalability considerations
• Security boundaries
• Extension points
This approach will create a comprehensive yet understandable system design that accurately represents the Subspace blockchain's architecture while maintaining clarity about component relationships and data flow.