-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract "component" crates into a separate repository #768
Comments
Here is the current dependency graph between the Rust crates: graph TD
n150[equihash]
n151[f4jumble]
n230[orchard]
n232[zcash_note_encryption]
n336[zcash_address]
n337[zcash_encoding]
n338[zcash_client_backend]
n339[zcash_primitives]
n340[zcash_proofs]
n341[zcash_client_sqlite]
n341 --> n338
n341 --> n339
n338 --> n230
n338 --> n336
n338 --> n337
n338 --> n232
n338 --> n339
n338 --> n340
n340 --> n339
n339 --> n150
n339 --> n230
n339 --> n336
n339 --> n337
n339 --> n232
n230 --> n232
n336 --> n151
n336 --> n337
If we define "component crates" as "crates that don't depend on the protocols" then we get this split: graph TD
subgraph components
n150[equihash]
n151[f4jumble]
n232[zcash_note_encryption]
n337[zcash_encoding]
end
subgraph protocols
n230[orchard]
end
subgraph main
n336[zcash_address]
n338[zcash_client_backend]
n339[zcash_primitives]
n340[zcash_proofs]
n341[zcash_client_sqlite]
end
n341 --> n338
n341 --> n339
n338 --> n230
n338 --> n336
n338 --> n337
n338 --> n232
n338 --> n339
n338 --> n340
n340 --> n339
n339 --> n150
n339 --> n230
n339 --> n336
n339 --> n337
n339 --> n232
n230 --> n232
n336 --> n151
n336 --> n337
Note that If we define "component crates" as "crates that the protocols depend on" then we get this split: graph TD
subgraph components
n232[zcash_note_encryption]
end
subgraph protocols
n230[orchard]
end
subgraph main
n150[equihash]
n151[f4jumble]
n337[zcash_encoding]
n336[zcash_address]
n338[zcash_client_backend]
n339[zcash_primitives]
n340[zcash_proofs]
n341[zcash_client_sqlite]
end
n341 --> n338
n341 --> n339
n338 --> n230
n338 --> n336
n338 --> n337
n338 --> n232
n338 --> n339
n338 --> n340
n340 --> n339
n339 --> n150
n339 --> n230
n339 --> n336
n339 --> n337
n339 --> n232
n230 --> n232
n336 --> n151
n336 --> n337
|
Here is how I think I'd like the dependency graph to look after #738 (removing a few of the direct dependencies that can be represented via transitive paths for clarity): graph TD
subgraph components
n232[zcash_note_encryption]
n150[equihash]
n151[f4jumble]
n337[zcash_encoding]
end
subgraph protocols
sapling[sapling-crypto]
n230[orchard]
end
subgraph main
n336[zcash_address]
n338[zcash_client_backend]
n339[zcash_primitives]
n340[zcash_proofs]
n341[zcash_client_sqlite]
end
n341 --> n338
n338 --> n339
n338 --> n340
n340 --> n339
n339 --> n150
n339 --> sapling
n339 --> n230
n339 --> n336
n339 --> n337
sapling --> n232
n230 --> n232
n336 --> n151
n336 --> n337
|
I came to this issue tracker to ask what defines Is it a correct definition for @str4d's preferred grouping that "components are crates which do not depend on Zcash protocols"? Another way to think of the definition is what can you build with each set of crates. For the preferred layout is this accurate:
|
…al workspace dependency mgmt.
Some more thinking about this, and how a single |
So maybe this is the split to go for: graph TD
subgraph standalone_components
nEqH[equihash]
nF4J[f4jumble]
end
subgraph protocol_components
nZEnc[zcash_encoding]
nZNE[zcash_note_encryption]
end
subgraph protocols
sapling[sapling-crypto]
orchard[orchard]
end
subgraph main
nZAddr[zcash_address]
nZPrim[zcash_primitives]
nZProof[zcash_proofs]
nZCB[zcash_client_backend]
nZCS[zcash_client_sqlite]
end
nZCS --> nZCB
nZCB --> nZPrim
nZCB --> nZProof
nZProof --> nZPrim
nZPrim --> nEqH
nZPrim --> sapling
nZPrim --> orchard
nZPrim --> nZAddr
nZPrim --> nZEnc
sapling --> nZNE
orchard --> nZNE
nZAddr --> nF4J
nZAddr --> nZEnc
|
Consider also that Given that #738 will end up moving the Sapling circuit logic out of graph TD
subgraph standalone_components
nEqH[equihash]
nF4J[f4jumble]
end
subgraph protocol_components
nZEnc[zcash_encoding]
nZNE[zcash_note_encryption]
end
subgraph protocols
sprout[sprout]
sapling[sapling-crypto]
orchard[orchard]
end
subgraph main
nZAddr[zcash_address]
nZPrim[zcash_primitives]
nZProof[zcash_proofs]
nZCB[zcash_client_backend]
nZCS[zcash_client_sqlite]
end
nZCS --> nZCB
nZCB --> nZPrim
nZProof --> nZPrim
nZPrim --> nEqH
nZPrim --> sprout
nZPrim --> sapling
nZPrim --> orchard
nZPrim --> nZAddr
nZPrim --> nZEnc
sapling --> nZNE
orchard --> nZNE
nZAddr --> nF4J
nZAddr --> nZEnc
Then |
In #1041 we moved |
#1140, #1142 and #1143 are intended to produce this result: %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
graph TD
subgraph standalone_components
nEqH[equihash]
nF4J[f4jumble]
nZEnc[zcash_encoding]
end
subgraph protocol_components
nZNE[zcash_note_encryption]
nZip32[zip32]
nZSpec[zcash_spec]
end
subgraph protocols
sprout[sprout]
sapling[sapling-crypto]
orchard[orchard]
end
subgraph main
nZAddr[zcash_address]
nZPrim[zcash_primitives]
nZProof[zcash_proofs]
nZCB[zcash_client_backend]
nZCS[zcash_client_sqlite]
nZProto[zcash_protocol]
nZip321[zip321]
end
subgraph wallets
nLightFFI[zcash-light-client-ffi]
nSwiftSDK[zcash-swift-wallet-sdk]
nAndroidSDK[zcash-android-wallet-sdk]
nZashiIOS[zashi-ios]
nZashiAndroid[zashi-android]
end
nZCS --> nZCB
nZCB --> nZPrim
nZProof --> nZPrim
nZPrim --> nZProto
nZCB --> nZip321
nZip321 --> nZAddr
nZAddr --> nZProto
nZip321 --> nZProto
nZPrim --> nEqH
nZPrim --> sprout
nZPrim --> sapling
nZPrim --> orchard
nZPrim --> nZEnc
sapling --> nZNE
sapling --> nZip32
sapling --> nZSpec
orchard --> nZNE
orchard --> nZip32
orchard --> nZSpec
nZAddr --> nF4J
nZAddr --> nZEnc
nLightFFI --> nZCS
nSwiftSDK --> nLightFFI
nZashiIOS --> nSwiftSDK
nAndroidSDK --> nZCS
nZashiAndroid --> nAndroidSDK
|
This is now in an acceptable state; we no longer have circular dependencies that result in cycles in the repository graph. |
Due to the
orchard
crate living in a separate repository, we currently have an annoying cyclic dependency between the two repositories, due tozcash_primitives
depending onorchard
, which depends onzcash_note_encryption
. We also intend to move the Sapling protocol logic out into its own repository again (#738).To improve development interactions between the crates, we should extract the "component crates" into a separate repository and Cargo workspace. By "component crates" I mean "crates that don't depend on the protocols", but this could also be the narrower "crates that the protocols depend on".
The text was updated successfully, but these errors were encountered: