massa
massa copied to clipboard
Rework consensus and refactor graph
This PR aims to remove consensus as it's now only a module that call block graph.
All the code from consensus will be removed or moved to graph.
The async from consensus will be remove also
Changes in algorithm:
- get_all_final_blocks will now return storage to avoid two fetching
@sydhds @gterzian Can you review this PR that is a draft for now ?
The architecture of consensus is ok to me I designed it in a separate crate. There is one/two little TODO I will address a bit more doc.
I tried to split the existing behavior to avoid having unreadable files and functions. I think I can still split a bit more will work on it.
I also added a lot of documentation even if some functions don't have yet.
To give a bit overview of the architecture. Graph will run in a separate thread. To interact with him we will use a controller that share a state with the thread. Pretty much all the code is in the state. The thread write in the state and the controller read it. Graph will make calculation each slots + whenever he receive a block/header from the controller.
Close in favor of #3162