Skip to content

Commit 8b0be45

Browse files
authored
Merge pending changed from beta 2.0.11 to stable 2.0.5 (#889)
- static code optimizations - release build scripts update
1 parent 729b125 commit 8b0be45

File tree

136 files changed

+27786
-291
lines changed

Some content is hidden

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

136 files changed

+27786
-291
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
4444
UNIT_TEST_SOURCES := $(sort $(shell GO111MODULE=off go list ./... | grep -v /go-algorand/test/ ))
4545
ALGOD_API_PACKAGES := $(sort $(shell GO111MODULE=off cd daemon/algod/api; go list ./... ))
4646

47+
MSGP_GENERATE := ./protocol ./crypto ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./auction ./agreement
48+
4749
default: build
4850

4951
# tools
@@ -80,6 +82,12 @@ prof:
8082
generate: deps
8183
PATH=$(GOPATH1)/bin:$$PATH go generate ./...
8284

85+
msgp: $(patsubst %,%/msgp_gen.go,$(MSGP_GENERATE))
86+
87+
%/msgp_gen.go: deps ALWAYS
88+
$(GOPATH1)/bin/msgp -file ./$(@D) -o $@ 1>/dev/null
89+
ALWAYS:
90+
8391
# build our fork of libsodium, placing artifacts into crypto/lib/ and crypto/include/
8492
crypto/lib/libsodium.a:
8593
cd crypto/libsodium-fork && \

agreement/actions.go

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
//go:generate stringer -type=actionType
29+
//msgp:ignore actionType
2930
type actionType int
3031

3132
const (

agreement/bundle.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type unauthenticatedBundle struct {
3636
Step step `codec:"step"`
3737
Proposal proposalValue `codec:"prop"`
3838

39-
Votes []voteAuthenticator `codec:"vote"`
40-
EquivocationVotes []equivocationVoteAuthenticator `codec:"eqv"`
39+
Votes []voteAuthenticator `codec:"vote,allocbound=config.MaxVoteThreshold"`
40+
EquivocationVotes []equivocationVoteAuthenticator `codec:"eqv,allocbound=config.MaxVoteThreshold"`
4141
}
4242

4343
// bundle is a set of votes, all from the same round, period, and step, and from distinct senders, that reaches quorum.
@@ -48,19 +48,23 @@ type bundle struct {
4848

4949
U unauthenticatedBundle `codec:"u"`
5050

51-
Votes []vote `codec:"vote"`
52-
EquivocationVotes []equivocationVote `codec:"eqv"`
51+
Votes []vote `codec:"vote,allocbound=config.MaxVoteThreshold"`
52+
EquivocationVotes []equivocationVote `codec:"eqv,allocbound=config.MaxVoteThreshold"`
5353
}
5454

5555
// voteAuthenticators omit the Round, Period, Step, and Proposal for compression
5656
// and to simplify checking logic.
5757
type voteAuthenticator struct {
58+
_struct struct{} `codec:""` // not omitempty
59+
5860
Sender basics.Address `codec:"snd"`
5961
Cred committee.UnauthenticatedCredential `codec:"cred"`
6062
Sig crypto.OneTimeSignature `codec:"sig,omitempty,omitemptycheckstruct"`
6163
}
6264

6365
type equivocationVoteAuthenticator struct {
66+
_struct struct{} `codec:""` // not omitempty
67+
6468
Sender basics.Address `codec:"snd"`
6569
Cred committee.UnauthenticatedCredential `codec:"cred"`
6670
Sigs [2]crypto.OneTimeSignature `codec:"sig,omitempty,omitemptycheckstruct"`

agreement/cadaver.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/algorand/go-algorand/protocol"
2828
)
2929

30+
//msgp:ignore cadaverEntryType
3031
type cadaverEntryType int
3132

3233
const (

agreement/coservice.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const (
3232
networkCoserviceType
3333
)
3434

35+
//msgp:ignore coserviceType
3536
type coserviceType int
3637

3738
type coserviceMonitor struct {

agreement/cryptoRequestContext.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type roundRequestsContext struct {
4646
}
4747

4848
// pendingRequests keeps the context for all pending requests
49+
//msgp:ignore pendingRequestsContext
4950
type pendingRequestsContext map[round]roundRequestsContext
5051

5152
func makePendingRequestsContext() pendingRequestsContext {

agreement/events.go

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type externalEvent interface {
6868
// type of the implementing struct.
6969
//
7070
//go:generate stringer -type=eventType
71+
//msgp:ignore eventType
7172
type eventType int
7273

7374
const (

0 commit comments

Comments
 (0)