Problem
The current ciphernode folder structure doesn't reflect our architectural dependency goals. Because we tried to keep things flat - it has meant that core business logic modules appear mixed with infrastructure code, making it unclear that core modules should never depend on EVM or networking code or anything else aside from the events module. This separation is essential for keeping core code easily testable.
Proposed Solution
Refactor the ciphernode code to clearly indicate component dependencies by colocating all core logic modules in a dedicated core/ folder.
Modules to move into core/:
keyshare
sortition
events
aggregator
request rename event-router
utility (*anything we use in core like ArcBytes)
fhe (to be deleted - although a couple of routine will need to be relocated)
Rules for core:
- Must exist completely in memory and have no IO. (except the event bus)
- All external capabilities come through events
- No blocking
Rationale
We originally had this structure but flattened it under the assumption that "flat is better than nested." However, this lost the important distinction between core and non-core modules.
Implementation
- Create a core/ folder
- Move each listed crate into it, including the tests folder
- Add a README explaining the dependency rules: packages in core/ should never depend on external infrastructure packages (EVM, networking, etc.), with the sole exception of the events package which everything depends on
Problem
The current ciphernode folder structure doesn't reflect our architectural dependency goals. Because we tried to keep things flat - it has meant that core business logic modules appear mixed with infrastructure code, making it unclear that core modules should never depend on EVM or networking code or anything else aside from the events module. This separation is essential for keeping core code easily testable.
Proposed Solution
Refactor the ciphernode code to clearly indicate component dependencies by colocating all core logic modules in a dedicated
core/folder.Modules to move into
core/:keysharesortitioneventsaggregatorrequestrenameevent-routerutility(*anything we use in core likeArcBytes)fhe(to be deleted - although a couple of routine will need to be relocated)Rules for core:
Rationale
We originally had this structure but flattened it under the assumption that "flat is better than nested." However, this lost the important distinction between core and non-core modules.
Implementation