Skip to content

Commit 98e6254

Browse files
authored
Merge pull request #1910 from o1-labs/dw/restructure-crates-libs
Reorganize repository structure: crates/, libs/, vendor/, tools/
2 parents ca139a4 + 2d05234 commit 98e6254

File tree

956 files changed

+833
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

956 files changed

+833
-83
lines changed

.github/workflows/test-docs-scripts.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ jobs:
272272
git diff --name-only | sort > actual_files.txt
273273
echo ".github/workflows/ci.yaml" > expected_files.txt
274274
echo "docker-compose.archive.devnet.compare.yml" >> expected_files.txt
275-
echo "node/testing/src/node/ocaml/config.rs" >> expected_files.txt
276-
echo "node/testing/src/node/ocaml/mod.rs" >> expected_files.txt
277-
echo "node/testing/src/scenarios/multi_node/basic_connectivity_peer_discovery.rs" >> expected_files.txt
278-
echo "node/testing/src/scenarios/solo_node/basic_connectivity_accept_incoming.rs" >> expected_files.txt
275+
echo "tools/testing/src/node/ocaml/config.rs" >> expected_files.txt
276+
echo "tools/testing/src/node/ocaml/mod.rs" >> expected_files.txt
277+
echo "tools/testing/src/scenarios/multi_node/basic_connectivity_peer_discovery.rs" >> expected_files.txt
278+
echo "tools/testing/src/scenarios/solo_node/basic_connectivity_accept_incoming.rs" >> expected_files.txt
279279
sort expected_files.txt > expected_files_sorted.txt
280280
281281
# Verify the same files were modified

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.env.docker
22
/target
3-
/node/testing/res/
3+
/tools/testing/res/
44
circuit-blobs
55
.DS_Store
66
*.profraw
@@ -16,7 +16,7 @@ tests.tsv
1616
# Generated API docs should not be committed
1717
website/static/api-docs/
1818

19-
ledger/3.0.0mainnet
20-
ledger/berkeley-devnet
19+
crates/ledger/3.0.0mainnet
20+
crates/ledger/berkeley-devnet
2121
mina-workdir
2222
.idea/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions

Cargo.toml

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
[workspace]
22
members = [
3-
"cli",
4-
"cli/replay_dynamic_effects",
5-
"core",
6-
"fuzzer",
7-
"ledger",
8-
"macros",
9-
"mina-p2p-messages",
10-
"node",
11-
"node/account",
12-
"node/common",
13-
"node/invariants",
14-
"node/native",
15-
"tools/testing",
16-
"node/web",
17-
"p2p",
18-
"p2p/libp2p-rpc-behaviour",
19-
"p2p/testing",
3+
# Main crates
4+
"crates/cli",
5+
"crates/cli/replay_dynamic_effects",
6+
"crates/core",
7+
"crates/fuzzer",
8+
"crates/ledger",
9+
"crates/macros",
10+
"crates/node",
11+
"crates/node/account",
12+
"crates/node/common",
13+
"crates/node/invariants",
14+
"crates/node/native",
15+
"crates/node/web",
16+
"crates/p2p",
17+
"crates/p2p/libp2p-rpc-behaviour",
18+
"crates/p2p/testing",
19+
"crates/p2p-messages",
20+
"crates/snark",
21+
"crates/vrf",
22+
# Crates to be removed (kept at root for now)
23+
# poseidon: https://github.com/o1-labs/mina-rust/issues/1215
2024
"poseidon",
21-
"snark",
25+
# Tools
2226
"tools/archive-breadcrumb-compare",
2327
"tools/bootstrap-sandbox",
2428
"tools/fuzzing",
2529
"tools/gossipsub-sandbox",
2630
"tools/hash-tool",
2731
"tools/ledger-tool",
32+
"tools/testing",
2833
"tools/transport",
2934
"tools/webrtc-sniffer",
30-
"vendor/alloc-test",
31-
"vendor/redux",
35+
# Reusable libraries (project-agnostic, potentially publishable)
36+
"libs/alloc-test",
37+
"libs/redux",
38+
# Vendored third-party libraries
3239
"vendor/salsa-simple",
33-
"vrf",
3440
]
3541

