Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-algorand 3.19.0-beta Release PR #5784

Merged
merged 63 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
828c1df
AVM: EC math (#4924)
jannotti Aug 23, 2023
51f5314
ledger: kv keys allocation optimizations (#5677)
icorderi Aug 23, 2023
9af066b
Revert "Ledger: Close the ledger at node shutdown" (#5705)
onetechnical Aug 24, 2023
572d728
Chore: Put the three doc strings about each op together (#5708)
jannotti Aug 25, 2023
b19594e
network: add P2PNetwork implementation (#5640)
cce Aug 25, 2023
ca420de
AVM: Generate langspec for each version (#5629)
jasonpaulos Aug 26, 2023
9ab1cc3
algod: Hot/Cold Data Directories and Resource Paths (#5614)
AlgoAxel Aug 28, 2023
10f2f55
encoding: eliminate unnecessary allocations (#5655)
algorandskiy Aug 29, 2023
2670e94
Simulate: Enable on follower node & allow specifying starting round (…
jasonpaulos Aug 29, 2023
b0cf5c8
performance: dynamic lambda (#5654)
yossigi Aug 31, 2023
f12005b
p2p: Close all connections and wsPeers on P2P network shutdown (#5712)
iansuvak Aug 31, 2023
0e67a0b
p2p: peerstore backed phonebook (#5710)
shiqizng Aug 31, 2023
55f6430
docker: fix typo in README.md (#5707)
eltociear Aug 31, 2023
ade30a8
scripts(configure_dev): conditional tap homebrew (#5573)
emg110 Aug 31, 2023
3c77a7f
p2p: Return non-loopback multiaddr from Address() if available (#5716)
iansuvak Sep 1, 2023
b212f94
Feature: Disable EnableBlockServiceFallbackToArchiver by default. (#5…
gmalouf Sep 1, 2023
ba92ba3
merklearray: simplify single-leaf proofs (#5703)
zeldovich Sep 1, 2023
caf472a
p2p: Make p2p listen address configurable via config.NetAddress (#5721)
iansuvak Sep 1, 2023
4780a87
chore: fix misspelled filename (#5717)
bbroder-algo Sep 1, 2023
c4dfc1b
goal: Add export and import options for genesis files during network …
algochoi Sep 1, 2023
02b99bb
Simulate: Return application initial states accessed during simulatio…
ahangsu Sep 1, 2023
2082b1d
tests: update TestCatchupOverGossip to be less parallel and use sub-t…
cce Sep 8, 2023
0597d91
Merge remote-tracking branch 'origin/rel/stable' into relstable3.18.0…
Algo-devops-service Sep 11, 2023
f6b9364
Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.
Algo-devops-service Sep 11, 2023
527d2c5
Merge pull request #5733 from Algo-devops-service/relstable3.18.0-rem…
algojohnlee Sep 11, 2023
ecb9afb
p2p: remove TestP2PThreeNodesEvenDist (#5736)
iansuvak Sep 13, 2023
f965427
tests: fix a rare data race in staling tracker tests (#5737)
algorandskiy Sep 13, 2023
beec227
tests: fix flaky simulate test (#5738)
algorandskiy Sep 13, 2023
43fb473
chore: Refactor catchpoint tracking logic into config (#5725)
Eric-Warehime Sep 14, 2023
ea20873
DevOps: update releases page GPG key mentions (#5742)
onetechnical Sep 15, 2023
3ff5722
chore: generalize persisted lists in ledger (#5741)
algorandskiy Sep 18, 2023
5f801db
tests: Fix simulate start round flaky test (#5748)
jasonpaulos Sep 20, 2023
2f09710
tools: Block Generator - allow exporting to files (#5714)
tzaffi Sep 21, 2023
4ef2410
docker: Support pregenerated keys in docker private networks (#5735)
winder Sep 21, 2023
2da483b
DevOps: fix releases page links (#5746)
onetechnical Sep 21, 2023
5570e88
windows: Fix GC (#5745)
dragmz Sep 21, 2023
1df4388
Specs: Change spec generation for Foundation to handle _v*.md (#5751)
jannotti Sep 22, 2023
63e1c02
Docs: No code change (#5753)
jannotti Sep 25, 2023
17871a3
api: StartFastCatchup initialize parameter (#5752)
winder Sep 25, 2023
37baa52
docs: Update node config comments so that they can be used for doc ge…
winder Sep 26, 2023
ff82655
goal: Add initialize option to 'goal node catchup'. (#5754)
winder Sep 26, 2023
0972548
tests: Address flakiness with TestMergePrimarySecondaryRelayAddressLi…
gmalouf Sep 26, 2023
d6d8f3b
perf: upgrade go-deadlock (#5760)
algorandskiy Sep 27, 2023
91604df
tools: better heap data rendering (#5761)
algorandskiy Sep 27, 2023
4945ec0
config: Add MaxBlockHistoryLookback option (#5749)
ohill Sep 28, 2023
157f59f
docker: Update docker config with node_exporter path (#5762)
winder Sep 28, 2023
67275a6
docker: Do not catchup if already initialized. (#5756)
winder Sep 28, 2023
79fb8fe
ci: fix scripts/create_and_deploy_recipe.sh build (#5764)
algorandskiy Sep 29, 2023
a65f7f4
Merge branch 'rel/stable' into relstable3.18.1-remerge
onetechnical Oct 3, 2023
802955b
Prep for remerge
ohill Oct 3, 2023
9487d3b
Fix prep for remerge
ohill Oct 3, 2023
d479850
Merge pull request #5770 from algorand/relstable3.18.1-remerge
algojohnlee Oct 3, 2023
a23449d
tests: Remove flaky persistent peers test from wsNetwork (#5772)
gmalouf Oct 3, 2023
4a381cb
tests: Fix flaky tealdbg unit test (#5768)
jasonpaulos Oct 4, 2023
690b07e
docker: Do not disable telemetry if logging.config is present. (#5769)
winder Oct 4, 2023
1a6d53e
Build: bump github.com/consensys/gnark-crypto from 0.11.2 to 0.12.0 (…
dependabot[bot] Oct 10, 2023
92ba7ee
TEAL: Report columns in TEAL source maps (#5776)
jasonpaulos Oct 11, 2023
5b2f1ab
Build: bump golang.org/x/net from 0.12.0 to 0.17.0 (#5779)
dependabot[bot] Oct 12, 2023
0358d1d
AVM: Cleanly handle broken switch/match programs (#5782)
jannotti Oct 12, 2023
4249027
dynamic-lambda: continue tracking the best proposal even after freezi…
yossigi Oct 13, 2023
d3df476
catchpoints: check EnableCatchupFromArchiveServers for ledgerFetcher …
ohill Oct 13, 2023
4dcc19f
Merge branch 'master' into relbeta3.19.0
Algo-devops-service Oct 13, 2023
b7c9222
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Oct 13, 2023
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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ crypto/libs

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

*.pem

Expand Down
89 changes: 73 additions & 16 deletions agreement/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import (
"context"
"fmt"
"time"

"github.com/algorand/go-algorand/logging/logspec"
"github.com/algorand/go-algorand/logging/telemetryspec"
Expand Down Expand Up @@ -65,6 +66,7 @@
do(context.Context, *Service)

String() string
ComparableStr() string
}

type nonpersistent struct{}
Expand All @@ -87,6 +89,8 @@
return a.t().String()
}

func (a noopAction) ComparableStr() string { return a.String() }

Check warning on line 92 in agreement/actions.go

View check run for this annotation

Codecov / codecov/patch

agreement/actions.go#L92

Added line #L92 was not covered by tests

type networkAction struct {
nonpersistent

Expand Down Expand Up @@ -119,6 +123,13 @@
return fmt.Sprintf("%s: %2v", a.t().String(), a.Tag)
}

func (a networkAction) ComparableStr() string {
if a.Tag == protocol.AgreementVoteTag {
return fmt.Sprintf("%s: %2v: %3v-%2v-%2v", a.t().String(), a.Tag, a.UnauthenticatedVote.R.Round, a.UnauthenticatedVote.R.Period, a.UnauthenticatedVote.R.Step)
}
return a.String()
}

func (a networkAction) do(ctx context.Context, s *Service) {
if a.T == broadcastVotes {
tag := protocol.AgreementVoteTag
Expand Down Expand Up @@ -191,6 +202,18 @@
return a.t().String()
}

func (a cryptoAction) ComparableStr() (s string) {
switch a.T {
case verifyVote:
s = fmt.Sprintf("%s: %3v-%2v TaskIndex %d", a.t().String(), a.Round, a.Period, a.TaskIndex)
case verifyPayload:
s = fmt.Sprintf("%s: %3v-%2v Pinned %v", a.t().String(), a.Round, a.Period, a.Pinned)
case verifyBundle:
s = fmt.Sprintf("%s: %3v-%2v-%2v", a.t().String(), a.Round, a.Period, a.Step)
}
return
}

func (a cryptoAction) do(ctx context.Context, s *Service) {
switch a.T {
case verifyVote:
Expand All @@ -209,6 +232,11 @@
Payload proposal
// the certificate proving commitment
Certificate Certificate

// The time that the winning proposal-vote was validated, relative to the beginning of the round
voteValidatedAt time.Duration
// The dynamic filter timeout calculated for this round, even if not enabled, for reporting to telemetry.
dynamicFilterTimeout time.Duration
}

func (a ensureAction) t() actionType {
Expand All @@ -219,6 +247,8 @@
return fmt.Sprintf("%s: %.5s: %v, %v, %.5s", a.t().String(), a.Payload.Digest().String(), a.Certificate.Round, a.Certificate.Period, a.Certificate.Proposal.BlockDigest.String())
}

func (a ensureAction) ComparableStr() string { return a.String() }

func (a ensureAction) do(ctx context.Context, s *Service) {
logEvent := logspec.AgreementEvent{
Hash: a.Certificate.Proposal.BlockDigest.String(),
Expand All @@ -231,29 +261,33 @@
logEvent.Type = logspec.RoundConcluded
s.log.with(logEvent).Infof("committed round %d with pre-validated block %v", a.Certificate.Round, a.Certificate.Proposal)
s.log.EventWithDetails(telemetryspec.Agreement, telemetryspec.BlockAcceptedEvent, telemetryspec.BlockAcceptedEventDetails{
Address: a.Certificate.Proposal.OriginalProposer.String(),
Hash: a.Certificate.Proposal.BlockDigest.String(),
Round: uint64(a.Certificate.Round),
ValidatedAt: a.Payload.validatedAt,
ReceivedAt: a.Payload.receivedAt,
PreValidated: true,
PropBufLen: uint64(len(s.demux.rawProposals)),
VoteBufLen: uint64(len(s.demux.rawVotes)),
Address: a.Certificate.Proposal.OriginalProposer.String(),
Hash: a.Certificate.Proposal.BlockDigest.String(),
Round: uint64(a.Certificate.Round),
ValidatedAt: a.Payload.validatedAt,
ReceivedAt: a.Payload.receivedAt,
VoteValidatedAt: a.voteValidatedAt,
DynamicFilterTimeout: a.dynamicFilterTimeout,
PreValidated: true,
PropBufLen: uint64(len(s.demux.rawProposals)),
VoteBufLen: uint64(len(s.demux.rawVotes)),
})
s.Ledger.EnsureValidatedBlock(a.Payload.ve, a.Certificate)
} else {
block := a.Payload.Block
logEvent.Type = logspec.RoundConcluded
s.log.with(logEvent).Infof("committed round %d with block %v", a.Certificate.Round, a.Certificate.Proposal)
s.log.EventWithDetails(telemetryspec.Agreement, telemetryspec.BlockAcceptedEvent, telemetryspec.BlockAcceptedEventDetails{
Address: a.Certificate.Proposal.OriginalProposer.String(),
Hash: a.Certificate.Proposal.BlockDigest.String(),
Round: uint64(a.Certificate.Round),
ValidatedAt: a.Payload.validatedAt,
ReceivedAt: a.Payload.receivedAt,
PreValidated: false,
PropBufLen: uint64(len(s.demux.rawProposals)),
VoteBufLen: uint64(len(s.demux.rawVotes)),
Address: a.Certificate.Proposal.OriginalProposer.String(),
Hash: a.Certificate.Proposal.BlockDigest.String(),
Round: uint64(a.Certificate.Round),
ValidatedAt: a.Payload.validatedAt,
ReceivedAt: a.Payload.receivedAt,
VoteValidatedAt: a.voteValidatedAt,
DynamicFilterTimeout: a.dynamicFilterTimeout,
PreValidated: false,
PropBufLen: uint64(len(s.demux.rawProposals)),
VoteBufLen: uint64(len(s.demux.rawVotes)),

Check warning on line 290 in agreement/actions.go

View check run for this annotation

Codecov / codecov/patch

agreement/actions.go#L281-L290

Added lines #L281 - L290 were not covered by tests
})
s.Ledger.EnsureBlock(block, a.Certificate)
}
Expand All @@ -278,6 +312,8 @@
return fmt.Sprintf("%s: %.5s. %v. %v", a.t().String(), a.Certificate.Proposal.BlockDigest.String(), a.Certificate.Round, a.Certificate.Period)
}

func (a stageDigestAction) ComparableStr() string { return a.String() }

func (a stageDigestAction) do(ctx context.Context, service *Service) {
logEvent := logspec.AgreementEvent{
Hash: a.Certificate.Proposal.BlockDigest.String(),
Expand All @@ -304,8 +340,25 @@
return a.t().String()
}

func (a rezeroAction) ComparableStr() string {
return fmt.Sprintf("%s: %d", a.t().String(), a.Round)
}

func (a rezeroAction) do(ctx context.Context, s *Service) {
s.Clock = s.Clock.Zero()
// Preserve the zero time of the new round a.Round (for
// period 0) for future use if a late proposal-vote arrives,
// for late credential tracking.
if _, ok := s.historicalClocks[a.Round]; !ok {
s.historicalClocks[a.Round] = s.Clock
}

// Garbage collect clocks that are too old
for rnd := range s.historicalClocks {
if a.Round > rnd+credentialRoundLag {
delete(s.historicalClocks, rnd)

Check warning on line 359 in agreement/actions.go

View check run for this annotation

Codecov / codecov/patch

agreement/actions.go#L359

Added line #L359 was not covered by tests
}
}
}

type pseudonodeAction struct {
Expand All @@ -326,6 +379,8 @@
return fmt.Sprintf("%v %3v-%2v-%2v: %.5v", a.t().String(), a.Round, a.Period, a.Step, a.Proposal.BlockDigest.String())
}

func (a pseudonodeAction) ComparableStr() string { return a.String() }

func (a pseudonodeAction) persistent() bool {
return a.T == attest
}
Expand Down Expand Up @@ -518,3 +573,5 @@
func (c checkpointAction) String() string {
return c.t().String()
}

func (c checkpointAction) ComparableStr() string { return c.String() }

Check warning on line 577 in agreement/actions.go

View check run for this annotation

Codecov / codecov/patch

agreement/actions.go#L577

Added line #L577 was not covered by tests
83 changes: 83 additions & 0 deletions agreement/credentialArrivalHistory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright (C) 2019-2023 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// go-algorand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>.

package agreement

import (
"sort"
"time"
)

// credentialArrivalHistory maintains a circular buffer of time.Duration samples.
type credentialArrivalHistory struct {
history []time.Duration
writePtr int
full bool
}

func makeCredentialArrivalHistory(size int) credentialArrivalHistory {
if size < 0 {
panic("can't create CredentialArrivalHistory with negative size")

Check warning on line 33 in agreement/credentialArrivalHistory.go

View check run for this annotation

Codecov / codecov/patch

agreement/credentialArrivalHistory.go#L33

Added line #L33 was not covered by tests
}
history := credentialArrivalHistory{history: make([]time.Duration, size)}
history.reset()
return history
}

// store saves a new sample into the circular buffer.
// If the buffer is full, it overwrites the oldest sample.
func (history *credentialArrivalHistory) store(sample time.Duration) {
if len(history.history) == 0 {
return
}

history.history[history.writePtr] = sample
history.writePtr++
if history.writePtr == len(history.history) {
history.full = true
history.writePtr = 0
}
}

// reset marks the history buffer as empty
func (history *credentialArrivalHistory) reset() {
history.writePtr = 0
history.full = false
}

// isFull checks if the circular buffer has been fully populated at least once.
func (history *credentialArrivalHistory) isFull() bool {
return history.full
}

// orderStatistics returns the idx'th time duration in the sorted history array.
// It assumes that history is full and the idx is within the array bounds, and
// panics if either of these assumptions doesn't hold.
func (history *credentialArrivalHistory) orderStatistics(idx int) time.Duration {
if !history.isFull() {
panic("history not full")

Check warning on line 71 in agreement/credentialArrivalHistory.go

View check run for this annotation

Codecov / codecov/patch

agreement/credentialArrivalHistory.go#L71

Added line #L71 was not covered by tests
}
if idx < 0 || idx >= len(history.history) {
panic("index out of bounds")

Check warning on line 74 in agreement/credentialArrivalHistory.go

View check run for this annotation

Codecov / codecov/patch

agreement/credentialArrivalHistory.go#L74

Added line #L74 was not covered by tests
}

// if history.history is long, then we could optimize this function to use
// the linear time order statistics algorithm.
sortedArrivals := make([]time.Duration, len(history.history))
copy(sortedArrivals[:], history.history[:])
sort.Slice(sortedArrivals, func(i, j int) bool { return sortedArrivals[i] < sortedArrivals[j] })
return sortedArrivals[idx]
}
Loading