An Insight into Muon’s New Multicore Technology

Boosting efficiency and optimizing the use of resources on the Muon network

Robert Wallace
Muon
3 min readOct 24, 2022

--

On October 10, an article called Muon Core Enhanced was published on Medium about a new upgrade to Muon Core. To provide readers with a deeper technical understanding of how multicore processing was implemented to the Muon node, we have compiled this follow-up article with all the in-depth details.

Implementation of Microservices

Muon V3 was implemented in mid-summer 2022 ahead of schedule. Up until V3, the Muon node was a monolithic application which was built as a single unified unit. But Muon’s innovation in V3 was to change its node’s structure and create a microservice architecture which allows the Muon node to use all available CPU cores. This new node is made up of three microservices that use Redis as a communication channel.

The node incorporated three microservices:

  • Gateway: This service is the outermost layer and acts as the node’s interface between users and Muon network. It includes an Express web server that nodes run and receives data requests. As each node can not support all apps, the gateway service checks whether or not the node supports the app that is to handle the request. If it can, it forwards the request to the core service; if it cannot, it routes the request to the node that supports the app. In the present architecture, the gateway is a one-instance microservice as it is not a CPU-intensive section of the node.
  • Core: This service is the second layer that runs MuonApps; that is, it receives requests, and processes them. If the requested data is verified, it is sent to the network service to collect other nodes’ shares of the threshold signatures. Finally, the shares are aggregated and a single threshold signature is generated. The Core is the most computationally intensive microservice.
  • Network: This service is tasked with establishing secure communications between nodes through the Libp2p framework.

A Bottleneck Removed

The division of the Muon node to microservices results in more modular codes. One of its major benefits is to help scale the system. Breaking the node down into different microservices allows each microservice to have its own process; moreover, it allows running multiple concurrent processes from a microservice. When an app uses multiple processes, they are run simultaneously on different CPU cores. This leads to more efficient performance.

Multiprocessing is particularly beneficial when used to replicate multiple instances of the slowest sections of an app: bottleneck sections. The most CPU-intensive section of the Muon node is calculating threshold signatures; in the new architecture, it has been encapsulated in the Core service. The encapsulation enables running multiple processes from this service concurrently; that is, calculations for different requests can be distributed among all available CPU cores, which optimizes system resource usage. This means if, for example, there are 10 CPU cores, Gateway and Network services run on one core and the other 9 are allocated to the Core microservices.‏

It is worth mentioning that if, at some point, a node needs to manage a large number of user requests, the Gateway service can easily be made to run on more than one core.

In short, due to the successful implementation of multiprocessing in V3, the Muon node has been upgraded significantly. As a result of the upgrade, the Muon node runs more efficiently and Muon users will be able to enjoy faster responses to their requests.

Pion is the Muon ecosystem’s Canary and first mainnet. It is a chain-independent and stateless DON (Decentralized Oracle Network) that enables dApps to make their off-chain components decentralized. By incorporating Pion (by Muon), the manner in which decentralized applications store, process, and access data will be fundamentally transformed.

Run a Pion node.

Twitter | Telegram | Discord | Website | Medium | GitBook | Developer’s Guide

--

--