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

Release: go-algorand 3.21.0-beta Release PR #5862

Merged
merged 19 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ae133b8
docs: participation key lifecycle. (#5847)
winder Nov 30, 2023
ed278b8
AVM: Add box_splice and box_resize opcodes (#5750)
jannotti Dec 4, 2023
6a6a15d
Merge pull request #5852 from Algo-devops-service/relstable3.20.1
algojohnlee Dec 5, 2023
6592300
network: Use peer address after proxy fix for app rate limiter if ava…
algorandskiy Dec 6, 2023
f48be99
tests: dump logs if e2e test node exited with an error (#5856)
algorandskiy Dec 6, 2023
4291e53
tests: wait longer in TestTotalWeightChanges for larger nightly test …
ohill Dec 7, 2023
e63b634
Round Times: Set minimum dynamic filter timeout to 2500ms. (#5853)
gmalouf Dec 7, 2023
356290e
Merge remote-tracking branch 'origin/rel/stable' into relstable3.20.1…
Algo-devops-service Dec 7, 2023
34d6799
Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.
Algo-devops-service Dec 7, 2023
be5fff3
Merge pull request #5859 from Algo-devops-service/relstable3.20.1-rem…
algojohnlee Dec 7, 2023
ebd3593
Round Times: Period 0 deadline timeout (#5850)
gmalouf Dec 7, 2023
9229066
network: fixes to public address support (#5851)
algorandskiy Dec 7, 2023
b37fadb
AVM: Add `global GenesisHash` (#5858)
jannotti Dec 7, 2023
686912b
Simulate: Properly handle failing clear state programs (#5842)
jasonpaulos Dec 8, 2023
b28b145
consensus: Enable dynamic round times in vfuture. (#5860)
gmalouf Dec 8, 2023
1411904
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Dec 8, 2023
1cfb80a
Consensus: Upgrade to consensus version v39. (#5868)
gmalouf Dec 14, 2023
a45ac99
CICD: fix aptly repo management (#5870)
onetechnical Dec 19, 2023
b2c158d
AVM: Require every global field to get tested (#5864)
jannotti Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .aptly.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"rootDir": "/root/aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
Expand Down Expand Up @@ -27,4 +26,3 @@
},
"SwiftPublishEndpoints": {}
}

3 changes: 1 addition & 2 deletions agreement/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ type ensureAction struct {
Payload proposal
// the certificate proving commitment
Certificate Certificate

// The time that the winning proposal-vote was validated, relative to the beginning of the round
// The time that the winning proposal-vote was validated for round credentialRoundLag back from the current one
voteValidatedAt time.Duration
// The dynamic filter timeout calculated for this round, even if not enabled, for reporting to telemetry.
dynamicFilterTimeout time.Duration
Expand Down
2 changes: 1 addition & 1 deletion agreement/dynamicFilterTimeoutParams.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const dynamicFilterCredentialArrivalHistory int = 40

// DynamicFilterTimeoutLowerBound specifies a minimal duration that the
// filter timeout must meet.
const dynamicFilterTimeoutLowerBound time.Duration = 500 * time.Millisecond
const dynamicFilterTimeoutLowerBound time.Duration = 2500 * time.Millisecond

// DynamicFilterTimeoutCredentialArrivalHistoryIdx specified which sample to use
// out of a sorted DynamicFilterCredentialArrivalHistory-sized array of time
Expand Down
23 changes: 16 additions & 7 deletions agreement/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,19 @@
r.t.logTimeout(*p)
}

var deadlineTimeout time.Duration
if e.Proto.Version == "" || e.Proto.Err != nil {
r.t.log.Errorf("failed to read valid protocol version for timeout event (proto %v): %v. "+
"Falling Back to default deadline timeout.", e.Proto.Version, e.Proto.Err)
deadlineTimeout = DefaultDeadlineTimeout()

Check warning on line 107 in agreement/player.go

View check run for this annotation

Codecov / codecov/patch

agreement/player.go#L105-L107

Added lines #L105 - L107 were not covered by tests
} else {
deadlineTimeout = DeadlineTimeout(p.Period, e.Proto.Version)
}

switch p.Step {
case soft:
// precondition: nap = false
actions = p.issueSoftVote(r)
actions = p.issueSoftVote(r, deadlineTimeout)
p.Step = cert
// update tracer state to match player
r.t.setMetadata(tracerMetadata{p.Round, p.Period, p.Step})
Expand All @@ -113,16 +122,16 @@
p.Step = next
// update tracer state to match player
r.t.setMetadata(tracerMetadata{p.Round, p.Period, p.Step})
return p.issueNextVote(r)
return p.issueNextVote(r, deadlineTimeout)
default:
if p.Napping {
return p.issueNextVote(r) // sets p.Napping to false
return p.issueNextVote(r, deadlineTimeout) // sets p.Napping to false
}
// not napping, so we should enter a new step
p.Step++ // note: this must happen before next timeout setting.
// TODO add unit test to ensure that deadlines increase monotonically here

lower, upper := p.Step.nextVoteRanges()
lower, upper := p.Step.nextVoteRanges(deadlineTimeout)
delta := time.Duration(e.RandomEntropy % uint64(upper-lower))

p.Napping = true
Expand Down Expand Up @@ -158,7 +167,7 @@
return p.issueFastVote(r)
}

func (p *player) issueSoftVote(r routerHandle) (actions []action) {
func (p *player) issueSoftVote(r routerHandle, deadlineTimeout time.Duration) (actions []action) {
defer func() {
p.Deadline = Deadline{Duration: deadlineTimeout, Type: TimeoutDeadline}
}()
Expand Down Expand Up @@ -202,7 +211,7 @@
return pseudonodeAction{T: attest, Round: p.Round, Period: p.Period, Step: cert, Proposal: e.Proposal}
}

func (p *player) issueNextVote(r routerHandle) []action {
func (p *player) issueNextVote(r routerHandle, deadlineTimeout time.Duration) []action {
actions := p.partitionPolicy(r)

a := pseudonodeAction{T: attest, Round: p.Round, Period: p.Period, Step: p.Step, Proposal: bottom}
Expand All @@ -226,7 +235,7 @@

r.t.timeR().RecStep(p.Period, p.Step, a.Proposal)

_, upper := p.Step.nextVoteRanges()
_, upper := p.Step.nextVoteRanges(deadlineTimeout)
p.Napping = false
p.Deadline = Deadline{Duration: upper, Type: TimeoutDeadline}
return actions
Expand Down
9 changes: 4 additions & 5 deletions agreement/player_permutation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,17 +811,16 @@ func TestPlayerPermutation(t *testing.T) {
}

func playerPermutationCheck(t *testing.T, enableDynamicFilterTimeout bool) {
// create a protocol version where dynamic filter is enabled
version, _, configCleanup := createDynamicFilterConfig()
// create a protocol where dynamic filter is set based on the enableDynamicFilterTimeout flag
dynamicFilterOverriddenProtocol, _, configCleanup := overrideConfigWithDynamicFilterParam(enableDynamicFilterTimeout)
defer configCleanup()

for i := 0; i < 7; i++ {
for j := 0; j < 14; j++ {
_, pMachine, helper := getPlayerPermutation(t, i)
inMsg := getMessageEventPermutation(t, j, helper)
if enableDynamicFilterTimeout {
inMsg.Proto = ConsensusVersionView{Version: version}
}
inMsg.Proto = ConsensusVersionView{Version: dynamicFilterOverriddenProtocol}

err, panicErr := pMachine.transition(inMsg)
fmt.Println(pMachine.getTrace().events)
fmt.Println("")
Expand Down
32 changes: 16 additions & 16 deletions agreement/player_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {
}

func makeTimeoutEvent() timeoutEvent {
return timeoutEvent{T: timeout, RandomEntropy: crypto.RandUint64()}
return timeoutEvent{T: timeout, RandomEntropy: crypto.RandUint64(), Proto: ConsensusVersionView{Version: protocol.ConsensusCurrentVersion}}
}

func generateProposalEvents(t *testing.T, player player, accs testAccountData, f testBlockFactory, ledger Ledger) (voteBatch []event, payloadBatch []event, lowestProposal proposalValue) {
Expand Down Expand Up @@ -3240,7 +3240,7 @@ func TestPlayerAlwaysResynchsPinnedValue(t *testing.T) {
func TestPlayerRetainsReceivedValidatedAtOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(131)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand All @@ -3262,7 +3262,7 @@ func TestPlayerRetainsReceivedValidatedAtOneSample(t *testing.T) {
func TestPlayerRetainsReceivedValidatedAtCredentialHistory(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-credentialRoundLag-1, p, soft)
Expand Down Expand Up @@ -3301,7 +3301,7 @@ func TestPlayerRetainsReceivedValidatedAtCredentialHistory(t *testing.T) {
func TestPlayerRetainsEarlyReceivedValidatedAtOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand Down Expand Up @@ -3339,7 +3339,7 @@ func testClockForRound(t *testing.T, pWhite *player, fixedDur time.Duration, cur
func TestPlayerRetainsLateReceivedValidatedAtOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand Down Expand Up @@ -3382,7 +3382,7 @@ func TestPlayerRetainsReceivedValidatedAtForHistoryWindowLateBetter(t *testing.T
}

func testPlayerRetainsReceivedValidatedAtForHistoryWindow(t *testing.T, addBetterLate bool) {
version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand Down Expand Up @@ -3449,7 +3449,7 @@ func testPlayerRetainsReceivedValidatedAtForHistoryWindow(t *testing.T, addBette
func TestPlayerRetainsReceivedValidatedAtPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()
const r = round(20239)
const p = period(0)
Expand Down Expand Up @@ -3505,7 +3505,7 @@ func TestPlayerRetainsReceivedValidatedAtPPOneSample(t *testing.T) {
func TestPlayerRetainsEarlyReceivedValidatedAtPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()

const r = round(20239)
Expand Down Expand Up @@ -3559,7 +3559,7 @@ func TestPlayerRetainsEarlyReceivedValidatedAtPPOneSample(t *testing.T) {
func TestPlayerRetainsLateReceivedValidatedAtPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()
const r = round(20239)
const p = period(0)
Expand Down Expand Up @@ -3613,7 +3613,7 @@ func TestPlayerRetainsLateReceivedValidatedAtPPOneSample(t *testing.T) {
func TestPlayerRetainsReceivedValidatedAtPPForHistoryWindow(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand Down Expand Up @@ -3655,7 +3655,7 @@ func TestPlayerRetainsReceivedValidatedAtAVPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

// create a protocol version where dynamic lambda is enabled
version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()
const r = round(20239)
const p = period(0)
Expand Down Expand Up @@ -3710,7 +3710,7 @@ func TestPlayerRetainsReceivedValidatedAtAVPPOneSample(t *testing.T) {
func TestPlayerRetainsEarlyReceivedValidatedAtAVPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand All @@ -3729,7 +3729,7 @@ func TestPlayerRetainsEarlyReceivedValidatedAtAVPPOneSample(t *testing.T) {
require.Equal(t, pWhite.lowestCredentialArrivals.writePtr, 0)

// create a protocol version where dynamic filter is enabled
version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()

// send votePresent message (mimicking the first AV message validating)
Expand Down Expand Up @@ -3767,7 +3767,7 @@ func TestPlayerRetainsEarlyReceivedValidatedAtAVPPOneSample(t *testing.T) {
func TestPlayerRetainsLateReceivedValidatedAtAVPPOneSample(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand All @@ -3786,7 +3786,7 @@ func TestPlayerRetainsLateReceivedValidatedAtAVPPOneSample(t *testing.T) {
require.Equal(t, pWhite.lowestCredentialArrivals.writePtr, 0)

// create a protocol version where dynamic filter is enabled
version, _, configCleanup := createDynamicFilterConfig()
version, _, configCleanup := overrideConfigWithDynamicFilterParam(true)
defer configCleanup()

// send votePresent message (mimicking the first AV message validating)
Expand Down Expand Up @@ -3821,7 +3821,7 @@ func TestPlayerRetainsLateReceivedValidatedAtAVPPOneSample(t *testing.T) {
func TestPlayerRetainsReceivedValidatedAtAVPPHistoryWindow(t *testing.T) {
partitiontest.PartitionTest(t)

version := protocol.ConsensusFuture
version := protocol.ConsensusCurrentVersion
const r = round(20239)
const p = period(0)
pWhite, pM, helper := setupP(t, r-1, p, soft)
Expand Down
9 changes: 9 additions & 0 deletions agreement/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ var credentialRoundLag round

func init() {
// credential arrival time should be at most 2*config.Protocol.SmallLambda after it was sent
// Note that the credentialRoundLag is inversely proportional to the dynamicFilterTimeoutLowerBound
// in the default formula. Since we are adjusting this lower bound over time,
// for consistency in analytics we are setting the minimum to be 8 rounds
// (equivalent to a dynamicFilterTimeoutLowerBound of 500 ms).
minCredentialRoundLag := round(8) // round 2*2000ms / 500ms
credentialRoundLag = round(2 * config.Protocol.SmallLambda / dynamicFilterTimeoutLowerBound)

if credentialRoundLag < minCredentialRoundLag {
credentialRoundLag = minCredentialRoundLag
}
if credentialRoundLag*round(dynamicFilterTimeoutLowerBound) < round(2*config.Protocol.SmallLambda) {
credentialRoundLag++
}
Expand Down
Loading