Skip to content

Commit

Permalink
Merge branch 'master' into feature/stateproofs
Browse files Browse the repository at this point in the history
  • Loading branch information
algoidan committed Apr 17, 2022
2 parents 1c3f705 + 8a5155f commit c34780a
Show file tree
Hide file tree
Showing 96 changed files with 6,033 additions and 2,612 deletions.
48 changes: 6 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ workflows:
- << matrix.platform >>_build
filters:
<<: *filters-nightly
context: slack-secrets
context:
- slack-secrets
- aws-secrets

- tests_verification_job:
name: << matrix.platform >>_<< matrix.job_type >>_verification
Expand Down Expand Up @@ -196,7 +198,7 @@ commands:
shell: bash.exe
command: |
choco install -y msys2 pacman make wget --force
choco install -y golang --version=1.16.11 --force
choco install -y golang --version=1.16.15 --force
choco install -y python3 --version=3.7.3 --force
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
Expand Down Expand Up @@ -335,9 +337,6 @@ commands:
key: 'go-cache-v2-{{ .Environment.CIRCLE_STAGE }}-{{ .Environment.CIRCLE_BUILD_NUM }}'
paths:
- tmp/go-cache
- upload_to_buildpulse:
platform: << parameters.platform >>
path: << parameters.result_path >>/<< parameters.result_subdir>>

upload_coverage:
description: Collect coverage reports and upload them
Expand All @@ -348,40 +347,6 @@ commands:
command: |
scripts/travis/upload_coverage.sh || true
upload_to_buildpulse:
description: Collect build reports and upload them
parameters:
platform:
type: string
path:
type: string
steps:
- run:
name: Send test results to BuildPulse
when: always
command: |
set -e
if ! ls << parameters.path >>/*/*.xml &> /dev/null; then exit 0; fi
sed -i"" -e 's/classname="/classname="<< parameters.platform >>-/' << parameters.path >>/*/*.xml
case "<< parameters.platform >>" in
arm64)
URL=https://github.com/buildpulse/test-reporter/releases/download/v0.21.0-pre/test-reporter-linux-arm64
SUM=53f94c29ad162c2b9ebb1f4a2f967f5262c0459ee4a0c34332977d8c89aafc18
;;
amd64)
URL=https://github.com/buildpulse/test-reporter/releases/download/v0.21.0-pre/test-reporter-linux-amd64
SUM=4655e54d756580c0de0112cab488e6e08d0af75e9fc8caea2d63f9e13be8beb5
;;
mac_amd64)
URL=https://github.com/buildpulse/test-reporter/releases/download/v0.21.0-pre/test-reporter-darwin-amd64
SUM=2f9e20a6f683c80f35d04e36bc57ecfe605bb48fee5a1b8d8f7c45094028eea3
;;
esac
curl -fsSL --retry 3 --retry-connrefused $URL > ./buildpulse-test-reporter
echo "$SUM *buildpulse-test-reporter" | shasum -a 256 -c --status
chmod +x ./buildpulse-test-reporter
./buildpulse-test-reporter submit << parameters.path >> --account-id 23182699 --repository-id 191266671 || true
generic_integration:
description: Run integration tests from build workspace, for re-use by diferent architectures
parameters:
Expand Down Expand Up @@ -432,6 +397,7 @@ commands:
export PARTITION_ID=${CIRCLE_NODE_INDEX}
export PARALLEL_FLAG="-p 1"
test/scripts/run_integration_tests.sh
- store_artifacts:
path: << parameters.result_path >>
destination: test-results
Expand All @@ -441,9 +407,6 @@ commands:
root: << parameters.result_path >>
paths:
- << parameters.result_subdir >>
- upload_to_buildpulse:
platform: << parameters.platform >>
path: << parameters.result_path >>/<< parameters.result_subdir>>

tests_verification_command:
description: Check if all tests were run at least once and only once across all parallel runs
Expand Down Expand Up @@ -651,6 +614,7 @@ jobs:
working_directory: << pipeline.parameters.build_dir >>/project
environment:
E2E_TEST_FILTER: "SCRIPTS"
E2E_PLATFORM: << parameters.platform >>
steps:
- prepare_build_dir
- prepare_go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install golang
uses: actions/setup-go@v2
with:
go-version: '1.16.11'
go-version: '1.16.15'
- name: Build Test
run: |
export ALGORAND_DEADLOCK=enable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install specific golang
uses: actions/setup-go@v2
with:
go-version: '1.16.11'
go-version: '1.16.15'
- name: Create folders for golangci-lint
run: mkdir -p cicdtmp/golangci-lint
- name: Check if custom golangci-lint is already built
Expand Down
5 changes: 5 additions & 0 deletions agreement/cryptoVerifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ import (

"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/util/metrics"
)

var voteVerifierOutFullCounter = metrics.MakeCounter(
metrics.MetricName{Name: "algod_agreement_vote_verifier_responses_dropped", Description: "Number of voteVerifier responses dropped due to full channel"})

