Skip to content

Commit

Permalink
Add new BlockHeader and AccountBaseData fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Mar 21, 2024
1 parent 2b673ee commit e98bc28
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 17 additions & 3 deletions types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,26 @@ type (
// Genesis hash to which this block belongs.
GenesisHash Digest `codec:"gh"`

// Proposer is the proposer of this block. Like the Seed, algod adds
// this after the block is built, so that the same block can be prepared
// for multiple Players in the same node. Therefore, it can not be used
// Proposer is the proposer of this block. Like the Seed, agreement adds
// this after the block is assembled by the transaction pool, so that the same block can be prepared
// for multiple participating accounts in the same node. Therefore, it can not be used
// to influence block evaluation. Populated if proto.EnableMining
Proposer Address `codec:"prp"`

// FeesCollected is the sum of all fees paid by transactions in this
// block. Populated if proto.EnableMining.
FeesCollected MicroAlgos `codec:"fc"`

// Bonus is the bonus incentive to be paid for proposing this block. It
// begins as a consensus parameter value, and decays periodically.
Bonus MicroAlgos `codec:"bi"`

// ProposerPayout is the amount that should be moved from the FeeSink to
// the Proposer at the start of the next block. It is basically the
// bonus + the mining fraction of FeesCollected, but may be zero'd by
// proposer ineligibility.
ProposerPayout MicroAlgos `codec:"pp"`

// Rewards.
//
// When a block is applied, some amount of rewards are accrued to
Expand Down Expand Up @@ -130,6 +140,10 @@ type (
// that needs to be converted to offline since their
// participation key expired.
ExpiredParticipationAccounts []Address `codec:"partupdrmv"`

// AbsentParticipationAccounts contains a list of online accounts that
// needs to be converted to offline since they are not proposing.
AbsentParticipationAccounts []Address `codec:"partupdabs"`
}

// RewardsState represents the global parameters controlling the rate
Expand Down
4 changes: 4 additions & 0 deletions types/statedelta.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ type AccountBaseData struct {
RewardsBase uint64
RewardedMicroAlgos MicroAlgos
AuthAddr Address
IncentiveEligible bool

TotalAppSchema StateSchema // Totals across created globals, and opted in locals.
TotalExtraAppPages uint32 // Total number of extra pages across all created apps
Expand All @@ -168,6 +169,9 @@ type AccountBaseData struct {
TotalAssets uint64 // Total of asset creations and optins (i.e. number of holdings)
TotalBoxes uint64 // Total number of boxes associated to this account
TotalBoxBytes uint64 // Total bytes for this account's boxes. keys _and_ values count

LastProposed Round // The last round that this account proposed the winning block.
LastHeartbeat Round // The last round that this account sent a heartbeat to show it was online.
}

// AccountData provides users of the Balances interface per-account data (like basics.AccountData)
Expand Down

0 comments on commit e98bc28

Please sign in to comment.