This repository was archived by the owner on Jan 5, 2026. It is now read-only.
feat: create network simulator#108
Open
0xmovses wants to merge 29 commits into
Open
Conversation
0xmovses/flake
0xmovses/system deps
Contributor
|
I'd like to Move this into https://github.com/movementlabsxyz/sdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes made
Created a new
simulatorcrate that will enable us to simulate asynchronous network conditions with more degrees of control. We can use this crate to build out further e2e tests also.I had to fork the anr-rs-sdk, as the avalanche-maintained rust client did not support the RPC calls we needed. I made several commits there, updating the
rpc.protofile and adding new client methods.System Deps
NB: These will be managed by the nix dev environment. But for now, when running locally it's critical to have
avalanchegoinstalled specifically v.1.10.12.Pre-reqs
avalanchegobinary needs to be in ~/.mvmt/avalanchego/build`, the ANR running in the simulator looks for it at that path. (We can change this path to wherever it will be in the nix shell).Because the plugin version supported is
28. Any versions higher than this will not work with our vm-pluginsubnet. Lower versions are possible, but I went with the latest, working version.Testing steps
cd m1/simulator && cargo buildcargo run start --verbose, orcargo start --nodes 5cargo add-validator --name node1cargo remove-validator --name node 1cargo add-node --name node6cargo remove-node --name node6Further Considerations
I ran into an interesting issue to do with avalanchego versions and our vm-plugin version. Our subnet runs vm-plugin version
28, the latest avalanchego version that can run our subnet is v1.10.12We have scripts to help with installation, but they have to be run in particular orders, also there are different scripts directories at different places in our workspace. Until we have the nix-shell running with all the deps needed. I could put together a doc for onboarding any devs that are going to be working on the m1 repo, as there are a few system-deps needed and understanding around how we use them, with avalanche-network-runner, for example.
Although, it does seem like nix-shell will be runnable soon, so maybe this doc not needed as that will alleviate all pain points here. I'd say this work around the nix-shell / system- dependencies and dev-ex is separate to the simulator.