Sep 2021
The MyCHIPs reference implementation release maintains state in a PostgreSQL database. This database is surrounded by one or more NodeJS server processes. which route traffic to/from administrators, users and peer systems.
The code as released in 2020 was crafted according to a set of proposed state transitions documented here. This evolved through an iterative process while trying to understand and develop the agorithm. Now that the algorithm is better.
A few unit tests were completed for basic parts of the protocol. But most of the states do not have functional unit tests.
Soon after public release of the code, a study was commissioned to analyze the proposed state flow--particularly as it relates to the distributed lift protocol. This study revealed several potential flaws in the protocol.
Since that time, the protocol has been extended and refined to address the exposed flaws. This improved protocol is documented as version 1.0 here. The security of distributed lifts using this improved protocol is the subject of current study at BYU. Preliminary results indicate that the security extensions provide for adequate safety and liveness for successful deployment of the network.
Now that a viable distributed network protocol has been tested and articulated, it is possible to take a more disciplined top-down approach to engineering the state processing code to fully implement the improved protocol.
The goal of this project is to upgrade the current state control logic to implement the improved protocol specification.
This will involve:
- Designing/coding unit tests for each component of the state transition logic;
- Updating the server code to implement the improved protocol;
- Validating server function
- Creating simulated tests for Byzantine failures and attacks;
- Validating server safety and liveness amidst Byzantine failures and attacks.
State transition logic and protocol exists for:
- Establishing Tallies
- Sending/receiving Chits (paying money locally)
- Route discovery (finding possible lift pathways)
- Lift execution (resolving credit imbalances and/or sending money to remote users)
- Understand the current code structure
- Can launch multiple instances of the server using the existing simulation environment;
- Evaluate the structure and function of the existing state transition logic;
- Plan/architect any structural code improvements;
- Understand the improved protocol;
- Write unit tests against state transition logic;
- Implement code improvements to state transition logic;
- Evaluate against unit tests
- Unit tests run under existing Node module structure (npm test)
Current limited unit tests are implemented in mocha. Are there any other (better) testing platforms that should be considered?
New unit tests may use mocha or some other framework, but should integrate properly with the existing tests.