Skip to content

Commit fa33874

Browse files
Merge branch 'rel/beta' into relstable3.18.0
2 parents f239f80 + c6a320f commit fa33874

File tree

288 files changed

+26237
-8104
lines changed

Some content is hidden

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

288 files changed

+26237
-8104
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ commands:
457457
shell: bash.exe
458458
command: |
459459
choco install -y msys2 pacman make wget --force
460-
choco install -y golang --version=1.20.5 --force
460+
choco install -y golang --version=$(./scripts/get_golang_version.sh) --force
461461
choco install -y python3 --version=3.7.3 --force
462462
export msys2='cmd //C RefreshEnv.cmd '
463463
export msys2+='& set MSYS=winsymlinks:nativestrict '
@@ -602,7 +602,6 @@ commands:
602602
export PACKAGE_NAMES=$(echo $PACKAGES | tr -d '\n')
603603
export PARTITION_TOTAL=${CIRCLE_NODE_TOTAL}
604604
export PARTITION_ID=${CIRCLE_NODE_INDEX}
605-
export GOEXPERIMENT="none"
606605
gotestsum --format standard-verbose --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES
607606
- store_artifacts:
608607
path: << parameters.result_path >>

.github/workflows/reviewdog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
uses: actions/cache@v3.3.1
5757
with:
5858
path: cicdtmp/golangci-lint/golangci-lint-cgo
59-
key: cicd-golangci-lint-cgo-v0.0.2
59+
key: cicd-golangci-lint-cgo-v0.0.2-${{ env.GO_VERSION }}
6060

6161
- name: Build custom golangci-lint with CGO_ENABLED
6262
if: steps.cache-golangci-lint.outputs.cache-hit != 'true'

.github/workflows/tools.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- 'tools/block-generator/**'
1010
- 'tools/x-repo-types/**'
1111
pull_request:
12-
paths:
13-
- 'tools/block-generator/**'
14-
- 'tools/x-repo-types/**'
1512

1613
jobs:
1714
tools_test:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:20.04 as builder
22

3-
ARG GO_VERSION="1.20.5"
3+
ARG GO_VERSION="1.20.7"
44

55
ARG CHANNEL
66
ARG URL

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ ifeq ($(SHORT_PART_PERIOD), 1)
6969
export SHORT_PART_PERIOD_FLAG := -s
7070
endif
7171

72-
# Disable go experiments during build as of go 1.20.5 due to
73-
# https://github.com/golang/go/issues/60825
74-
# Likely fix: https://go-review.googlesource.com/c/go/+/503937/6/src/runtime/race_arm64.s
75-
export GOEXPERIMENT=none
76-
7772
GOTAGS := --tags "$(GOTAGSLIST)"
7873
GOTRIMPATH := $(shell GOPATH=$(GOPATH) && go help build | grep -q .-trimpath && echo -trimpath)
7974

@@ -91,7 +86,7 @@ ALGOD_API_PACKAGES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && cd d
9186

9287
GOMOD_DIRS := ./tools/block-generator ./tools/x-repo-types
9388

94-
MSGP_GENERATE := ./protocol ./protocol/test ./crypto ./crypto/merklearray ./crypto/merklesignature ./crypto/stateproof ./data/basics ./data/transactions ./data/stateproofmsg ./data/committee ./data/bookkeeping ./data/hashable ./agreement ./rpcs ./network ./node ./ledger ./ledger/ledgercore ./ledger/store/trackerdb ./ledger/encoded ./stateproof ./data/account ./daemon/algod/api/spec/v2
89+
MSGP_GENERATE := ./protocol ./protocol/test ./crypto ./crypto/merklearray ./crypto/merklesignature ./crypto/stateproof ./data/basics ./data/transactions ./data/stateproofmsg ./data/committee ./data/bookkeeping ./data/hashable ./agreement ./rpcs ./network ./node ./ledger ./ledger/ledgercore ./ledger/store/trackerdb ./ledger/store/trackerdb/generickv ./ledger/encoded ./stateproof ./data/account ./daemon/algod/api/spec/v2
9590

9691
default: build
9792

@@ -212,9 +207,11 @@ build: buildsrc buildsrc-special
212207
# get around a bug in go build where it will fail
213208
# to cache binaries from time to time on empty NFS
214209
# dirs
215-
buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN
216-
mkdir -p "${GOCACHE}" && \
217-
touch "${GOCACHE}"/file.txt && \
210+
${GOCACHE}/file.txt:
211+
mkdir -p "${GOCACHE}"
212+
touch "${GOCACHE}"/file.txt
213+
214+
buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN ${GOCACHE}/file.txt
218215
go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...
219216

