Skip to content

Commit f8c6203

Browse files
committed
Website: introduce future work with p2p evoluation and persistence
1 parent bc7a94d commit f8c6203

File tree

5 files changed

+687
-0
lines changed

5 files changed

+687
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
sidebar_position: 1
3+
title: Overview
4+
description:
5+
Overview of planned enhancements and design proposals for the Mina Rust node
6+
slug: /developers/future-work
7+
---
8+
9+
# Future Work
10+
11+
This section outlines planned enhancements and design proposals for the Mina
12+
Rust node that are not yet implemented but are critical for the project's
13+
continued development and mainnet readiness.
14+
15+
## Overview
16+
17+
The Mina Rust node is an active development project with several key areas
18+
identified for future enhancement. These proposals represent thoughtful designs
19+
for addressing current limitations and preparing the node for production
20+
deployment at scale.
21+
22+
## Key Areas
23+
24+
### P2P Networking Evolution
25+
26+
The [P2P Evolution Plan](p2p-evolution) builds on the successful pull-based
27+
design already implemented for webnodes. Key planned improvements include:
28+
29+
- **QUIC Transport Integration**: Adding QUIC as an alternative transport to
30+
WebRTC for improved performance and reduced complexity
31+
- **Block Propagation Optimization**: Reducing bandwidth usage by sending only
32+
block headers and missing data
33+
- **OCaml Node Integration**: Potential unification of networking layers across
34+
Mina implementations
35+
36+
### Persistent Storage
37+
38+
The [Persistence Design](persistence-design) addresses one of the most critical
39+
requirements for mainnet readiness. Current challenges include:
40+
41+
- **Memory Usage**: The entire ledger is currently kept in memory, creating
42+
scalability issues
43+
- **Startup Time**: Nodes must reconstruct the full ledger, which is
44+
time-consuming
45+
- **SNARK Verification**: Redundant verification work across blocks and pools
46+
47+
## Implementation Status
48+
49+
**Important**: All items in this section are design proposals only and are not
50+
yet implemented. These documents serve as:
51+
52+
- **Technical Specifications**: Detailed designs for future implementation
53+
- **Discussion Starting Points**: Basis for technical discussions and
54+
refinements
55+
- **Roadmap Guidance**: Priority areas for development effort
56+
57+
## Contribution
58+
59+
These design proposals benefit from community review and input. Developers
60+
interested in contributing to these areas should:
61+
62+
1. **Review the designs** thoroughly to understand the proposed approaches
63+
2. **Check the
64+
[project dashboard](https://github.com/orgs/o1-labs/projects/24/)** for
65+
current development status and active work items
66+
3. **Provide feedback** on technical feasibility and implementation details
67+
4. **Participate in discussions** about priorities and trade-offs
68+
5. **Contribute to implementation** when development begins
69+
70+
The designs may evolve based on community feedback, technical constraints, and
71+
changing requirements as the Mina ecosystem develops.
72+
73+
## Timeline Considerations
74+
75+
While these documents provide detailed implementation plans, actual development
76+
timelines depend on:
77+
78+
- **Resource allocation** and team priorities
79+
- **Community needs** and feedback
80+
- **Technical dependencies** and prerequisites
81+
- **Coordination requirements** with other Mina implementations
82+
83+
The goal is to ensure these enhancements are implemented thoughtfully and with
84+
proper consideration for the broader Mina ecosystem.

website/docs/developers/getting-started.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ import NixDevelop from "!!raw-loader!./scripts/setup/nix-develop.sh";
2323
Welcome to Mina Rust Node development! This guide will help you set up your
2424
development environment and build the Mina Rust Node from source.
2525

26+
This documentation covers the current implementation, architecture, and
27+
networking approaches. The [**Future Work**](future-work) section outlines
28+
planned enhancements and design proposals for upcoming features like persistent
29+
storage and P2P protocol evolution that are not yet implemented but are critical
30+
for the node's continued development and mainnet readiness.
31+
2632
## Prerequisites
2733

2834
### System Requirements
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
---
2+
sidebar_position: 5
3+
title: P2P Evolution Plan
4+
description: Evolution plan for Mina's P2P networking layer
5+
slug: /developers/p2p-evolution
6+
---
7+
8+
# P2P Layer Evolution Plan
9+
10+
This document outlines the evolution plan for Mina's P2P networking layer,
11+
building on the successful pull-based design already implemented for the Mina
12+
Rust node webnodes. The idea of using QUIC as a transport was originally
13+
proposed by George in his "Networking layer 2.0" document.
14+
15+
**Status**: The pull-based P2P protocol is implemented and operational. This
16+
document proposes enhancements including QUIC transport, block propagation
17+
optimizations, and integration with the OCaml node to create a unified
18+
networking layer across all Mina implementations. Coordination with OCaml Mina
19+
team required for ecosystem-wide adoption.
20+
21+
## Current State
22+
23+
### The Problem: Divergent P2P Architectures
24+
25+
The Mina ecosystem currently has divergent P2P implementations:
26+
27+
1. **Mina (OCaml) nodes**
28+
- Use libp2p exclusively via external Golang helper process (`libp2p_helper`)
29+
- Push-based GossipSub protocol
30+
- Known weaknesses in network performance and scalability
31+
32+
2. **The Mina Rust node**
33+
- Support both libp2p (for OCaml compatibility) AND pull-based WebRTC
34+
- Must internally normalize between push and pull models, adding complexity
35+
- Webnodes use WebRTC exclusively and require Rust nodes as bridges to libp2p
36+
network
37+
- Maintenance burden of supporting two different protocol designs
38+
39+
This creates significant complexity:
40+
41+
- The Mina Rust node maintains two protocol implementations
42+
- Webnodes cannot directly communicate with OCaml nodes
43+
- Different security and performance characteristics
44+
- Inconsistent behavior and debugging challenges
45+
46+
## Vision: Unified Pull-Based P2P Layer
47+
48+
The goal is to evolve the Mina Rust node's pull-based P2P design to improve
49+
webnode networking immediately and potentially become the universal networking
50+
layer for all Mina nodes (both Rust and OCaml), with multiple transport options.
51+
Full ecosystem adoption would require coordination and agreement with the OCaml
52+
Mina team.
53+
54+
### Core Design Principles
55+
56+
The pull-based model addresses fundamental problems in traditional push-based
57+
systems:
58+
59+
#### Problems with Push-Based Systems
60+
61+
- **Resource Exhaustion**: Message queues grow unboundedly during high traffic
62+
- **Message Loss**: Dropped messages break eventual consistency
63+
- **DDOS Vulnerability**: Attackers can flood nodes with messages
64+
- **Fairness Issues**: Some peers can monopolize resources
65+
66+
#### Pull-Based Advantages
67+
68+
- **Flow Control**: Recipients control message flow through permits
69+
- **Resource Protection**: Processing required before requesting next message
70+
- **Eventual Consistency**: Guaranteed message delivery and processing
71+
- **Fairness**: Equal resource allocation across peers
72+
73+
## Evolution Phases
74+
75+
### Phase 1: Enhanced WebRTC Implementation (Current)
76+
77+
**Status**: ✅ Complete
78+
79+
- Pull-based messaging with WebRTC transport
80+
- Multiple signaling methods (HTTP, relay-based)
81+
- Channel isolation per protocol type
82+
- Efficient pool propagation
83+
- NAT traversal and encryption
84+
85+
### Phase 2: QUIC Transport Integration
86+
87+
**Goals**:
88+
89+
- Add QUIC as alternative transport to WebRTC
90+
- Maintain pull-based protocol semantics
91+
- Improve performance and reduce complexity
92+
93+
**Benefits**:
94+
95+
- **Simplified NAT Traversal**: QUIC handles NAT better than WebRTC setup
96+
- **Lower Latency**: Reduced connection establishment time
97+
- **Better Multiplexing**: Native stream multiplexing without complex setup
98+
- **Standardized Protocol**: Well-defined, battle-tested transport
99+
100+
**Implementation**:
101+
102+
- QUIC streams map to current WebRTC data channels
103+
- Same pull-based messaging protocol
104+
- Gradual rollout alongside existing WebRTC
105+
106+
### Phase 3: Block Propagation Optimization
107+
108+
**Current Challenge**: Blocks contain redundant data (transactions, SNARKs)
109+
already in local pools.
110+
111+
**Solution**:
112+
113+
- Send block headers + merkle proofs + missing data only
114+
- Nodes reconstruct full blocks from local pools
115+
- Dramatic reduction in block transmission size
116+
- Faster propagation across network
117+
118+
**Benefits**:
119+
120+
- Reduced bandwidth usage
121+
- Lower memory overhead
122+
- Faster block propagation
123+
- Improved scalability
124+
125+
### Phase 4: OCaml Node Integration (Future)
126+
127+
**Vision**: Enable OCaml nodes to use pull-based protocol
128+
129+
**Approach Options**:
130+
131+
1. **FFI Integration**
132+
- Bind Rust P2P implementation to OCaml
133+
- Gradual migration from libp2p
134+
- Maintains OCaml node architecture
135+
136+
2. **Protocol Standardization**
137+
- Define language-agnostic pull-based protocol specification
138+
- OCaml native implementation
139+
- Both implementations interoperate
140+
141+
3. **Hybrid Bridge**
142+
- Enhanced bridge between protocols
143+
- Improved push-to-pull translation
144+
- Maintains backward compatibility
145+
146+
## Technical Implementation Details
147+
148+
### Transport Layer Abstraction
149+
150+
```rust
151+
trait Transport {
152+
async fn connect(&self, addr: Address) -> Result<Connection>;
153+
async fn listen(&self, addr: Address) -> Result<Listener>;
154+
}
155+
156+
impl Transport for WebRtcTransport { ... }
157+
impl Transport for QuicTransport { ... }
158+
```
159+
160+
### Protocol Compatibility
161+
162+
Pull-based protocol remains transport-agnostic:
163+
164+
- Same message formats
165+
- Same flow control semantics
166+
- Same channel abstractions
167+
- Transport selection via configuration
168+
169+
### Migration Strategy
170+
171+
1. **Parallel Operation**: Run both transports simultaneously
172+
2. **Gradual Adoption**: Nodes advertise transport capabilities
173+
3. **Preference System**: Prefer QUIC when both peers support it
174+
4. **Fallback Support**: Maintain WebRTC for compatibility
175+
176+
## Performance Expectations
177+
178+
### QUIC Benefits Over WebRTC
179+
180+
- **Connection Time**: ~50% reduction in handshake time
181+
- **Memory Usage**: Lower per-connection overhead
182+
- **CPU Usage**: Reduced encryption/decryption overhead
183+
- **Multiplexing**: More efficient stream management
184+
185+
### Block Propagation Improvements
186+
187+
- **Size Reduction**: 60-80% smaller block messages
188+
- **Propagation Speed**: 2-3x faster across network
189+
- **Resource Usage**: Significant reduction in bandwidth and parsing
190+
191+
## Ecosystem Integration
192+
193+
### Webnode Improvements
194+
195+
- Direct QUIC connections without complex WebRTC setup
196+
- Better performance behind restrictive networks
197+
- Simplified debugging and monitoring
198+
199+
### OCaml Node Benefits (Future)
200+
201+
- Access to optimized pull-based protocol
202+
- Improved network performance
203+
- Unified P2P behavior across implementations
204+
205+
### Network-Wide Effects
206+
207+
- More efficient resource utilization
208+
- Better resistance to network attacks
209+
- Improved consistency guarantees
210+
- Enhanced scalability
211+
212+
## Implementation Timeline
213+
214+
### Immediate (Current Release Cycle)
215+
216+
- ✅ WebRTC pull-based implementation
217+
- ✅ Multi-transport abstraction foundation
218+
219+
### Short Term (Next 2-3 Releases)
220+
221+
- QUIC transport implementation
222+
- Block propagation optimization
223+
- Performance benchmarking
224+
225+
### Medium Term (6-12 Months)
226+
227+
- Production QUIC deployment
228+
- Advanced block reconstruction
229+
- Protocol refinements based on real-world usage
230+
231+
### Long Term (12+ Months)
232+
233+
- OCaml integration exploration
234+
- Protocol standardization
235+
- Ecosystem-wide adoption planning
236+
237+
## Success Metrics
238+
239+
### Technical Metrics
240+
241+
- Connection establishment time reduction
242+
- Block propagation latency improvement
243+
- Bandwidth usage reduction
244+
- Memory and CPU usage optimization
245+
246+
### Network Health
247+
248+
- Improved consensus convergence time
249+
- Reduced network partitions
250+
- Better handling of high-traffic periods
251+
- Enhanced resistance to attacks
252+
253+
### Developer Experience
254+
255+
- Simplified debugging
256+
- Unified protocol behavior
257+
- Better monitoring and observability
258+
- Reduced maintenance burden
259+
260+
## Risks and Mitigation
261+
262+
### Technical Risks
263+
264+
- **QUIC Implementation Complexity**: Mitigate with gradual rollout and
265+
extensive testing
266+
- **Transport Compatibility**: Maintain WebRTC fallback during transition
267+
- **Protocol Changes**: Ensure backward compatibility during evolution
268+
269+
### Ecosystem Risks
270+
271+
- **Adoption Resistance**: Demonstrate clear benefits before proposing ecosystem
272+
changes
273+
- **Fragmentation**: Maintain compatibility with existing implementations
274+
- **Coordination Complexity**: Start with Mina Rust node-only improvements
275+
276+
### Mitigation Strategies
277+
278+
- Incremental rollout with feature flags
279+
- Comprehensive testing across different network conditions
280+
- Close coordination with stakeholders
281+
- Clear migration paths and documentation
282+
283+
## Conclusion
284+
285+
The P2P layer evolution builds on the Mina Rust node's successful pull-based
286+
design to create a more efficient, secure, and unified networking layer for the
287+
Mina ecosystem. While immediate improvements benefit the Mina Rust node and
288+
webnodes, the long-term vision of ecosystem-wide adoption would require
289+
coordination with the OCaml Mina team and careful migration planning.
290+
291+
The phased approach allows for immediate improvements while keeping future
292+
integration possibilities open, ensuring that the Mina network can evolve toward
293+
better performance and consistency regardless of implementation language.

0 commit comments

Comments
 (0)