3642
resolver = "2"
@@ -43,7 +49,7 @@ indexing_slicing = "warn"
4349
[workspace.dependencies]
4450
aes = "0.8"
4551
aes-gcm = "0.10.3"
46-
alloc-test = { path = "vendor/alloc-test" }
52+
alloc-test = { path = "libs/alloc-test" }
4753
anyhow = "1.0.81"
4854
argon2 = { version = "0.5.3", features = ["std"] }
4955
ark-ec = { version = "0.5.0", features = ["std"] }
@@ -126,7 +132,7 @@ juniper_warp = "0.8.0"
126132
kimchi = { git = "https://github.com/o1-labs/proof-systems", tag = "0.2.0" }
127133
lazy_static = "1.4.0"
128134
leb128 = "0.2.1"
129-
ledger = { path = "ledger", package = "mina-tree" }
135+
ledger = { path = "crates/ledger", package = "mina-tree" }
130136
libc = "0.2.151"
131137
libp2p = { git = "https://github.com/openmina/rust-libp2p", rev = "5c44c7d9", default-features = false }
132138
libp2p-identity = { version = "=0.2.7", features = ["peerid"] }
@@ -135,25 +141,25 @@ local-ip-address = "0.6.1"
135141
log = "0.4.25"
136142
md5 = "0.7.0"
137143
mina-bootstrap-sandbox = { path = "tools/bootstrap-sandbox" }
138-
mina-core = { path = "core" }
144+
mina-core = { path = "crates/core" }
139145
mina-curves = { git = "https://github.com/o1-labs/proof-systems", tag = "0.2.0" }
140-
mina-fuzzer = { path = "fuzzer" }
146+
mina-fuzzer = { path = "crates/fuzzer" }
141147
mina-hasher = { git = "https://github.com/o1-labs/proof-systems", tag = "0.2.0" }
142-
mina-macros = { path = "macros" }
143-
mina-node-account = { path = "node/account" }
144-
mina-node-common = { path = "node/common" }
145-
mina-node-invariants = { path = "node/invariants" }
146-
mina-node-native = { path = "node/native" }
148+
mina-macros = { path = "crates/macros" }
149+
mina-node-account = { path = "crates/node/account" }
150+
mina-node-common = { path = "crates/node/common" }
151+
mina-node-invariants = { path = "crates/node/invariants" }
152+
mina-node-native = { path = "crates/node/native" }
147153
mina-node-testing = { path = "tools/testing" }
148-
mina-p2p-messages = { path = "mina-p2p-messages" }
154+
mina-p2p-messages = { path = "crates/p2p-messages" }
149155
mina-poseidon = { git = "https://github.com/o1-labs/proof-systems", tag = "0.2.0" }
150156
mina-signer = { git = "https://github.com/o1-labs/proof-systems", tag = "0.2.0" }
151157
mina-transport = { path = "tools/transport" }
152158
mio = { version = "1.0.4", features = ["os-poll", "net"] }
153159
multiaddr = "0.18.1"
154160
multihash = { version = "0.18.1", features = ["blake2b"] }
155161
nix = { version = "0.27.1", features = ["process", "signal"] }
156-
node = { path = "node" }
162+
node = { path = "crates/node" }
157163
nom = "8.0.0"
158164
num = { version = "0.4", features = ["std"] }
159165
num-bigint = { git = "https://github.com/openmina/num-bigint", branch = "rebase-onstack" }
@@ -181,7 +187,7 @@ rand_pcg = "0.3"
181187
rand_seeder = "0.2"
182188
rayon = "1.5"
183189
rcgen = { version = "0.13", features = ["pem", "x509-parser"] }
184-
redux = { path = "vendor/redux", features = ["serde"] }
190+
redux = { path = "libs/redux", features = ["serde"] }
185191
regex = "1"
186192
reqwest = { version = "0.12.8", features = ["blocking", "json"] }
187193
ring_buffer = "2.0.2"
@@ -235,7 +241,7 @@ vergen = { version = "8.2.4", features = [
235241
"gitcl",
236242
"rustc",
237243
] }
238-
vrf = { path = "vrf" }
244+
vrf = { path = "crates/vrf" }
239245
warp = "0.3"
240246
wasm-bindgen = "^0.2.106"
241247
wasm-bindgen-futures = "^0.4.56"

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ build: ## Build the project in debug mode
8585

8686
.PHONY: build-ledger
8787
build-ledger: download-circuits ## Build the ledger binary and library, requires nightly Rust
88-
@cd ledger && cargo +$(NIGHTLY_RUST_VERSION) build --release --tests
88+
@cd crates/ledger && cargo +$(NIGHTLY_RUST_VERSION) build --release --tests
8989

9090
build-node-native: ## Build the package mina-node-native with all features and tests
9191
@cargo build -p mina-node-native --all-features --release --tests
@@ -135,7 +135,7 @@ build-tests-webrtc: ## Build tests for WebRTC
135135

136136
.PHONY: build-wasm
137137
build-wasm: ## Build WebAssembly node
138-
@cd node/web && cargo +${NIGHTLY_RUST_VERSION} build \
138+
@cd crates/node/web && cargo +${NIGHTLY_RUST_VERSION} build \
139139
--release --target wasm32-unknown-unknown
140140
# Update ./.gitignore accordingly if the out-dir is changed
141141
@wasm-bindgen --keep-debug --web \
@@ -241,8 +241,8 @@ download-circuits: ## Download the circuits used by Mina from GitHub
241241
git clone --depth 1 $(CIRCUITS_REPO) -b $(CIRCUITS_REV); \
242242
for network in $(CIRCUITS_NETWORKS); do \
243243
echo "Including circuits for $$network"; \
244-
rm -f "$$PWD"/ledger/"$$network"; \
245-
ln -s "$$PWD"/circuit-blobs/"$$network" ledger/"$$network"; \
244+
rm -f "$$PWD"/crates/ledger/"$$network"; \
245+
ln -s "$$PWD"/circuit-blobs/"$$network" crates/ledger/"$$network"; \
246246
done; \
247247
else \
248248
echo "circuit-blobs already exists, skipping download."; \
@@ -341,7 +341,7 @@ test: ## Run tests
341341

342342
.PHONY: test-ledger
343343
test-ledger: build-ledger ## Run ledger tests in release mode, requires nightly Rust
344-
@cd ledger && cargo +$(NIGHTLY_RUST_VERSION) test --release -- -Z unstable-options --report-time
344+
@cd crates/ledger && cargo +$(NIGHTLY_RUST_VERSION) test --release -- -Z unstable-options --report-time
345345

346346
.PHONY: test-p2p
347347
test-p2p: ## Run P2P tests
@@ -386,7 +386,7 @@ nextest-p2p: ## Run P2P tests with cargo-nextest
386386

387387
.PHONY: nextest-ledger
388388
nextest-ledger: build-ledger ## Run ledger tests with cargo-nextest, requires nightly Rust
389-
@cd ledger && cargo +$(NIGHTLY_RUST_VERSION) nextest run --release
389+
@cd crates/ledger && cargo +$(NIGHTLY_RUST_VERSION) nextest run --release
390390

391391
# Docker build targets
392392

README.md

Lines changed: 49 additions & 13 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)