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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,283 changes: 756 additions & 527 deletions agreement/msgp_gen.go

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ type ConsensusParams struct {
EnableKeyregCoherencyCheck bool

EnableExtraPagesOnAppUpdate bool

// MaxProposedExpiredOnlineAccounts is the maximum number of online accounts, which need
// to be taken offline, that would be proposed to be taken offline.
MaxProposedExpiredOnlineAccounts int
}

// PaysetCommitType enumerates possible ways for the block header to commit to
Expand Down Expand Up @@ -465,6 +469,10 @@ var MaxExtraAppProgramLen int
//supported supported by any of the consensus protocols. used for decoding purposes.
var MaxAvailableAppProgramLen int

// MaxProposedExpiredOnlineAccounts is the maximum number of online accounts, which need
// to be taken offline, that would be proposed to be taken offline.
var MaxProposedExpiredOnlineAccounts int

func checkSetMax(value int, curMax *int) {
if value > *curMax {
*curMax = value
Expand Down Expand Up @@ -501,6 +509,7 @@ func checkSetAllocBounds(p ConsensusParams) {
// Its value is much larger than any possible reasonable MaxLogCalls value in future
checkSetMax(p.MaxAppProgramLen, &MaxLogCalls)
checkSetMax(p.MaxInnerTransactions, &MaxInnerTransactions)
checkSetMax(p.MaxProposedExpiredOnlineAccounts, &MaxProposedExpiredOnlineAccounts)
}

// SaveConfigurableConsensus saves the configurable protocols file to the provided data directory.
Expand Down Expand Up @@ -1045,6 +1054,8 @@ func initConsensusProtocols() {
// Enable TEAL 6 / AVM 1.1
vFuture.LogicSigVersion = 6

vFuture.MaxProposedExpiredOnlineAccounts = 32

Consensus[protocol.ConsensusFuture] = vFuture
}

Expand Down
10 changes: 10 additions & 0 deletions data/basics/userBalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,16 @@ func MakeAccountData(status Status, algos MicroAlgos) AccountData {
return AccountData{Status: status, MicroAlgos: algos}
}

// ClearOnlineState resets the account's fields to indicate that the account is an offline account
func (u *AccountData) ClearOnlineState() {
u.Status = Offline
u.VoteFirstValid = Round(0)
u.VoteLastValid = Round(0)
u.VoteKeyDilution = 0
u.VoteID = crypto.OneTimeSignatureVerifier{}
u.SelectionID = crypto.VRFVerifier{}
}

// Money returns the amount of MicroAlgos associated with the user's account
func (u AccountData) Money(proto config.ConsensusParams, rewardsLevel uint64) (money MicroAlgos, rewards MicroAlgos) {
e := u.WithUpdatedRewards(proto, rewardsLevel)
Expand Down
15 changes: 15 additions & 0 deletions data/bookkeeping/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ type (
// for multiple types of certs.
//msgp:sort protocol.CompactCertType protocol.SortCompactCertType
CompactCert map[protocol.CompactCertType]CompactCertState `codec:"cc,allocbound=protocol.NumCompactCertTypes"`

// ParticipationUpdates contains the information needed to mark
// certain accounts offline because their participation keys expired
ParticipationUpdates
}

// ParticipationUpdates represents participation account data that
// needs to be checked/acted on by the network
ParticipationUpdates struct {
_struct struct{} `codec:",omitempty,omitemptyarray"`

// ExpiredParticipationAccounts contains a list of online accounts
// that needs to be converted to offline since their
// participation key expired.
ExpiredParticipationAccounts []basics.Address `codec:"partupdrmv,allocbound=config.MaxProposedExpiredOnlineAccounts"`
}

// RewardsState represents the global parameters controlling the rate
Expand Down
Loading