About DVs
Exploring the Charon Test Command
18 Oct 2024
The recent release of Charon v1.1 included a new alpha feature: the Charon test command. Created by DV Labs Protocol Engineer Kaloyan Tanev, the test command is a convenient way to test the performance of a candidate DV node and full DV cluster to spot issues before the Distributed Validator is fully created.
In this article, Kalo explains the work that went into the test command, and what’s next for the project.
Why the test command is needed
In multi-operator, geographically distributed clusters, it can be hard to tell how good or bad connectivity will be between the nodes, especially when people may not be familiar with their machine’s performance and internet quality. It is a big waste of time to set up an entire cluster only to realise that performance is poor, and the setup needs to be changed.
As described in the docs, the command can run multiple tests, on your machine’s hardware and internet connection, the Charon clients, beacon nodes, your validator client, and even MEV relays.
To test other Charon peers, you and the other cluster nodes first need to create ENRs. You then run the test command by entering the ENRs of the other nodes in the cluster. All nodes run the command at the same time, similar to the DKG command.
Similarly, a beacon node can be tested. Usually the beacon node is the most resource heavy service that Charon communicates with. To test your connection with it, nothing more than the beacon API’s URL is required.
Once a test has finished, it will give a letter-grade score viewable in the CLI and results for each test. You can also output the information to a file. The screenshot below shows a test of two public beacon nodes, one on Holesky testnet and one on Sepolia testnet, resulting in a grade “A” score.
The operators in Lido’s SimpleDVT have been running the MEV test a lot, and produced a lot of useful data. Given that they have hundreds of geographically distributed operators, the data they collect should be quite valuable about latencies to MEV relays with different geographies and setups. It’s been great to see the command get put to use already, but I would also like to see more subcommands being used. (By the way, the MEV test command has nothing to do with Charon, so you can test against MEV Boost relay URLs even if you aren't running Charon! The same also goes for the beacon node test and the hardware performance.)
The next iteration in the test command
Aside from adding more tests, the goal for the future is to make it more understandable for the user, and to bring that data beyond the terminal. Soon, you will have the option to publish your results to the Launchpad, allowing all the cluster peers to see each others’ test results in aggregate, directly in the browser. The first step would be creating a prompt within the launchpad to run the CLI command, similar to how the DKG command is shown in the launchpad currently.
From a solo project to a group effort
Until now, I mainly worked on this project by myself, with some support from colleagues. I had to do a lot of P2P protocol work, sometimes digging deep into Charon’s QBFT consensus, while getting support from our Senior Protocol Engineer. It was also very helpful to ask hardware-related questions to our Protocol Tech Lead, since he has lots of experience with hardware, Linux, and networking.
Getting the peer-testing working was quite interesting, since in the background it creates a whole network and then runs the tests. Another challenge was the hardware performance test, which had to work regardless of the type of OS, and for multiple hardware types including local consumer-grade PCs, bare metal servers in data centres and cloud-based VMs. There is still quite some work that needs to be done on that front.
To work toward the next milestone, I will be working together with the API and Launchpad teams to incorporate the test command into their workflow and products.
If this is interesting to you, don’t hesitate to get in touch with me directly, or use our jobs site to apply for an open role or submit a general application. Thanks for reading, and keep an eye out for future developments of the test command!