From e98bc286a37bd3be48b7c66675a414656be836c7 Mon Sep 17 00:00:00 2001 From: chris erway Date: Thu, 21 Mar 2024 15:19:36 -0400 Subject: [PATCH] Add new BlockHeader and AccountBaseData fields --- types/block.go | 20 +++++++++++++++++--- types/statedelta.go | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/types/block.go b/types/block.go index c56914c1..40cb66cc 100644 --- a/types/block.go +++ b/types/block.go @@ -28,9 +28,9 @@ 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"` @@ -38,6 +38,16 @@ type ( // 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 @@ -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 diff --git a/types/statedelta.go b/types/statedelta.go index 54c71fb5..c09990a7 100644 --- a/types/statedelta.go +++ b/types/statedelta.go @@ -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 @@ -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)