docs: design for absorbing offchain and solana into this repo - #4239
docs: design for absorbing offchain and solana into this repo#4239bgm-malbeclabs wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a design spec that describes how to migrate malbeclabs/doublezero-offchain and malbeclabs/doublezero-solana into this repository as two new top-level trees, and how to sequence the work to reduce risk.
Changes:
- Add a new migration design spec that defines scope, decisions (D1–D5), sequencing (steps 0–5), rollback, and risk analysis.
- Document workspace strategy, toolchain pin strategy, tag import strategy, and the sentinel binary rename plan.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| make build-artifacts NETWORK=mainnet-beta | ||
| shasum -a 256 -c programs/sha256sums_mainnet_beta.txt |
There was a problem hiding this comment.
Fixed. The commands were also wrong in a deeper way — see the Bugbot thread on the same step: running them against solana's own lockfile reports no change however the merged workspace resolves.
Step 0 has since run with a resolution-comparison method instead of a rebuild, and the checksum gate in step 4 now specifies running from inside solana/.
| Gate: `cargo check --workspace`, `cargo clippy --all-targets`, the full test suite, e2e, | ||
| and the program checksum check. Also confirm the lockfile holds no crate twice: | ||
| `grep '^name = ' Cargo.lock | sort | uniq -d` should print nothing that was not already | ||
| duplicated before the merge. |
There was a problem hiding this comment.
Right, and the real number is worse than the concern suggests: cargo tree -d --workspace reports 140 duplicate groups on main today. All normal. A duplicate-name check would have been pure noise.
Replaced with two gates that actually mean something:
grep -c 'source = "git+https://github.com/malbeclabs' Cargo.lock # expect 0
cargo tree -d --workspace --locked | grep -cE '^[a-z0-9_-]+ v' # baseline 140, must not riseThe first is the one that matters. After the dependency flip there should be no internal git sources left at all, because they are all path deps.
|
|
||
| Gate: every existing job green, with no existing job definition touched. `git diff` | ||
| between each imported tree and its filtered source is empty. The diff is large and needs | ||
| no judgement to review. |
There was a problem hiding this comment.
Taken. Worth noting the repo had one of each, so there was no convention to break — but judgment matches the US spelling used elsewhere (onchain, etc.), so it is the better default.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bc5b84. Configure here.
Only the monorepo migration design belongs on this branch. Nine other spec and plan documents under docs/superpowers were untracked working files and were committed by accident. They stay on disk, they are just no longer tracked.

Design for absorbing
malbeclabs/doublezero-offchainandmalbeclabs/doublezero-solanainto this repo. Docs only — no code changes, nothing here is implemented yet.Prerequisite is already done: both repos moved from
doublezerofoundationtomalbeclabson 2026-08-26 (doublezero-offchain#412, doublezero-solana#125, doublezero-shreds#686, doublezero#4236, docs#202).Summary
offchain/andsolana/. Nothing existing moves. Rejects flattening intocrates/andsmartcontract/programs/, mainly because the two program sets target different chains — the CLAUDE.md already treats the DoubleZero Ledger / Solana L1 split as load-bearing, and warns it fails silently when confused.malbeclabs/doublezerodeps and its 3doublezero-solanadeps all become path deps.network-shapleyis the only external pin left.passportandrevenue-distributionare held back until measured. They build reproducibly against their own lockfile and are checked againstprograms/sha256sums_*.txt. Step 0 is a throwaway merge that answers whether a shared lockfile changes the bytes. Decided by measurement, not argument.doublezero-sentinel. This repo's is renamed todz-e2e-sentinel; it has no external contract, and the explicit name makes the later cleanup easy to find.sentinel, and it resolves by deleting an orphan tag we want gone anyway.Why now
A change spanning the three repos currently needs three PRs in a fixed order plus a pin bump in each consumer. On 2026-08-26 that failed badly: shreds pointed one crate at the new org while the offchain revision it pinned still pointed at the old one. Cargo makes a git dep's URL part of the crate identity, so it built two copies and the oracle reported 194 errors of the form "no method named X" on types that plainly had X. Nothing in the error text mentioned a URL. The spec's "Why" section leads with that incident because it is the clearest statement of the cost.
What it means for shreds
Shreds stays a separate repo — it is private and this one is public — so it keeps git deps and coordinated bumps. It still improves a lot: three upstream pins collapse to one, and the duplicate
doublezero_sdkit builds today becomes impossible, because no second source will exist. That holds only if shreds repoints everymalbeclabs/doublezerodep to a single ref in one commit, so the spec gives that step a lockfile grep as its acceptance test and recommends keeping it as a CI guard.Testing Verification
Every quantitative claim was measured against the repos rather than estimated:
sentinel). The spec includes the command to re-run immediately before importing, in case new tags land.solana-sdk,solana-programandsolana-clientresolve identically in all three lockfiles. Only borsh (1.7.0 / 1.7.0 / 1.6.0) and the toolchain (1.97.1 / 1.92.0 / 1.91) differ.Cargo.tomlfiles declare[[bin]] name = "doublezero-sentinel", and that this repo's is unreleased, feature-gated behindserver, and consumed only by thedz-e2e/sentinelimage ine2e.yml. The rename touches two files.doublezero_sdk: confirmed present in shreds' lockfile today at two sources (?tag=client/v0.31.0and?rev=8bb7900e).Review asks
The five decisions (D1–D5) each carry their rationale and the alternatives rejected. Worth arguing with:
offchain/andsolana/versus folding into the existing trees.