Skip to content

Commit c441789

Browse files
authored
Merge pull request #90 from AbdelStark/vendoring/stwo
vendoring: vendor and pin Stwo under third_party/stwo
2 parents 86a357c + a9ee44b commit c441789

250 files changed

Lines changed: 43738 additions & 12 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 896 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
[workspace]
1313
resolver = "2"
1414
members = ["crates/*"]
15+
# Vendored proving substrate (RFC-0015) is its own upstream workspace; it is not
16+
# a member of ours. First-party crates depend on individual vendored crates by
17+
# path (the only permitted source, INV-RFC0015-01); the vendored workspace keeps
18+
# its own manifest/lockfile and is excluded here so cargo does not absorb it.
19+
exclude = ["third_party/stwo", "third_party/stwo-circuits"]
1520

1621
[workspace.package]
1722
version = "0.1.0"
@@ -36,6 +41,10 @@ pwm-air = { path = "crates/pwm-air", version = "0.1.0" }
3641
pwm-export = { path = "crates/pwm-export", version = "0.1.0" }
3742
pwm-prover = { path = "crates/pwm-prover", version = "0.1.0" }
3843
pwm-verifier = { path = "crates/pwm-verifier", version = "0.1.0" }
44+
# Vendored proving substrate (RFC-0015). Path dependencies only — never a
45+
# crates.io or git source for a Stwo package (INV-RFC0015-01). The vendored tree
46+
# is pinned at stwo v2.2.0 (third_party/stwo/REVISION).
47+
stwo = { path = "third_party/stwo/crates/stwo", version = "2.2.0" }
3948
# Test-only third-party dependencies (used by pwm-testkit and pwm-core dev-deps).
4049
serde = { version = "1", features = ["derive"] }
4150
serde_json = "1"

crates/pwm-prover/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ pwm-core = { workspace = true }
1414
pwm-air = { workspace = true }
1515
pwm-circuits = { workspace = true }
1616
pwm-export = { workspace = true }
17+
# Vendored Stwo prover (RFC-0015), referenced by path only. This is the first
18+
# in-tree consumer that proves third_party/stwo builds as a path dependency; the
19+
# prover drives the Stwo commit/challenge/proof flow.
20+
stwo = { workspace = true }
1721

1822
[lints]
1923
workspace = true

crates/pwm-prover/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ use pwm_air as _;
2020
use pwm_circuits as _;
2121
use pwm_core as _;
2222
use pwm_export as _;
23+
// Vendored proving substrate (third_party/stwo, RFC-0015). Linked here to prove
24+
// the path-dependency wiring builds; the prover flow uses it from #62 onward.
25+
use stwo as _;

deny.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
allow = [
1313
"Apache-2.0",
1414
"MIT",
15+
"BSD-2-Clause",
1516
"BSD-3-Clause",
1617
"Unicode-3.0",
18+
"Zlib",
1719
]
1820
confidence-threshold = 0.9
1921
# The allow list is forward-looking (no external deps exist on the skeleton yet);

docs/rfcs/RFC-0015-third-party-vendoring-and-pinning.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ third_party/
168168
PATCHES/
169169
0001-<slug>.patch # one file per local modification, applied in order
170170
0001-<slug>.md # rationale, audit note, upstream-PR/issue link or "none"
171-
src/... # vendored source tree (workspace member crates)
171+
crates/... # vendored source tree, upstream layout preserved verbatim
172172
stwo-circuits/
173173
REVISION
174174
LICENSE
175175
NOTICE
176176
UPSTREAM.md
177177
PATCHES/
178-
src/...
178+
crates/...
179179
```
180180

181181
`third_party/<comp>/REVISION` is the single source of truth for the pin. Schema
@@ -210,10 +210,12 @@ path dependency into the vendored tree.
210210

211211
```toml
212212
# crates/pwm-air/Cargo.toml — REQUIRED form
213+
# (The vendored tree preserves the upstream `crates/` layout verbatim, so the
214+
# path is `third_party/stwo/crates/<dir>`; see third_party/stwo/UPSTREAM.md.)
213215
[dependencies]
214-
stwo = { path = "../../third_party/stwo/src/stwo" }
215-
stwo-constraint-framework = { path = "../../third_party/stwo/src/stwo-constraint-framework" }
216-
stwo-air-utils = { path = "../../third_party/stwo/src/stwo-air-utils" }
216+
stwo = { path = "../../third_party/stwo/crates/stwo" }
217+
stwo-constraint-framework = { path = "../../third_party/stwo/crates/constraint-framework" }
218+
stwo-air-utils = { path = "../../third_party/stwo/crates/air-utils" }
217219

