Skip to content

Commit 9d6c59b

Browse files
authored
Merge pull request #1580 from o1-labs/dw/remove-salsa-simple
Move salsa-simple from tools/ to vendor/ and alphabetize workspace
2 parents ad84b13 + 5776835 commit 9d6c59b

File tree

7 files changed

+57
-22
lines changed

7 files changed

+57
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9191
- **Development Tools**: Update taplo configuration to exclude `node_modules` and
9292
`target` directories from TOML formatting checks
9393
([#1573](https://github.com/o1-labs/mina-rust/pull/1573))
94+
- **Build System**: Move salsa-simple from tools/ to vendor/ and alphabetize
95+
workspace members. salsa-simple is a vendored XSalsa20 implementation with
96+
serde support, not a command-line tool
97+
([#1580](https://github.com/o1-labs/mina-rust/pull/1580))
9498
- **CI**: Speed up CI by decoupling test runs from full build completion.
9599
Created dedicated single-platform build jobs that run only on ubuntu-22.04
96100
to produce artifacts needed for testing, allowing tests to start as soon as

Cargo.toml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
[workspace]
22
members = [
3+
"cli",
4+
"cli/replay_dynamic_effects",
35
"core",
4-
"macros",
6+
"fuzzer",
57
"ledger",
6-
"snark",
7-
"p2p",
8-
"p2p/testing",
9-
"p2p/libp2p-rpc-behaviour",
8+
"macros",
9+
"mina-p2p-messages",
1010
"node",
1111
"node/account",
1212
"node/common",
13-
"node/native",
14-
"node/web",
1513
"node/invariants",
14+
"node/native",
1615
"node/testing",
17-
"cli",
18-
"cli/replay_dynamic_effects",
19-
"vrf",
20-
21-
"mina-p2p-messages",
22-
"ledger",
16+
"node/web",
17+
"p2p",
18+
"p2p/libp2p-rpc-behaviour",
19+
"p2p/testing",
2320
"poseidon",
24-
25-
"tools/transport",
21+
"snark",
22+
"tools/archive-breadcrumb-compare",
2623
"tools/bootstrap-sandbox",
24+
"tools/fuzzing",
2725
"tools/gossipsub-sandbox",
2826
"tools/hash-tool",
2927
"tools/ledger-tool",
30-
"tools/salsa-simple",
31-
"tools/fuzzing",
32-
"tools/archive-breadcrumb-compare",
28+
"tools/transport",
3329
"tools/webrtc-sniffer",
34-
35-
"fuzzer",
30+
"vendor/salsa-simple",
31+
"vrf",
3632
]
3733

3834
resolver = "2"
@@ -195,7 +191,7 @@ rsexp = "0.2.3"
195191
rsexp-derive = "0.2.3"
196192
rsprocmaps = "0.3.2"
197193
rust-format = "0.3"
198-
salsa-simple = { path = "tools/salsa-simple" }
194+
salsa-simple = { path = "vendor/salsa-simple" }
199195
salsa20 = "0.10.2"
200196
serde = { version = "1.0.190", features = ["derive", "rc"] }
201197
serde_bytes = "0.11"

frontend/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ COPY p2p ./p2p
7474
COPY poseidon ./poseidon
7575
COPY snark ./snark
7676
COPY tools ./tools
77+
COPY vendor ./vendor
7778
COPY vrf ./vrf
7879

7980
# Build WebAssembly using Makefile (source VERGEN variables from .env.docker)

frontend/angular.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@
7272
"with": "src/environments/environment.prod.ts"
7373
}
7474
],
75-
"outputHashing": "all"
75+
"outputHashing": "all",
76+
"optimization": {
77+
"scripts": true,
78+
"styles": {
79+
"minify": true,
80+
"inlineCritical": false
81+
},
82+
"fonts": false
83+
}
7684
},
7785
"development": {
7886
"optimization": false,
File renamed without changes.

tools/salsa-simple/src/lib.rs renamed to vendor/salsa-simple/src/lib.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
//! Vendored XSalsa20 stream cipher implementation with serde support.
2+
//!
3+
//! This is a custom implementation of the XSalsa20 stream cipher algorithm
4+
//! that provides serialization support via serde, which is required for
5+
//! persisting P2P network connection state in the Redux state machine.
6+
//!
7+
//! # Why vendored?
8+
//!
9+
//! The external [`salsa20`](https://crates.io/crates/salsa20) crate (v0.10.2)
10+
//! does not provide serde support for serializing/deserializing cipher state.
11+
//! This is needed for:
12+
//! - Persisting P2P pnet encryption state across restarts
13+
//! - State snapshots in the Redux architecture
14+
//! - Debugging and inspection capabilities
15+
//!
16+
//! # Implementation
17+
//!
18+
//! This implementation manually implements the XSalsa20 algorithm and adds
19+
//! `Serialize` and `Deserialize` derives. It is tested against the external
20+
//! `salsa20` crate (used as a dev-dependency) to ensure correctness.
21+
//!
22+
//! # Usage
23+
//!
24+
//! Used in `p2p/src/network/pnet/` for P2P private network encryption,
25+
//! providing encrypted communication between peers with serializable state.
26+
127
#[cfg(test)]
228
mod tests;
329

File renamed without changes.

0 commit comments

Comments
 (0)