Skip to content

Commit f8aab76

Browse files
authored
Merge pull request #6328 from Algo-devops-service/relstable4.1.0
2 parents f3be4a3 + 7c333ef commit f8aab76

File tree

305 files changed

+12154
-6066
lines changed

Some content is hidden

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

305 files changed

+12154
-6066
lines changed

.golangci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ linters:
1515
- misspell
1616
- nilerr
1717
- nolintlint
18+
- paralleltest
1819
- revive
1920
- staticcheck
2021
- typecheck
21-
- paralleltest
2222
- unused
2323

2424
severity:
@@ -124,6 +124,8 @@ issues:
124124
linters: unused
125125
- path: tools/
126126
linters: unused
127+
- path: daemon/kmd/lib/kmdapi/
128+
linters: unused
127129
- path: _test\.go
128130
linters:
129131
- errcheck
@@ -142,6 +144,9 @@ issues:
142144
linters:
143145
- staticcheck
144146
text: "SA4006: this value" # of X is never used
147+
- linters:
148+
- staticcheck
149+
text: "(SA3001|SA1019):"
145150
- path: _test\.go
146151
linters:
147152
- revive

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
5151
endif
5252

5353
ifeq ($(OS_TYPE), darwin)
54-
# For Xcode >= 15, set -no_warn_duplicate_libraries linker option
55-
CLANG_MAJOR_VERSION := $(shell clang --version | grep '^Apple clang version ' | awk '{print $$4}' | cut -d. -f1)
56-
ifeq ($(shell [ $(CLANG_MAJOR_VERSION) -ge 15 ] && echo true), true)
57-
EXTLDFLAGS := -Wl,-no_warn_duplicate_libraries
58-
endif
5954
# M1 Mac--homebrew install location in /opt/homebrew
6055
ifeq ($(ARCH), arm64)
6156
export CPATH=/opt/homebrew/include
@@ -148,6 +143,13 @@ generate: deps
148143

149144
msgp: $(patsubst %,%/msgp_gen.go,$(MSGP_GENERATE))
150145

146+
api:
147+
make -C daemon/algod/api
148+
149+
logic:
150+
make -C data/transactions/logic
151+
152+
151153
%/msgp_gen.go: deps ALWAYS
152154
@set +e; \
153155
printf "msgp: $(@D)..."; \
@@ -335,7 +337,11 @@ node_exporter: $(GOPATH1)/bin/node_exporter
335337
$(GOPATH1)/bin/node_exporter:
336338
mkdir -p $(GOPATH1)/bin && \
337339
cd $(GOPATH1)/bin && \
338-
tar -xzvf $(SRCPATH)/installer/external/node_exporter-stable-$(shell ./scripts/ostype.sh)-$(shell uname -m | tr '[:upper:]' '[:lower:]').tar.gz && \
340+
if [ -z "$(CROSS_COMPILE_ARCH)" ]; then \
341+
tar -xzvf $(SRCPATH)/installer/external/node_exporter-stable-$(shell ./scripts/ostype.sh)-$(shell uname -m | tr '[:upper:]' '[:lower:]').tar.gz; \
342+
else \
343+
tar -xzvf $(SRCPATH)/installer/external/node_exporter-stable-$(shell ./scripts/ostype.sh)-universal.tar.gz; \
344+
fi && \
339345
cd -
340346

341347
# deploy

agreement/actions.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ func (c checkpointAction) do(ctx context.Context, s *Service) {
566566
// we don't expect this to happen in recovery
567567
s.log.with(logEvent).Errorf("checkpoint action for (%v, %v, %v) reached with nil completion channel", c.Round, c.Period, c.Step)
568568
}
569-
return
570569
}
571570

572571
func (c checkpointAction) String() string {

agreement/agreementtest/simulate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
207207
err := fmt.Errorf("Lookup called on future round: %v > %v! (this is probably a bug)", r, l.nextRound)
208208
panic(err)
209209
}
210-
return l.state[a].OnlineAccountData(), nil
210+
return basics_testing.OnlineAccountData(l.state[a]), nil
211211
}
212212

