massa icon indicating copy to clipboard operation
massa copied to clipboard

Get rid of Consensus

Open damip opened this issue 3 years ago • 5 comments

Rationale

Since the refactoring, block production, operation management etc... were all removed from Consensus. Consensus now only manages the block graph, ticks for the block graph, and communication between graph and other modules. It also uses async for no good reason.

TODO in this PR

  • remove massa-consensus-exports
  • remove massa-consensus-worker
  • split massa-graph into:
    • massa-consensus-worker: to run a separate worker thread with its own clock ticker and that directly talks to other modules (no async)
    • massa-consensus-exports for the consnensus controller trait and various exports (no async)

damip avatar Aug 22 '22 14:08 damip

I think we should first fix all consensus tests and do other clean-ups first, otherwise it's going to be very hard to resolve the conflicts with this proposed refactoring.

Also, the use of async and the fact that "consensus" doesn't do much besides managing graph, is not a big problem right now, so it could be done for the next testnet?

gterzian avatar Aug 23 '22 06:08 gterzian

Yes let's keep it for testnet 15. Together with https://github.com/massalabs/massa/discussions/2895

damip avatar Aug 23 '22 07:08 damip

I still don't think "graph" is a good module name, there are graphs in other places, and it does not reflect what's going on inside... so why no going for "consensus" or "blockclique" or "Nakamoto" or "clique" or "bestclique" ?

sebastien-forestier avatar Sep 11 '22 16:09 sebastien-forestier

because this module does all the block graph handling (dependency tree resolution AND graph storage AND compatibility graph computation AND clique computations AND nakamoto) but doesn't do all the consensus (the final state/ledger is also part of the consensus but is not handled by this module)

damip avatar Sep 13 '22 13:09 damip

Actually after thinking more about it I think you're right @sebastien-forestier , "consensus" sounds better :)

damip avatar Sep 23 '22 15:09 damip

Done in https://github.com/massalabs/massa/pull/3162

AurelienFT avatar Dec 01 '22 14:12 AurelienFT