-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create network simulator #108
Open
0xmovses
wants to merge
29
commits into
main
Choose a base branch
from
0xmovses/simulator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
0xmovses/flake
0xmovses
added
enhancement
New feature or request
tooling
Ask for improvements to tooling
testing
Additions to tests
big
a diff of 800+ lines
labels
Feb 17, 2024
0xmovses/system deps
0xmovses
changed the title
feat: create network simulator [WIP]
feat: create network simulator
Feb 20, 2024
I'd like to Move this into https://github.com/movementlabsxyz/sdk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
testing
Additions to tests
tooling
Ask for improvements to tooling
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
simulator
crate 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.proto
file 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
avalanchego
installed specifically v.1.10.12.Pre-reqs
avalanchego
binary 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 build
cargo run start --verbose
, orcargo start --nodes 5
cargo add-validator --name node1
cargo remove-validator --name node 1
cargo add-node --name node6
cargo remove-node --name node6
Further 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.