dusk-blockchain
dusk-blockchain copied to clipboard
Evaluate efforts needed to migrate consensus from golang to rustlang
Describe what you want implemented
Build a rust lib that encapsulates a rust implementation of golang package github.com/dusk-network/dusk-blockchain/pkg/core/consensus/
. This should follow the same design of the original package where golang runtime is substituted with tokio::runtime.
The library should also address how consensus lib will:
- receive wire messages ( currently it receives messages from the wire via EventBus in a unmarshaled form )
- send wire messages ( currently it publishes messages to EventBus as mediator to transport layer )
- interact with synchronizer/chain components
- interact with mempool
- interact with KV (append-only) store
Describe "Why" this is needed A replicate implementation of consensus pkg could be a major step toward having dusk-blockchain repo fully implemented in rustlang. Additionally, while we're upgrading/optimizing the live version of consensus (the golang impl) it should be feasible to maintain rustlang impl in parallel.
Describe alternatives you've considered
- Instead of replicating the consensus impl in golang that is based on green threads, the rustlang consensus could be a re-designed version taking advantage of native nature of the language (e.g spawning OS threads for agreement and consensus loops)
Additional context