Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ crypto/libsodium-fork/build-aux/

# doc intermediates
data/transactions/logic/*.md

*.pem

10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: xenial
dist: bionic
go:
- "1.12"
go_import_path: github.com/algorand/go-algorand
Expand All @@ -17,14 +17,16 @@ stages:
if: branch =~ /^rel\// AND type != pull_request
- name: deploy
if: branch =~ /^rel\// AND type != pull_request
- name: post_deploy
if: branch =~ /^rel\// AND type != pull_request

jobs:
allow_failures:
- name: External ARM64 Build
- name: External ARM64 Deploy
- name: External ARM64 Integration Test
- name: External ARM Build
- name: External ARM Deploy
- name: Test Release Builds
include:
- stage: build_commit
os: linux
Expand Down Expand Up @@ -110,7 +112,9 @@ jobs:
- stage: deploy
name: Ubuntu Deploy
os: linux
script: scripts/travis/deploy_packages.sh
script:
- scripts/travis/deploy_packages.sh
- scripts/travis/test_release.sh
- # same stage, parallel job
name: MacOS Deploy
os: osx
Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ BUILDCHANNEL ?= $(shell ./scripts/compute_branch_channel.sh $(BUILDBRANCH))
DEFAULTNETWORK ?= $(shell ./scripts/compute_branch_network.sh $(BUILDBRANCH))
DEFAULT_DEADLOCK ?= $(shell ./scripts/compute_branch_deadlock_default.sh $(BUILDBRANCH))

GOTAGSLIST := sqlite_unlock_notify sqlite_omit_load_extension

ifeq ($(UNAME), Linux)
EXTLDFLAGS := -static-libstdc++ -static-libgcc
ifeq ($(ARCH), amd64)
# the following predicate is abit misleading; it tests if we're not in centos.
ifeq (,$(wildcard /etc/centos-release))
EXTLDFLAGS += -static
endif
GOTAGSLIST += osusergo netgo static_build
GOBUILDMODE := -buildmode pie
endif
endif

GOTAGS := --tags "sqlite_unlock_notify sqlite_omit_load_extension"
GOTAGS := --tags "$(GOTAGSLIST)"
GOTRIMPATH := $(shell go help build | grep -q .-trimpath && echo -trimpath)

GOLDFLAGS_BASE := -X github.com/algorand/go-algorand/config.BuildNumber=$(BUILDNUMBER) \
Expand Down Expand Up @@ -56,6 +66,9 @@ vet:
check_license:
./scripts/check_license.sh

check_shell:
find . -type f -name "*.sh" -exec shellcheck {} +

sanity: vet fix lint fmt check_license

cover:
Expand Down Expand Up @@ -127,7 +140,7 @@ $(KMD_API_SWAGGER_INJECT): $(KMD_API_SWAGGER_SPEC) $(KMD_API_SWAGGER_SPEC).valid
build: buildsrc gen

buildsrc: crypto/lib/libsodium.a node_exporter NONGO_BIN deps $(ALGOD_API_SWAGGER_INJECT) $(KMD_API_SWAGGER_INJECT)
go install $(GOTRIMPATH) $(GOTAGS) -ldflags="$(GOLDFLAGS)" ./...
go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...

SOURCES_RACE := github.com/algorand/go-algorand/cmd/kmd

Expand Down Expand Up @@ -243,4 +256,4 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
install: build
scripts/dev_install.sh -p $(GOPATH1)/bin

.PHONY: default fmt vet lint check_license sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN
.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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ A number of packages provide utilities for the various components:

Please see the [COPYING_FAQ](COPYING_FAQ) for details about how to apply our license.

Copyright (C) 2019, Algorand Inc
Copyright (C) 2019-2020, Algorand Inc.

[developer site url]: https://developer.algorand.org/
1 change: 1 addition & 0 deletions THANKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ In no particular order:

### Bug Reports
- Nanyan
- xixisese
2 changes: 1 addition & 1 deletion agreement/abstractions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
9 changes: 4 additions & 5 deletions agreement/actions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand All @@ -20,7 +20,6 @@ import (
"context"
"fmt"

"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/logging/logspec"
"github.com/algorand/go-algorand/logging/telemetryspec"
"github.com/algorand/go-algorand/protocol"
Expand Down Expand Up @@ -312,7 +311,7 @@ func (a pseudonodeAction) do(ctx context.Context, s *Service) {
case errPseudonodeNoProposals:
// no participation keys, do nothing.
default:
logging.Base().Errorf("pseudonode.MakeProposals call failed %v", err)
s.log.Errorf("pseudonode.MakeProposals call failed %v", err)
}
case repropose:
logEvent := logspec.AgreementEvent{
Expand All @@ -336,7 +335,7 @@ func (a pseudonodeAction) do(ctx context.Context, s *Service) {
// do nothing
default:
// otherwise,
logging.Base().Errorf("pseudonode.MakeVotes call failed for reproposal(%v) %v", a.T, err)
s.log.Errorf("pseudonode.MakeVotes call failed for reproposal(%v) %v", a.T, err)
}
case attest:
logEvent := logspec.AgreementEvent{
Expand All @@ -360,7 +359,7 @@ func (a pseudonodeAction) do(ctx context.Context, s *Service) {
s.demux.prioritize(voteEvents)
default:
// otherwise,
logging.Base().Errorf("pseudonode.MakeVotes call failed(%v) %v", a.T, err)
s.log.Errorf("pseudonode.MakeVotes call failed(%v) %v", a.T, err)
fallthrough // just so that we would close the channel.
case errPseudonodeNoVotes:
// do nothing; we're closing the channel just to avoid leaving open channels, but it's not
Expand Down
8 changes: 3 additions & 5 deletions agreement/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand All @@ -18,8 +18,6 @@ package agreement

import (
"fmt"

"github.com/algorand/go-algorand/logging"
)

// An actor is a state machine which accepts events and returns sequences of actions.
Expand Down Expand Up @@ -89,12 +87,12 @@ func (l checkedActor) handle(r routerHandle, in event) []action {

for _, pre := range cerrpre {
if pre != nil {
logging.Base().Warnf("precondition call violation: %v", pre)
r.t.log.Warnf("precondition call violation: %v", pre)
}
}
for _, post := range cerrpost {
if post != nil {
logging.Base().Warnf("postcondition call violation: %v", post)
r.t.log.Warnf("postcondition call violation: %v", post)
}
}
// for _, pre := range terrpre {
Expand Down
2 changes: 1 addition & 1 deletion agreement/agreeInstall.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/agreementtest/keyManager.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions agreement/agreementtest/simulate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -189,7 +189,7 @@ func Simulate(dbname string, n basics.Round, roundDeadline time.Duration, ledger
Logger: log,
Accessor: accessor,
Clock: stopwatch,
Network: gossip.WrapNetwork(new(blackhole)),
Network: gossip.WrapNetwork(new(blackhole), log),
Ledger: ledger,
BlockFactory: proposalFactory,
BlockValidator: proposalValidator,
Expand Down
2 changes: 1 addition & 1 deletion agreement/agreementtest/simulate_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/asyncVoteVerifier.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/autopsy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/bundle.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/bundle_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/cadaver.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/certificate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/certificate_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/common_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
10 changes: 5 additions & 5 deletions agreement/coservice.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -44,8 +44,8 @@ type coserviceMonitor struct {
}

type coserviceListener interface {
inc(sum uint)
dec(sum uint)
inc(sum uint, state map[coserviceType]uint)
dec(sum uint, state map[coserviceType]uint)
}

func (m *coserviceMonitor) inc(t coserviceType) {
Expand All @@ -62,7 +62,7 @@ func (m *coserviceMonitor) inc(t coserviceType) {
m.c[t]++

if m.coserviceListener != nil {
m.coserviceListener.inc(m.sum())
m.coserviceListener.inc(m.sum(), m.c)
}
}

Expand All @@ -83,7 +83,7 @@ func (m *coserviceMonitor) dec(t coserviceType) {
m.c[t]--

if m.coserviceListener != nil {
m.coserviceListener.dec(m.sum())
m.coserviceListener.dec(m.sum(), m.c)
}
}

Expand Down
2 changes: 1 addition & 1 deletion agreement/cryptoRequestContext.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/cryptoRequestContext_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/cryptoVerifier.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/cryptoVerifier_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/demux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/demux_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/encoding_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/events.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/bandwidthFilter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/catchupFilter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/clockedFilter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/dropMessageFilter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/duplicateMessageFilter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/filter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 Algorand, Inc.
// Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
Expand Down
Loading