Skip to content

Commit d57586a

Browse files
authored
Merge pull request #2304 from Algo-devops-service/relbeta2.7.0
go-algorand 2.7.0-beta
2 parents 34f7106 + 78a221c commit d57586a

File tree

236 files changed

+22830
-15749
lines changed

Some content is hidden

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

236 files changed

+22830
-15749
lines changed

.gitignore

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
*.out
44
*.prof
55
coverage.html
6+
coverage.txt
7+
cover.out
8+
cpu.out
9+
mem.out
10+
mutex.out
611

712
# cadaver
813
*.cdv
914
*.cdv.archive
1015

11-
# swagger
12-
swagger.json
13-
swagger.json.validated
14-
kmdSwaggerWrappers.go
15-
bundledSpecInject.go
16-
1716
# Exclude GoLand files
1817
.idea/
1918

.travis.yml

+40-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
os: linux
22
dist: bionic
3-
go_import_path: github.com/algorand/go-algorand
4-
language: go
3+
language: minimal
54

65
# Don't build tags
76
if: tag IS blank
@@ -32,6 +31,11 @@ jobs:
3231
- travis_retry scripts/travis/build_test.sh
3332

3433
- stage: build_pr
34+
os: linux
35+
name: Ubuntu AMD64 CodeGen Verification
36+
script:
37+
- scripts/travis/codegen_verification.sh
38+
- # same stage, parallel job
3539
os: linux
3640
name: Ubuntu AMD64 Build
3741
script:
@@ -88,6 +92,11 @@ jobs:
8892
- travis_retry $mingw64 scripts/travis/build_test.sh
8993

9094
- stage: build_release
95+
os: linux
96+
name: Ubuntu AMD64 CodeGen Verification
97+
script:
98+
- scripts/travis/codegen_verification.sh
99+
- # same stage, parallel job
91100
os: linux
92101
name: Ubuntu AMD64 Build
93102
script:
@@ -98,11 +107,17 @@ jobs:
98107
script:
99108
- travis_retry ./scripts/travis/integration_test.sh
100109
- # same stage, parallel job
101-
os: osx
102-
osx_image: xcode11
103-
name: MacOS AMD64 Build
110+
name: External ARM64 Build
111+
os: linux
112+
env:
113+
- BUILD_TYPE: "external_build"
114+
- TARGET_PLATFORM: "linux-arm64"
115+
addons:
116+
apt:
117+
packages:
118+
- awscli
104119
script:
105-
- travis_retry scripts/travis/build_test.sh
120+
- travis_retry scripts/travis/external_build.sh ./scripts/travis/build_test.sh
106121
- # same stage, parallel job
107122
name: External ARM64 Integration Test
108123
os: linux
@@ -115,6 +130,18 @@ jobs:
115130
- awscli
116131
script:
117132
- scripts/travis/external_build.sh ./scripts/travis/integration_test.sh
133+
- # same stage, parallel job
134+
os: osx
135+
osx_image: xcode11
136+
name: MacOS AMD64 Build
137+
script:
138+
- travis_retry scripts/travis/build_test.sh
139+
- # same stage, parallel job
140+
os: osx
141+
osx_image: xcode11
142+
name: MacOS AMD64 Integration Test
143+
script:
144+
- travis_retry ./scripts/travis/integration_test.sh
118145
- # same stage, parallel job
119146
os: windows
120147
name: Windows x64 Build
@@ -148,18 +175,6 @@ jobs:
148175
- awscli
149176
script:
150177
- scripts/travis/external_build.sh ./scripts/travis/deploy_packages.sh
151-
- # same stage, parallel job
152-
name: External ARM Deploy
153-
os: linux
154-
env:
155-
- BUILD_TYPE: "external_build"
156-
- TARGET_PLATFORM: "linux-arm"
157-
addons:
158-
apt:
159-
packages:
160-
- awscli
161-
script:
162-
- scripts/travis/external_build.sh ./scripts/travis/deploy_packages.sh
163178

