massa icon indicating copy to clipboard operation
massa copied to clipboard

Rework consensus and refactor graph

Open AurelienFT opened this issue 2 years ago • 1 comments

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

AurelienFT avatar Sep 26 '22 21:09 AurelienFT

@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.

AurelienFT avatar Oct 13 '22 17:10 AurelienFT

Close in favor of #3162

AurelienFT avatar Oct 24 '22 14:10 AurelienFT