Skip to content

Commit a913f79

Browse files
tizocdannywillems
authored andcommitted
docs(handover): Add core/summary.md
1 parent 2e8028d commit a913f79

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

core/summary.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Core Crate Summary
2+
3+
The core crate contains foundational infrastructure and shared utilities that all other crates depend on. We use this crate for shared types, utilities, and abstractions that need to be accessible across the entire project.
4+
5+
## What This Crate Contains
6+
7+
- **Substate System** (`src/substate.rs`): Type-safe access patterns for Redux state slicing and mutation control
8+
- **WASM Threading** (`src/thread.rs`): Main thread task delegation system needed for browser environments
9+
- **Network Configuration** (`src/network.rs`): Static network constants and config for mainnet/devnet
10+
- **Core Domain Types**: Basic blockchain types (blocks, SNARKs, requests, consensus) that everything uses
11+
- `src/block/` - Block structures and validation
12+
- `src/snark/` - SNARK work and job management
13+
- `src/transaction/` - Transaction helper types and metadata
14+
- `src/consensus.rs` - Consensus types and fork decision logic
15+
- **Request Management** (`src/requests/`): Type-safe request ID generation and lifecycle tracking
16+
- **Channel Wrappers** (`src/channels.rs`): Abstractions over flume channels for message passing
17+
- **Distributed Pool** (`src/distributed_pool.rs`): BTreeMap-based data structure for network-synchronized state
18+
19+
## Technical Debt and Issues
20+
21+
### Medium Priority
22+
23+
**Hardcoded Network Constants**
24+
- Fork constants are hardcoded in the `NetworkConfig` struct
25+
- Impact: Can't deploy flexibly, need code changes for network updates
26+
27+
### Low Priority
28+
29+
**Unsafe Redux Access**
30+
- `unsafe_get_state()` method in `Substate` struct breaks Redux safety
31+
- Only used by the transaction pool state machine which requires refactoring
32+
33+
**Inconsistent Error Handling**
34+
- Various instances of `panic!`, `unwrap()`, or `expect()` calls throughout core
35+
36+
## Known Limitations
37+
38+
1. **Network Config**: Can't dynamically configure network parameters without code changes
39+
2. **WASM Constraints**: Browser limitations require specialized threading patterns

docs/handover/component-summaries.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ technical debt analysis and implementation notes.
77
## Component Tree
88

99
- **openmina/**
10+
- **core/**
11+
- [summary.md](../../core/summary.md)
12+
- **ledger/**
13+
- [summary.md](../../ledger/summary.md)
1014
- **node/**
1115
- **src/**
1216
- [summary.md](../../node/src/summary.md)

0 commit comments

Comments
 (0)