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

go-algorand 3.26.0-beta Release PR #6133

Merged
merged 84 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
5c2cf06
Merge pull request #6000 from Algo-devops-service/relstable3.24.0
algojohnlee May 15, 2024
88b0ca5
tests: fix TestVotersReloadFromDiskAfterOneStateProofCommitted (#6024)
algorandskiy Jun 11, 2024
985512b
network: Allow short-lived connections to query /status endpoint when…
hsoerensen Jun 11, 2024
a5aac42
tests: debug output on LibGoalFixture failure (#6026)
algorandskiy Jun 11, 2024
4caf2e4
AVM: Expose relevant incentive constants (#6025)
jannotti Jun 11, 2024
7f89399
libgoal: output debug info on failure to stderr (#6027)
algorandskiy Jun 12, 2024
9191b1b
config: Add GoMemLimit config option and use with 10-node test (#5975)
ohill Jun 12, 2024
dbe60ee
Legacy Docker: pin ubuntu version (#6028)
onetechnical Jun 12, 2024
4e116cb
config: Add warning if EndpointAddress and NetAddress ports are equal…
hsoerensen Jun 12, 2024
6b09750
Merge branch 'rel/beta' into relstable3.25.0
Algo-devops-service Jun 12, 2024
9855f57
Merge pull request #6029 from Algo-devops-service/relstable3.25.0
algojohnlee Jun 13, 2024
95c9c18
tests: preserve logs on LibGoalFixture failure (#6030)
algorandskiy Jun 13, 2024
97ab559
simulate: fix signers (#5942)
joe-p Jun 14, 2024
232219e
Merge remote-tracking branch 'origin/rel/stable' into relstable3.25.0…
Algo-devops-service Jun 17, 2024
02961e3
Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.
Algo-devops-service Jun 17, 2024
d02ee6a
Merge pull request #6033 from Algo-devops-service/relstable3.25.0-rem…
algojohnlee Jun 17, 2024
052f832
catchup: do not loop forever if there is no peers (#6037)
algorandskiy Jun 20, 2024
052ceb2
CICD: remove mac AMD64 support from circleci (#6036)
onetechnical Jun 21, 2024
24382d8
node: close ledger and part keys on node shutdown (#6039)
algorandskiy Jun 25, 2024
c99a1c9
build: add universal Mac make target (#6023)
ohill Jun 26, 2024
f523300
Metrics: Add algod version to metrics (#6003)
hsoerensen Jun 26, 2024
d3831cd
ledger: restore block listeners on reloadLedger (#6041)
algorandskiy Jun 26, 2024
63c0d5b
testing: set pprof labels for goroutines that use the same code for d…
cce Jun 27, 2024
c8407ab
network: p2p traffic exchange for algorand node (#5939)
algorandskiy Jun 28, 2024
4ba009b
network: use http.ResponseController instead of GetHTTPRequestConnect…
cce Jul 1, 2024
3bcfedb
tests: extend TestP2PRelay logging (#6048)
algorandskiy Jul 1, 2024
1b29523
CI: increase artifact upload timeout (#6050)
onetechnical Jul 3, 2024
b3c7bca
Config: Expose merged configuration for easier debugging (#6049)
gmalouf Jul 8, 2024
046d01d
tests: increase ListPeersForTopic wait time in TestP2PRelay (#6056)
algorandskiy Jul 8, 2024
a9641a3
ci: pin reviewdog version to v0.18.1 (#6058)
algorandskiy Jul 8, 2024
2929329
algod: fix telemetry lookup if phonebook is used (#6061)
algorandskiy Jul 10, 2024
cf99017
tests: fix concurrent accout commits in TestLedgerVerifiesOldStatePro…
algorandskiy Jul 10, 2024
b46e2c1
tests: disable TestP2PRelay on CI (#6059)
algorandskiy Jul 10, 2024
5869a00
logging: change transaction pool re-evaluation message from warn to i…
cce Jul 10, 2024
1493410
P2P: Disable circuit relaying via libp2p.NoListenAddrs (#6064)
gmalouf Jul 12, 2024
8a44d87
rest api: Fix to Disable API authentication (#6067)
algorandskiy Jul 15, 2024
48a539f
rest api: make RawTransactionAsync developer api (#6069)
algorandskiy Jul 15, 2024
1fa0ef7
P2P: Introduce profiles for hybridRelay, hybridArchival, and hybridCl…
gmalouf Jul 18, 2024
9c93670
p2p: hybrid node net identity for connection deduplication (#6035)
algorandskiy Jul 19, 2024
2d385ff
build: quiet duplicate libraries and ATOMIC_VAR_INT messages (#6072)
cce Jul 19, 2024
75bb6a9
catchup: skip logging err for catchup cancellation (#6053)
urtho Jul 19, 2024
47fd1c9
build: make -no_warn_duplicate_libraries conditional on Xcode >= 15 (…
cce Jul 22, 2024
f6fa590
CI: update nightly builds to use universal mac update (#6071)
onetechnical Jul 25, 2024
2b34eda
CI: update to CentOS Stream 9 and start integrating universal target …
onetechnical Jul 26, 2024
adaecde
p2p: fix connection deduplication in hybrid mode (#6082)
algorandskiy Jul 26, 2024
e52f91a
txHandler: fix TestTxHandlerAppRateLimiter (#6075)
algorandskiy Jul 26, 2024
8ed60e2
tests: fix TestNodeHybridTopology (#6079)
algorandskiy Jul 26, 2024
04ec5f9
CI: fix mac universal rebuild for nightlies (#6084)
onetechnical Jul 26, 2024
edda2ee
rpcs: simplify API for BlockService to handle multiple HTTP paths (#5…
zeldovich Jul 26, 2024
a9c2b7e
p2p: do not register closing peer (#6086)
algorandskiy Jul 29, 2024
e697ae8
CICD: fix broken ci-build target (#6087)
onetechnical Jul 29, 2024
578684e
p2p: support EnableGossipService in p2p streams (#6073)
algorandskiy Jul 29, 2024
8eca278
tests: debug logging for TestVotersReloadFromDiskAfterOneStateProofCo…
algorandskiy Jul 31, 2024
05a52e2
tests: fix flushing in TestVotersReloadFromDiskAfterOneStateProofComm…
algorandskiy Jul 31, 2024
94f1355
netgoal: allow unknown template tokens (#6091)
algorandskiy Aug 1, 2024
d2c4ca7
cmd: Add goal node subcommand to generate peer private key (#6078)
algorandskiy Aug 1, 2024
a0815c1
tests: fixes to e2e test logs parsers (#6093)
algorandskiy Aug 7, 2024
9924574
tests: fix e2e subs goal-partkey-commands (#6095)
algorandskiy Aug 7, 2024
c6a433b
p2p: do not advertise private and non-routable addresses (#6092)
algorandskiy Aug 7, 2024
602d950
p2p: handle txns in pubsub validator (#6070)
algorandskiy Aug 8, 2024
595ec23
network: remove ws net proto 2.1 (#6081)
algorandskiy Aug 8, 2024
23a04c2
tests: flaky tests fixes (#6098)
algorandskiy Aug 8, 2024
7fc243c
docs: p2p package overview (#6096)
algorandskiy Aug 15, 2024
3b9f3e3
p2p: get rid of interface{} from PeerStore methods (#6101)
algorandskiy Aug 15, 2024
8e2e2e4
Installer: add support for algoh to systemd installs (#6102)
onetechnical Aug 15, 2024
4990077
network: fix publicKeyIdentTracker data race in hybrid mode (#6110)
algorandskiy Aug 26, 2024
8d678c3
config: use P2PHybridIncomingConnectionsLimit only for hybrid mode (#…
algorandskiy Aug 28, 2024
e14fea6
metrics: collect total netdev sent/received bytes (#6108)
algorandskiy Aug 28, 2024
9d5c4cd
REST API: Fix `LedgerStateDelta` JSON encoding (#6106)
jasonpaulos Aug 29, 2024
f6c59a4
p2p: Add algod_network_p2p_* traffic metrics (#6105)
algorandskiy Aug 29, 2024
10e8b39
tests: fix a race in TestP2PwsStreamHandlerDedup (#6116)
algorandskiy Aug 29, 2024
81edd96
tests: use temp file for capturing e2e goal-partkey-commands output (…
cce Aug 30, 2024
d105841
p2p: store private keys as PKCS#8 ASN.1 DER PEM (#6119)
algorandskiy Sep 3, 2024
0da0e99
network: fix outgoing HTTP rate limiting (#6118)
algorandskiy Sep 3, 2024
43cb563
AVM: Provide access to some more block header values (#6107)
jannotti Sep 3, 2024
b1d81bc
algons: expose error for dnsaddr command (#6121)
onetechnical Sep 3, 2024
66b87dc
tests: fix expect tests and add EOF linter (#6122)
algorandskiy Sep 5, 2024
37a9a18
AVM: Derive looser, but more principled, checks of txn max size (#6114)
jannotti Sep 9, 2024
1d08955
p2p: make sure p2p http server runs on all interfaces (#6123)
algorandskiy Sep 10, 2024
3b3b5ce
scripts: allow metrics filtering by labels in metrics_viz.py (#6125)
algorandskiy Sep 11, 2024
90353e5
config: ensure both ws and p2p net running the same mode in hybrid (#…
algorandskiy Sep 13, 2024
2b6e018
node: clear new p2p net handlers on fast catchup (#6127)
algorandskiy Sep 13, 2024
619d257
p2p: reuse existing libp2p.Host for http clients (#6129)
algorandskiy Sep 16, 2024
cac2c09
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Sep 17, 2024
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
27 changes: 8 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,18 @@ executors:
machine:
image: << pipeline.parameters.ubuntu_image >>
resource_class: arm.large
mac_amd64_medium:
mac_arm64_medium:
macos:
xcode: 14.2.0
resource_class: macos.x86.medium.gen2
resource_class: macos.m1.medium.gen1
environment:
HOMEBREW_NO_AUTO_UPDATE: "true"
mac_amd64_large:
mac_arm64_large:
macos:
xcode: 14.2.0
# Since they removed the large class for amd64, we will use medium here too.
resource_class: macos.x86.medium.gen2
environment:
HOMEBREW_NO_AUTO_UPDATE: "true"
mac_arm64: &executor-mac-arm64
machine: true
resource_class: algorand/macstadium-m1
resource_class: macos.m1.large.gen1
environment:
HOMEBREW_NO_AUTO_UPDATE: "true"
# these are required b/c jobs explicitly assign sizes to the executors
# for `mac_arm64` there is only one size
mac_arm64_medium:
<<: *executor-mac-arm64
mac_arm64_large:
<<: *executor-mac-arm64

slack-fail-stop-step: &slack-fail-post-step
post-steps:
Expand All @@ -86,7 +74,7 @@ workflows:
name: << matrix.platform >>_build_nightly
matrix: &matrix-nightly
parameters:
platform: ["amd64", "arm64", "mac_amd64", "mac_arm64"]
platform: ["amd64", "arm64", "mac_arm64"]
filters: &filters-nightly
branches:
only:
Expand Down Expand Up @@ -137,7 +125,7 @@ workflows:
name: << matrix.platform >>_<< matrix.job_type >>_verification
matrix:
parameters:
platform: ["amd64", "arm64", "mac_amd64", "mac_arm64"]
platform: ["amd64", "arm64", "mac_arm64"]
job_type: ["test_nightly", "integration_nightly", "e2e_expect_nightly"]
requires:
- << matrix.platform >>_<< matrix.job_type >>
Expand Down Expand Up @@ -727,12 +715,13 @@ commands:
command: |
if [ "${CIRCLE_BRANCH}" = "rel/nightly" ]
then
export NO_BUILD="true"
export NIGHTLY_BUILD="true"
fi
export PATH=$(echo "$PATH" | sed -e "s|:${HOME}/\.go_workspace/bin||g" | sed -e 's|:/usr/local/go/bin||g')
export GOPATH="<< parameters.build_dir >>/go"
export TRAVIS_BRANCH=${CIRCLE_BRANCH}
scripts/travis/deploy_packages.sh
no_output_timeout: 20m
- when:
condition:
equal: [ "amd64", << parameters.platform >> ]
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
cd ../../
- name: Install reviewdog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/v0.17.4/install.sh | sh -s
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/v0.18.1/install.sh | sh -s -- v0.18.1
reviewdog --version
- name: Build custom linters
run: |
Expand Down Expand Up @@ -102,3 +102,16 @@ jobs:
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Reviewdog failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
reviewdog-shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: "github-pr-check"
shellcheck_flags: "-e SC2034,SC2046,SC2053,SC2207,SC2145 -S warning"
fail_on_error: true
path: |
test/scripts/e2e_subs
55 changes: 50 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ endif
SRCPATH := $(shell pwd)
ARCH := $(shell ./scripts/archtype.sh)
OS_TYPE := $(shell ./scripts/ostype.sh)
# overrides for cross-compiling platform-specific binaries
ifdef CROSS_COMPILE_ARCH
ARCH := $(CROSS_COMPILE_ARCH)
GO_INSTALL := CGO_ENABLED=1 GOOS=$(OS_TYPE) GOARCH=$(ARCH) go build -o $(GOPATH1)/bin-$(OS_TYPE)-$(ARCH)
else
GO_INSTALL := go install
endif
S3_RELEASE_BUCKET = $$S3_RELEASE_BUCKET

GOLANG_VERSIONS := $(shell ./scripts/get_golang_version.sh all)
Expand Down Expand Up @@ -42,8 +49,13 @@ else
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
endif

# M1 Mac--homebrew install location in /opt/homebrew
ifeq ($(OS_TYPE), darwin)
# For Xcode >= 15, set -no_warn_duplicate_libraries linker option
CLANG_MAJOR_VERSION := $(shell clang --version | grep '^Apple clang version ' | awk '{print $$4}' | cut -d. -f1)
ifeq ($(shell [ $(CLANG_MAJOR_VERSION) -ge 15 ] && echo true), true)
EXTLDFLAGS := -Wl,-no_warn_duplicate_libraries
endif
# M1 Mac--homebrew install location in /opt/homebrew
ifeq ($(ARCH), arm64)
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
Expand Down Expand Up @@ -102,6 +114,9 @@ fix: build
lint: deps
$(GOPATH1)/bin/golangci-lint run -c .golangci.yml

expectlint:
cd test/e2e-go/cli/goal/expect && python3 expect_linter.py *.exp

check_go_version:
@if [ $(CURRENT_GO_VERSION_MAJOR) != $(GOLANG_VERSION_BUILD_MAJOR) ]; then \
echo "Wrong major version of Go installed ($(CURRENT_GO_VERSION_MAJOR)). Please use $(GOLANG_VERSION_BUILD_MAJOR)"; \
Expand Down Expand Up @@ -153,10 +168,40 @@ crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a:
cp -R crypto/libsodium-fork/. crypto/copies/$(OS_TYPE)/$(ARCH)/libsodium-fork
cd crypto/copies/$(OS_TYPE)/$(ARCH)/libsodium-fork && \
./autogen.sh --prefix $(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH) && \
./configure --disable-shared --prefix="$(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH)" && \
./configure --disable-shared --prefix="$(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH)" $(EXTRA_CONFIGURE_FLAGS) && \
$(MAKE) && \
$(MAKE) install

universal:
ifeq ($(OS_TYPE),darwin)
# build amd64 Mac binaries
mkdir -p $(GOPATH1)/bin-darwin-amd64
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOPATH1)/bin-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=12.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=12.0" --host=x86_64-apple-darwin' $(MAKE)

# build arm64 Mac binaries
mkdir -p $(GOPATH1)/bin-darwin-arm64
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOPATH1)/bin-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=12.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=12.0" --host=aarch64-apple-darwin' $(MAKE)

# same for buildsrc-special
cd tools/block-generator && \
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOPATH1)/bin-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=12.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=12.0" --host=x86_64-apple-darwin' $(MAKE)
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOPATH1)/bin-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=12.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=12.0" --host=aarch64-apple-darwin' $(MAKE)

# lipo together
mkdir -p $(GOPATH1)/bin
for binary in $$(ls $(GOPATH1)/bin-darwin-arm64); do \
if [ -f $(GOPATH1)/bin-darwin-amd64/$$binary ]; then \
lipo -create -output $(GOPATH1)/bin/$$binary \
$(GOPATH1)/bin-darwin-arm64/$$binary \
$(GOPATH1)/bin-darwin-amd64/$$binary; \
else \
echo "Warning: Binary $$binary exists in arm64 but not in amd64"; \
fi \
done
else
echo "OS_TYPE must be darwin for universal builds, skipping"
endif

deps:
./scripts/check_deps.sh

Expand Down Expand Up @@ -212,11 +257,11 @@ ${GOCACHE}/file.txt:
touch "${GOCACHE}"/file.txt

buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN ${GOCACHE}/file.txt
go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...
$(GO_INSTALL) $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...

buildsrc-special:
cd tools/block-generator && \
go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...
$(GO_INSTALL) $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...

check-go-version:
./scripts/check_golang_version.sh build
Expand Down Expand Up @@ -331,7 +376,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
install: build
scripts/dev_install.sh -p $(GOPATH1)/bin

.PHONY: default fmt lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_kmd_swagger
.PHONY: default fmt lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_kmd_swagger universal

###### TARGETS FOR CICD PROCESS ######
include ./scripts/release/mule/Makefile.mule
Expand Down
2 changes: 2 additions & 0 deletions agreement/demux.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/logging/logspec"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/util"
)

const (
Expand Down Expand Up @@ -113,6 +114,7 @@ func (d *demux) tokenizeMessages(ctx context.Context, net Network, tag protocol.
defer func() {
close(decoded)
}()
util.SetGoroutineLabels("tokenizeTag", string(tag))
for {
select {
case raw, ok := <-networkMessages:
Expand Down
21 changes: 14 additions & 7 deletions agreement/fuzzer/networkFacade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ type NetworkFacade struct {
rand *rand.Rand
timeoutAtInitOnce sync.Once
timeoutAtInitWait sync.WaitGroup
peerToNode map[network.Peer]int
peerToNode map[*facadePeer]int
}

type facadePeer struct {
id int
net network.GossipNode
}

func (p *facadePeer) GetNetwork() network.GossipNode { return p.net }

// MakeNetworkFacade creates a facade with a given nodeID.
func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
n := &NetworkFacade{
Expand All @@ -83,12 +90,12 @@ func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
eventsQueues: make(map[string]int),
eventsQueuesCh: make(chan int, 1000),
rand: rand.New(rand.NewSource(int64(nodeID))),
peerToNode: make(map[network.Peer]int, fuzzer.nodesCount),
peerToNode: make(map[*facadePeer]int, fuzzer.nodesCount),
debugMessages: false,
}
n.timeoutAtInitWait.Add(1)
for i := 0; i < fuzzer.nodesCount; i++ {
n.peerToNode[network.Peer(new(int))] = i
n.peerToNode[&facadePeer{id: i, net: n}] = i
}
return n
}
Expand Down Expand Up @@ -179,7 +186,7 @@ func (n *NetworkFacade) WaitForEventsQueue(cleared bool) {
func (n *NetworkFacade) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, exclude network.Peer) error {
excludeNode := -1
if exclude != nil {
excludeNode = n.peerToNode[exclude]
excludeNode = n.peerToNode[exclude.(*facadePeer)]
}
return n.broadcast(tag, data, excludeNode, "NetworkFacade service-%v Broadcast %v %v\n")
}
Expand Down Expand Up @@ -240,7 +247,7 @@ func (n *NetworkFacade) PushDownstreamMessage(newMsg context.CancelFunc) bool {
func (n *NetworkFacade) Address() (string, bool) { return "mock network", true }

// Start - unused function
func (n *NetworkFacade) Start() {}
func (n *NetworkFacade) Start() error { return nil }

// Stop - unused function
func (n *NetworkFacade) Stop() {}
Expand Down Expand Up @@ -341,8 +348,8 @@ func (n *NetworkFacade) ReceiveMessage(sourceNode int, tag protocol.Tag, data []
n.pushPendingReceivedMessage()
}

func (n *NetworkFacade) Disconnect(sender network.Peer) {
sourceNode := n.peerToNode[sender]
func (n *NetworkFacade) Disconnect(sender network.DisconnectablePeer) {
sourceNode := n.peerToNode[sender.(*facadePeer)]
n.fuzzer.Disconnect(n.nodeID, sourceNode)
}

Expand Down
10 changes: 3 additions & 7 deletions agreement/gossip/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package gossip

import (
"context"
"net"
"net/http"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -136,7 +135,7 @@ func (w *whiteholeNetwork) Relay(ctx context.Context, tag protocol.Tag, data []b
func (w *whiteholeNetwork) BroadcastSimple(tag protocol.Tag, data []byte) error {
return w.Broadcast(context.Background(), tag, data, true, nil)
}
func (w *whiteholeNetwork) Disconnect(badnode network.Peer) {
func (w *whiteholeNetwork) Disconnect(badnode network.DisconnectablePeer) {
return
}
func (w *whiteholeNetwork) DisconnectPeers() {
Expand All @@ -156,11 +155,8 @@ func (w *whiteholeNetwork) GetPeers(options ...network.PeerOption) []network.Pee
}
func (w *whiteholeNetwork) RegisterHTTPHandler(path string, handler http.Handler) {
}
func (w *whiteholeNetwork) GetHTTPRequestConnection(request *http.Request) (conn net.Conn) {
return nil
}

func (w *whiteholeNetwork) Start() {
func (w *whiteholeNetwork) Start() error {
w.quit = make(chan struct{})
go func(w *whiteholeNetwork) {
w.domain.messagesMu.Lock()
Expand Down Expand Up @@ -216,7 +212,7 @@ func (w *whiteholeNetwork) Start() {
atomic.AddUint32(&w.lastMsgRead, 1)
}
}(w)
return
return nil
}
func (w *whiteholeNetwork) getMux() *network.Multiplexer {
return w.mux
Expand Down
3 changes: 3 additions & 0 deletions agreement/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func (s *Service) Start() {
//
// This method returns after all resources have been cleaned up.
func (s *Service) Shutdown() {
s.log.Debug("agreement service is stopping")
defer s.log.Debug("agreement service has stopped")

close(s.quit)
s.quitFn()
<-s.done
Expand Down
3 changes: 3 additions & 0 deletions catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
// Stop stops the catchpoint catchup service - unlike Abort, this is not intended to abort the process but rather to allow
// cleanup of in-memory resources for the purpose of clean shutdown.
func (cs *CatchpointCatchupService) Stop() {
cs.log.Debug("catchpoint service is stopping")
defer cs.log.Debug("catchpoint service has stopped")

Check warning on line 189 in catchup/catchpointService.go

View check run for this annotation

Codecov / codecov/patch

catchup/catchpointService.go#L188-L189

Added lines #L188 - L189 were not covered by tests

// signal the running goroutine that we want to stop
cs.cancelCtxFunc()
// wait for the running goroutine to terminate.
Expand Down
Loading
Loading