Skip to content
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

Bitswap support in Libp2p helper #9626

Merged
merged 21 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions buildkite/src/Jobs/Test/Libp2pUnitTest.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ Pipeline.build
key = "libp2p-unit-tests",
target = Size.Large,
docker = None Docker.Type
},
Command.build
Command.Config::{
commands = [
Cmd.run "chmod -R 777 src/libp2p_ipc",
Cmd.runInDocker
Cmd.Docker::
{ image=ContainerImages.minaToolchainBuster
, extraEnv = [ "GO=/usr/lib/go/bin/go" ]
} "make -C src/app/libp2p_helper test-bs-qc"
],
label = "libp2p bitswap QuickCheck",
key = "libp2p-bs-qc",
target = Size.Large,
docker = None Docker.Type
}
]
}
13 changes: 13 additions & 0 deletions src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ let setup_daemon logger =
"true|false Help keep the mesh connected when closing connections \
(default: true)"
(optional_with_default true bool)
and min_connections =
flag "--min-connections" ~aliases:[ "min-connections" ]
~doc:
(Printf.sprintf
"NN min number of connections that this peer will have to neighbors \
in the gossip network (default: %d)"
Cli_lib.Default.min_connections)
(optional int)
and max_connections =
flag "--max-connections" ~aliases:[ "max-connections" ]
~doc:
Expand Down Expand Up @@ -1026,6 +1034,10 @@ let setup_daemon logger =
let direct_peers =
List.map ~f:Mina_net2.Multiaddr.of_string direct_peers_raw
in
let min_connections =
or_from_config YJ.Util.to_int_option "min-connections"
~default:Cli_lib.Default.min_connections min_connections
in
let max_connections =
or_from_config YJ.Util.to_int_option "max-connections"
~default:Cli_lib.Default.max_connections max_connections
Expand Down Expand Up @@ -1075,6 +1087,7 @@ Pass one of -peer, -peer-list-file, -seed, -peer-list-url.|} ;
; direct_peers
; mina_peer_exchange
; peer_exchange = Option.value ~default:false peer_exchange
; min_connections
; max_connections
; validation_queue_size
; isolate = Option.value ~default:false isolate
Expand Down
1 change: 1 addition & 0 deletions src/app/cli/src/tests/coda_worker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ module T = struct
; trust_system
; flooding = false
; direct_peers = []
; min_connections = 20
; max_connections = 50
; validation_queue_size = 150
; peer_exchange = true
Expand Down
1 change: 1 addition & 0 deletions src/app/cli/src/tests/full_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ let run_test () : unit Deferred.t =
; client_port
}
; trust_system
; min_connections = 20
; max_connections = 50
; validation_queue_size = 150
; keypair = None
Expand Down
3 changes: 0 additions & 3 deletions src/app/libp2p_helper/BUILD.bazel

This file was deleted.

201 changes: 0 additions & 201 deletions src/app/libp2p_helper/LICENSE

This file was deleted.

17 changes: 16 additions & 1 deletion src/app/libp2p_helper/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
.PHONY: libp2p_helper clean test
.DEFAULT_GOAL := libp2p_helper

ifeq ($(GO),)
GO := go
endif

../../libp2p_ipc/libp2p_ipc.capnp.go:
make -C ../../libp2p_ipc libp2p_ipc.capnp.go

libp2p_helper: ../../libp2p_ipc/libp2p_ipc.capnp.go
$(WRAPAPP) ../../../scripts/build-go-helper.sh libp2p_helper

test: ../../libp2p_ipc/libp2p_ipc.capnp.go
$(WRAPAPP) ../../../scripts/build-go-helper.sh --test libp2p_helper
cd src/libp2p_helper && $(GO) test -short -timeout 15m

test-bs-qc: ../../libp2p_ipc/libp2p_ipc.capnp.go
cd src/libp2p_helper \
&& (ulimit -n 65536 || true) \
&& $(GO) test -timeout 40m -run "^TestBitswapQC$$"

test-large: ../../libp2p_ipc/libp2p_ipc.capnp.go
cd src/libp2p_helper \
&& (ulimit -n 65536 || true) \
&& $(GO) test -timeout 40m -run "^TestBitswapMedium$$" \
&& $(GO) test -timeout 40m -run "^TestBitswapJumbo$$"

clean:
rm -rf result ../../libp2p_ipc/libp2p_ipc.capnp.go
59 changes: 0 additions & 59 deletions src/app/libp2p_helper/WORKSPACE.bazel

This file was deleted.

1 change: 0 additions & 1 deletion src/app/libp2p_helper/bzl/libp2p/BUILD.bazel

This file was deleted.

Loading