Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Credits auto rewind on vote recreation#22546

Merged
CriesofCarrots merged 5 commits intosolana-labs:masterfrom
ryoqun:credits-auto-rewind
Apr 26, 2022
Merged

Credits auto rewind on vote recreation#22546
CriesofCarrots merged 5 commits intosolana-labs:masterfrom
ryoqun:credits-auto-rewind

Conversation

@ryoqun
Copy link
Copy Markdown
Contributor

@ryoqun ryoqun commented Jan 17, 2022

still draft; exploring best-desired least-intrusive code changes with some preparatory code cleanings (should be separated into its own pr)...

todo:

  • should reset activation_epoch? (i guess we should avoid that and write down the reasons...)
  • what about deactivation epoch?
  • test, proper feature gate (currently, brokenly piggy-bucking on an existing one)

Problem

(See #22512)

Summary of Changes

(See #22512)

Fixes #22512

Comment thread programs/stake/src/stake_state.rs
Comment thread programs/stake/src/stake_state.rs Outdated
}
return (0, stake.credits_observed);
if credits_in_vote <= credits_in_stake {
let (referenced_credits, forced_credits_update_with_skipped_reward) = if credits_auto_rewind
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readability: enum NoCredit:{Delinquent, Recreated} or should_rewrite

Copy link
Copy Markdown
Contributor Author

@ryoqun ryoqun Jan 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or out_of_sync/outdated? is_stale_credits

@ryoqun ryoqun force-pushed the credits-auto-rewind branch from aff230a to de5bf81 Compare January 25, 2022 12:33
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 25, 2022

Codecov Report

Merging #22546 (aca12b0) into master (3155270) will increase coverage by 11.9%.
The diff coverage is 75.4%.

@@             Coverage Diff             @@
##           master   #22546       +/-   ##
===========================================
+ Coverage    70.0%    82.0%    +11.9%     
===========================================
  Files          36      596      +560     
  Lines        2255   165080   +162825     
  Branches      322        0      -322     
===========================================
+ Hits         1580   135460   +133880     
- Misses        560    29620    +29060     
+ Partials      115        0      -115     

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jan 25, 2022

I ran solana-ledger-tool capitalization --warp-epoch +1 against mainnet-beta. and it seems I'm getting correct inflation tracer outputs for sampled stake account 5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD:

## before

5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD (Stake11111111111111111111111111111111111111): ◎ 432.872655746 => ◎ 432.872655746 (+◎ 0.000000000 0.000000000%) Some(CalculationDetail { epochs: 0, voter: 9Gko8QZBbV5SrEvHKtQHcMrGGSfgFP3KJUozEGifu25x, voter_owner: Vote111111111111111111111111111111111111111, current_effective_stake: 432868089986, total_stake: 432868089986, rent_exempt_reserve: 2282880, points: [], base_rewards: 0, commission: 10, vote_rewards: 0, stake_rewards: 0, activation_epoch: 260, deactivation_epoch: None, point_value: None, old_credits_observed: Some(4169959), new_credits_observed: None, skipped_reasons: "ZeroCreditsAndReturnCurrent/ZeroPoints" })

## after

5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD (Stake11111111111111111111111111111111111111): ◎ 432.872655746 => ◎ 432.872655746 (+◎ 0.000000000 0.000000000%) Some(CalculationDetail { epochs: 0, voter: 9Gko8QZBbV5SrEvHKtQHcMrGGSfgFP3KJUozEGifu25x, voter_owner: Vote111111111111111111111111111111111111111, current_effective_stake: 432868089986, total_stake: 432868089986, rent_exempt_reserve: 2282880, points: [], base_rewards: 0, commission: 10, vote_rewards: 0, stake_rewards: 0, activation_epoch: 260, deactivation_epoch: None, point_value: None, old_credits_observed: Some(4169959), new_credits_observed: Some(2349979), skipped_reasons: "ZeroCreditsAndReturnRewinded" })

note that no reward before&after the feature activation, new_credits_observed, and skipped_reasons.

Comment thread ledger-tool/src/main.rs Outdated
Comment thread ledger-tool/src/main.rs Outdated
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jan 30, 2022

I ran solana-ledger-tool capitalization --warp-epoch +1 against mainnet-beta. and it seems I'm getting correct inflation tracer outputs:

## before

5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD (Stake11111111111111111111111111111111111111): ◎ 432.872655746 => ◎ 432.872655746 (+◎ 0.000000000 0.000000000%) Some(CalculationDetail { epochs: 0, voter: 9Gko8QZBbV5SrEvHKtQHcMrGGSfgFP3KJUozEGifu25x, voter_owner: Vote111111111111111111111111111111111111111, current_effective_stake: 432868089986, total_stake: 432868089986, rent_exempt_reserve: 2282880, points: [], base_rewards: 0, commission: 10, vote_rewards: 0, stake_rewards: 0, activation_epoch: 260, deactivation_epoch: None, point_value: None, old_credits_observed: Some(4169959), new_credits_observed: None, skipped_reasons: "ZeroCreditsAndReturnCurrent/ZeroPoints" })

## after

5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD (Stake11111111111111111111111111111111111111): ◎ 432.872655746 => ◎ 432.872655746 (+◎ 0.000000000 0.000000000%) Some(CalculationDetail { epochs: 0, voter: 9Gko8QZBbV5SrEvHKtQHcMrGGSfgFP3KJUozEGifu25x, voter_owner: Vote111111111111111111111111111111111111111, current_effective_stake: 432868089986, total_stake: 432868089986, rent_exempt_reserve: 2282880, points: [], base_rewards: 0, commission: 10, vote_rewards: 0, stake_rewards: 0, activation_epoch: 260, deactivation_epoch: None, point_value: None, old_credits_observed: Some(4169959), new_credits_observed: Some(2349979), skipped_reasons: "ZeroCreditsAndReturnRewinded" })

note that no reward before&after the feature activation, new_credits_observed, and skipped_reasons.

fyi: i've rebased out-of-tree pretty hacky inflation validation subcommand of solana-ledger-tool.. code is here: https://github.com/ryoqun/solana/tree/ledger-tool-inflation-validation

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jan 30, 2022

Also, around +0.007% (currently stalled due to the accidental vote account recreation) stakes will be started to earn staking rewards after this feature activation. this should be negligible overall

$ grep ReturnRewi mainnet-beta-272-2.log | grep -o current_effective_stake.*$ | awk '{print $2}' | tr -d , | paste -d+ -s | bc
26549195711625

$ ./target/release/solana -um stake-history

  Epoch       Effective Stake      Activating Stake    Deactivating Stake
    273   386164845.578965962     3751481.729363170     3375889.729314109 SOL
    272   389409318.788984954     2432030.220285488     5802706.327593587 SOL
    271   392955548.748773754     1980704.748732860     5653660.032072398 SOL
    270   393719463.247481167     2391855.557573695     3283877.238107522 SOL
    269   394411986.403078020     3051392.704833432     3872033.135666619 SOL
    268   393354958.271813154     2592345.372506808     1663351.552270411 SOL
    267   395165510.789034367     2032117.252118937     3969902.194922559 SOL
    266   395559881.128125072     4024142.877033422     4545366.195989004 SOL
    265   394969262.506878734     3243355.053764615     2780222.688156187 SOL
    264   396038677.696802497     1624993.008589262     2822182.589519491 SOL
$ pry
[1] pry(main)> "%0.5f%%" % (100 * 26_549_195_711_625.0 / 386_164_845_578_965_962) 
=> "0.00688%"

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jan 31, 2022

(status: this pr is almost ready for review. it went through rather rigorous self-review including full re-audit of staking code)

@ryoqun ryoqun force-pushed the credits-auto-rewind branch from 70bb7c0 to 8e3962f Compare February 1, 2022 14:11
Comment thread programs/stake/src/stake_state.rs Outdated
stake_history,
inflation_point_calc_tracer.as_ref(),
);
let (points, credits_observed, mut forced_credits_update_with_skipped_reward) =
Copy link
Copy Markdown
Contributor Author

@ryoqun ryoqun Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit contrived flag coding. but i rather wanted some encapsulation for maintainability (place new code at lowest-level to be touched by all codepath even including currently-hypothetical code, which isn't via this fn calculate_stake_rewards) and separation-of-concerns (no visible muddy credits handling with feature activation here and put it into calculate_stake_point_and_credits)

@ryoqun ryoqun changed the title wip: Credits auto rewind on vote recreation Credits auto rewind on vote recreation Feb 2, 2022
@ryoqun ryoqun requested a review from CriesofCarrots February 2, 2022 16:05
@ryoqun ryoqun marked this pull request as ready for review February 2, 2022 16:05
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Feb 2, 2022

@CriesofCarrots this is finally ready for review. :)

CriesofCarrots
CriesofCarrots previously approved these changes Feb 2, 2022
Copy link
Copy Markdown
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ryoqun , this looks great! Just wondering if it's time for some helper return structs to keep values clear, but I'm okay to ship as-is, if you want to keep the changeset smaller.

Comment thread programs/stake/src/stake_state.rs
Comment thread programs/stake/src/stake_state.rs
t-nelson
t-nelson previously approved these changes Feb 4, 2022
Copy link
Copy Markdown
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Comment thread runtime/src/bank.rs Outdated
Comment thread programs/stake/src/stake_state.rs
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Feb 11, 2022

status: this pr is pended because of questioned risk/benefits for changing on this (#22512 (comment) ; as a stake-related engineer, i think this pr is safe and might be beneficial but not so strongly opinionated to ship this) and i requested audits to @bennofs (indicated he can find something interesting in this change)

@bennofs
Copy link
Copy Markdown
Contributor

bennofs commented Feb 11, 2022

quite busy ATM, but I'll look at this early next week.

@bennofs bennofs self-requested a review February 14, 2022 17:56
Copy link
Copy Markdown
Contributor

@bennofs bennofs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for waiting for me, I reviewed the changes and it looks good to me. My reasoning for why this is safe:

  • the rewind code is only triggered when there is a vote account with lower credits than observed in a rooted bank. This means that there is no way that any vote state with higher credits observed is obtainable.
  • the codepath that calls the rewind code reloads the stake account from the bank, so even if there were inconsistencies in the stakes cache these wouldn't matter here
  • rewinding only happens at the end of the epoch, and no rewards are paid for ending epoch. So the outcome is the same as you would get by just unstaking and restaking

I also did a quick search for credits_observed in the code base just to make sure that we didn't forget about something that uses that field and would break, but only found the stake program and some cli tools/tests so that's good as well.

@stale
Copy link
Copy Markdown

stale Bot commented Mar 2, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale Bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Mar 2, 2022
@CriesofCarrots
Copy link
Copy Markdown
Contributor

@ryoqun , what are you thinking about this one?

@stale stale Bot closed this Apr 25, 2022
@CriesofCarrots
Copy link
Copy Markdown
Contributor

I still think we should make this fix, as current behavior is objectively broken. Assuming I can push to this branch, I will rebase here.
@ryoqun , can you please give me an update on any testing you've done, or think is required? Thank you.

@t-nelson
Copy link
Copy Markdown
Contributor

oh i didn't realize we never landed this 😕

@stale stale Bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Apr 25, 2022
@mergify mergify Bot dismissed stale reviews from t-nelson and CriesofCarrots April 25, 2022 21:14

Pull request has been modified.

@CriesofCarrots CriesofCarrots added feature-gate Pull Request adds or modifies a runtime feature gate and removed v1.9 labels Apr 25, 2022
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Apr 26, 2022

I still think we should make this fix, as current behavior is objectively broken. Assuming I can push to this branch, I will rebase here.

@CriesofCarrots thanks for taking over and rebasing this. it's embarrassing for me not to be able to work on this for such long time. i have been focusing on the prolonged cluster-wide instability with primary focus of assisting affected ecosystem partners. maybe, it's time for me to take a breather and address not-highest-priority tasks...

as @mvines reacted with +1, i guess team's consensus here is that this fix outweigh this concern at this moment. :)

@ryoqun, can you please give me an update on any testing you've done, or think is required? Thank you.

as said above, i haven't spent time on this regarding testing... And, I think it's required, considering the touched code. Once this lands (with guarantee of shipping eventually), i'll report back here with results with procedures (i.e. csv, its solana-ledger-tool one-liner, a short commentary from me). 1.11.x is targeted without backporting, maybe? (I'll do that testing with tip of master after merge, then.)

Also, I'll monitor few epochs before and after around devnet/testnet feature activation.

lastly, sorry for not properly communicating about this pr's stalemate.

Comment thread runtime/src/bank.rs
@CriesofCarrots
Copy link
Copy Markdown
Contributor

Once this lands (with guarantee of shipping eventually), i'll report back here with results with procedures (i.e. csv, its solana-ledger-tool one-liner, a short commentary from me). 1.11.x is targeted without backporting, maybe? (I'll do that testing with tip of master after merge, then.)

