Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Inconsistent block reward amount credited to bootstrap validator account without registered seed #8229

Closed
Tracked by #7210
Incede opened this issue Mar 6, 2023 · 1 comment
Assignees
Milestone

Comments

@Incede
Copy link
Contributor

Incede commented Mar 6, 2023

Actual behavior

Without registering seed for an bootstrap validator, it receives the correct reward for the first block forged. The block generation is disabled immediately after and is enabled again after 206 blocks since then. Subsequently, the validator receives a reward when it forges a block as expected, however the amount credited to validator account is different compared to the amount when it forged the very first block.

Expected behavior

The amount credited should be same as the amount credited after forging the first block.

Steps to reproduce

Without registering seed, check first block reward and stop block generation then enable after 206 blocks
Optional - offset value can be changed in the config to avoid long waiting time (2160 blocks) :

	"modules": {
		"dynamicReward": {
		  "offset": 1
		}
	},

Which version(s) does this affect? (Environment, OS, etc...)

development

@Madhulearn Madhulearn added this to the Sprint 91 milestone Mar 14, 2023
@bobanm bobanm self-assigned this Mar 17, 2023
@bobanm
Copy link
Contributor

bobanm commented Mar 20, 2023

I've set modules.dynamicReward.offset = 1 in config, and assigned hash onions to 1 of the initial validators.

Then I observed the rewards minted and assigned to that validator:

round   block      amount
-------------------------
    1      64   500000000
    2     165   500000000
    3     266   500000000
    4     355   504500000
    5     499   509090909
    6     582   513775510
    7     662   518556701
    8     785   523437500

This is the expected behavior of Dynamic Reward module, and is not caused by whether or not a validator has registered hash onion seed.

The rewards per block are increasing because the number of available validators is constantly decreasing as of round 4. The reward calculation is handled in this section of Dynamic Reward module:

https://github.com/LiskHQ/lisk-sdk/blob/48b698dc63c44890bf384883cbc2a2e570f7a60c/framework/src/modules/dynamic_rewards/module.ts#L268-L278

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants