Skip to content

Commit

Permalink
Merge pull request #4823 from Algo-devops-service/relbeta3.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
algojohnlee authored Nov 22, 2022
2 parents 31a1099 + efdfc1f commit bacdf8d
Show file tree
Hide file tree
Showing 194 changed files with 8,106 additions and 9,170 deletions.
42 changes: 25 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2.1
orbs:
win: circleci/[email protected]
go: circleci/[email protected]
slack: circleci/slack@4.4.2
slack: circleci/slack@4.10.1

parameters:
ubuntu_image:
Expand Down Expand Up @@ -64,6 +64,13 @@ executors:
mac_arm64_large:
<<: *executor-mac-arm64

slack-fail-stop-step: &slack-fail-post-step
post-steps:
- slack/notify:
branch_pattern: "master,rel/beta,rel/nightly,rel/stable"
event: fail
template: basic_fail_1

# ===== Workflow Definitions =====
workflows:
version: 2
Expand All @@ -80,6 +87,7 @@ workflows:
- /rel\/.*/
- << pipeline.parameters.valid_nightly_branch >>
context: slack-secrets
<<: *slack-fail-post-step

- test:
name: << matrix.platform >>_test
Expand All @@ -91,6 +99,8 @@ workflows:
ignore:
- /rel\/.*/
- << pipeline.parameters.valid_nightly_branch >>
context: slack-secrets
<<: *slack-fail-post-step

- test_nightly:
name: << matrix.platform >>_test_nightly
Expand All @@ -99,13 +109,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- integration:
name: << matrix.platform >>_integration
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- integration_nightly:
name: << matrix.platform >>_integration_nightly
Expand All @@ -114,13 +127,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- e2e_expect:
name: << matrix.platform >>_e2e_expect
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- e2e_expect_nightly:
name: << matrix.platform >>_e2e_expect_nightly
Expand All @@ -129,13 +145,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- e2e_subs:
name: << matrix.platform >>_e2e_subs
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- e2e_subs_nightly:
name: << matrix.platform >>_e2e_subs_nightly
Expand All @@ -146,6 +165,7 @@ workflows:
context:
- slack-secrets
- aws-secrets
<<: *slack-fail-post-step

- tests_verification_job:
name: << matrix.platform >>_<< matrix.job_type >>_verification
Expand All @@ -155,6 +175,8 @@ workflows:
job_type: ["test", "integration", "e2e_expect"]
requires:
- << matrix.platform >>_<< matrix.job_type >>
context: slack-secrets
<<: *slack-fail-post-step

- tests_verification_job_nightly:
name: << matrix.platform >>_<< matrix.job_type >>_verification
Expand All @@ -165,6 +187,7 @@ workflows:
requires:
- << matrix.platform >>_<< matrix.job_type >>
context: slack-secrets
<<: *slack-fail-post-step

- upload_binaries:
name: << matrix.platform >>_upload_binaries
Expand All @@ -183,6 +206,7 @@ workflows:
context:
- slack-secrets
- aws-secrets
<<: *slack-fail-post-step

#- windows_x64_build

Expand All @@ -207,9 +231,6 @@ jobs:
- go
- gimme
- .gimme
- slack/notify: &slack-fail-event
event: fail
template: basic_fail_1

test:
parameters:
Expand Down Expand Up @@ -240,9 +261,6 @@ jobs:
result_subdir: << parameters.platform >>_test_nightly
no_output_timeout: 45m
- upload_coverage
- slack/notify: &slack-fail-event
event: fail
template: basic_fail_1

integration:
parameters:
Expand Down Expand Up @@ -275,8 +293,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform >>_integration_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

e2e_expect:
parameters:
Expand Down Expand Up @@ -309,8 +325,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform>>_e2e_expect_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

e2e_subs:
parameters:
Expand Down Expand Up @@ -345,8 +359,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform >>_e2e_subs_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

windows_x64_build:
executor:
Expand Down Expand Up @@ -396,8 +408,6 @@ jobs:
- checkout
- tests_verification_command:
result_subdir: << parameters.platform >>_<< parameters.job_type >>
- slack/notify:
<<: *slack-fail-event

upload_binaries:
working_directory: << pipeline.parameters.build_dir >>/project
Expand All @@ -410,8 +420,6 @@ jobs:
- prepare_go
- upload_binaries_command:
platform: << parameters.platform >>
- slack/notify:
<<: *slack-fail-event

# ===== Command Definitions =====
commands:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: '200%'
comment-on-alert: true
- name: Slack Notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Benchmark workflow failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Nightly windows build test on Github failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.base_ref, 'rel/nightly') || contains(github.base_ref, 'rel/beta') || contains(github.base_ref, 'rel/stable')) }}
curl -X POST --data-urlencode "payload={\"text\": \"Build windows failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
6 changes: 6 additions & 0 deletions .github/workflows/codegen_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ jobs:
export GOPATH="${GITHUB_WORKSPACE}/go"
cd go-algorand
scripts/travis/codegen_verification.sh
- name: Slack Notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Codegen verification failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
6 changes: 6 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@ jobs:
-filter-mode=added
-fail-on-error=false
-level=warning
- name: Slack Notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Reviewdog failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
15 changes: 5 additions & 10 deletions .golangci-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ linters:
- deadcode
- partitiontest
- structcheck
- typecheck
- varcheck
- unconvert
- unused


