monero.loveA little love for the network.
← All guides

Network Simulation / Monero Research

Monerosim Explained: How Researchers Test Monero's Network Without Using Mainnet

Follow a Monerosim experiment from a YAML scenario to running Monero nodes. Learn how Shadow handles time and how researchers interpret transaction logs.

A YAML scenario feeds Monerosim's Rust generator. Shadow runs Monero processes on virtual links. Researchers compare the resulting logs.

Suppose two Monero nodes record the same transaction four seconds apart. The difference could come from a relay timer, a slow link, a busy wallet or the way the observer defines receipt. On the public network, a researcher knows only some of those things. In Monerosim, the researcher chooses the programs, the links and the workload, then reads the logs from both ends. The freedom to choose also creates an obligation to explain which choices shaped the result. Monerosim project and documentation

Simulation diagram (SVG)

Which programs run

Monerosim has two stages. First, its Rust generator reads a YAML description of an experiment and produces a configuration for Shadow. Second, a Monero-specific fork of Shadow starts Linux processes on virtual hosts. The Monero daemon still makes peer connections, checks blocks and relays transactions. Shadow intercepts system calls needed to supply networking and time. Its discrete-event scheduler orders events such as a packet arriving or a sleeping process becoming ready. A minute on the simulated clock might take seconds or several minutes on the researcher's clock. Monerosim architecture · Shadow's design

A host's role determines which processes it needs. A relay can participate with a daemon alone. A user generally has a daemon, a wallet RPC service and a Python agent. The agent asks the wallet to make payments. The wallet and daemon handle the transaction using their own code. A mining agent produces blocks, a distributor can fund users, and a monitor observes progress. Counting simulated hosts tells you less about the workload than counting active senders, relays, miners and observers separately. Roles and example configuration

The underlying link graph and the application's peer network answer different questions. The graph describes the paths available to packets and their modeled costs. The peer network consists of the connections the running daemons form over those paths. Two nodes placed near each other on the underlying graph need never become direct Monero peers. A link-latency change can alter propagation even with the same peer connections. A peer-selection change can affect propagation on the same link graph. Saving both the input topology and observations of actual connections makes it possible to tell those effects apart. Network configuration

Which clock makes the blocks?

In the default mining mode, a Python agent schedules block generation using seeded random timing. It calls the daemon's regression-test block generation interface. The chain acquires blocks other daemons can validate, while the experiment controls who finds the next block and when. This is a convenient way to study transaction propagation with a repeatable source of new blocks. A result about mining incentives depends on the process that selected the miner and assigned difficulty. Mining modes

An optional native mode uses a patched mining daemon. Its miner takes a real block template and performs RandomX hashes, with pacing tied to the configured hash rate. Other nodes can verify the blocks. That path allows the daemon's own mining and difficulty logic to participate in the experiment. It still describes a deliberately small chain with assigned miners. A reported hashrate in this mode describes the experiment's input. It says nothing about the mining power required to win blocks on mainnet. Native proof-of-work design

A small local example

The project's quick start includes a small scenario with five miners and three transacting users and a relay. It also includes a distributor and monitor, a six-hour simulated duration and a seed of 12345. The start schedule gives the miners time to build the chain and lets rewards mature before users send money. The project lists 8 GB of RAM as the floor for this example and recommends a dedicated Linux account for the tools, which create and clean up process state during a run. Use a checkout matching the linked configuration and follow its setup instructions first. Pinned quick start · Exact scenario

Shell
./run_sim.sh --config test_configs/quickstart.yaml

Run this from the configured Monerosim checkout. The example uses a local regression-test chain and Shadow's virtual network. The progress display reports height, blocks, transactions and synchronization. The upstream authors give a rough wall-time estimate for their example. Your machine, binaries and configuration determine the elapsed time. We verified the command and inputs against the project files. Running simulations

For a first reading, check that the chain advanced, users reached their scheduled activity period and their payments appeared in blocks. A run can end on schedule with too little activity to answer the original question. A transaction count of zero before the wallets have spendable funds tells you nothing about relay speed. Look at agent output alongside the daemon logs if the expected transactions never appeared. The project archives the run configuration and output separately for each run so the next comparison can use the same starting assumptions. Quick-start timing and outputs

How to compare two runs

Start with one question concrete enough to measure. For example, does substituting a different relay implementation change how long transactions take to reach the same observers? Hold the topology, seed, transaction schedule and observer set fixed. Choose an event that has the same meaning in both measurements. A wallet reporting a successful submission and a remote daemon recording receipt mark different stages of a payment. Subtracting their timestamps across different implementations could measure the logging convention itself. Cuprate comparison design

In the published mixed-implementation study, the researchers compared a reference-only network with one containing 149 Cuprate relays. They timed receipts at reference-daemon observers in both runs. They then varied the outbound connection count to examine how much of the difference could follow from Cuprate's more numerous peers. Reporting how many observers saw a transaction matters alongside the median delay. A median computed only from successful deliveries can improve even while more observers miss messages. The July report gives both propagation times and reach. Comparison and connection follow-ups · Cuprate node project

A scenario is only part of a reproducible record. Keep the Monerosim revision, the pinned Shadow and Monero revisions, any daemon patches and the expanded configuration. Record the seed, mining mode, observation window and host settings that affect execution. The developers report that determinism at 1,000 or more agents remains unvalidated. Use several seeds when a finding might hinge on who connects first. Separating repeats with identical inputs from repeats with deliberately different seeds makes two distinct checks possible. The first looks for unexplained variation. The second asks whether the result survives ordinary variation in the modeled network. Dependency pins and scenario formats

What each kind of network can tell you

Environment What the researcher controls What it can answer
An ordinary node on mainnet Its own binary, settings and instrumentation What this node accepted, saw or relayed while connected to real peers
A private local test network The participants and their chain Whether a small set of nodes and wallets can perform a particular operation
A Shadow simulation The virtual links, node roles, schedule, workload and software versions How two configurations behave under specified, repeatable conditions
A public stressnet A shared test chain with participants running their own machines How participating builds interoperate and cope with a coordinated public test
Passive production measurements The sampling method and consenting observation points How often a phenomenon appeared within that sample of real activity

A stressnet can expose behavior arising from machines, wallets and operators outside the author's control. Mainnet observations supply a reference distribution for comparison. Neither provides a reset button that restores every participant to the same history. A simulation supplies that experimental control but samples the researcher's assumptions about arrival times, peer availability and traffic. Applying the same analysis to both sources can reveal assumptions that need testing. Research Lab test-network agenda · Mainnet and simulator comparison

Why a bigger simulation can give a worse match

Rucknium compared the span of transaction activity seen from individual peers in voluntarily supplied mainnet logs and in two simulated networks. The median inferred connection duration was about 121 minutes in a 35-node run, 1.52 minutes in a 1,000-node run and 23 minutes in the mainnet sample. The small test ran for 72 simulated hours. The large one ran for 16. Five logs from the small run and ten from the large one entered the analysis. An estimate based on a peer sending transactions also measures a different event from an explicit socket close. Rucknium's public beta review

A follow-up inspected actual connection events in the large run and identified a periodic search for peers. The simulated network could refill an outgoing slot almost immediately. That produced a recognizable pattern in the observed lifetimes. The investigators could use a discrepancy to locate a mechanism precisely because the simulator preserved logs behind the summary statistic. The same follow-up left other differences open, including why mainnet transaction batching differed after accounting for traffic volume. Follow-up analysis

From an observation to a change in Monero

A research question leads to a controlled run, measurement and a candidate change. Review, independent tests and release decisions precede deployment.

Research workflow (SVG)

Peer diversity, mining fairness and compatibility each need different evidence. A peer-selection study can measure whether a node keeps an independent view as peers come and go. A mining study can compare honest miners' stale blocks under different propagation delays. A compatibility study can ask whether two implementations agree on a chain tip and continue to agree after a reorganization. The easiest metric to collect, such as a successful process exit, rarely answers all of those questions. Research Lab work · Share or Perish study

A promising result supplies a test case and sometimes a proposed patch. Reviewers still need to inspect the implementation, repeat the relevant tests independently and check cases that the simulation omitted. The version in a stable release can differ from the research branch. Node operators then choose when to upgrade, and consensus changes can require coordinated activation. A reproducible report identifies the binaries and conditions under which someone else can test its claim. Monero development repository · Peer-selection proposals and their review history

For planning a run, begin with the number of active wallets, expected transactions, logging level and the time needed after startup to see the behavior of interest. The project's scale study reports 98 GB peak RAM for one 1,011-host workload and shows how logging changes the disk budget. Our infrastructure feature traces those measurements back to the configurations and explains why even a server with a terabyte of memory can run short of scratch space. Inside Monero's research computing cluster

Support Monero Love

Help keep the public nodes and packages running. Send any amount of XMR.

Scan with a Monero wallet to donate to Monero Love.89hGTKxRVA3AUeKAbCRBt5TMSzq3MQZooNNsezCpNFjp2oeJPRx8AJeGKA8ziHZNqab78f4Vr1ntxhPDxX5298nnGZjHkhm