Skip to content

Commit 1657db4

Browse files
authored
Merge pull request #4050 from Algo-devops-service/relbeta3.7.0
2 parents 025f642 + bd54c4b commit 1657db4

File tree

189 files changed

+7634
-3628
lines changed

Some content is hidden

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

189 files changed

+7634
-3628
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ commands:
198198
shell: bash.exe
199199
command: |
200200
choco install -y msys2 pacman make wget --force
201-
choco install -y golang --version=1.16.15 --force
201+
choco install -y golang --version=1.17.9 --force
202202
choco install -y python3 --version=3.7.3 --force
203203
export msys2='cmd //C RefreshEnv.cmd '
204204
export msys2+='& set MSYS=winsymlinks:nativestrict '

.codecov.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
ignore:
5+
- "**/*_gen.go"
6+
- "**/*_gen_test.go"
7+
- "**/generated"
8+
9+
coverage:
10+
status:
11+
project:
12+
default:
13+
target: auto
14+
informational: true
15+
patch:
16+
default:
17+
target: auto
18+
informational: true

.github/workflows/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Github Actions Workflows
2+
3+
## Benchmarking Performance Tests
4+
`benchmarks.yml` contains a workflow to check for any performance regressions or
5+
improvements in benchmark tests.
6+
7+
It uses
8+
[github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark)
9+
to check performance diffs between a PR and the `master` branch, comments if it
10+
there is a regression past a certain threshold (default: `200%`), and generates
11+
a performance diff JSON between consecutive commits in the `master` branch in
12+
the `gh-pages` branch (the JSON is visualized into a graph that can be seen at:
13+
https://algorand.github.io/go-algorand/dev/bench/).
14+
15+
### Adding benchmark tests
16+
Add run steps or extend existing benchmark invocations in the `Run benchmark`
17+
step. Additional benchmarks can be run using the `-bench` flag. Since there's
18+
few benchmarks run by the workflow, there are _no_ formal groupings and/or
19+
naming conventions.
20+
21+
### CI Variance
22+
There may be some variance between runs because github actions might spin up a
23+
different machine each time (e.g. Intel Xeon 8370C vs 8171M; the latter might
24+
run benchmarks slightly slower). Empirically, the variance seems to be 10~30%
25+
for the most part. Due to this environment variance, the workflow is most
26+
suitable for finding _large_ performance degradations.

.github/workflows/benchmarks.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Benchmark workflow"
2+
on:
3+
# Push and update benchmarks when a commit is merged into master.
4+
push:
5+
branches:
6+
- master
7+
# Trigger benchmark test on this PR's commit against master.
8+
pull_request:
9+
branches:
10+
- master
11+
permissions:
12+
# Push benchmark performance graph to gh-pages branch.
13+
contents: write
14+
deployments: write
15+
jobs:
16+
benchmark:
17+
name: Performance regression check
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-go@v3
22+
with:
23+
go-version-file: 'go.mod'
24+
- run: go version
25+
- name: Build go-algorand
26+
run: scripts/travis/build.sh
27+
# BenchmarkUintMath - Serves as a proxy for AVM `eval` performance.
28+
# Performance degradations suggest either or both: (1) op code
29+
# degradation, (2) `eval` degradation. (2) suggests a broader performance
30+
# issue.
31+
- name: Run benchmark
32+
run: go test ./data/transactions/logic -bench 'BenchmarkUintMath' | tee benchmark_output.txt
33+
- name: Push benchmark result to gh-pages branch
34+
if: github.event_name == 'push'
35+
uses: benchmark-action/github-action-benchmark@v1
36+
with:
37+
name: Go Benchmark
38+
tool: 'go'
39+
output-file-path: benchmark_output.txt
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
auto-push: true
42+
- name: Evaluate benchmark on PR branch
43+
if: github.event.pull_request
44+
uses: benchmark-action/github-action-benchmark@v1
45+
with:
46+
name: Go Benchmark
47+
tool: 'go'
48+
output-file-path: benchmark_output.txt
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
alert-threshold: '200%'
51+
comment-on-alert: true

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install golang
2121
uses: actions/setup-go@v2
2222
with:
23-
go-version: '1.16.15'
23+
go-version: '1.17.9'
2424
- name: Build Test
2525
run: |
2626
export ALGORAND_DEADLOCK=enable

.github/workflows/reviewdog.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Install specific golang
4545
uses: actions/setup-go@v2
4646
with:
47-
go-version: '1.16.15'
47+
go-version: '1.17.9'
4848
- name: Create folders for golangci-lint
4949
run: mkdir -p cicdtmp/golangci-lint
5050
- name: Check if custom golangci-lint is already built

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ else
3636
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
3737
endif
3838

39+
# M1 Mac--homebrew install location in /opt/homebrew
40+
ifeq ($(OS_TYPE), darwin)
41+
ifeq ($(ARCH), arm64)
42+
export CPATH=/opt/homebrew/include
43+
export LIBRARY_PATH=/opt/homebrew/lib
44+
endif
45+
endif
3946
ifeq ($(UNAME), Linux)
4047
EXTLDFLAGS := -static-libstdc++ -static-libgcc
4148
ifeq ($(ARCH), amd64)

agreement/fuzzer/bandwidthFilter_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (n *BandwidthFilter) Tick(newClockTime int) bool {
167167
n.downstreamMutex.Lock()
168168
if n.downstreamDataSize < 0 && n.downstreamQueue.Len() == 0 {
169169
if n.debugMessageLevel >= 1 {
170-
fmt.Printf("node: %d, tick: %d, reseting queued downstream capacity %d -> 0\n", n.nodeID, n.currentTick, n.upstreamDataSize)
170+
fmt.Printf("node: %d, tick: %d, resetting queued downstream capacity %d -> 0\n", n.nodeID, n.currentTick, n.upstreamDataSize)
171171
}
172172
n.downstreamDataSize = 0
173173
}
@@ -179,7 +179,7 @@ func (n *BandwidthFilter) Tick(newClockTime int) bool {
179179
// adjust the upstream size.
180180
if n.upstreamDataSize < 0 && n.upstreamQueue.Len() == 0 {
181181
if n.debugMessageLevel >= 1 {
182-
fmt.Printf("node: %d, tick: %d, reseting queued upstream capacity %d -> 0\n", n.nodeID, n.currentTick, n.upstreamDataSize)
182+
fmt.Printf("node: %d, tick: %d, resetting queued upstream capacity %d -> 0\n", n.nodeID, n.currentTick, n.upstreamDataSize)
183183
}
184184
n.upstreamDataSize = 0
185185
}

agreement/gossip/network.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ import (
3232
)
3333

3434
var messagesHandledTotal = metrics.MakeCounter(metrics.AgreementMessagesHandled)
35-
var messagesHandledByType = metrics.NewTagCounter("algod_agreement_handled_{TAG}", "Number of agreement messages handled per type")
35+
var messagesHandledByType = metrics.NewTagCounter("algod_agreement_handled_{TAG}", "Number of agreement {TAG} messages handled",
36+
agreementVoteMessageType, agreementProposalMessageType, agreementBundleMessageType)
3637
var messagesDroppedTotal = metrics.MakeCounter(metrics.AgreementMessagesDropped)
37-
var messagesDroppedByType = metrics.NewTagCounter("algod_agreement_dropped_{TAG}", "Number of agreement messages handled per type")
38+
var messagesDroppedByType = metrics.NewTagCounter("algod_agreement_dropped_{TAG}", "Number of agreement {TAG} messages dropped",
39+
agreementVoteMessageType, agreementProposalMessageType, agreementBundleMessageType)
3840

3941
const (
4042
agreementVoteMessageType = "vote"

0 commit comments

Comments
 (0)