Skip to content

Commit

Permalink
config: Add some warning comments about changing RewardUnit value
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Mar 29, 2022
1 parent d8ea805 commit 7dfca75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ type ConsensusParams struct {
//
// Rewards are received by whole reward units. Fractions of
// RewardUnits do not receive rewards.
//
// Ensure both considerations below are taken into account if RewardUnit is planned for change:
// 1. RewardUnits should not be changed without touching all accounts to apply their rewards
// based on the old RewardUnits and then use the new RewardUnits for all subsequent calculations.
// 2. Having a consistent RewardUnit is also important for preserving
// a constant amount of total algos in the system:
// the block header tracks how many reward units worth of algos are in existence
// and have logically received rewards.
RewardUnit uint64

// RewardsRateRefreshInterval is the number of rounds after which the
Expand Down
2 changes: 1 addition & 1 deletion data/bookkeeping/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ type (
FeeSink basics.Address `codec:"fees"`

// The RewardsPool accepts periodic injections from the
// FeeSink and continually redistributes them to adresses as
// FeeSink and continually redistributes them to addresses as
// rewards.
RewardsPool basics.Address `codec:"rwd"`

Expand Down

0 comments on commit 7dfca75

Please sign in to comment.