-
Notifications
You must be signed in to change notification settings - Fork 52
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
Reward block author in Dancelight #784
base: master
Are you sure you want to change the base?
Conversation
WASM runtime size check:Compared to target branchdancebox runtime: 1428 KB (no changes) ✅ flashbox runtime: 824 KB (no changes) ✅ dancelight runtime: 2136 KB (no changes) ✅ container chain template simple runtime: 1124 KB (no changes) ✅ container chain template frontier runtime: 1400 KB (no changes) ✅ |
Coverage Report@@ Coverage Diff @@
## master tomasz-reward-block-author +/- ##
==============================================================
- Coverage 65.15% 65.14% -0.01%
Files 327 327
+ Lines 57299 57308 +9
==============================================================
+ Hits 37330 37333 +3
+ Misses 19969 19975 +6
|
...es/dev-tanssi-relay/external-validators-rewards/test_external_validator_reward_candidates.ts
Outdated
Show resolved
Hide resolved
const totalRewards = validatorRewards.total.toBigInt(); | ||
|
||
// Validators get 20 points for creating a block, so if they included a candidate, they will get more than 20 | ||
expect(totalRewards).to.be.greaterThan(20n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait they get 20 per candidate and per block created. So you will always have higher than 20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess if so, you need to check the rewards totalRewards > num_blocks*20
Previously we were only rewarding the Dancelight block author for including parachain candidates, but not for the block per se. So an empty block would get no reward.
This PR fixed that by rewarding 20 points to the block author, same as in polkadot.
https://github.com/paritytech/polkadot-sdk/blob/48c6574b1a32893e6a2113622d009cefda0a5f21/substrate/frame/staking/src/pallet/impls.rs#L1411