220217
buildsrc-special:

agreement/agreementtest/simulate.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/algorand/go-algorand/crypto"
3232
"github.com/algorand/go-algorand/data/basics"
3333
"github.com/algorand/go-algorand/logging"
34-
"github.com/algorand/go-algorand/protocol"
3534
"github.com/algorand/go-algorand/util/db"
3635
"github.com/algorand/go-algorand/util/timers"
3736
)
@@ -52,15 +51,15 @@ func makeInstant() *instant {
5251
return i
5352
}
5453

55-
func (i *instant) Decode([]byte) (timers.Clock, error) {
54+
func (i *instant) Decode([]byte) (timers.Clock[agreement.TimeoutType], error) {
5655
return i, nil
5756
}
5857

5958
func (i *instant) Encode() []byte {
6059
return nil
6160
}
6261

63-
func (i *instant) TimeoutAt(d time.Duration) <-chan time.Time {
62+
func (i *instant) TimeoutAt(d time.Duration, timeoutType agreement.TimeoutType) <-chan time.Time {
6463
ta := make(chan time.Time)
6564
select {
6665
case <-i.timeoutAtCalled:
@@ -69,13 +68,13 @@ func (i *instant) TimeoutAt(d time.Duration) <-chan time.Time {
6968
return ta
7069
}
7170

72-
if d == agreement.FilterTimeout(0, protocol.ConsensusCurrentVersion) && !i.HasPending("pseudonode") {
71+
if timeoutType == agreement.TimeoutFilter && !i.HasPending("pseudonode") {
7372
close(ta)
7473
}
7574
return ta
7675
}
7776

78-
func (i *instant) Zero() timers.Clock {
77+
func (i *instant) Zero() timers.Clock[agreement.TimeoutType] {
7978
i.Z0 <- struct{}{}
8079
// pause here until runRound is called
8180
i.Z1 <- struct{}{}

agreement/demux.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package agreement
1919
import (
2020
"context"
2121
"fmt"
22-
"time"
2322

2423
"github.com/algorand/go-algorand/config"
2524
"github.com/algorand/go-algorand/logging"
@@ -190,7 +189,7 @@ func (d *demux) verifyBundle(ctx context.Context, m message, r round, p period,
190189
// next blocks until it observes an external input event of interest for the state machine.
191190
//
192191
// If ok is false, there are no more events so the agreement service should quit.
193-
func (d *demux) next(s *Service, deadline time.Duration, fastDeadline time.Duration, currentRound round) (e externalEvent, ok bool) {
192+
func (d *demux) next(s *Service, deadline Deadline, fastDeadline Deadline, currentRound round) (e externalEvent, ok bool) {
194193
defer func() {
195194
if !ok {
196195
return
@@ -250,8 +249,8 @@ func (d *demux) next(s *Service, deadline time.Duration, fastDeadline time.Durat
250249
}
251250

252251
ledgerNextRoundCh := s.Ledger.Wait(nextRound)
253-
deadlineCh := s.Clock.TimeoutAt(deadline)
254-
fastDeadlineCh := s.Clock.TimeoutAt(fastDeadline)
252+
deadlineCh := s.Clock.TimeoutAt(deadline.Duration, deadline.Type)
253+
fastDeadlineCh := s.Clock.TimeoutAt(fastDeadline.Duration, fastDeadline.Type)
255254

256255
d.UpdateEventsQueue(eventQueueDemux, 0)
257256
d.monitor.dec(demuxCoserviceType)

agreement/demux_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,14 @@ func TestDemuxNext(t *testing.T) {
422422
}
423423

424424
// implement timers.Clock
425-
func (t *demuxTester) Zero() timers.Clock {
425+
func (t *demuxTester) Zero() timers.Clock[TimeoutType] {
426426
// we don't care about this function in this test.
427427
return t
428428
}
429429

430430
// implement timers.Clock
431-
func (t *demuxTester) TimeoutAt(delta time.Duration) <-chan time.Time {
432-
if delta == fastTimeoutChTime {
431+
func (t *demuxTester) TimeoutAt(delta time.Duration, timeoutType TimeoutType) <-chan time.Time {
432+
if timeoutType == TimeoutFastRecovery {
433433
return nil
434434
}
435435

@@ -450,7 +450,7 @@ func (t *demuxTester) Encode() []byte {
450450
}
451451

452452
// implement timers.Clock
453-
func (t *demuxTester) Decode([]byte) (timers.Clock, error) {
453+
func (t *demuxTester) Decode([]byte) (timers.Clock[TimeoutType], error) {
454454
// we don't care about this function in this test.
455455
return t, nil
456456
}
@@ -675,7 +675,7 @@ func (t *demuxTester) TestUsecase(testcase demuxTestUsecase) bool {
675675
close(s.quit)
676676
}
677677

678-
e, ok := dmx.next(s, time.Second, fastTimeoutChTime, 300)
678+
e, ok := dmx.next(s, Deadline{Duration: time.Second, Type: TimeoutDeadline}, Deadline{Duration: fastTimeoutChTime, Type: TimeoutFastRecovery}, 300)
679679

680680
if !assert.Equal(t, testcase.ok, ok) {
681681
return false

agreement/fuzzer/fuzzer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type Fuzzer struct {
4747
wallClock int32
4848
agreements []*agreement.Service
4949
facades []*NetworkFacade
50-
clocks []timers.Clock
50+
clocks []timers.Clock[agreement.TimeoutType]
5151
disconnected [][]bool
5252
crashAccessors []db.Accessor
5353
router *Router
@@ -80,7 +80,7 @@ func MakeFuzzer(config FuzzerConfig) *Fuzzer {
8080
networkName: config.FuzzerName,
8181
agreements: make([]*agreement.Service, config.NodesCount),
8282
facades: make([]*NetworkFacade, config.NodesCount),
83-
clocks: make([]timers.Clock, config.NodesCount),
83+
clocks: make([]timers.Clock[agreement.TimeoutType], config.NodesCount),
8484
disconnected: make([][]bool, config.NodesCount),
8585
crashAccessors: make([]db.Accessor, config.NodesCount),
8686
accounts: make([]account.Participation, config.NodesCount),

agreement/fuzzer/networkFacade_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131

3232
"github.com/algorand/go-deadlock"
3333

34+
"github.com/algorand/go-algorand/agreement"
3435
"github.com/algorand/go-algorand/network"
3536
"github.com/algorand/go-algorand/protocol"
3637
"github.com/algorand/go-algorand/util/timers"
@@ -48,7 +49,7 @@ type NetworkFacadeMessage struct {
4849
type NetworkFacade struct {
4950
network.GossipNode
5051
NetworkFilter
51-
timers.Clock
52+
timers.Clock[agreement.TimeoutType]
5253
nodeID int
5354
mux *network.Multiplexer
5455
fuzzer *Fuzzer
@@ -77,7 +78,7 @@ func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
7778
n := &NetworkFacade{
7879
fuzzer: fuzzer,
7980
nodeID: nodeID,
80-
mux: network.MakeMultiplexer(fuzzer.log),
81+
mux: network.MakeMultiplexer(),
8182
clocks: make(map[int]chan time.Time),
8283
eventsQueues: make(map[string]int),
8384
eventsQueuesCh: make(chan int, 1000),
@@ -345,7 +346,7 @@ func (n *NetworkFacade) Disconnect(sender network.Peer) {
345346
n.fuzzer.Disconnect(n.nodeID, sourceNode)
346347
}
347348

348-
func (n *NetworkFacade) Zero() timers.Clock {
349+
func (n *NetworkFacade) Zero() timers.Clock[agreement.TimeoutType] {
349350
n.clockSync.Lock()
350351
defer n.clockSync.Unlock()
351352

@@ -375,7 +376,7 @@ func (n *NetworkFacade) Rezero() {
375376
// Since implements the Clock interface.
376377
func (n *NetworkFacade) Since() time.Duration { return 0 }
377378

378-
func (n *NetworkFacade) TimeoutAt(d time.Duration) <-chan time.Time {
379+
func (n *NetworkFacade) TimeoutAt(d time.Duration, timeoutType agreement.TimeoutType) <-chan time.Time {
379380
defer n.timeoutAtInitOnce.Do(func() {
380381
n.timeoutAtInitWait.Done()
381382
})
@@ -414,7 +415,7 @@ func (n *NetworkFacade) Encode() []byte {
414415
return buf.Bytes()
415416
}
416417

417-
func (n *NetworkFacade) Decode(in []byte) (timers.Clock, error) {
418+
func (n *NetworkFacade) Decode(in []byte) (timers.Clock[agreement.TimeoutType], error) {
418419
n.clockSync.Lock()
419420
defer n.clockSync.Unlock()
420421

0 commit comments

Comments
 (0)