Skip to content

Commit 0d10b24

Browse files
authored
Merge pull request #6145 from Algo-devops-service/relstable3.26.0
2 parents 9855f57 + c0aea8a commit 0d10b24

File tree

274 files changed

+14813
-3833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+14813
-3833
lines changed

.circleci/config.yml

+8-23
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,14 @@ executors:
4545
machine:
4646
image: << pipeline.parameters.ubuntu_image >>
4747
resource_class: arm.large
48-
mac_amd64_medium:
48+
mac_arm64_medium:
4949
macos:
5050
xcode: 14.2.0
51-
resource_class: macos.x86.medium.gen2
52-
environment:
53-
HOMEBREW_NO_AUTO_UPDATE: "true"
54-
mac_amd64_large:
51+
resource_class: macos.m1.medium.gen1
52+
mac_arm64_large:
5553
macos:
5654
xcode: 14.2.0
57-
# Since they removed the large class for amd64, we will use medium here too.
58-
resource_class: macos.x86.medium.gen2
59-
environment:
60-
HOMEBREW_NO_AUTO_UPDATE: "true"
61-
mac_arm64: &executor-mac-arm64
62-
machine: true
63-
resource_class: algorand/macstadium-m1
64-
environment:
65-
HOMEBREW_NO_AUTO_UPDATE: "true"
66-
# these are required b/c jobs explicitly assign sizes to the executors
67-
# for `mac_arm64` there is only one size
68-
mac_arm64_medium:
69-
<<: *executor-mac-arm64
70-
mac_arm64_large:
71-
<<: *executor-mac-arm64
55+
resource_class: macos.m1.large.gen1
7256

7357
slack-fail-stop-step: &slack-fail-post-step
7458
post-steps:
@@ -86,7 +70,7 @@ workflows:
8670
name: << matrix.platform >>_build_nightly
8771
matrix: &matrix-nightly
8872
parameters:
89-
platform: ["amd64", "arm64", "mac_amd64", "mac_arm64"]
73+
platform: ["amd64", "arm64", "mac_arm64"]
9074
filters: &filters-nightly
9175
branches:
9276
only:
@@ -137,7 +121,7 @@ workflows:
137121
name: << matrix.platform >>_<< matrix.job_type >>_verification
138122
matrix:
139123
parameters:
140-
platform: ["amd64", "arm64", "mac_amd64", "mac_arm64"]
124+
platform: ["amd64", "arm64", "mac_arm64"]
141125
job_type: ["test_nightly", "integration_nightly", "e2e_expect_nightly"]
142126
requires:
143127
- << matrix.platform >>_<< matrix.job_type >>
@@ -727,12 +711,13 @@ commands:
727711
command: |
728712
if [ "${CIRCLE_BRANCH}" = "rel/nightly" ]
729713
then
730-
export NO_BUILD="true"
714+
export NIGHTLY_BUILD="true"
731715
fi
732716
export PATH=$(echo "$PATH" | sed -e "s|:${HOME}/\.go_workspace/bin||g" | sed -e 's|:/usr/local/go/bin||g')
733717
export GOPATH="<< parameters.build_dir >>/go"
734718
export TRAVIS_BRANCH=${CIRCLE_BRANCH}
735719
scripts/travis/deploy_packages.sh
720+
no_output_timeout: 20m
736721
- when:
737722
condition:
738723
equal: [ "amd64", << parameters.platform >> ]

.github/workflows/reviewdog.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
cd ../../
7070
- name: Install reviewdog
7171
run: |
72-
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/v0.17.4/install.sh | sh -s
72+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/v0.18.1/install.sh | sh -s -- v0.18.1
7373
reviewdog --version
7474
- name: Build custom linters
7575
run: |
@@ -102,3 +102,16 @@ jobs:
102102
run: |
103103
curl -X POST --data-urlencode "payload={\"text\": \"Reviewdog failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
104104
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')) }}
105+
reviewdog-shellcheck:
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- name: shellcheck
110+
uses: reviewdog/action-shellcheck@v1
111+
with:
112+
github_token: ${{ secrets.GITHUB_TOKEN }}
113+
reporter: "github-pr-check"
114+
shellcheck_flags: "-e SC2034,SC2046,SC2053,SC2207,SC2145 -S warning"
115+
fail_on_error: true
116+
path: |
117+
test/scripts/e2e_subs

Makefile

+50-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ endif
1111
SRCPATH := $(shell pwd)
1212
ARCH := $(shell ./scripts/archtype.sh)
1313
OS_TYPE := $(shell ./scripts/ostype.sh)
14+
# overrides for cross-compiling platform-specific binaries
15+
ifdef CROSS_COMPILE_ARCH
16+
ARCH := $(CROSS_COMPILE_ARCH)
17+
GO_INSTALL := CGO_ENABLED=1 GOOS=$(OS_TYPE) GOARCH=$(ARCH) go build -o $(GOPATH1)/bin-$(OS_TYPE)-$(ARCH)
18+
else
19+
GO_INSTALL := go install
20+
endif
1421
S3_RELEASE_BUCKET = $$S3_RELEASE_BUCKET
1522

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

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

