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

Feat/1207513338125664 delayed staking rewards #280

Draft
wants to merge 29 commits into
base: dev
Choose a base branch
from

Conversation

talhadaar
Copy link
Member

@talhadaar talhadaar commented Aug 28, 2024

WIP - Opened for discussion

  • CollatorBlock: now a double map, stores numbers of blocks authored by a collator in each session.
  • AtStake StorageDoubleMap: here we snapshot collator staking state at the start of the round.
  • DelayedPayoutInfo: Stores the info we need to calculate payouts for collators/delegators for blocks generated in previous session.
  • payout_collator(end_session_flag) - Takes a block author from previous session from CollatorBlock, takes their staking state of previous session from AtStake, calculates and pays out their rewards based DelayedPayoutInfo.
    • end_session_flag indicates if this round is ending(probably by force_new_roud), if so, then execute all remaining delayed payouts for the previous round.
    • if this flag is true, then snapshot of previous round is also cleared from storage.

@talhadaar talhadaar requested a review from sfffaaa August 28, 2024 15:06
@talhadaar talhadaar self-assigned this Aug 28, 2024
@talhadaar talhadaar marked this pull request as draft August 28, 2024 15:06
@talhadaar talhadaar changed the title Feat/1207513338125664 delated staking rewards Feat/1207513338125664 delayed staking rewards Aug 28, 2024
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/parachain-staking/src/migrations.rs Outdated Show resolved Hide resolved
@talhadaar talhadaar force-pushed the feat/1207513338125664_delated-staking-rewards branch from ac18836 to 1f580f3 Compare October 10, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants