Skip to content

Commit

Permalink
Merge pending changed from beta 2.0.11 to stable 2.0.5 (#889)
Browse files Browse the repository at this point in the history
- static code optimizations
- release build scripts update
  • Loading branch information
tsachiherman authored Mar 5, 2020
1 parent 729b125 commit 8b0be45
Show file tree
Hide file tree
Showing 136 changed files with 27,786 additions and 291 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
UNIT_TEST_SOURCES := $(sort $(shell GO111MODULE=off go list ./... | grep -v /go-algorand/test/ ))
ALGOD_API_PACKAGES := $(sort $(shell GO111MODULE=off cd daemon/algod/api; go list ./... ))

MSGP_GENERATE := ./protocol ./crypto ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./auction ./agreement

default: build

# tools
Expand Down Expand Up @@ -80,6 +82,12 @@ prof:
generate: deps
PATH=$(GOPATH1)/bin:$$PATH go generate ./...

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

%/msgp_gen.go: deps ALWAYS
$(GOPATH1)/bin/msgp -file ./$(@D) -o $@ 1>/dev/null
ALWAYS:

# build our fork of libsodium, placing artifacts into crypto/lib/ and crypto/include/
crypto/lib/libsodium.a:
cd crypto/libsodium-fork && \
Expand Down
1 change: 1 addition & 0 deletions agreement/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
)

//go:generate stringer -type=actionType
//msgp:ignore actionType
type actionType int

const (
Expand Down
12 changes: 8 additions & 4 deletions agreement/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type unauthenticatedBundle struct {
Step step `codec:"step"`
Proposal proposalValue `codec:"prop"`

Votes []voteAuthenticator `codec:"vote"`
EquivocationVotes []equivocationVoteAuthenticator `codec:"eqv"`
Votes []voteAuthenticator `codec:"vote,allocbound=config.MaxVoteThreshold"`
EquivocationVotes []equivocationVoteAuthenticator `codec:"eqv,allocbound=config.MaxVoteThreshold"`
}

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

U unauthenticatedBundle `codec:"u"`

Votes []vote `codec:"vote"`
EquivocationVotes []equivocationVote `codec:"eqv"`
Votes []vote `codec:"vote,allocbound=config.MaxVoteThreshold"`
EquivocationVotes []equivocationVote `codec:"eqv,allocbound=config.MaxVoteThreshold"`
}

// voteAuthenticators omit the Round, Period, Step, and Proposal for compression
// and to simplify checking logic.
type voteAuthenticator struct {
_struct struct{} `codec:""` // not omitempty

Sender basics.Address `codec:"snd"`
Cred committee.UnauthenticatedCredential `codec:"cred"`
Sig crypto.OneTimeSignature `codec:"sig,omitempty,omitemptycheckstruct"`
}

type equivocationVoteAuthenticator struct {
_struct struct{} `codec:""` // not omitempty

Sender basics.Address `codec:"snd"`
Cred committee.UnauthenticatedCredential `codec:"cred"`
Sigs [2]crypto.OneTimeSignature `codec:"sig,omitempty,omitemptycheckstruct"`
Expand Down
1 change: 1 addition & 0 deletions agreement/cadaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/algorand/go-algorand/protocol"
)

//msgp:ignore cadaverEntryType
type cadaverEntryType int

const (
Expand Down
1 change: 1 addition & 0 deletions agreement/coservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
networkCoserviceType
)

//msgp:ignore coserviceType
type coserviceType int

type coserviceMonitor struct {
Expand Down
1 change: 1 addition & 0 deletions agreement/cryptoRequestContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type roundRequestsContext struct {
}

// pendingRequests keeps the context for all pending requests
//msgp:ignore pendingRequestsContext
type pendingRequestsContext map[round]roundRequestsContext

func makePendingRequestsContext() pendingRequestsContext {
Expand Down
1 change: 1 addition & 0 deletions agreement/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type externalEvent interface {
// type of the implementing struct.
//
//go:generate stringer -type=eventType
//msgp:ignore eventType
type eventType int

const (
Expand Down
Loading

0 comments on commit 8b0be45

Please sign in to comment.