Open eddyashton opened 2 years ago
The repo currently contains 3 READMEs which claim the following dependencies:
ds/README.md
# Data Structures
This directory contains data structures and utilities used by the rest of the code. No files
in this directory should include files from any other directory.
kv/README.md
# Transactional Key Value Store
This directory implements a transactional key value store. The only directory
it should depend on is `ds`.
crypto/README.md
# Crypto
This directory implements several cryptography helper types. The only directory
it should depend on is `ds`.
None of these dependencies are currently enforced. The actual dependencies between the folders under src/
look like this:
Dotted lines show mutual/circular dependencies. Initial thoughts:
kv/
and consensus/
, and believe it's extremely hard to breakds/
to crypto/
crypto/
, I wonder if it's worth splitting thisclients/
, host/
, apps/
), we should enforce that distinction while we have it
The build-time dependency graph between components in CCF has grown messier over time. We originally had
README.md
s in somesrc/
folders indicating their intended dependencies, but these have rotted over time.We should re-evaluate what dependencies we have and can enforce, to keep the code base navigable.
A few high-level goals to start with:
nlohmann/json
is used throughout the codebase, including in core containers), with a few exceptions: We should limit visibility of anything platform-specific (including SGX and host-only libraries).ds/
should not depend on anything else. This is a place for generic containers and shims that may be used by multiple other components.ds/
. For instancecrypto/
,tls/
, andhttp/
could be written like this - generic protocol implementations and helpers, stripped of platform-integration features.kv/
andconsensus/
, we should try to document this coupling to ensure it is required.