-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mock-node: simplify and remove client setup code (#12838)
Before this change, the mock-node tool starts one mock node, and one normal neard node with `nearcore::start_with_config()`, and then waits for the node to sync. It also modifies and sets up a home dir for this client if `--client-height` is given on the command line. However, nobody was really using this `--client-height` feature much. Since we can get good test/benchmark results from just using a regular neard home directory taken from mainnet or localnet testing, we don't really need any code that manually sets up the database state. Then if we get rid of that, the question arises: why does this code even start a node with `nearcore::start_with_config()`? There's not a great reason to do it in the same binary, and doing so restricts the use of this tool, since we can't use it to test a standard neard binary, but must build a custom `mock-node` binary that's not very intuitive unless you've looked at the code. So here we delete all the client set up code and just have the node start a mock node listening on whatever addr is specified in the near config. Then to use it to benchmark the sync performance of a node, you just need to set the right boot nodes argument (and possibly also manually wipe the peer store), and you can use a normal neard binary for tests
- Loading branch information
1 parent
54b225f
commit 5d9d184
Showing
4 changed files
with
78 additions
and
498 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.