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

config: add some warning comments about changing RewardUnit value #3846

Merged
merged 1 commit into from
Mar 30, 2022
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
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