Thank you, that sounds perfect. Yes, I'm planning to let this ride in on v1.11 without backporting.

@CriesofCarrots CriesofCarrots requested a review from t-nelson April 26, 2022 15:53
@CriesofCarrots CriesofCarrots merged commit 412a5a0 into solana-labs:master Apr 26, 2022
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Apr 27, 2022
* Credits auto rewind on vote recreation

* Update comment

* Improve comments and tests

* Recommended fn rename

* Restore old feature, and replace new feature key

Co-authored-by: Tyera Eulberg <tyera@solana.com>
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jun 27, 2022

Once this lands (with guarantee of shipping eventually), i'll report back here with results with procedures (i.e. csv, its solana-ledger-tool one-liner, a short commentary from me). 1.11.x is targeted without backporting, maybe? (I'll do that testing with tip of master after merge, then.)

Thank you, that sounds perfect. Yes, I'm planning to let this ride in on v1.11 without backporting.

fyi, I'm still not forgetting this pr and this live-cluster verification chore. :) I'm just waiting v1.11 upgrade for devnet and testnet.

jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
* Credits auto rewind on vote recreation

* Update comment

* Improve comments and tests

* Recommended fn rename

* Restore old feature, and replace new feature key

Co-authored-by: Tyera Eulberg <tyera@solana.com>
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
* Credits auto rewind on vote recreation