164179
# Don't rebuild libsodium every time
165180
cache:
@@ -202,6 +217,9 @@ before_cache:
202217
esac
203218
docker save -o $HOME/docker_cache/images.tar $(docker images -a -q)
204219
220+
after_success:
221+
- scripts/travis/upload_coverage.sh || true
222+
205223
addons:
206224
apt:
207225
packages:
@@ -219,3 +237,7 @@ addons:
219237
notifications:
220238
slack:
221239
secure: lBomhenfQvDzpUGxLadga188zavtGRr05GVWI6iI8ll/uwXewij8ginQ716Axg3pJvvRMNCuTNEmg0+fVlHf0JxTG3qWG35qOUexAHGcmimPD4ugmVkufua8Oc8Nl1LRSdWvbwIKvrAU1HDA37M5tCdEOm+Sf/OL72iVWbXhlHRvhdeiKHkbkcpI/15dOH4RpXuvPe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CP5lBXCAwDlPB3XOe0bSmiiGQ1/sf/1CovqOBg/vLwCpjQE0IZPofCiDZZdZbv4n4aCOjiAqhS8MjJ/LfLyUuAtPmQG5g47FzS1K4=
243+

Makefile

+31-29
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ GOTAGSLIST := sqlite_unlock_notify sqlite_omit_load_extension
2929
# e.g. make GOTAGSCUSTOM=msgtrace
3030
GOTAGSLIST += ${GOTAGSCUSTOM}
3131

32+
# If available, use gotestsum instead of 'go test'.
33+
ifeq (, $(shell which gotestsum))
34+
export GOTESTCOMMAND=go test
35+
else
36+
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
37+
endif
38+
3239
ifeq ($(UNAME), Linux)
3340
EXTLDFLAGS := -static-libstdc++ -static-libgcc
3441
ifeq ($(ARCH), amd64)
@@ -68,7 +75,7 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
6875
UNIT_TEST_SOURCES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && go list ./... | grep -v /go-algorand/test/ ))
6976
ALGOD_API_PACKAGES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && cd daemon/algod/api; go list ./... ))
7077

71-
MSGP_GENERATE := ./protocol ./crypto ./crypto/compactcert ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./auction ./agreement ./rpcs ./node ./ledger ./ledger/ledgercore ./compactcert
78+
MSGP_GENERATE := ./protocol ./crypto ./crypto/compactcert ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./agreement ./rpcs ./node ./ledger ./ledger/ledgercore ./compactcert
7279

7380
default: build
7481

@@ -81,9 +88,6 @@ fmt:
8188
fix: build
8289
$(GOPATH1)/bin/algofix */
8390

84-
fixcheck: build
85-
$(GOPATH1)/bin/algofix -error */
86-
8791
lint: deps
8892
$(GOPATH1)/bin/golint ./...
8993

@@ -148,7 +152,7 @@ $(ALGOD_API_SWAGGER_SPEC): $(ALGOD_API_FILES) crypto/libs/$(OS_TYPE)/$(ARCH)/lib
148152
PATH=$(GOPATH1)/bin:$$PATH \
149153
go generate ./...
150154

151-
$(ALGOD_API_SWAGGER_INJECT): $(ALGOD_API_SWAGGER_SPEC) $(ALGOD_API_SWAGGER_SPEC).validated
155+
$(ALGOD_API_SWAGGER_INJECT): deps $(ALGOD_API_SWAGGER_SPEC) $(ALGOD_API_SWAGGER_SPEC).validated
152156
./daemon/algod/api/server/lib/bundle_swagger_json.sh
153157

154158
# Regenerate kmd swagger spec files
@@ -175,35 +179,45 @@ $(KMD_API_SWAGGER_SPEC): $(KMD_API_FILES) crypto/libs/$(OS_TYPE)/$(ARCH)/lib/lib
175179
touch $@; \
176180
fi
177181

178-
$(KMD_API_SWAGGER_INJECT): $(KMD_API_SWAGGER_SPEC) $(KMD_API_SWAGGER_SPEC).validated
182+
$(KMD_API_SWAGGER_INJECT): deps $(KMD_API_SWAGGER_SPEC) $(KMD_API_SWAGGER_SPEC).validated
179183
./daemon/kmd/lib/kmdapi/bundle_swagger_json.sh
180184

