Repository for WIP project on applying Deadline Ordered Multicast to a BFT protocol.
Note this repo is based off of Nezha.
I used Bazelisk as a wrapper for Bazel, which allows for us to specify a version of Bazel to use (5.2.0). The way third party dependencies are setup in this repo means that more recent versions of Bazel are not compatible.
To build the client
bazel build //processes/client/...
The same syntax is used to build the proxy
, receiver
and other components. You can
also build all of them at the same time with something like
bazel build //processes/...
The built executables will be created by default in bazel-bin
, inside of which is
the same directory structure as the source, containing the executables.
The /scripts directory also contains a number of helpful scripts for running the executables both locally and remotely. See the README there for more details.
Tests exist for this code, though I make no guarantees about how comprehensive they are. The tests can be built with
bazel build //test/...
The files starting with test_
are gtest files for various components that I've built.
This repo includes a super basic Docker setup which can be used for development. Future work is planned to make it more realistic for testing and deployment.
The current way to use this setup is to simply run
docker compose run --rm dev
This will give you a bash shell in a conatiner where you can run the above commands to compile the code. Docker compose mounts the source code into the container as well, so any changes you make locally (i.e. in an editor) will be reflected in your conatiner.
To get CPU profiles of the processes, we use the gperftools CPU profiler. The steps for setting this up are:
-
Build and install the repository https://github.com/gperftools/gperftools on the machine you plan to run the profile on
-
Follow the instructions here: https://gperftools.github.io/gperftools/cpuprofile.html to run the process with the profiler. Specifically, append
env LD_PRELOAD='.../libprofiler.so' CPUPROFILE=profile.prof
to the command.- Note it isn't reccomended in the above link to do this runtime linking. We should probably figure out how to incoporate this library into our build
- Also, the
invoke gcloud-run
command includes a--profile
argument that adds this to processes already, for running on the cloud.
-
Visualize the profile results with the pprof tool: https://github.com/google/pprof.
pprof -web [main_binary] profile.prof