* Update comment

* Improve comments and tests

* Recommended fn rename

* Restore old feature, and replace new feature key

Co-authored-by: Tyera Eulberg <tyera@solana.com>
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Aug 31, 2022

Once this lands (with guarantee of shipping eventually), i'll report back here with results with procedures (i.e. csv, its solana-ledger-tool one-liner, a short commentary from me). 1.11.x is targeted without backporting, maybe? (I'll do that testing with tip of master after merge, then.)

Thank you, that sounds perfect. Yes, I'm planning to let this ride in on v1.11 without backporting.

fyi, I'm still not forgetting this pr and this live-cluster verification chore. :) I'm just waiting v1.11 upgrade for devnet and testnet.

@CriesofCarrots this is done with no concerns found. I've found no not-explainable wierdness after carefully investigating actual inflation distributions after the feature activation on testnet.

(for the very curious stranger who is eager to redo the verification step, this is done with rebased out-of-tree ugly inflation validation code, which I'm carrying in my bag for years: (found here: ryoqun@5343644) and the dataset used was here https://drive.google.com/drive/folders/13DE2dvdfhfhN5VWNIDaJQKGgOLmWr4k9?usp=sharing)

So, devnet and mainnet-beta is remaining..

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jun 24, 2023

this feature finally was activated. in short, it seems working as expected:

$ grep ReturnRewi ./mainnet-beta-after-rewind-with-rewind.log | grep -o current_effective_stake.*$ | awk '{print $2}' | tr -d , | paste -d+ -s | bc
22500153335748
$ solana -um feature status --display-all BUS12ciZ5gCoFafUHWW8qaFMMtwFQGVxjsDheWLdqBE2
Feature                                      | Status                  | Activation Slot | Description
BUS12ciZ5gCoFafUHWW8qaFMMtwFQGVxjsDheWLdqBE2 | active since epoch 464  | 200448008       | Auto rewind stake's credits_observed if (accidental) vote recreation is detected #22546
$ solana -um stake-history
  Epoch       Effective Stake      Activating Stake    Deactivating Stake
    464   388620608.562748790     1797516.702643046     1265885.799712572 SOL
    463   388283431.704100668     1343627.726265571     1121176.049718931 SOL
    462   387366397.995904684     2710135.622854811     1907508.178961365 SOL
    461   388222876.775501192     2401705.256340335     3372082.311824944 SOL
    460   389072050.175475955     2000915.199247054     2964338.113380553 SOL
$ irb
irb(main):002:0> "%0.5f%%" % (100 * 22_500_153_335_748.0 / 388_620_608_562_748_790) 
=> "0.00579%"

(this is redo of #22546 (comment))

Also, around +0.007% (currently stalled due to the accidental vote account recreation) stakes will be started to earn staking rewards after this feature activation. this should be negligible overall

1.5 years has passed. +0.006% started to earn rewards thanks to this feature activation; seems the total staked amount is mostly unchanged and the stuck stake amount reduced because some of newly recreated vote accounts surpassed credits of deleted vote accounts.

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jun 24, 2023

I ran solana-ledger-tool capitalization --warp-epoch +1 against mainnet-beta. and it seems I'm getting correct inflation tracer outputs for sampled stake account 5mHWstuuRk7DVPPVTZNYM43Se9czqBeZ6Woo7QrLi9CD:

the stuck stake amount reduced because some of newly recreated vote accounts surpassed credits of deleted vote accounts.

as this sampled vote account had already been earning staking rewards prior to this feature activation, i've chosen different sampled stake account: HVGsbFNgwaniyJNQY9bP4LxqpyR4V2Z9yqDdVf71ToDL:

$ solana -um stake-account --with-rewards --num-rewards-epochs 5 HVGsbFNgwaniyJNQY9bP4LxqpyR4V2Z9yqDdVf71ToDL --verbose
RPC URL: https://api.mainnet-beta.solana.com
Default Signer Path: /home/ryoqun/.config/solana/id.json
Commitment: confirmed
Balance: 344.289928228 SOL
Rent Exempt Reserve: 0.00228288 SOL
Delegated Stake: 344.278513828 SOL
Active Stake: 344.278513828 SOL
Delegated Vote Account Address: 7gfSX88DYoScBCaFqNxbsgFeZom8Qotnf747iJLhhJC6
Stake Authority: FNsitHktYun9mksohjdDgE5YGaGByDyJJAeFEeJHSHTv
Withdraw Authority: EhYXq3ANp5nAerUpbSgd7VK2RRcxK1zNuSQ755G5Mtxx
Lockup Timestamp: 2027-02-07T00:00:00Z
Lockup Custodian: 3XdBZcURF5nKg3oTZAcfQZg8XEc5eKsx6vK8r3BdGGxg
Epoch Rewards:
  Epoch   Reward Slot  Time                        Amount              New Balance         Percent Change             APR  Commission
  465     201312012    2023-06-24 07:00:19 +09:00  ◎0.145596747        ◎344.289928228           0.042307%           6.75%         10%
  464     200880004    2023-06-22 00:07:28 +09:00  ◎0.145802933        ◎344.144331481           0.042385%           6.84%         10%
Credits Observed: 55886414

$ solana -um vote-account 7gfSX88DYoScBCaFqNxbsgFeZom8Qotnf747iJLhhJC6
Account Balance: 27.191143833 SOL
Validator Identity: 6GRLDLiAtx8ZjYgQgPo7UsYeJ9g1pLX5j3HK97tFmtXb
Vote Authority: {466: "6GRLDLiAtx8ZjYgQgPo7UsYeJ9g1pLX5j3HK97tFmtXb"}
Withdraw Authority: DtutfyBQVgxn2AHSq74E5TFfB2fsnP4peRYtp3uLK2tz
Credits: 55959049
Commission: 10%
Root Slot: 201388426
Recent Timestamp: 2023-06-24T07:38:21Z from slot 201388469
Recent Votes (using 31/31 entries):
- slot: 201388469 (confirmation count: 1)
- slot: 201388468 (confirmation count: 2)
- slot: 201388467 (confirmation count: 3)
- slot: 201388466 (confirmation count: 4)
- slot: 201388465 (confirmation count: 5)
- slot: 201388464 (confirmation count: 6)
- slot: 201388457 (confirmation count: 7)
- slot: 201388450 (confirmation count: 8)
- slot: 201388449 (confirmation count: 9)
- slot: 201388448 (confirmation count: 10)
- slot: 201388447 (confirmation count: 11)
- slot: 201388446 (confirmation count: 12)
- slot: 201388445 (confirmation count: 13)
- slot: 201388444 (confirmation count: 14)
- slot: 201388443 (confirmation count: 15)
- slot: 201388442 (confirmation count: 16)
- slot: 201388441 (confirmation count: 17)
- slot: 201388440 (confirmation count: 18)
- slot: 201388439 (confirmation count: 19)
- slot: 201388438 (confirmation count: 20)
- slot: 201388437 (confirmation count: 21)
- slot: 201388436 (confirmation count: 22)
- slot: 201388435 (confirmation count: 23)
- slot: 201388434 (confirmation count: 24)
- slot: 201388433 (confirmation count: 25)
- slot: 201388432 (confirmation count: 26)
- slot: 201388431 (confirmation count: 27)
- slot: 201388430 (confirmation count: 28)
- slot: 201388429 (confirmation count: 29)
- slot: 201388428 (confirmation count: 30)
- slot: 201388427 (confirmation count: 31)
- ... (truncated 55959049 rooted votes, which have been credited)
Recent Epoch Voting History (using 64/64 entries):
* missed credits include slots unavailable to vote on due to delinquent leaders
- epoch: 466
  credits range: (55886414..55959049]
  credits/slots: 72635/432000
- epoch: 465
  credits range: (55474859..55886414]
  credits/slots: 411555/432000
- epoch: 464
  credits range: (55059628..55474859]
  credits/slots: 415231/432000
- epoch: 463
  credits range: (54642620..55059628]
  credits/slots: 417008/432000
- epoch: 462
  credits range: (54227245..54642620]
  credits/slots: 415375/432000

you can see this account started to earn reward only after epoch 464 (this feature got activated) and onwards.
the rewind rewrite was done at the start of epoch 464 instantly after feature activation. so, it's expected that any rewound stake accounts earn rewards at the end of epoch 464.

After that, these stake accounts are just normal stake accounts. so, I've seen no rewound stakes accounts at epoch 465.

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Jun 24, 2023

also, I've checked all stuck stake accounts are normalized to same credits by vote accounts (there were 4 bad vote accounts at the time of feature activation):

$ grep ReturnRewi ./mainnet-beta-after-rewind-with-rewind.log | grep -E -o 'voter:[^,]*|new_credits_observed[^,]*' | sort | uniq -c | sort -n
     16 new_credits_observed: Some(0)
     16 voter: 7X5QAMP54upioBdu75QZkz8hpYcwz7UmzAHGB2STq9da
     77 new_credits_observed: Some(55048232)
     77 voter: 7gfSX88DYoScBCaFqNxbsgFeZom8Qotnf747iJLhhJC6
    213 new_credits_observed: Some(38209189)
    213 voter: 3Xn3K5zeTzs4sURj1PCRaF6rvFg2hPgT49B4SiM998f7
    483 new_credits_observed: Some(345583)
    483 voter: 47e2BfrzbWdDieFZA7fc9fX1f73WTtkok2fQxSb8GueY

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

Labels

feature-gate Pull Request adds or modifies a runtime feature gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting and recreating vote account causes calculate_stake_points_and_credits to exit early

4 participants