185+
# generated files we should make sure we clean
186+
GENERATED_FILES := \
187+
$(ALGOD_API_SWAGGER_INJECT) \
188+
$(KMD_API_SWAGGER_INJECT) \
189+
$(ALGOD_API_SWAGGER_SPEC) $(ALGOD_API_SWAGGER_SPEC).validated \
190+
$(KMD_API_SWAGGER_SPEC) $(KMD_API_SWAGGER_SPEC).validated
191+
192+
rebuild_swagger: deps
193+
rm -f $(GENERATED_FILES)
194+
# we need to invoke the make here since we want to ensure that the deletion and re-creating are sequential
195+
make $(KMD_API_SWAGGER_INJECT) $(ALGOD_API_SWAGGER_INJECT)
196+
181197
# develop
182198

183-
build: buildsrc gen
199+
build: buildsrc
184200

185201
# We're making an empty file in the go-cache dir to
186202
# get around a bug in go build where it will fail
187203
# to cache binaries from time to time on empty NFS
188204
# dirs
189-
buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN deps $(ALGOD_API_SWAGGER_INJECT) $(KMD_API_SWAGGER_INJECT)
205+
buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN
190206
mkdir -p tmp/go-cache && \
191207
touch tmp/go-cache/file.txt && \
192208
GOCACHE=$(SRCPATH)/tmp/go-cache go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...
193209

194210
check-go-version:
195211
./scripts/check_golang_version.sh build
196212

197-
SOURCES_RACE := github.com/algorand/go-algorand/cmd/kmd
198-
199213
## Build binaries with the race detector enabled in them.
200214
## This allows us to run e2e tests with race detection.
201215
## We overwrite bin-race/kmd with a non -race version due to
202216
## the incredible performance impact of -race on Scrypt.
203217
build-race: build
204218
@mkdir -p $(GOPATH1)/bin-race
205219
GOBIN=$(GOPATH1)/bin-race go install $(GOTRIMPATH) $(GOTAGS) -race -ldflags="$(GOLDFLAGS)" ./...
206-
GOBIN=$(GOPATH1)/bin-race go install $(GOTRIMPATH) $(GOTAGS) -ldflags="$(GOLDFLAGS)" $(SOURCES_RACE)
220+
cp $(GOPATH1)/bin/kmd $(GOPATH1)/bin-race
207221

208222
NONGO_BIN_FILES=$(GOPATH1)/bin/find-nodes.sh $(GOPATH1)/bin/update.sh $(GOPATH1)/bin/COPYING $(GOPATH1)/bin/ddconfig.sh
209223

@@ -221,45 +235,33 @@ $(GOPATH1)/bin/%:
221235
cp -f $< $@
222236

223237
test: build
224-
go test $(GOTAGS) -race $(UNIT_TEST_SOURCES) -timeout 3600s | logfilter
238+
$(GOTESTCOMMAND) $(GOTAGS) -race $(UNIT_TEST_SOURCES) -timeout 1h -coverprofile=coverage.txt -covermode=atomic
225239

226240
fulltest: build-race
227-
for PACKAGE_DIRECTORY in $(UNIT_TEST_SOURCES) ; do \
228-
go test $(GOTAGS) -timeout 2500s -race $$PACKAGE_DIRECTORY | logfilter; \
229-
done
230-
231-
shorttest: build-race $(addprefix short_test_target_, $(UNIT_TEST_SOURCES))
241+
$(GOTESTCOMMAND) $(GOTAGS) -race $(UNIT_TEST_SOURCES) -timeout 1h -coverprofile=coverage.txt -covermode=atomic
232242

233-
$(addprefix short_test_target_, $(UNIT_TEST_SOURCES)): build
234-
@go test $(GOTAGS) -short -timeout 2500s -race $(subst short_test_target_,,$@) | logfilter
243+
shorttest: build-race
244+
$(GOTESTCOMMAND) $(GOTAGS) -short -race $(UNIT_TEST_SOURCES) -timeout 1h -coverprofile=coverage.txt -covermode=atomic
235245

236246
integration: build-race
237247
./test/scripts/run_integration_tests.sh
238248

239249
testall: fulltest integration
240250

