Skip to content

Commit 9aabaa2

Browse files
authored
Merge pull request #607 from openmina/docs/status-update
docs(status): Update status
2 parents a467f56 + 09e35c0 commit 9aabaa2

File tree

2 files changed

+224
-22
lines changed

2 files changed

+224
-22
lines changed

docs/testing/README.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Testing
2+
3+
## Table of contents
4+
5+
- [P2P tests](#p2p-tests)
6+
- [RPC](#rpc)
7+
- [Kademlia](#kademlia)
8+
- [Identify](#identify)
9+
- [Connection](#connection)
10+
- [Scenarios](#scenarios)
11+
- [Connection Discovery](#connection-discovery)
12+
- [P2P Connections](#p2p-connections)
13+
- [Kademlia](#p2p-kademlia)
14+
- [Pubsub](#p2p-pubsub)
15+
- [P2P Incoming](#p2p-incoming)
16+
- [P2p Outgoing](#p2p-outgoing)
17+
- [Single Node](#single-node)
18+
- [Multi Node](#multi-node)
19+
- [Record/Reply](#recordreplay)
20+
21+
## P2p tests
22+
23+
### [RPC](../../p2p/tests/rpc.rs)
24+
25+
* `rust_to_rust`: test that rust node can receive and send response to and from another rust node
26+
* `rust_to_many_rust_query`: tests that rust node can respond to many rust peers
27+
* `rust_to_many_rust`: test that rust node can send request to many rust peers
28+
* rpc tests, these tests check if node can correctly communicate over rpc:
29+
* `initial_peers`: check that initial peers are correctly sent and received
30+
* `best_tip_with_proof`: check that best tip is correctly sent and received
31+
* `ledger_query`: check that ledger query is sent correctly and received
32+
* `staged_ledger_aux_and_pending_coinbases_at_block`: fails with `attempt to subtract with overflow` in yamux
33+
* `block`: fails with `attempt to subtract with overflow` in yamux
34+
35+
### [Kademlia](../../p2p/tests/kademlia.rs)
36+
37+
* `kademlia_routing_table`: tests that node receives peers using kademlia
38+
* `kademlia_incoming_routing_table`: test that kademlia is updated with incoming peer
39+
* `bootstrap_no_peers`: test that kademlia bootstrap finished event if no peers are passed
40+
* `discovery_seed_single_peer`: test nodes discovery over kademlia
41+
* `discovery_seed_multiple_peers`: test node discovery and identify integration
42+
* `test_bad_node`: test that if node gives us invalid peers we handle it
43+
44+
### [Identify](../../p2p/tests/identify.rs)
45+
46+
* `rust_node_to_rust_node`: test if rust node can identify another rust node
47+
48+
### [Connection](../../p2p/tests/connection.rs)
49+
50+
* `rust_to_rust`: test if rust node can connect to rust node
51+
* `rust_to_libp2p`: test if out node can connect to rust libp2p
52+
* `libp2p_to_rust`: test if libp2p node can connect to rust node
53+
* `mutual_rust_to_rust`: test if one rust node can connect to second rust node, while second node is trying to connect to first one
54+
* `mutual_rust_to_rust_many`: test that many rust nodes can connect to each other at the same time
55+
* `mutual_rust_to_libp2p`: test if rust node can connect to libp2p node, while libp2p node is trying to connect to rust node
56+
* `mutual_rust_to_libp2p_port_reuse`: test that rust node can resolve mutual connection between itself and libp2p node, currently failing due to [Issue #399](https://github.com/openmina/openmina/issues/399)
57+
58+
## Scenarios
59+
60+
### [Connection Discovery](../../node/testing/src/scenarios/multi_node/connection_discovery.rs)
61+
62+
We want to test whether the Rust node can connect and discover peers from Ocaml node, and vice versa
63+
64+
* `RustToOCaml`:
65+
This test ensures that after the Rust node connects to an OCaml node with a known address, it adds its address to its Kademlia state. It also checks that the OCaml node has a peer with the correct peer_id and port corresponding to the Rust node.
66+
67+
* `OCamlToRust`:
68+
This test ensures that after an OCaml node connects to the Rust node, its address becomes available in the Rust node’s Kademlia state. It also checks whether the OCaml node has a peer with the correct `peer_id` and a port corresponding to the Rust node.
69+
70+
* `RustToOCamlViaSeed`:
71+
This test ensures that the Rust node can connect to an OCaml peer, the address of whom can only be discovered from an OCaml seed node, and that the Rust node adds its address to its Kademlia state. It also checks whether the OCaml node has a peer with the correct `peer_id` and port corresponding to the Rust node. Initially, the OCaml seed node has the other two nodes in its peer list, while the OCaml node and the Rust node only have the seed node. The two (OCaml and Rust) non-seed nodes connect to the OCaml seed node. Once connected, they gain information about each other from the seed node. They then make a connection between themselves. If the test is successful, then at the end of this process, each node has each other in its peer list.
72+
73+
* `OCamlToRustViaSeed`: This test ensures that an OCaml node can connect to the Rust node, the address of which can only be discovered from an OCaml seed node, and its address becomes available in the Rust node’s Kademlia state. It also checks whether the OCaml node has a peer with the correct `peer_id` and a port corresponding to the Rust node.
74+
75+
* `RustNodeAsSeed`: This test ensures that the Rust node can work as a seed node by running two OCaml nodes that only know about the Rust node’s address. After these nodes connect to the Rust node, the test makes sure that they also have each other’s addresses as their peers.
76+
77+
### [P2P Connections](../../node/testing/tests/p2p_basic_connections.rs)
78+
79+
* `SimultaneousConnections`:
80+
Tests if two nodes are connecting to each other at the same time, they should be
81+
connected, so each one has exactly one connection.
82+
83+
* `AllNodesConnectionsAreSymmetric`
84+
Connections between all peers are symmetric, i.e. if the node1 has the node2 among its active peers, then the node2 should have the node1 as its active peers.
85+
86+
* `SeedConnectionsAreSymmetric`
87+
Connections with other peers are symmetric for seed node, i.e. if a node is the seed's peer, then it has the node among its peers.
88+
89+
* `MaxNumberOfPeersIncoming`:
90+
Test that Rust node's incoming connections are limited.
91+
92+
* `MaxNumberOfPeersIs1`
93+
Two nodes with max peers = 1 can connect to each other.
94+
95+
### [P2P Kademlia](../../node/testing/tests/p2p_kad.rs)
96+
97+
Test related to kademlia layer.
98+
99+
* `KademliaBootstrap`:
100+
Test that node discovers peers another rust node and is able to bootstrap
101+
102+
### [P2P Pubsub](../../node/testing/tests/p2p_pubsub.rs)
103+
104+
Tests related to pubsub layer.
105+
106+
* `P2pReceiveBlock`
107+
Test that node receives block over meshsub from node
108+
109+
### [P2P Incoming](../../node/testing/tests/p2p_basic_incoming.rs)
110+
111+
Tests related to handling incoming connections.
112+
113+
* `AcceptIncomingConnection`: Node should accept incoming connections.
114+
* `AcceptMultipleIncomingConnections`: Node should accept multiple incoming connections.
115+
116+
### [P2P Outgoing](../../node/testing/tests/p2p_basic_outgoing.rs)
117+
118+
Tests related to outgoing connections
119+
120+
* `MakeOutgoingConnection`: Node should be able to make an outgoing connection to a listening node.
121+
122+
* `MakeMultipleOutgoingConnections`: Node should be able to create multiple outgoing connections.
123+
124+
* `DontConnectToNodeWithSameId`: Node shouldn't establish connection with a node with the same peer_id.
125+
126+
* `DontConnectToInitialPeerWithSameId`: Node shouldn't connect to a node with the same peer id even if its address specified in initial peers.
127+
128+
* `DontConnectToSelfInitialPeer`: Node shouldn't connect to itself even if its address specified in initial peers.
129+
130+
* `ConnectToInitialPeers`: Node should be able to connect to all initial peers.
131+
132+
* `ConnectToUnavailableInitialPeers`: Node should repeat connecting to unavailable initial peer.
133+
134+
* `ConnectToInitialPeersBecomeReady`: Node should be able to connect to all initial peers after they become ready.
135+
136+
### [Single Node](../../node/testing/tests/single_node.rs):
137+
138+
We want to test whether the Rust node is compatible with the OCaml node. We achieve this by attempting to connect the Openmina node to the existing OCaml testnet.
139+
140+
For that purpose, we are utilizing a _solo node_, which is a single Open Mina node connected to a network of OCaml nodes. Currently, we are using the public testnet, but later on we want to use our own network of OCaml nodes on our cluster.
141+
142+
* `SoloNodeBasicConnectivityAcceptIncoming`: Local test to ensure that the Openmina node can accept a connection from an existing OCaml node.
143+
144+
* `SoloNodeBasicConnectivityInitialJoining`: Local test to ensure that the Openmina node can connect to an existing OCaml testnet.
145+
146+
* `SoloNodeSyncRootSnarkedLedger`: Set up single Rust node and sync up root snarked ledger.
147+
148+
* `SoloNodeBootstrap`: Set up single Rust node and bootstrap snarked ledger, bootstrap ledger and blocks.
149+
150+
151+
### [Multi Node](../../node/testing/tests/multi_node.rs):
152+
153+
We also want to test a scenario in which the network consists only of Openmina nodes. If the Openmina node is using a functionality that is implemented only in the OCaml node, and it does not perform it correctly, then we will not be able to see it with solo node test. For that purpose, we utilize a Multi node test, which involves a network of our nodes, without any third party, so that the testing is completely local and under our control.
154+
155+
* `MultiNodeBasicConnectivityPeerDiscovery`: Tests that our node is able to discovery Ocaml nodes through Ocaml seed node.
156+
157+
* `MultiNodeBasicConnectivityInitialJoining`: Tests that node maintains number of peers between minimum and maximum allowed peers.
158+
159+
### [Record/Replay](../../node/testing/tests/record_replay.rs)
160+
161+
* `RecordReplayBootstrap`: Bootstrap a rust node while recorder of state and input actions is enabled and make sure we can successfully replay it.
162+
163+
* `RecordReplayBlockProduction`: Makes sure we can successfully record and replay multiple nodes in the cluster + block production.

status.md

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- Block production logic
1919
- [x] Without transactions and without proof
2020
- [x] Full block with proof
21-
- [ ] Blocks with transactions. - Missing because we don't yet have the transaction pool logic.
21+
- [x] Blocks with transactions.
2222
- Networking layer
2323
- [x] P2P layer in general along with serialization/deserialization of all messages
2424
- RPCs support
@@ -40,12 +40,20 @@
4040
- [x] Floodsub-like resending of blocks, txs and snarks
4141
- [ ] Trust system (to punish/ban peers): **not implemented (and no equivalent)**
4242
- Pools
43-
- [ ] Transaction pool: **in progress**
44-
- No pool is maintained, transactions received over the gossip network are not processed or re-broadcasted
43+
- Transaction pool: **in progress**
44+
- [x] Receiving, validating and integrating transactions
45+
- [x] Payments
46+
- [x] zkApp transactions (with proofs too)
47+
- [x] Broadcasting transactions to peers.
48+
- [x] Updating and revalidating the txn pool when new blocks are applied (by removing transactions already in the block)
49+
- [x] Updating and revalidating the txn pool when there are chain reorgs (by restoring transactions from discarded chains)
50+
- [ ] Error handling
51+
- [ ] Testing
4552
- SNARK pool
4653
- [x] SNARK Verification
4754
- [x] Pool is implemented
48-
- [x] SNARK work production is implemented (through OCaml). Node can complete and broadcast SNARK work.
55+
- [x] SNARK work production and broadcasting.
56+
- [ ] Testing
4957
- [x] Compatible ledger implementation
5058
- [x] Transition frontier
5159
- [x] Support for loading arbitrary genesis ledgers at startup
@@ -81,13 +89,32 @@
8189
- [x] Zkapp proof verification (same as above)
8290
- [ ] Client API (currently the node has a very partial support, not planned at the moment)
8391
- [ ] Support for the archive node sidecar process (sending updates through RPC calls).
84-
- [x] Berkeleynet support
8592
- [x] Devnet support
8693
- [x] Raw data for gates used to produced files updated for devnet compatibility
8794
- [x] Non-circuit logic updated for devnet compatibility
88-
- [x] Circuit logic updated for devnet compatibility (**partially implemented**)
95+
- [x] Circuit logic updated for devnet compatibility
8996
- [x] Genesis ledger file loadable by openmina for connecting to devnet
9097
- [x] Updated to handle fork proof and new genesis state
98+
- [x] Mainnet support
99+
- [x] Raw data for gates used to produced files updated for mainnet compatibility
100+
- [x] Non-circuit logic updated for mainnet compatibility
101+
- [x] Circuit logic updated for mainnet compatibility
102+
- [x] Genesis ledger file loadable by openmina for connecting to mainnet
103+
- [x] Updated to handle fork proof and new genesis state
104+
- Block replayer using precomputed blocks from Google Cloud Storage
105+
- [x] Basic replayer that applies blocks with openmina and verifies the results.
106+
- [ ] Enable proofs verification (for performance reasons, that is skipped right now)
107+
- [x] OCaml node counterpart to replay failed block applications (for debugging an testing)
108+
- [ ] CI pipeline to regularly test application of mainnet blocks
109+
- [ ] Support for applying all blocks, not just the cannonical chain
110+
- [ ] Produce tracing receipts from both the OCaml and Rust implementations that can be compared (for debugging and verification purposes)
111+
- Webnode
112+
- [x] WASM compilation
113+
- [x] WebRTC-based P2P layer
114+
- [x] Able to successfully sync up to the network
115+
- [ ] Testing
116+
- [ ] o1js integration
117+
- [ ] Frontend
91118

92119
## VRF Evaluator <a name="vrf-evaluator"></a>
93120

@@ -112,12 +139,12 @@
112139

113140
## Block Producer <a name="block-producer"></a>
114141

115-
- [ ] Block producer
142+
- [x] Block producer
116143
- [x] Integrate with VRF evaluator
117144
- [x] Include coinbase transactions
118145
- [x] Include fee transfers
119-
- [ ] Include simple transactions (transaction pool missing)
120-
- [ ] Include zkapp transactions (transaction pool missing)
146+
- [x] Include simple transactions
147+
- [x] Include zkapp transactions
121148
- [x] Ledger diff creation
122149
- [x] Integrate with transition frontier
123150
- [x] New epoch seed calculation
@@ -137,8 +164,11 @@
137164
- [x] Zkapps
138165
- [x] Ledger interactions are asynchronous and cannot stall the state machine.
139166
- [x] Persistent database
140-
- https://github.com/MinaProtocol/mina/pull/13340
141-
- Drop-in replacement for RocksDB
167+
- [x] (discarded) Drop-in replacement for RocksDB https://github.com/MinaProtocol/mina/pull/13340
168+
- [ ] Design and implement a persistent ledger
169+
- DRAFT design https://github.com/openmina/openmina/issues/522
170+
- [ ] Design and implement a persistent block storage
171+
- [ ] Design and implement a persistent proof storage
142172

143173
## Proofs <a name="proofs"></a>
144174

@@ -157,13 +187,14 @@
157187
### Handshake
158188

159189
- [x] Create a service for low level TCP networking (mio, epoll).
160-
- [ ] Per-connection data buffering limits.
190+
- [x] Per-connection data buffering limits.
161191
- [ ] DNS support.
162192
- [x] Pnet protocol.
163193
- [x] Multistream select protocol.
164-
- [ ] Handle simultaneous connect case.
194+
- [x] Handle simultaneous connect case.
165195
- [x] Noise protocol for outgoing connections.
166196
- [x] Noise protocol for incoming connections.
197+
- [x] Forbid connections whose negotiated peer-id don't match the one in the dial-opts or routing table.
167198
- [x] Yamux multiplexer.
168199
- [ ] Yamux congestion control.
169200

@@ -176,21 +207,21 @@
176207
- [ ] Implement Kademlia algorithm.
177208
- [x] Implement Kademlia FIND_NODE (client/server).
178209
- [x] Implement Kademlia Bootstrap process.
179-
- [ ] Update Kademlia routing table according to Identify protocol messages.
210+
- [x] Update Kademlia routing table according to Identify protocol messages.
180211
- [ ] Per peer limit on incoming requests
181212

182213
### RPC
183214

184215
- [x] Perform outgoing RPC requests.
185216
- [x] Handle incoming RPC requests.
186-
- [ ] Per peer limit on incoming requests
217+
- [x] Per peer limit on incoming requests
187218

188219
### Gossipsub
189220

190221
- [x] Implement gossipsub compatible with libp2p.
191222
- [ ] Research how to use "expander graph" theory to make gossipsub robust and efficient.
192-
- [ ] Implement mesh (meshsub protocol)
193-
- [ ] Handle control messages
223+
- [x] Implement mesh (meshsub protocol)
224+
- [x] Handle control messages
194225
- [ ] Limit received blocks, txs and snarks from the same peer
195226
- [ ] Rebroadcast only validated
196227

@@ -201,6 +232,7 @@
201232
- [x] Test that the Openmina node can bootstrap from the replayer tool.
202233
- [ ] Test that the OCaml node can bootstrap from the Openmina node.
203234
- [ ] Test that the Openmina node can bootstrap from another instance of openmina node.
235+
- [ ] Test block propagation
204236

205237
### Fuzzing
206238
- [x] Mutator-based (bit-flipping/extend/shrink) fuzzing of communication between two openmina nodes
@@ -209,28 +241,35 @@
209241
- [x] Noise mutator.
210242
- [x] Yamux mutator.
211243
- [x] Stream-based protocols mutators: Identify, Kad, Meshsub, RPCs.
244+
- [x] Fixed bugs found by fuzzing
245+
- [x] Connection management / resources leak issues.
246+
- [x] Panics in Kad due incorrect buffer index calculations.
212247

213248
## P2P Related Tests <a name="p2p-tests"></a>
214249

250+
See [Testing](./docs/testing/README.md) for more details.
251+
215252
- [ ] P2p functionality tests
216253
- [ ] p2p messages
217254
- [ ] Binprot types (de)serialization testing/fuzzing
218255
- [ ] Mina RPC types testing (ideally along with OCaml codecs)
219256
- [ ] hashing testing (ideally along with OCaml hash implementations)
220257
- [ ] Connection
221-
- [ ] Proper initial peers handling, like reconnecting if offline
222-
- [ ] Peers number maintaining, including edge cases, when we have max peers but still allow peers to connect for e.g. discovery, that is dropping connection strategy
223-
- [ ] Other connection constraints, like no duplicate connections to the same peer, peer_id, no self connections etc
258+
- [x] Proper initial peers handling, like reconnecting if offline
259+
- [x] Peers number maintaining, including edge cases, when we have max peers but still allow peers to connect for e.g. discovery, that is dropping connection strategy
260+
- [x] Other connection constraints, like no duplicate connections to the same peer, peer_id, no self connections etc
224261
- [ ] Connection quality metrics
262+
- [x] Connects to OCaml node and vice versa
225263
- [ ] Kademlia
226-
- [ ] Peers discovery, according to Kademlia parameters (a new node gets 20 new peers)
264+
- [x] Peers discovery, according to Kademlia parameters (a new node gets 20 new peers)
265+
- [x] Bootstraps from OCaml node and vice versa
227266
- [ ] Kademlia routing table is up-to-date with the network (each peer status, like connected/disconnected/can_connect/cant_connect, reflects actual peer state)
228267
- [ ] Gossipsub
229268
- [ ] Reacheability (all nodes get the message)
230269
- [ ] Non-redundancy (minimal number of duplicating/unneeded messages)
231270
- [ ] Interoperability with OCaml node
232271
- [ ] Bootstrap Rust node from OCaml and vice versa
233-
- [ ] Discovery using Rust node
272+
- [x] Discovery using Rust node
234273
- [ ] Gossipsub relaying
235274
- [ ] Public network tests. This should be the only set of tests that involve publicly available networks, and should be executed if we're sure we don't ruin them.
236275
- [ ] Attack resistance testing

0 commit comments

Comments
 (0)