Expand Down Expand Up @@ -52,24 +52,19 @@ issues:
# be more lenient with test code
- path: _test\.go
linters:
- staticcheck
- deadcode
- structcheck
- typecheck
- varcheck
- deadcode
- gosimple
- unconvert
- unused
# Add all linters here -- Comment this block out for testing linters
- path: test/linttest/lintissues\.go
linters:
- staticcheck
- deadcode
- structcheck
- typecheck
- varcheck
- deadcode
- gosimple
- unconvert
- unused
- partitiontest
- path: crypto/secp256k1/secp256_test\.go
linters:
- partitiontest
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ linters:
- revive
- staticcheck
- typecheck
- paralleltest

severity:
default-severity: error
Expand Down Expand Up @@ -115,6 +116,10 @@ issues:
# - revive
- staticcheck
- typecheck
# Ignore missing parallel tests in existing packages
- path: (agreement|catchup|cmd|config|crypto|daemon|data|gen|ledger|logging|netdeploy|network|node|protocol|rpcs|shared|stateproof|test|tools|util).*_test.go
linters:
- paralleltest
# Add all linters here -- Comment this block out for testing linters
- path: test/linttest/lintissues\.go
linters:
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Algorand takes the security of the platform and of its users very seriously. We

If you believe that you have found a security vulnerability you may disclose it here:

https://www.algorand.com/resources/blog/security
https://immunefi.com/bounty/algorand/
2 changes: 1 addition & 1 deletion buildnumber.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0
1
19 changes: 15 additions & 4 deletions catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,15 @@ type CatchpointCatchupStats struct {
TotalAccounts uint64
ProcessedAccounts uint64
VerifiedAccounts uint64
TotalKVs uint64
ProcessedKVs uint64
VerifiedKVs uint64
TotalBlocks uint64
AcquiredBlocks uint64
VerifiedBlocks uint64
ProcessedBytes uint64
TotalAccountHashes uint64
TotalKVHashes uint64
StartTime time.Time
}

Expand Down Expand Up @@ -303,7 +307,7 @@ func (cs *CatchpointCatchupService) processStageLedgerDownload() (err error) {
if err == nil {
cs.log.Infof("ledger downloaded in %d seconds", time.Since(start)/time.Second)
start = time.Now()
err = cs.ledgerAccessor.BuildMerkleTrie(cs.ctx, cs.updateVerifiedAccounts)
err = cs.ledgerAccessor.BuildMerkleTrie(cs.ctx, cs.updateVerifiedCounts)
if err == nil {
cs.log.Infof("built merkle trie in %d seconds", time.Since(start)/time.Second)
break
Expand Down Expand Up @@ -335,12 +339,17 @@ func (cs *CatchpointCatchupService) processStageLedgerDownload() (err error) {
return nil
}

// updateVerifiedAccounts update the user's statistics for the given verified accounts
func (cs *CatchpointCatchupService) updateVerifiedAccounts(addedTrieHashes uint64) {
// updateVerifiedCounts update the user's statistics for the given verified hashes
func (cs *CatchpointCatchupService) updateVerifiedCounts(accountCount, kvCount uint64) {
cs.statsMu.Lock()
defer cs.statsMu.Unlock()

if cs.stats.TotalAccountHashes > 0 {
cs.stats.VerifiedAccounts = cs.stats.TotalAccounts * addedTrieHashes / cs.stats.TotalAccountHashes
cs.stats.VerifiedAccounts = cs.stats.TotalAccounts * accountCount / cs.stats.TotalAccountHashes
}

if cs.stats.TotalKVs > 0 {
cs.stats.VerifiedKVs = kvCount
}
}

Expand Down Expand Up @@ -756,6 +765,8 @@ func (cs *CatchpointCatchupService) updateLedgerFetcherProgress(fetcherStats *le
defer cs.statsMu.Unlock()
cs.stats.TotalAccounts = fetcherStats.TotalAccounts
cs.stats.ProcessedAccounts = fetcherStats.ProcessedAccounts
cs.stats.TotalKVs = fetcherStats.TotalKVs
cs.stats.ProcessedKVs = fetcherStats.ProcessedKVs
cs.stats.ProcessedBytes = fetcherStats.ProcessedBytes
cs.stats.TotalAccountHashes = fetcherStats.TotalAccountHashes
}
Expand Down
2 changes: 1 addition & 1 deletion catchup/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (b *basicRPCNode) RegisterHandlers(dispatch []network.TaggedMessageHandler)

func (b *basicRPCNode) start() bool {
var err error
b.listener, err = net.Listen("tcp", "")
b.listener, err = net.Listen("tcp", "127.0.0.1:")
if err != nil {
logging.Base().Error("tcp listen", err)
return false
Expand Down
1 change: 1 addition & 0 deletions catchup/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func MakeService(log logging.Logger, config config.Local, net network.GossipNode
func (s *Service) Start() {
s.done = make(chan struct{})
s.ctx, s.cancel = context.WithCancel(context.Background())
atomic.StoreUint32(&s.initialSyncNotified, 0)
s.InitialSyncDone = make(chan struct{})
go s.periodicSync()
}
Expand Down
Loading

0 comments on commit bacdf8d

Please sign in to comment.