241-
# generated files we should make sure we clean
242-
GENERATED_FILES := daemon/algod/api/bundledSpecInject.go \
243-
daemon/algod/api/lib/bundledSpecInject.go \
244-
daemon/kmd/lib/kmdapi/bundledSpecInject.go \
245-
$(ALGOD_API_SWAGGER_SPEC) $(ALGOD_API_SWAGGER_SPEC).validated \
246-
$(KMD_API_SWAGGER_SPEC) $(KMD_API_SWAGGER_SPEC).validated
247-
248251
clean:
249252
go clean -i ./...
250253
rm -f $(GOPATH1)/bin/node_exporter
251-
rm -f $(GENERATED_FILES)
252254
cd crypto/libsodium-fork && \
253255
test ! -e Makefile || make clean
254256
rm -rf crypto/lib
255257
rm -rf crypto/libs
256258
rm -rf crypto/copies
259+
rm -rf ./gen/devnet ./gen/mainnetnet ./gen/testnet
257260

258261
# clean without crypto
259262
cleango:
260263
go clean -i ./...
261264
rm -f $(GOPATH1)/bin/node_exporter
262-
rm -f $(GENERATED_FILES)
263265

264266
# assign the phony target node_exporter the dependency of the actual executable.
265267
node_exporter: $(GOPATH1)/bin/node_exporter
@@ -312,7 +314,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
312314
install: build
313315
scripts/dev_install.sh -p $(GOPATH1)/bin
314316

315-
.PHONY: default fmt vet lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version
317+
.PHONY: default fmt vet 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_swagger
316318

317319
###### TARGETS FOR CICD PROCESS ######
318320
include ./scripts/release/mule/Makefile.mule

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Initial environment setup:
3636
git clone https://github.com/algorand/go-algorand
3737
cd go-algorand
3838
./scripts/configure_dev.sh
39+
./scripts/buildtools/install_buildtools.sh
3940
```
4041

4142
At this point you are ready to build go-algorand. We use `make` and have a
@@ -164,8 +165,6 @@ The following packages allow developers to interface with the Algorand system:
164165
- `libgoal` exports a Go interface useful for developers of Algorand clients.
165166
- `debug` holds secondary commands which assist developers during debugging.
166167

167-
The `auction` package implements the Algorand auctions.
168-
169168
The following packages contain tools to help Algorand developers deploy networks
170169
of their own:
171170

agreement/player.go

+24-11
Original file line numberDiff line numberDiff line change
@@ -554,22 +554,35 @@ func (p *player) handleMessageEvent(r routerHandle, e messageEvent) (actions []a
554554
return append(actions, ignoreAction(e, ef.(payloadProcessedEvent).Err))
555555
case payloadPipelined:
556556
ep := ef.(payloadProcessedEvent)
557+
558+
up := e.Input.UnauthenticatedProposal
559+
uv := ef.(payloadProcessedEvent).Vote.u()
560+
561+
// relay proposal if it has been pipelined
562+
ra := relayAction(e, protocol.ProposalPayloadTag, compoundMessage{Proposal: up, Vote: uv})
563+
557564
if ep.Round == p.Round {
558-
return append(actions, verifyPayloadAction(e, ep.Round, ep.Period, ep.Pinned))
565+
vpa := verifyPayloadAction(e, ep.Round, ep.Period, ep.Pinned)
566+
return append(actions, vpa, ra)
559567
}
560-
}
561568

562-
var uv unauthenticatedVote
563-
switch ef.t() {
564-
case payloadPipelined, payloadAccepted:
565-
uv = ef.(payloadProcessedEvent).Vote.u()
566-
case proposalCommittable:
567-
uv = ef.(committableEvent).Vote.u()
569+
actions = append(actions, ra)
568570
}
569-
up := e.Input.UnauthenticatedProposal
570571

571-
a := relayAction(e, protocol.ProposalPayloadTag, compoundMessage{Proposal: up, Vote: uv})
572-
actions = append(actions, a)
572+
// relay as the proposer
573+
if e.Input.MessageHandle == nil {
574+
var uv unauthenticatedVote
575+
switch ef.t() {
576+
case payloadPipelined, payloadAccepted:
577+
uv = ef.(payloadProcessedEvent).Vote.u()
578+
case proposalCommittable:
579+
uv = ef.(committableEvent).Vote.u()
580+
}
581+
up := e.Input.UnauthenticatedProposal
582+
583+
a := relayAction(e, protocol.ProposalPayloadTag, compoundMessage{Proposal: up, Vote: uv})
584+
actions = append(actions, a)
585+
}
573586

574587
// If the payload is valid, check it against any received cert threshold.
575588
// Of course, this should only trigger for payloadVerified case.

0 commit comments

Comments
 (0)