Skip to content

Commit a6fdbad

Browse files
authored
Merge pull request #1116 from onetechnical/onetechnical/beta2.0.14
Algorand Release 2.0.14-beta
2 parents 5df2b13 + 902afe9 commit a6fdbad

File tree

250 files changed

+20357
-2428
lines changed

Some content is hidden

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

250 files changed

+20357
-2428
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ It is also a good idea to run tests:
1515

1616
## Summary
1717

18-
Explain the goal of this change and what problem it is solving.
18+
Explain the goal of this change and what problem it is solving. Format this cleanly so that it may be used for a commit message, as your changes will be squash-merged.
1919

2020
## Test Plan
2121

2222
How did you test these changes? Please provide the exact scenarios you tested in as much detail as possible including commands, output and rationale.
23-

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ addons:
166166
artifacts:
167167
s3_region: "us-east-1"
168168
paths:
169-
- $(git ls-files -o | grep -v crypto/libsodium-fork | grep -v crypto/lib/ | grep -v ^gen/ | grep -v swagger.json.validated | tr "\n" ":")
169+
- $(git ls-files -o | grep -v crypto/libs | grep -v crypto/copies | grep -v crypto/libsodium-fork | grep -v crypto/lib/ | grep -v ^gen/ | grep -v swagger.json.validated | tr "\n" ":")
170170

171171
notifications:
172172
slack:

CONTRIBUTING.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
If you are interested in contributing to the project, we welcome and thank you. We want to make the best decentralized and effective blockchain platform available and we appreciate your willingness to help us.
44