117+
expectlint:
118+
cd test/e2e-go/cli/goal/expect && python3 expect_linter.py *.exp
119+
105120
check_go_version:
106121
@if [ $(CURRENT_GO_VERSION_MAJOR) != $(GOLANG_VERSION_BUILD_MAJOR) ]; then \
107122
echo "Wrong major version of Go installed ($(CURRENT_GO_VERSION_MAJOR)). Please use $(GOLANG_VERSION_BUILD_MAJOR)"; \
@@ -153,10 +168,40 @@ crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a:
153168
cp -R crypto/libsodium-fork/. crypto/copies/$(OS_TYPE)/$(ARCH)/libsodium-fork
154169
cd crypto/copies/$(OS_TYPE)/$(ARCH)/libsodium-fork && \
155170
./autogen.sh --prefix $(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH) && \
156-
./configure --disable-shared --prefix="$(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH)" && \
171+
./configure --disable-shared --prefix="$(SRCPATH)/crypto/libs/$(OS_TYPE)/$(ARCH)" $(EXTRA_CONFIGURE_FLAGS) && \
157172
$(MAKE) && \
158173
$(MAKE) install
159174

175+
universal:
176+
ifeq ($(OS_TYPE),darwin)
177+
# build amd64 Mac binaries
178+
mkdir -p $(GOPATH1)/bin-darwin-amd64
179+
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)
180+
181+
# build arm64 Mac binaries
182+
mkdir -p $(GOPATH1)/bin-darwin-arm64
183+
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)
184+
185+
# same for buildsrc-special
186+
cd tools/block-generator && \
187+
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)
188+
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)
189+
190+
# lipo together
191+
mkdir -p $(GOPATH1)/bin
192+
for binary in $$(ls $(GOPATH1)/bin-darwin-arm64); do \
193+
if [ -f $(GOPATH1)/bin-darwin-amd64/$$binary ]; then \
194+
lipo -create -output $(GOPATH1)/bin/$$binary \
195+
$(GOPATH1)/bin-darwin-arm64/$$binary \
196+
$(GOPATH1)/bin-darwin-amd64/$$binary; \
197+
else \
198+
echo "Warning: Binary $$binary exists in arm64 but not in amd64"; \
199+
fi \
200+
done
201+
else
202+
echo "OS_TYPE must be darwin for universal builds, skipping"
203+
endif
204+
160205
deps:
161206
./scripts/check_deps.sh
162207

@@ -212,11 +257,11 @@ ${GOCACHE}/file.txt:
212257
touch "${GOCACHE}"/file.txt
213258

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

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

221266
check-go-version:
222267
./scripts/check_golang_version.sh build
@@ -331,7 +376,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
331376
install: build
332377
scripts/dev_install.sh -p $(GOPATH1)/bin
333378

334-
.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
379+
.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
335380

336381
###### TARGETS FOR CICD PROCESS ######
337382
include ./scripts/release/mule/Makefile.mule

agreement/demux.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/algorand/go-algorand/logging"
2626
"github.com/algorand/go-algorand/logging/logspec"
2727
"github.com/algorand/go-algorand/protocol"
28+
"github.com/algorand/go-algorand/util"
2829
)
2930