213213
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
@@ -222,7 +222,7 @@ func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.M
222222
var sum basics.MicroAlgos
223223
var overflowed bool
224224
for _, rec := range l.state {
225-
sum, overflowed = basics.OAddA(sum, rec.OnlineAccountData().VotingStake())
225+
sum, overflowed = basics.OAddA(sum, basics_testing.OnlineAccountData(rec).VotingStake())
226226
if overflowed {
227227
panic("circulation computation overflowed")
228228
}

agreement/autopsy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func (a *Autopsy) extractNextCdv(ch chan<- autopsyTrace) (bounds AutopsyBounds,
384384
close(pch)
385385
}
386386

387-
pch = make(chan autopsyPair, 0)
387+
pch = make(chan autopsyPair)
388388
acc = autopsyTrace{m: acc.m, p: pch}
389389
err = protocol.DecodeStream(a, &acc.x)
390390
if err != nil {

agreement/certificate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func TestCertificateCertWrongRound(t *testing.T) {
276276
ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100()
277277
round := ledger.NextRound()
278278
period := period(0)
279-
block := makeRandomBlock(1 - 1)
279+
block := makeRandomBlock(0)
280280

281281
votes := make([]vote, 0)
282282
equiVotes := make([]equivocationVote, 0)

agreement/common_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/algorand/go-algorand/config"
3030
"github.com/algorand/go-algorand/crypto"
3131
"github.com/algorand/go-algorand/data/basics"
32+
basics_testing "github.com/algorand/go-algorand/data/basics/testing"
3233
"github.com/algorand/go-algorand/data/bookkeeping"
3334
"github.com/algorand/go-algorand/data/committee"
3435
"github.com/algorand/go-algorand/logging"
@@ -332,7 +333,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
332333
return basics.OnlineAccountData{}, &LedgerDroppedRoundError{}
333334
}
334335

335-
return l.state[a].OnlineAccountData(), nil
336+
return basics_testing.OnlineAccountData(l.state[a]), nil
336337
}
337338

338339
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
@@ -347,7 +348,7 @@ func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.M
347348
var sum basics.MicroAlgos
348349
var overflowed bool
349350
for _, rec := range l.state {
350-
sum, overflowed = basics.OAddA(sum, rec.OnlineAccountData().VotingStake())
351+
sum, overflowed = basics.OAddA(sum, basics_testing.OnlineAccountData(rec).VotingStake())
351352
if overflowed {
352353
panic("circulation computation overflowed")
353354
}

agreement/fuzzer/ledger_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/algorand/go-algorand/config"
2626
"github.com/algorand/go-algorand/crypto"
2727
"github.com/algorand/go-algorand/data/basics"
28+
basics_testing "github.com/algorand/go-algorand/data/basics/testing"
2829
"github.com/algorand/go-algorand/data/bookkeeping"
2930
"github.com/algorand/go-algorand/data/committee"
3031
"github.com/algorand/go-algorand/protocol"
@@ -241,7 +242,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
241242
err := fmt.Errorf("Lookup called on future round: %d >= %d! (this is probably a bug)", r, l.nextRound)
242243
panic(err)
243244
}
244-
return l.state[a].OnlineAccountData(), nil
245+
return basics_testing.OnlineAccountData(l.state[a]), nil
245246
}
246247

247248
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
@@ -256,7 +257,7 @@ func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.M
256257
var sum basics.MicroAlgos
257258
var overflowed bool
258259
for _, rec := range l.state {
259-
sum, overflowed = basics.OAddA(sum, rec.OnlineAccountData().VotingStake())
260+
sum, overflowed = basics.OAddA(sum, basics_testing.OnlineAccountData(rec).VotingStake())
260261
if overflowed {
261262
panic("circulation computation overflowed")
262263
}

agreement/gossip/network.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package gossip
2020

2121
import (
2222
"context"
23-
"time"
2423

2524
"github.com/algorand/go-algorand/agreement"
2625
"github.com/algorand/go-algorand/config"
@@ -179,12 +178,3 @@ func (i *networkImpl) Disconnect(h agreement.MessageHandle) {
179178

180179
i.net.Disconnect(metadata.raw.Sender)
181180
}
182-
183-
// broadcastTimeout is currently only used by test code.
184-
// In test code we want to queue up a bunch of outbound packets and then see that they got through, so we need to wait at least a little bit for them to all go out.
185-
// Normal agreement state machine code uses GossipNode.Broadcast non-blocking and may drop outbound packets.
186-
func (i *networkImpl) broadcastTimeout(t protocol.Tag, data []byte, timeout time.Duration) error {
187-
ctx, cancel := context.WithTimeout(context.Background(), timeout)
188-
defer cancel()
189-
return i.net.Broadcast(ctx, t, data, true, nil)
190-
}

agreement/persistence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func (p *asyncPersistenceLoop) loop(ctx context.Context) {
355355
select {
356356
case <-ctx.Done():
357357
return
358-
case s, _ = <-p.pending:
358+
case s = <-p.pending:
359359
}
360360

361361
// make sure that the ledger finished writing the previous round to disk.

0 commit comments

Comments
 (0)