5-
The algorand project is composed of several repositories on GitHub. Specifically we have repositories for the main node software,the JavaScript SDK, the Go SDK, and the Java SDK. Additionally we have repositories for projects we forked like go-codec that make up some of the main dependencies for a node. Each of these will follow similar guidelines on how to contribute. The main difference between these concerns code formatting and deploying changes to production.
5+
The [Algorand GitHub Organization](https://github.com/algorand) has all of our open source projects, and dependencies which we fork and use in those projects. This contribution guide applies to all of these.
6+
7+
Some of our most active projects include:
8+
* [go-algorand](https://github.com/algorand/go-algorand) - Algorand node software (this repository)
9+
* [go-algorand-sdk](https://github.com/algorand/go-algorand-sdk) - Golang SDK
10+
* [java-algorand-sdk](https://github.com/algorand/java-algorand-sdk) - Java SDK
11+
* [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk) - JavaScript SDK
12+
* [indexer](https://github.com/algorand/indexer) - Blockchain analytics database
13+
* [ledger-app-algorand](https://github.com/algorand/ledger-app-algorand) - Ledger hardware wallet application
14+
* [mule](https://github.com/algorand/mule) - Continuous Integration automation tool
15+
* [py-algorand-sdk](https://github.com/algorand/py-algorand-sdk) - Python SDK
16+
* [sandbox](https://github.com/algorand/sandbox) - Algorand node quickstart tool
617

718
# Filing Issues
819

@@ -24,7 +35,9 @@ If you have any questions, don't hesitate to contact us at [email protected]
2435

2536
# Contribution Model
2637

27-
For each of our repositories we use the same model for contributing code. Developers wanting to contribute must create pull requests. This process is described in the GitHub [Creating a pull request from a fork](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) documentation. Each pull request should be initiated against the master branch in the Algorand repository. After a pull request is submitted the core development team will review the submission and communicate with the developer using the comments sections of the PR. After the submission is reviewed and approved, it will be merged into the master branch of the source. These changes will be merged to our release branch on the next viable release date. For the SDKs, this may be immediate. Changes to the node software may take more time as we must ensure and verify the security, as well as apply protocol upgrades in an orderly way.
38+
For each of our repositories we use the same model for contributing code. Developers wanting to contribute must create pull requests. This process is described in the GitHub [Creating a pull request from a fork](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) documentation. Each pull request should be initiated against the `master` branch in the Algorand repository. After a pull request is submitted the core development team will review the submission and communicate with the developer using the comments sections of the PR. After the submission is reviewed and approved, it will be merged into the `master` branch of the source. These changes will be merged to our release branch on the next viable release date. For the SDKs, this may be immediate. Changes to the node software may take more time as we must ensure and verify the security, as well as apply protocol upgrades in an orderly way.
39+
40+
Note: some of our projects are using gitflow, for these you will open pull requests against the `develop` branch.
2841

2942
Again, if you have a patch for a critical security vulnerability, please use our [vulnerability disclosure form][vuln_url] instead of creating a PR. We'll follow up with you on distributing the patch before we merge it.
3043

Makefile

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
GOPATH := $(shell go env GOPATH)
1+
export GOPATH := $(shell go env GOPATH)
22
GOPATH1 := $(firstword $(subst :, ,$(GOPATH)))
3-
export GOPATH
4-
GO111MODULE := on
5-
export GO111MODULE
3+
export GO111MODULE := on
4+
export GOPROXY := https://gocenter.io
5+
66
UNAME := $(shell uname)
77
SRCPATH := $(shell pwd)
88
ARCH := $(shell ./scripts/archtype.sh)
@@ -52,14 +52,15 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
5252
UNIT_TEST_SOURCES := $(sort $(shell GO111MODULE=off go list ./... | grep -v /go-algorand/test/ ))
5353
ALGOD_API_PACKAGES := $(sort $(shell GO111MODULE=off cd daemon/algod/api; go list ./... ))
5454

55-
MSGP_GENERATE := ./protocol ./crypto ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./auction ./agreement ./rpcs ./node
55+
MSGP_GENERATE := ./protocol ./crypto ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./auction ./agreement ./rpcs ./node ./ledger
5656

5757
default: build
5858

5959
# tools
6060

6161
fmt:
6262
go fmt ./...
63+
./scripts/check_license.sh -i
6364

6465
fix: build
6566
$(GOPATH1)/bin/algofix */
@@ -73,13 +74,10 @@ lint: deps
7374
vet:
7475
go vet ./...
7576

76-
check_license:
77-
./scripts/check_license.sh
78-
7977
check_shell:
8078
find . -type f -name "*.sh" -exec shellcheck {} +
8179

82-
sanity: vet fix lint fmt check_license
80+
sanity: vet fix lint fmt
8381

8482
cover:
8583
go test $(GOTAGS) -coverprofile=cover.out $(UNIT_TEST_SOURCES)
@@ -276,14 +274,8 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
276274
install: build
277275
scripts/dev_install.sh -p $(GOPATH1)/bin
278276

279-
.PHONY: default fmt vet lint check_license check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN
280-
281-
### TARGETS FOR CICD PROCESS
277+
.PHONY: default fmt vet lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN
282278

283-
ci-deps:
284-
scripts/configure_dev-deps.sh && \
285-
scripts/check_deps.sh
279+
###### TARGETS FOR CICD PROCESS ######
280+
include ./scripts/release/mule/Makefile.mule
286281

287-
ci-build: buildsrc gen
288-
mkdir -p $(SRCPATH)/tmp/node_pkgs/$(OS_TYPE)/$(ARCH) && \
289-
PKG_ROOT=$(SRCPATH)/tmp/node_pkgs/$(OS_TYPE)/$(ARCH) NO_BUILD=True VARIATIONS=$(OS_TYPE)/$(ARCH) scripts/build_packages.sh $(OS_TYPE)/$(ARCH)

THANKS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
## Thanks
33

4-
A big thank you to everyone who has contributed to the `go-algorand` codebase.
4+
A big thank you to everyone who has contributed to the `go-algorand` codebase.
55

66
### External Contributors
77
In no particular order:
@@ -11,6 +11,7 @@ In no particular order:
1111
- scnale
1212
- jsign
1313
- RomitKumar
14+
- jeapostrophe
1415

1516
### Bug Reports
1617
- Nanyan

agreement/abstractions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ type Network interface {
276276
// Disconnect sends the Network a hint to disconnect to the peer
277277
// associated with the given MessageHandle.
278278
Disconnect(MessageHandle)
279+
280+
// Start notifies the network that the agreement service is ready
281+
// to start receiving messages.
282+
Start()
279283
}
280284

281285
// RandomSource is an abstraction over the random number generator.

agreement/cadaver.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,21 @@ func (c *cadaver) trySetup() bool {
119119
c.out.Close()
120120
err := os.Rename(c.filename(), c.filename()+".archive")
121121
if err != nil {
122-
logging.Base().Error(err)
123-
c.failed = err
124-
return false
122+
if os.IsNotExist(err) {
123+
// we can't rename the cadaver file since it doesn't exists.
124+
// this typically happens when it being externally deleted, and could happen
125+
// far before we close the handle above.
126+
logging.Base().Info(err)
127+
} else {
128+
logging.Base().Warn(err)
129+
c.failed = err
130+
return false
131+
}
125132
}
126133

127134
err = c.init()
128135
if err != nil {
129-
logging.Base().Error(err)
136+
logging.Base().Warn(err)
130137
c.failed = err
131138
return false
132139
}

agreement/demux.go

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,35 @@ type demux struct {
6666
log logging.Logger
6767
}
6868

69+
// demuxParams contains the parameters required to initliaze a new demux object
70+
type demuxParams struct {
71+
net Network
72+
ledger LedgerReader
73+
validator BlockValidator
74+
voteVerifier *AsyncVoteVerifier
75+
processingMonitor EventsProcessingMonitor
76+
log logging.Logger
77+
monitor *coserviceMonitor
78+
}
79+
6980
// makeDemux initializes the goroutines needed to process external events, setting up the appropriate channels.
7081
//
7182
// It must be called before other methods are called.
72-
func makeDemux(net Network, ledger LedgerReader, validator BlockValidator, voteVerifier *AsyncVoteVerifier, processingMonitor EventsProcessingMonitor, log logging.Logger) (d *demux) {
83+
func makeDemux(params demuxParams) (d *demux) {
7384
d = new(demux)
74-
d.crypto = makeCryptoVerifier(ledger, validator, voteVerifier, log)
75-
d.log = log
76-
d.ledger = ledger
85+
d.crypto = makeCryptoVerifier(params.ledger, params.validator, params.voteVerifier, params.log)
86+
d.log = params.log
87+
d.ledger = params.ledger
88+
d.monitor = params.monitor
89+
d.queue = make([]<-chan externalEvent, 0)
90+
d.processingMonitor = params.processingMonitor
7791

7892
tokenizerCtx, cancelTokenizers := context.WithCancel(context.Background())
79-
d.rawVotes = d.tokenizeMessages(tokenizerCtx, net, protocol.AgreementVoteTag, decodeVote)
80-
d.rawProposals = d.tokenizeMessages(tokenizerCtx, net, protocol.ProposalPayloadTag, decodeProposal)
81-
d.rawBundles = d.tokenizeMessages(tokenizerCtx, net, protocol.VoteBundleTag, decodeBundle)
93+
d.rawVotes = d.tokenizeMessages(tokenizerCtx, params.net, protocol.AgreementVoteTag, decodeVote)
94+
d.rawProposals = d.tokenizeMessages(tokenizerCtx, params.net, protocol.ProposalPayloadTag, decodeProposal)
95+
d.rawBundles = d.tokenizeMessages(tokenizerCtx, params.net, protocol.VoteBundleTag, decodeBundle)
8296
d.cancelTokenizers = cancelTokenizers
8397

84-
d.queue = make([]<-chan externalEvent, 0)
85-
d.processingMonitor = processingMonitor
86-
8798
return d
8899
}
89100

agreement/fuzzer/networkFacade_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
7777
n := &NetworkFacade{
7878
fuzzer: fuzzer,
7979
nodeID: nodeID,
80-
mux: network.MakeMultiplexer(),
80+
mux: network.MakeMultiplexer(fuzzer.log),
8181
clocks: make(map[int]chan time.Time),
8282
eventsQueues: make(map[string]int),
8383
eventsQueuesCh: make(chan int, 1000),
@@ -258,7 +258,7 @@ func (n *NetworkFacade) RegisterHandlers(dispatch []network.TaggedMessageHandler
258258

259259
// ClearHandlers
260260
func (n *NetworkFacade) ClearHandlers() {
261-
n.mux.ClearHandlers()
261+
n.mux.ClearHandlers([]network.Tag{})
262262
}
263263

264264
// SetDownstreamFilter sets the downstream filter.

agreement/gossip/network.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ func WrapNetwork(net network.GossipNode, log logging.Logger) agreement.Network {
6363
i.net = net
6464
i.log = log
6565

66+
return i
67+
}
68+
69+
func (i *networkImpl) Start() {
6670
handlers := []network.TaggedMessageHandler{
6771
{Tag: protocol.AgreementVoteTag, MessageHandler: network.HandlerFunc(i.processVoteMessage)},
6872
{Tag: protocol.ProposalPayloadTag, MessageHandler: network.HandlerFunc(i.processProposalMessage)},
6973
{Tag: protocol.VoteBundleTag, MessageHandler: network.HandlerFunc(i.processBundleMessage)},
7074
}
71-
net.RegisterHandlers(handlers)
72-
return i
75+
i.net.RegisterHandlers(handlers)
7376
}
7477

7578
func messageMetadataFromHandle(h agreement.MessageHandle) *messageMetadata {

0 commit comments

Comments
 (0)