3031
const (
@@ -113,6 +114,7 @@ func (d *demux) tokenizeMessages(ctx context.Context, net Network, tag protocol.
113114
defer func() {
114115
close(decoded)
115116
}()
117+
util.SetGoroutineLabels("tokenizeTag", string(tag))
116118
for {
117119
select {
118120
case raw, ok := <-networkMessages:

agreement/fuzzer/networkFacade_test.go

+14-7
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@ type NetworkFacade struct {
7070
rand *rand.Rand
7171
timeoutAtInitOnce sync.Once
7272
timeoutAtInitWait sync.WaitGroup
73-
peerToNode map[network.Peer]int
73+
peerToNode map[*facadePeer]int
7474
}
7575

76+
type facadePeer struct {
77+
id int
78+
net network.GossipNode
79+
}
80+
81+
func (p *facadePeer) GetNetwork() network.GossipNode { return p.net }
82+
7683
// MakeNetworkFacade creates a facade with a given nodeID.
7784
func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
7885
n := &NetworkFacade{
@@ -83,12 +90,12 @@ func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
8390
eventsQueues: make(map[string]int),
8491
eventsQueuesCh: make(chan int, 1000),
8592
rand: rand.New(rand.NewSource(int64(nodeID))),
86-
peerToNode: make(map[network.Peer]int, fuzzer.nodesCount),
93+
peerToNode: make(map[*facadePeer]int, fuzzer.nodesCount),
8794
debugMessages: false,
8895
}
8996
n.timeoutAtInitWait.Add(1)
9097
for i := 0; i < fuzzer.nodesCount; i++ {
91-
n.peerToNode[network.Peer(new(int))] = i
98+
n.peerToNode[&facadePeer{id: i, net: n}] = i
9299
}
93100
return n
94101
}
@@ -179,7 +186,7 @@ func (n *NetworkFacade) WaitForEventsQueue(cleared bool) {
179186
func (n *NetworkFacade) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, exclude network.Peer) error {
180187
excludeNode := -1
181188
if exclude != nil {
182-
excludeNode = n.peerToNode[exclude]
189+
excludeNode = n.peerToNode[exclude.(*facadePeer)]
183190
}
184191
return n.broadcast(tag, data, excludeNode, "NetworkFacade service-%v Broadcast %v %v\n")
185192
}
@@ -240,7 +247,7 @@ func (n *NetworkFacade) PushDownstreamMessage(newMsg context.CancelFunc) bool {
240247
func (n *NetworkFacade) Address() (string, bool) { return "mock network", true }
241248

242249
// Start - unused function
243-
func (n *NetworkFacade) Start() {}
250+
func (n *NetworkFacade) Start() error { return nil }
244251

245252
// Stop - unused function
246253
func (n *NetworkFacade) Stop() {}
@@ -341,8 +348,8 @@ func (n *NetworkFacade) ReceiveMessage(sourceNode int, tag protocol.Tag, data []
341348
n.pushPendingReceivedMessage()
342349
}
343350

344-
func (n *NetworkFacade) Disconnect(sender network.Peer) {
345-
sourceNode := n.peerToNode[sender]
351+
func (n *NetworkFacade) Disconnect(sender network.DisconnectablePeer) {
352+
sourceNode := n.peerToNode[sender.(*facadePeer)]
346353
n.fuzzer.Disconnect(n.nodeID, sourceNode)
347354
}
348355

agreement/gossip/network_test.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package gossip
1818

1919
import (
2020
"context"
21-
"net"
2221
"net/http"
2322
"sync"
2423
"sync/atomic"
@@ -136,7 +135,7 @@ func (w *whiteholeNetwork) Relay(ctx context.Context, tag protocol.Tag, data []b
136135
func (w *whiteholeNetwork) BroadcastSimple(tag protocol.Tag, data []byte) error {
137136
return w.Broadcast(context.Background(), tag, data, true, nil)
138137
}
139-
func (w *whiteholeNetwork) Disconnect(badnode network.Peer) {
138+
func (w *whiteholeNetwork) Disconnect(badnode network.DisconnectablePeer) {
140139
return
141140
}
142141
func (w *whiteholeNetwork) DisconnectPeers() {
@@ -156,11 +155,8 @@ func (w *whiteholeNetwork) GetPeers(options ...network.PeerOption) []network.Pee
156155
}
157156
func (w *whiteholeNetwork) RegisterHTTPHandler(path string, handler http.Handler) {
158157
}
159-
func (w *whiteholeNetwork) GetHTTPRequestConnection(request *http.Request) (conn net.Conn) {
160-
return nil
161-
}
162158

163-
func (w *whiteholeNetwork) Start() {
159+
func (w *whiteholeNetwork) Start() error {
164160
w.quit = make(chan struct{})
165161
go func(w *whiteholeNetwork) {
166162
w.domain.messagesMu.Lock()
@@ -216,7 +212,7 @@ func (w *whiteholeNetwork) Start() {
216212
atomic.AddUint32(&w.lastMsgRead, 1)
217213
}
218214
}(w)
219-
return
215+
return nil
220216
}
221217
func (w *whiteholeNetwork) getMux() *network.Multiplexer {
222218
return w.mux

agreement/service.go

+3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ func (s *Service) Start() {
173173
//
174174
// This method returns after all resources have been cleaned up.
175175
func (s *Service) Shutdown() {
176+
s.log.Debug("agreement service is stopping")
177+
defer s.log.Debug("agreement service has stopped")
178+
176179
close(s.quit)
177180
s.quitFn()
178181
<-s.done

catchup/catchpointService.go

+3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ func (cs *CatchpointCatchupService) Abort() {
185185
// Stop stops the catchpoint catchup service - unlike Abort, this is not intended to abort the process but rather to allow
186186
// cleanup of in-memory resources for the purpose of clean shutdown.
187187
func (cs *CatchpointCatchupService) Stop() {
188+
cs.log.Debug("catchpoint service is stopping")
189+
defer cs.log.Debug("catchpoint service has stopped")
190+
188191
// signal the running goroutine that we want to stop
189192
cs.cancelCtxFunc()
190193
// wait for the running goroutine to terminate.

0 commit comments

Comments
 (0)