218220
# FORBIDDEN forms (CI gate rejects either):
219221
# stwo = "2.2.0"

third_party/INVENTORY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Third-party dependency and license inventory
2+
3+
The authoritative inventory of vendored components and their license surface,
4+
per [RFC-0015](../docs/rfcs/RFC-0015-third-party-vendoring-and-pinning.md). The
5+
`cargo deny check licenses` gate ([`deny.toml`](../deny.toml)) enforces the
6+
allowed-license set against the resolved dependency graph on every PR.
7+
8+
## Vendored components
9+
10+
| Component | Path | Pin | License | REVISION |
11+
| --- | --- | --- | --- | --- |
12+
| Stwo | `third_party/stwo` | `v2.2.0` (`289c20de`) | Apache-2.0 | [`stwo/REVISION`](stwo/REVISION) |
13+
| stwo-circuits | `third_party/stwo-circuits` | `v0.1.0` (`b0db13e4`) | Apache-2.0 | pending (#25) |
14+
15+
Each vendored component is pinned by commit, carries its upstream `LICENSE`
16+
verbatim and a recorded `NOTICE`, and is referenced by path only (INV-RFC0015-01:
17+
no crates.io/git source for a substrate package).
18+
19+
## License surface of the resolved graph (Stwo vendored)
20+
21+
Licenses present in the transitive dependency tree once `stwo` is wired in. Every
22+
crate resolves to at least one allowed license (dual-licensed crates list every
23+
option; the allowed alternative satisfies the gate).
24+
25+
| SPDX license | Allowed | Notes |
26+
| --- | --- | --- |
27+
| Apache-2.0 | yes | project license; most of the tree |
28+
| MIT | yes | most of the tree (dual with Apache-2.0) |
29+
| BSD-2-Clause | yes | `arrayref` (single), `zerocopy` (dual) |
30+
| BSD-3-Clause | yes | `subtle` |
31+
| Unicode-3.0 | yes | `unicode-ident` (dual) |
32+
| Zlib | yes | `foldhash` (single), `bytemuck` (dual) |
33+
| Apache-2.0 WITH LLVM-exception | via Apache-2.0 | `blake3`, `wasi` (dual with Apache-2.0) |
34+
| CC0-1.0 / MIT-0 / Unlicense | via alternative | `blake3`, `constant_time_eq`, `memchr` — each dual with an allowed license |
35+
36+
The allow-list lives in [`deny.toml`](../deny.toml). Duplicate dependency
37+
versions (e.g. `itertools` 0.10/0.12, `hashbrown` 0.14/0.17, `syn` 1/2) are
38+
permitted (`bans.multiple-versions = "allow"`) because they originate in the
39+
pinned upstream tree; tightening is tracked by the vendoring-audit work (#26).

third_party/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ vendoring, modification, and re-audit policy is governed by
1212
| `stwo/` | github.com/starkware-libs/stwo | Apache-2.0 | Workspace v2.2.0 — Circle-STARK prover/verifier, M31 field module, FRI + PCS, Fiat-Shamir channels, LogUp. |
1313
| `stwo-circuits/` | github.com/starkware-libs/stwo-circuits | Apache-2.0 | v0.1.0 (edition 2024) — the low-level scalar gate set. |
1414

15+
The authoritative TCB / license inventory is [`INVENTORY.md`](INVENTORY.md).
16+
1517
## Status
1618

17-
This is the workspace skeleton (issue #23). The actual upstream code is **not**
18-
vendored yet; that is the work of issues #24 (`stwo`) and #25 (`stwo-circuits`).
19-
Each subtree carries a `REVISION` file recording the exact pinned commit. Until
20-
the revisions are frozen during the `v0.1 — Foundations` milestone, both files
21-
contain the placeholder string `pending-rfc-0015`.
19+
- **`stwo/`** — vendored (#24). Pristine at `v2.2.0`
20+
(`289c20de80b7c7f508de9c46151fb81dae404154`); see [`stwo/REVISION`](stwo/REVISION)
21+
and [`stwo/UPSTREAM.md`](stwo/UPSTREAM.md). First-party crates depend on it by
22+
path; the tree is its own workspace and is `exclude`d from the first-party
23+
workspace.
24+
- **`stwo-circuits/`** — not vendored yet (#25); `REVISION` holds the placeholder
25+
`pending-rfc-0015`.
2226

2327
Vendored files retain their upstream license headers unmodified; the first-party
2428
SPDX header lint excludes `third_party/`

0 commit comments

Comments
 (0)