// TODO put these in config
const (
voteParallelism = 16
Expand Down Expand Up @@ -210,6 +214,7 @@ func (c *poolCryptoVerifier) voteFillWorker(toBundleWait chan<- bundleFuture) {
select {
case c.votes.out <- asyncVerifyVoteResponse{index: votereq.TaskIndex, err: err, cancelled: true}:
default:
voteVerifierOutFullCounter.Inc(nil)
c.log.Infof("poolCryptoVerifier.voteFillWorker unable to write failed enqueue response to output channel")
}
}
Expand Down
9 changes: 9 additions & 0 deletions agreement/pseudonode.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/algorand/go-algorand/logging/logspec"
"github.com/algorand/go-algorand/logging/telemetryspec"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/util/metrics"
)

// TODO put these in config
Expand All @@ -43,6 +44,9 @@ var errPseudonodeVerifierClosedChannel = errors.New("crypto verifier closed the
var errPseudonodeNoVotes = errors.New("no valid participation keys to generate votes for given round")
var errPseudonodeNoProposals = errors.New("no valid participation keys to generate proposals for given round")

var pseudonodeBacklogFullByType = metrics.NewTagCounter("algod_agreement_pseudonode_tasks_dropped_{TAG}", "Number of pseudonode tasks dropped per type")
var pseudonodeResultTimeoutsByType = metrics.NewTagCounter("algod_agreement_pseudonode_tasks_timeouts_{TAG}", "Number of pseudonode task result timeouts per type")

// A pseudonode creates proposals and votes with a KeyManager which holds participation keys.
//
// It constructs these messages as if they arrived from an external source and were verified.
Expand Down Expand Up @@ -176,6 +180,7 @@ func (n asyncPseudonode) MakeProposals(ctx context.Context, r round, p period) (
return proposalTask.outputChannel(), nil
default:
proposalTask.close()
pseudonodeBacklogFullByType.Add("proposal", 1)
return nil, fmt.Errorf("unable to make proposal for (%d, %d): %w", r, p, errPseudonodeBacklogFull)
}
}
Expand All @@ -193,6 +198,7 @@ func (n asyncPseudonode) MakeVotes(ctx context.Context, r round, p period, s ste
return proposalTask.outputChannel(), nil
default:
proposalTask.close()
pseudonodeBacklogFullByType.Add("vote", 1)
return nil, fmt.Errorf("unable to make vote for (%d, %d, %d): %w", r, p, s, errPseudonodeBacklogFull)
}
}
Expand Down Expand Up @@ -474,6 +480,7 @@ verifiedVotesLoop:
return
case <-outputTimeout:
// we've been waiting for too long for this vote to be written to the output.
pseudonodeResultTimeoutsByType.Add("vote", 1)
t.node.log.Warnf("pseudonode.makeVotes: unable to write vote to output channel for round %d, period %d", t.round, t.period)
outputTimeout = nil
}
Expand Down Expand Up @@ -577,6 +584,7 @@ verifiedVotesLoop:
return
case <-outputTimeout:
// we've been waiting for too long for this vote to be written to the output.
pseudonodeResultTimeoutsByType.Add("pvote", 1)
t.node.log.Warnf("pseudonode.makeProposals: unable to write proposal vote to output channel for round %d, period %d", t.round, t.period)
outputTimeout = nil
}
Expand All @@ -597,6 +605,7 @@ verifiedPayloadsLoop:
return
case <-outputTimeout:
// we've been waiting for too long for this vote to be written to the output.
pseudonodeResultTimeoutsByType.Add("ppayload", 1)
t.node.log.Warnf("pseudonode.makeProposals: unable to write proposal payload to output channel for round %d, period %d", t.round, t.period)
outputTimeout = nil
}
Expand Down
19 changes: 9 additions & 10 deletions cmd/algod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func run() int {
}

version := config.GetCurrentVersion()
heartbeatGauge := metrics.MakeStringGauge()
heartbeatGauge.Set("version", version.String())
heartbeatGauge.Set("version-num", strconv.FormatUint(version.AsUInt64(), 10))
heartbeatGauge.Set("channel", version.Channel)
heartbeatGauge.Set("branch", version.Branch)
heartbeatGauge.Set("commit-hash", version.GetCommitHash())
var baseHeartbeatEvent telemetryspec.HeartbeatEventDetails
baseHeartbeatEvent.Info.Version = version.String()
baseHeartbeatEvent.Info.VersionNum = strconv.FormatUint(version.AsUInt64(), 10)
baseHeartbeatEvent.Info.Channel = version.Channel
baseHeartbeatEvent.Info.Branch = version.Branch
baseHeartbeatEvent.Info.CommitHash = version.GetCommitHash()

if *branchCheck {
fmt.Println(config.Branch)
Expand Down Expand Up @@ -339,12 +339,11 @@ func run() int {
defer ticker.Stop()

sendHeartbeat := func() {
values := make(map[string]string)
values := make(map[string]float64)
metrics.DefaultRegistry().AddMetrics(values)

heartbeatDetails := telemetryspec.HeartbeatEventDetails{
Metrics: values,
}
heartbeatDetails := baseHeartbeatEvent
heartbeatDetails.Metrics = values

log.EventWithDetails(telemetryspec.ApplicationState, telemetryspec.HeartbeatEvent, heartbeatDetails)
}
Expand Down
Loading

0 comments on commit c34780a

Please sign in to comment.