v2.0: banking_stage: do not insert legacy vote ixs, refactor & unstaked (backport of #2888)#2901
Conversation
) * banking_stage: do not insert legacy vote ixs, refactor & unstaked * pr feedback: use matches instead of separate fn (cherry picked from commit 1334fb5) # Conflicts: # core/src/banking_stage/latest_unprocessed_votes.rs
|
Cherry-pick of 1334fb5 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
| pub mod deprecate_legacy_vote_ixs { | ||
| solana_program::declare_id!("depVvnQ2UysGrhwdiwU42tCadZL8GcBb1i2GYhMopQv"); | ||
| } |
There was a problem hiding this comment.
it seems odd to me to manually backport the creation of this feature for the filtering, but not the actaul code for disallowing the instructions in the processor.
Seems like we should be backporting #587 if we are using this
There was a problem hiding this comment.
I had to add it as part of fixing conflicts. I would prefer not to backport #587 since it's a huge change and the feature is not planned to be activated till 2.1.0. I can rekey this with a dummy ID if that makes more sense.
There was a problem hiding this comment.
got it - probably fine then, just slightly concerned someone sees the feature is in 2.0, then changes schedule to say it can be activated with 2.0 (which it cannot be).
There was a problem hiding this comment.
i've rekeyed the feature to avoid any mishaps.
|
What's the case for backport? It seems like a new feature essentially to me. |
bw-solana
left a comment
There was a problem hiding this comment.
LGTM overall but left a few questions/suggestions
| for vote_source in [VoteSource::Gossip, VoteSource::Tpu] { | ||
| for (vote_source, staked) in [VoteSource::Gossip, VoteSource::Tpu] | ||
| .into_iter() | ||
| .flat_map(|vs| [(vs, true), (vs, false)]) |
There was a problem hiding this comment.
This looks like a good opportunity to use the iproduct! macro
| } | ||
|
|
||
| /// Get the EpochStakes for the current Bank::epoch | ||
| pub fn current_epoch_stakes(&self) -> &EpochStakes { |
There was a problem hiding this comment.
yeah it can, good catch. would you prefer I fix this and iproduct! in a master commit and then backport both commits together? or merge this and then fix in master and backport separately?
There was a problem hiding this comment.
I'm okay with either approach. Neither is a big enough deal that I'd block the PR
Problem
The feature
deprecate_legacy_vote_ixsdisallows all previous vote instructions in the vote program other than theTowerSyncvariants. Banking stage should also filter these out.Summary of Changes
When the feature is active, do not insert votes with these legacy instructions, also some small refactoring of the weighted shuffle and unstaked check.
This is an automatic backport of pull request #2888 done by Mergify.